Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
faceoff.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 faceoff (Director.Mission):
10  def __init__(self):
11  VS.SetDifficulty(0.1)
12  Director.Mission.__init__(self)
13  self.lasttime=-100
14  self.waittime=100.0
15  self.launchShip("nova","confed")
16  self.launchShip("nova","confed")
17  self.launchShip("revoker","pirates")
18  self.launchShip("revoker","pirates")
19  self.launchShip("revoker","pirates")
20 
21  def launchShip (self,type,faction):
22  return launch.launch_wave_around_unit("Shadow",faction,type,"default",1,100.0,2000.0,VS.getPlayer(),'')
23  def launch_new_wave(self):
24  side = vsrandom.randrange(0,2)
25  faction="confed"
26  ai = vsrandom.randrange(0,2)
27  if (ai==0):
28  ai = "printhello.py"
29  else:
30  ai = "default"
31  if (side==0):
32  faction=faction_ships.get_enemy_of("confed")
33  else:
34  faction=faction_ships.get_friend_of("confed")
35  launched = launchShip(faction_ships.getRandomFighter(faction),faction);
36 
37  def Execute (self):
38  time = VS.GetGameTime()
39  if (time-self.lasttime>self.waittime):
40  #self.launch_new_wave()
41  VS.IOmessage (0,"game","all","[Confed] This is a test of the emergency broadcast system.")
42  self.lasttime=time