Beispiel #1
0
    def get_ex(ix, tech_level, population, remarks, belts, gg, location):

        resources = roll_dice(2, 'Ex res', location, conn, c)
        if tech_level >= 8:
            resources += gg
            resources += belts
        if resources < 0: resources = 0
        resources = tohex(resources)

        labor = population - 1
        if labor < 0: labor = 0
        labor = tohex(labor)

        if 'Ba' in remarks: infrastructure = 0
        elif 'Lo' in remarks: infrastructure = 1
        elif 'Ni' in remarks:
            infrastructure = roll_dice(1, 'Ex infra Ni', location, conn,
                                       c) + ix
        else:
            infrastructure = roll_dice(2, 'Ex infra', location, conn, c) + ix
        if infrastructure < 0: infrastructure = 0
        infrastructure = tohex(infrastructure)

        efficiency = roll_dice(2, "Ex eff", location, conn, c) - 7
        if efficiency < 0:
            return ('(' + str(resources) + str(labor) + str(infrastructure) +
                    str(efficiency) + ')')
        else:
            return ('(' + str(resources) + str(labor) + str(infrastructure) +
                    '+' + str(efficiency) + ')')
Beispiel #2
0
 def get_government(location, population, mw_government):
     if mw_government == '6':
         dice = 6
     else:
         dice = roll_dice(2,'Government',row[0], conn, c) + population - 7  
         if dice < 0: dice = 0
         elif dice > 15: dice = 15
         if population == 0: dice = 0    
     return dice
Beispiel #3
0
    def get_population(location,mw):
        

        dice = roll_dice(2,'Population',location, conn, c) - 4
    
        if dice >= mw['population']:
            dice = mw['population'] - 1
        
        if dice < 0: dice = 0

        return dice    
Beispiel #4
0
    def get_bases(location, starport):
        str_base = 'X'
        base_list = list()
        if starport == 'D':
            dice = roll_dice(2, 'Scout Base', location, conn, c)
            if dice <= 7: base_list.append('S')
        elif starport == 'C':
            dice = roll_dice(2, 'Scout Base', location, conn, c)
            if dice <= 6: base_list.append('S')
        elif starport == 'B':
            dice1 = roll_dice(2, 'Scout Base', location, conn, c)
            dice2 = roll_dice(2, 'Naval Base', location, conn, c)
            if dice1 <= 5: base_list.append('S')
            if dice2 <= 5: base_list.append('N')
        elif starport == 'A':
            dice1 = roll_dice(2, 'Scout Base', location, conn, c)
            dice2 = roll_dice(2, 'Naval Base', location, conn, c)
            if dice1 <= 4: base_list.append('S')
            if dice2 <= 6: base_list.append('N')

        if 'S' in base_list:
            if 'N' in base_list:
                str_base = 'NS'
            else:
                str_base = 'S'
        elif 'N' in base_list:
            str_base = 'N'
        else:
            str_base = '-'

        return str_base
Beispiel #5
0
    def get_starport(location, population):
        # Using First In rules for Starport
        c_starport = 'Z'

        dice = roll_dice(3, 'Starport A', location, conn, c)
        if population >= 6:
            if dice < population + 3:
                c_starport = 'A'
                return c_starport

        dice = roll_dice(3, 'Starport B', location, conn, c)
        if population >= 6:
            if dice < population + 6:
                c_starport = 'B'
                return c_starport

        dice = roll_dice(3, 'Starport C', location, conn, c)
        if dice < population + 9:
            c_starport = 'C'
            return c_starport

        dice = roll_dice(3, 'Starport D', location, conn, c)
        if dice < population + 8:
            c_starport = 'D'
            return c_starport

        dice = roll_dice(3, 'Starport E', location, conn, c)
        if dice < 15:
            c_starport = 'E'
            return c_starport

        dice = roll_dice(3, 'Starport X', location, conn, c)
        c_starport = 'X'
        return c_starport
