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

Public Member Functions

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

Data Fields

 stage
 
 player
 
 timer
 
 system
 
 object
 
 groups
 
 capital
 
 fighter
 
 msgColor
 
 names
 
 playernum
 
 name
 
- Data Fields inherited from quest
 name
 
 playernum
 

Detailed Description

Definition at line 31 of file quest_blockade.py.

Constructor & Destructor Documentation

def __init__ (   self)

Definition at line 32 of file quest_blockade.py.

32 
33  def __init__ (self):
34  self.stage = 1
35  self.player = VS.getPlayer()
36  self.timer = VS.GetGameTime()
37  self.system = VS.getSystemName()
38  self.object = unit.getUnitByName('Jump_To_Nethuuleil')
39  self.groups = 2 #vsrandom.randrange(4,8)
40  self.capital = []
41  self.fighter = []
42  self.msgColor = ("#FFFF99","#FF99FF")

Member Function Documentation

def Execute (   self)

Definition at line 50 of file quest_blockade.py.

References quest_blockade.groups, Pattern.groups, quest_blockade.player, quest_blockade.stage, ambush.timer, waitjump.timer, ai_escortpatrol.timer, quest_blockade.timer, ambush_scan.timer, and Profile.timer.

50 
51  def Execute (self):
52  if (self.player):
53  #print str(self.player.Position())
54  # launch the actors
55  if (self.stage<=self.groups and VS.GetGameTime()>=self.timer):
56  #print "group: " +str(self.stage)
57  self.names = fg_util.GetRandomFGNames(self.groups,"confed")
58  shiptype = faction_ships.getRandomCapitolInt(faction_ships.confed)
59  #print "group/name: " + str(self.stage) + "/"+names[self.stage-1]
60  # launch capital ships
61  number = vsrandom.randrange(2,4)
62  #print ">capital/type: " +str(number)+"/"+shiptype
63  location = Vector.Add (self.object.Position(),(vsrandom.uniform(-10000,10000),
64  vsrandom.uniform(-10000,10000),
65  vsrandom.uniform(-10000,10000)))
66  offset = (vsrandom.uniform(1000,2000),vsrandom.uniform(1000,2000),vsrandom.uniform(1000,2000))
67  for i in range(number):
68  #self.capital += [launch.launch_wave_around_unit(names[self.stage-1],'confed',shiptype,'sitting_duck',1,5000,20000,self.object)]
69  # launch(name,type,faction,unittype,ai,nr,nrwaves,pos,squadlogo)
70  pos = Vector.Add (location,Vector.Scale(offset,i))
71  self.capital += [VS.launch(self.names[self.stage-1],shiptype,'confed','unit','sitting_duck',1,1,pos,'')]
72  # launch fighters
73  number = number*vsrandom.randrange(3,6)
74  # test: Lancelot, Schroedinger, Quicksilver, Convolution
75  shiptype = faction_ships.getRandomFighterInt(faction_ships.confed)
76  #print ">fighters/type: " + str(number) + "/" + shiptype
77  ship = self.capital[0]
78  for i in range(number):
79  self.fighter += [launch.launch_wave_around_unit(self.names[self.stage-1],'confed',shiptype,'sitting_duck',1,1000,2000,ship)]
80  # change orders for capital ships
81  for ship in self.capital:
82  ship.PrimeOrders()
83  unit.faceTaget(ship, self.object)
84  # change orders for fighter ships
85  for ship in self.fighter:
86  #unit.faceTaget(ship, self.capital[0])
87  ship.PrimeOrders()
88  #ship.SetTarget(self.capital[0])
89  ship.SetTarget(self.object)
90  #ship.UnFire()
91  #ship.setFgDirective("E.") # escort
92  ship.LoadAIScript("modules/ai_escortpatrol.py")
93  # time between spawning the groups
94  self.timer = VS.GetGameTime() #+10
95  self.stage += 1
96  if (self.stage==self.groups+1 and VS.GetGameTime()>self.timer):
97  self.stage = 10
98  # publish news
99  if (self.stage==10 and VS.GetGameTime()>self.timer):
100  text = "JUMP POINT BLOCKADE IN " + self.system + " SYSTEM\\\Intelligence has uncovered Aeran plans to invade Confederation space."
101  text += "As a preventive measure " + str(self.groups) + " flight groups were dispatched and stationed near the Nethuuleil jump point. "
102  text += "Multiple capital vessels are guarding the jump point while a multitude of fighter escorts is patrolling nearby space."
103  news.publishNews(text)
104  self.timer = VS.GetGameTime()+5
105  self.stage = 11
106  #make some random chatter
107  if (self.stage==11 and VS.GetGameTime()>self.timer):
108  # select two pilots to chatter
109  flightgroup = 1 #vsrandom.randrange(1,self.groups)
110  numchatters = 0
111  chatters = []
112  while (numchatters<2):
113  chatter = vsrandom.randrange(0,len(self.fighter)-1)
114  if (self.fighter[chatter].getFlightgroupName()==self.names[flightgroup-1]):
115  chatters += [chatter]
116  numchatters += 1
117  VS.IOmessage (0,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"... lousy bar on our mothership?")
118  VS.IOmessage (5,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Yeah, bad lighting, and no bar company besides your dull face.")
119  VS.IOmessage (10,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"The drinks selection is not the best I have seen.")
120  VS.IOmessage (15,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"And this bartender droid really gets on my nerves.")
121  VS.IOmessage (20,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"He never stops talking for an instant.")
122  VS.IOmessage (25,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"Guess, we've got to live with that.")
123  VS.IOmessage (30,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Yeah.")
124  self.timer = VS.GetGameTime()+240
125  self.stage = 12
126  if (self.stage==12 and VS.GetGameTime()>self.timer):
127  # select two pilots to chatter
128  flightgroup = 2 #vsrandom.randrange(1,self.groups)
129  numchatters = 0
130  chatters = []
131  while (numchatters<2):
132  chatter = vsrandom.randrange(0,len(self.fighter)-1)
133  if (self.fighter[chatter].getFlightgroupName()==self.names[flightgroup-1]):
134  chatters += [chatter]
135  numchatters += 1
136  VS.IOmessage (0,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"Phil?")
137  VS.IOmessage (10,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"What's up, buddy?")
138  VS.IOmessage (15,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"The rumor is the Aera are planning an invasion.")
139  VS.IOmessage (25,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Maybe no rumor anymore. Probably it's all over the news now.")
140  VS.IOmessage (35,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"That's why we are here? Will we have to fight?")
141  VS.IOmessage (40,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Calm down, youngling.")
142  VS.IOmessage (45,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"The war hasn't quite started yet.")
143  VS.IOmessage (50,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"I tell ya. This operation is to prepare the worlds for the war.")
144  VS.IOmessage (55,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"All staged by the higherups.")
145  VS.IOmessage (65,unit.getUnitFullName(self.fighter[chatters[0]]),"all",self.msgColor[0]+"You think so? And what if you're not right? Will you take care of my 'lil sister if I die?")
146  VS.IOmessage (75,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Ho, ho. Now stop that blubber. Nobody's gonna die here.")
147  VS.IOmessage (80,unit.getUnitFullName(self.fighter[chatters[1]]),"all",self.msgColor[1]+"Just stick to your orders and by dinner time we'll have a big jar of Pilsner and a nice long talk.")
148  self.timer = VS.GetGameTime()+300
149  self.stage = 13
150  # just a temporary backup
151  if (self.stage==99):
152  #for ship in self.fighter:
153  # ship = VS.getUnit(i)
154  # if (ship.getFlightgroupName()==names[flightgroup]):
155  # print "shipname: " + ship.getFullName()
156  # #ship.setFgDirective("E.") # escort
157  # #VS.PythonAI.XMLScript("++evade.xml")
158  self.stage = 98
159  #if (self.stage==99 and not VS.getSystemName()==self.system):
160  if (not VS.getSystemName()==self.system):
161  self.stage += 1 # don't enter this loop anymore
162  self.playernum = -1
163  self.name = "quest_capital"
164  self.removeQuest()
165  return 0
166  #return 1

Field Documentation

capital

Definition at line 39 of file quest_blockade.py.

fighter

Definition at line 40 of file quest_blockade.py.

groups

Definition at line 38 of file quest_blockade.py.

msgColor

Definition at line 41 of file quest_blockade.py.

name

Definition at line 162 of file quest_blockade.py.

names

Definition at line 56 of file quest_blockade.py.

object

Definition at line 37 of file quest_blockade.py.

player

Definition at line 34 of file quest_blockade.py.

playernum

Definition at line 161 of file quest_blockade.py.

stage

Definition at line 33 of file quest_blockade.py.

system

Definition at line 36 of file quest_blockade.py.

timer

Definition at line 35 of file quest_blockade.py.


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