Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
quest_rlaan_spy.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
8  def __init__ (self):
9  self.sysfile = VS.getSystemFile()
10  self.stage=0
11  self.sig=VS.Unit()
12  def SignificantsNear(self,significant):
13  if (significant.isJumppoint()):
14  import faction_ships
15  VS.IOmessage (0,"game","all","[Computer] Target detected matching engine signature reported for rlaan spy in %s" % self.sysfile)
16  VS.IOmessage (0,"game","all","[Computer] Confed was hunting this target...");
17  self.spy=launch.launch_wave_around_unit("Spy",faction_ships.factions[faction_ships.rlaan],faction_ships.getRandomFighterInt(faction_ships.rlaan),"default",1,30000,50000,significant)
18  self.spy.ActivateJumpDrive(0)
19  self.spy.SetTarget(significant)
20  VS.getPlayer().SetTarget(self.spy)
21  self.spy.setFgDirective('B')
22  self.sig=significant
23  self.stage=1
24  def Victory(self):
25  VS.IOmessage (0,"game","all","[Confed] You stopped the Rlaan spy from delivering his information to Rlaan HQ.")
26  VS.IOmessage (0,"game","all","[Confed] A price of 20,000 will be awarded to you for your expert effort.")
27  self.removeQuest()
28  playa = VS.getPlayer()
29  VS.IOmessage (0,"game","news","RLAAN SPY CAPTURED: After miners in the Novaya Kiev system exposed the rlaan spy and its escape ship, privateers across the sector began searching for the spy. The Rlaan ship made best speed to the local jump point, putting it right in the path of a hungry privateer. 20 thousand credits later, that privateer crushed the Rlaan spy and prevented it from communicating whatever finds it had made to the headquarters. Officially the Star Confederacy discourages vigilante policing; however, in this case the information snagged by the spy was valuable enough to justify putting a hefty sum on the rlaan's head.")
30  if (playa):
31  playa.addCredits(20000)
32  def Lose(self):
33  VS.IOmessage (0,"game","all","[Computer] Jump signature matching Rlaan spy reported earlier detected.")
34  VS.IOmessage (0,"game","all","[Computer] unable to track.")
35  VS.IOmessage (10,"game","all","[Computer] burst transmission to Rlaan space detected.")
36  self.removeQuest()
37 
38  def Execute (self):
39  if (VS.getSystemFile()!=self.sysfile):
40  return 1
41  if (self.stage==1):
42  if (self.spy.isNull()):
43  self.Victory()
44  return 0
45  else:
46  if (self.spy.getUnitSystemFile()!=self.sysfile):
47  self.Lose()
48  return 0
49  else:
50  self.spy.SetTarget(self.sig)
51  return 1
52 
54  def __init__ (self):
55  quest.quest_factory.__init__ (self,"quest_rlaan_spy")
56  def precondition(self,playernum):
57  return quest.findQuest(playernum,'rlaan_mining_spy')
58  def create (self):
59  return quest_rlaan_spy()