Beispiel #6
0
 def get_spaceport(location,population):
     
     if population == 0:
         spaceport = 'Y'
     else:
         dice = roll_dice(1,'Spaceport',location, conn, c) - population
         if dice >= 4: spaceport = 'F'
         elif dice == 3: spaceport = 'G'
         elif 1 <= dice <=2 : spaceport = 'H'
         else: spaceport = 'Y'
     
     
     return spaceport
Beispiel #7
0
    def get_cx(population, ix, tech_level, location):
        homogeneity = population + roll_dice(2, 'Cx h**o', location, conn,
                                             c) - 7
        if homogeneity < 1: homogeneity = 1
        homogeneity = tohex(homogeneity)

        acceptance = int(population) + int(ix)
        if acceptance < 1: acceptance = 1
        acceptance = tohex(acceptance)

        strangeness = roll_dice(2, 'Cx strange', location, conn, c) - 7 + 5
        if strangeness < 1: strangeness = 1
        strangeness = tohex(strangeness)

        symbols = (roll_dice(2, 'Cx symbols', location, conn, c) - 7 +
                   tech_level)
        if symbols < 1: symbols = 1
        symbols = tohex(symbols)

        if population == 0: return '[0000]'
        else:
            return ('[' + str(homogeneity) + str(acceptance) +
                    str(strangeness) + str(symbols) + ']')
Beispiel #8
0
    def get_tech_level(location, starport, size, atmosphere, hydrographics,
                       population, government):

        starport_mod = -100
        starport_mod_dict = {'A': 6, 'B': 4, 'C': 2, 'X': -4}
        if starport in starport_mod_dict.keys():
            starport_mod = starport_mod_dict[starport]
        else:
            starport_mod = 0

        size_mod = -100
        size_mod_dict = {'0': 2, '1': 2, '2': 1, '3': 1, '4': 1}
        if str(size) in size_mod_dict.keys():
            size_mod = size_mod_dict[str(size)]
        else:
            size_mod = 0

        int_atmos = int(atmosphere)
        atmosphere_mod = -100
        if int_atmos <= 3: atmosphere_mod = 1
        elif int_atmos >= 10: atmosphere_mod = 1
        else: atmosphere_mod = 0

        hydro_mod = -100
        if hydrographics == 9: hydro_mod = 1
        elif hydrographics == 10: hydro_mod = 2
        else: hydro_mod = 0

        pop_mod = -100
        if population <= 5: pop_mod = 1
        elif population == 9: pop_mod = 2
        elif population >= 10: pop_mod = 4
        else: pop_mod = 1

        gov_mod = -100
        if government == 0: gov_mod = 1
        elif government == 5: gov_mod = 1
        elif government == 13: gov_mod = -2
        else: gov_mod = 0

        dice =  roll_dice(1, 'Tech roll', location, conn, c) \
                + starport_mod \
                + size_mod  \
                + atmosphere_mod \
                + hydro_mod \
                + pop_mod \
                + gov_mod
        #        print ('Tech',starport,dice,starport_mod,size_mod,atmosphere_mod,hydro_mod,pop_mod,gov_mod)
        if population == 0: dice = 0
        return dice
Beispiel #9
0
 def get_law_level(location, government):
     dice = roll_dice(2, 'Law Level', row[0], conn, c) + government - 7
     if dice < 0: dice = 0
     elif dice > 15: dice = 15
     if population == 0: dice = 0
     return dice
Beispiel #10
0
 def get_government(location, population):
     dice = roll_dice(2, 'Government', row[0], conn, c) + population - 7
     if dice < 0: dice = 0
     elif dice > 15: dice = 15
     if population == 0: dice = 0
     return dice
Beispiel #11
0
 def get_population(location):
     dice = roll_dice(2, 'Population', location, conn, c) - 2
     if dice == 10:
         dice = roll_dice(2, 'Population', location, conn, c) + 3
     return dice