Ejemplo n.º 1
0
def AddSysDict(cursys):
    #pick random fighter from insysenemies with .3 probability OR pick one from the friendlies list.
    #       debug.debug('Addsysdict')
    sysfaction = VS.GetGalaxyFaction(cursys)
    global fgnames, fglists
    i = 0
    AddBasesToSystem(sysfaction, cursys)
    for i in range(1 + vsrandom.randrange(
            fg_util.MinNumFlightgroupsInSystem(cursys) -
            1, fg_util.MaxNumFlightgroupsInSystem(cursys))
                   ):  #number of fgs in a system.
        faction = sysfaction
        friendly = 0
        if vsrandom.random(
        ) < .3 or sysfaction == 'unknown' or sysfaction == '':
            faction = faction_ships.get_rabble_of(sysfaction)
        else:
            faction = faction_ships.get_friend_of(sysfaction)
            if (faction == sysfaction):
                friendly = 1
            if (sysfaction in faction_ships.production_centers):
                if (cursys in faction_ships.production_centers[sysfaction]):
                    friendly = 2
            #if (friendly):
            #    debug.debug(faction+" "+sysfaction+" "+cursys)
        factionnr = faction_ships.factionToInt(faction)
        global maxshipsinfg
        typenumbertuple = GenerateFgShips(
            vsrandom.randrange(maxshipsinfg) + 1, factionnr, friendly)
        fgname = GetNewFGName(faction)
        fg_util.AddShipsToFG(fgname, faction, typenumbertuple, cursys)
    return i
Ejemplo n.º 2
0
 def launch_new_wave(self):
     un = VS.getPlayer()
     if (vsrandom.randrange(0,4)==0):
         if (un):
             currentsystem = VS.getSystemFile()
             numadj=VS.GetNumAdjacentSystems(currentsystem)
             if (numadj):
                 cursys=VS.GetAdjacentSystem(currentsystem,vsrandom.randrange(0,numadj))
             else:
                 cursys = 'enigma_sector/heavens_gate'
             debug.info("TJ: jumping to "+cursys)
             un.JumpTo(cursys)
         else:
             debug.info("TJ: jumping to [ERROR: you are null]")
     side = vsrandom.randrange(0,2)
     faction="confed"
     ai = vsrandom.randrange(0,6)
     if (0 and ai==0):
         ai = "printhello.py"
     else:
         ai = "default"
     if (side==0):
         faction=faction_ships.get_enemy_of("confed")
     else:
         faction=faction_ships.get_friend_of("confed")
     launched = launch.launch_wave_around_unit ("Shadow",faction,faction_ships.getRandomFighter(faction),ai,vsrandom.randrange(1,10),100.0,2000.0,VS.getPlayer(),'')
     if (vsrandom.randrange(0,10)==0):
         launch.launch_wave_around_unit ("ShadowCap",faction,faction_ships.getRandomCapitol(faction),ai,1,2000.0,4000.0,VS.getPlayer(),'')
Ejemplo n.º 3
0
 def launch_new_wave(self):
     side = vsrandom.randrange(0, 2)
     faction = "confed"
     ai = vsrandom.randrange(0, 2)
     if (ai == 0):
         ai = "printhello.py"
     else:
         ai = "default"
     if (side == 0):
         faction = faction_ships.get_enemy_of("confed")
     else:
         faction = faction_ships.get_friend_of("confed")
     launched = launchShip(faction_ships.getRandomFighter(faction), faction)