Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
spawner.py
Go to the documentation of this file.
1 from go_to_adjacent_systems import *
2 from go_somewhere_significant import *
3 import vsrandom
4 import launch
5 import faction_ships
6 import VS
7 import Briefing
8 import universe
9 import unit
10 import Vector
11 import Director
12 import quest
13 class spawner (Director.Mission):
14  def __init__ (self):
15  Director.Mission.__init__(self)
16 
17  self.fac=[]
18  self.facnames=["confed","homeland-security","merchant","hunter","pirates","luddites","aera","rlaan","ISO","andolian","highborn","shaper","unadorned","purist","forsaken","LIHW","klkk","mechanist","shmrn","rlaan_briin"]
19  self.facnames=self.facnames+self.facnames
20  for i in range(len(self.facnames)):
21  nam=self.facnames[i]+"_SPAWN"
22  if (i>=len(self.facnames)/2):
23  nam+="_CAPSHIP"
24  self.fac.append(VS.launchJumppoint(nam,"neutral","75 jump.png %s (ONE ONE)"%nam,"planet","sitting_duck",1,1,Vector.Add((0.,-1000.+i*200.,1000.),VS.getPlayer().Position()),"",""))
25  self.delay=VS.GetGameTime()
26  def Execute (self):
27  if (VS.getPlayer()):
28  iter=0
29  for base in self.fac:
30 
31  if (base.getDistance(VS.getPlayer())<0):
32  if (VS.GetGameTime()-self.delay>10):
33  self.delay=VS.GetGameTime()
35  if (iter>=len(self.facnames)/2):
37  launch.launch_wave_around_unit("Shadow_"+self.facnames[iter],self.facnames[iter],type,"default",1,200,250,VS.getPlayer(),'',0)
38  VS.getPlayer().upgrade("tungsten",0,0,1,0)
39  VS.getPlayer().upgrade("tungsten_hull",0,0,1,0)
40  else:
41  VS.IOmessage(0,"spawner","all","Going to spawn "+self.facnames[iter]+"starships in %d seconds at."%(10-(VS.GetGameTime()-self.delay)))
42  iter+=1