Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
total_war.py
Go to the documentation of this file.
1 import vsrandom
2 import launch
3 import faction_ships
4 import VS
5 import Briefing
6 import universe
7 import unit
8 import Director
9 class total_war (Director.Mission):
10  def __init__(self):
11  print "init1INITNITNITNTINTINTINTINTITNINTINTINTINTINT\nININTINTINTITNITNITNTINTINTINTINTITNITNITNITNITNITNITNITNITNIT"
12  VS.SetDifficulty(.9)
13  Director.Mission.__init__(self)
14  self.lasttime=-1000
15  self.waittime=10.0
16  def launch_new_wave(self):
17  side = vsrandom.randrange(0,2)
18  faction="confed"
19  ai = vsrandom.randrange(0,8)
20  if (0 and ai==0):
21  ai = "printhello.py"
22  else:
23  ai = "default"
24  if (side==0):
25  faction=faction_ships.get_enemy_of("confed")
26  else:
27  faction="merchant"
28  launched = launch.launch_wave_around_unit ("Shadow",faction,faction_ships.getRandomFighter(faction),ai,vsrandom.randrange(1,5),100.0,2000.0,VS.getPlayer(),'')
29  if (vsrandom.randrange(0,10)==0 or faction=="luddites"):
30  launch.launch_wave_around_unit ("ShadowCap"+str(vsrandom.randrange(0,10)),faction,faction_ships.getRandomCapitol(faction),ai,1,2000.0,4000.0,VS.getPlayer(),'')
31  def Execute (self):
32  un=VS.getUnit(0);
33  i=0
34  while (un):
35  i+=1
36  un= VS.getUnit(i)
37  time = VS.GetGameTime()
38  if (time-self.lasttime>self.waittime):
39  self.launch_new_wave()
40  self.waittime=vsrandom.randrange(4.0,6.0)
41  self.lasttime=time
42  def initbriefing(self):
43  print "ending briefing"
44  def loopbriefing(self):
45  print "loop briefing"
46  Briefing.terminate();
47  def endbriefing(self):
48  print "ending briefing"