Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
quest_rogue_militia Class Reference
Inheritance diagram for quest_rogue_militia:
quest

Public Member Functions

def __init__
 
def ZeroVel
 
def deductToll
 
def distractMilitia
 
def Execute
 
- Public Member Functions inherited from quest
def NoSignificantsNear
 
def SignificantsNear
 
def setOwner
 
def removeQuest
 
def makeQuestPersistent
 
def isPersistent
 
def Execute
 

Data Fields

 sysfile
 
 stage
 
 mark
 
 gametime
 
 militia
 
- Data Fields inherited from quest
 name
 
 playernum
 

Detailed Description

Definition at line 8 of file quest_rogue_militia.py.

Constructor & Destructor Documentation

def __init__ (   self)

Definition at line 9 of file quest_rogue_militia.py.

9 
10  def __init__ (self):
11  self.sysfile = VS.getSystemFile()
12  playa=VS.getPlayer()
13  difficulty=4
14  self.stage=0
15  self.mark=VS.GetGameTime()
16  self.gametime = VS.GetGameTime()
17  self.militia = []
18  for i in range(difficulty):
19  self.militia += [launch.launch_wave_around_unit("Extortionist","pirates",faction_ships.getRandomFighterInt(faction_ships.homeland_security),"default",1,100,150,playa)]
20  # self.distractMilitia()
21  VS.IOmessage (0,"Extortionist","all","This is the milita: You must pay toll to pass through these parts")
22  VS.IOmessage (0,"Extortionist","all","Power down your engines for 10 seconds and allow us to remove 2000 credits")
VS.IOmessage (5,"Extortionist","all","Those pirates who do not reduce speed will be shot")

Member Function Documentation

def deductToll (   self,
  playa 
)

Definition at line 26 of file quest_rogue_militia.py.

26 
27  def deductToll(self,playa):
28  playa.addCredits(-2000)
29  VS.IOmessage (0,"Extortionist","all","We appreciate your donation and wish you safe passage through this system!")
VS.IOmessage (3,"Extortionist","all","Thank you, come again!")
def distractMilitia (   self)

Definition at line 30 of file quest_rogue_militia.py.

References unit.getSignificant(), and quest_rogue_militia.militia.

30 
31  def distractMilitia(self):
32  targ = unit.getSignificant(2,1,1)
33  for un in self.militia:
34  un.SetTarget(targ)
un.SetVelocity ((500,500,500))
def Execute (   self)

Definition at line 35 of file quest_rogue_militia.py.

References quest_rogue_militia.deductToll(), quest_rogue_militia.distractMilitia(), quest_racene.gametime, quest_rogue_militia.gametime, escort_mission.gametime, escort_local.gametime, faction_ships.getRandomCapitolInt(), launch.launch_wave_around_unit(), quest_rogue_militia.mark, Unpickler.mark, quest_rogue_militia.militia, quest.removeQuest(), quest_rlaan_spy.stage, quest_drone.stage, quest_rogue_militia.stage, quest_racene.stage, quest_dispute.stage, quest_blockade.stage, quest_debug.stage, quest_disappear.sysfile, quest_rlaan_spy.sysfile, quest_racene.sysfile, quest_rogue_militia.sysfile, quest_drone.sysfile, quest_explore.sysfile, and quest_rogue_militia.ZeroVel().

35 
36  def Execute (self):
37  playa=VS.getPlayer()
38  if (playa.isNull()):
39  return 1
40  if (VS.getSystemFile()!=self.sysfile):
41  self.gametime=VS.GetGameTime()
42  return 1
43  if (VS.GetGameTime()-self.gametime>10 and self.stage==0):
44  self.stage=1
45  if (self.ZeroVel(playa)):
46  self.deductToll(playa)
47  self.distractMilitia()
48  return 0
49  else:
50  self.stage=1
51  for un in self.militia:
52  un.SetTarget(playa)
53  VS.IOmessage(0,"Extortionist","all","Ok you asked for it! Die scoundrel!")
54  if (self.stage==1):
55  if (len (self.militia)==0):
56  VS.IOmessage (0,"Extortionist","all","*@&* taking work from honest securme($*@")
57  VS.IOmessage(0,"game","news","ROGUE SECURITY FORCES CRUSHED: With the bulk of the Confederate Navy deployed in the war against the Aera, the protection and defense of civilian trade lines have been left to local militias in many systems. Recent events have proven, though, that some of these militias walk a very fine line between enforcing the law and breaking it. In the Heinlein System, the militia began charging outrageous toll fees for passage through the system. On those occasions when their demands weren't met, they opened fire. This prompted the Navy to dispatch the HCS Hangzhou to the system, and today the cruiser finally reported arresting the last member of the rogue security forces.")
58  l = faction_ships.capitols[faction_ships.confed]
59  launch.launch_wave_around_unit("Hangzhou",faction_ships.factions[faction_ships.confed],faction_ships.getRandomCapitolInt(faction_ships.confed),"default",1,1000,2000,playa)
60  self.removeQuest();
61  return 0
62  else:
63  if (self.ZeroVel(playa)):
64  tim = VS.GetGameTime()
65  if (tim-self.mark>10):
66  self.mark = tim
67  elif (tim-self.mark>5):
68  self.deductToll(playa)
69  self.distractMilitia()
70  return 0
71  if (self.militia[0].isNull()):
72  del self.militia[0]
73  return 1
def ZeroVel (   self,
  playa 
)

Definition at line 23 of file quest_rogue_militia.py.

23 
24  def ZeroVel (self,playa):
25  vel =playa.GetVelocity()
return (vel[0]>-.1 and vel[0] < .1 and vel[1]>-.1 and vel[1] < .1 and vel[2]>-.1 and vel[2] < .1)

Field Documentation

gametime

Definition at line 15 of file quest_rogue_militia.py.

mark

Definition at line 14 of file quest_rogue_militia.py.

militia

Definition at line 16 of file quest_rogue_militia.py.

stage

Definition at line 13 of file quest_rogue_militia.py.

sysfile

Definition at line 10 of file quest_rogue_militia.py.


The documentation for this class was generated from the following file: