Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
quest_racene.py
Go to the documentation of this file.
1 import quest
2 import Vector
3 import VS
4 import unit
5 import vsrandom
6 import launch
7 import faction_ships
9  def __init__ (self):
10  self.sysfile = VS.getSystemFile()
11  playa=VS.getPlayer()
12  difficulty=4
13  self.stage=0
14  self.gametime = VS.GetGameTime()
15  self.aera = []
16  aer=faction_ships.factions[faction_ships.aera]
17  conf=faction_ships.factions[faction_ships.confed]
18  for i in range(difficulty):
19  self.aera += [launch.launch_wave_around_unit("Recon_Lead",aer,faction_ships.getRandomFighterInt(faction_ships.aera),"default",1,500,2000,playa)]
20  self.devil=launch.launch_wave_around_significant ('Devils_Fort',aer,'starfortress','default',1,50000,100000,4)
21  launch.launch_wave_around_significant ('terran_rescue_fleet',conf,faction_ships.getRandomCapitolInt(faction_ships.confed),'default',1,10000,100000,4)
22  launch.launch_wave_around_significant ('terran_rescue_fleet',conf,faction_ships.getRandomCapitolInt(faction_ships.confed),'default',1,10000,100000,4)
23  launch.launch_wave_around_significant ('terran_rescue_fleet',conf,faction_ships.getRandomCapitolInt(faction_ships.confed),'default',1,10000,100000,4)
24  VS.IOmessage (0,"game","all","[Aera] Scanning for terran capships... [ping] [ping]")
25  VS.IOmessage (3,"game","all","[Computer] Analysis of pattern focuses on scan for attacks on Devils Fort...")
26  VS.IOmessage (4,"game","all","[Computer] Area class fighter vessels outfitted with powerful radar appear to be used as scouts in the aera...")
27  def Execute (self):
28  playa=VS.getPlayer()
29  if (playa.isNull()):
30  return 1
31  if (self.stage==0):
32  if (len (self.aera)==0):
33  if (VS.getSystemFile()!=self.sysfile):
34  return 0
35  if (len (self.aera)==0):
36  VS.IOmessage (0,"game","all","[Aera Burst Transmission] No targets detected--resistance encountered ca--&$&(*!@^6")
37  self.gametime=VS.GetGameTime()
38  self.removeQuest();
39  self.stage=1
40  else:
41  if (self.aera[0].isNull()):
42  del self.aera[0]
43  else:
44  if (VS.GetGameTime()-self.gametime>100):
45  if (not self.devil.isNull()):
46  self.devil.DealDamageToHull((10,0,0),self.devil.GetHull()*100)
47  VS.IOmessage (0,"game","all","[Computer] Large energy release detected...")
48  VS.IOmessage (0,"game","all","[Computer] Aera Starbase destroyed!")
49  VS.IOmessage (0,"game","all","[Computer] Star Confederacy Starships detected on far side of planet!")
50  VS.IOmessage (5,"game","all","[Computer] Message from Rescue Fleet")
51  VS.IOmessage (6,"RescueFleet","all","Thank you for your help, privateer...we owe our victory to your cunning kill of those scouts. We offer you 24,000 credits for this critical act!")
52  playa.addCredits (24000)
53  self.removeQuest()
54  return 0
55  return 1
56 
58  def __init__ (self):
59  quest.quest_factory.__init__ (self,"quest_racene")
60  def precondition(self,playernum):
61  print 'precondition'
62  return 1
63  return quest.findQuest(playernum,'racene_star_intro') and quest.notLoadedQuest(playernum,'racene_star_loss')
64  def create (self):
65  return quest_racene()