Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
wingman.py
Go to the documentation of this file.
1 from go_to_adjacent_systems import *
2 from go_somewhere_significant import *
3 import vsrandom
4 import launch
5 import faction_ships
6 import VS
7 import Briefing
8 import universe
9 import unit
10 import Director
11 class wingman (Director.Mission):
12  def __init__ (self,price,factionname,numships,difficulty):
13  Director.Mission.__init__(self)
14  self.price=price
15  self.faction=factionname
16  self.you = VS.getPlayer()
17  self.numships=numships
18  self.diff=difficulty
19  self.adjsys=go_somewhere_significant (self.you,0,5000,0)
21  nam = "[%s]" % self.wingship
22  self.adjsys.Print("Hello I'm waiting for your arrival at %s" ,self.wingship)
23  VS.IOmessage(1,self.wingship,"all","Once you meet me")
24  VS.IOmessage(2,self.wingship,"all","I will obey your commands until our contracts expire.")
25 
26  def GenerateWingmen(self):
27  if (self.you):
28  if (self.you.getCredits()>=self.price):
29  self.you.addCredits(-self.price)
30  lead=launch.launch_wave_around_unit(self.you.getFlightgroupName(),
31  self.you.getFactionName(),
32  self.wingship,
33  "default",
34  self.numships,
35  500,
36  1000,
37  self.you)
38  VS.IOmessage (0,lead.getName(),"all","I am at your service commander. Let us succeed!")
39  else:
40  lead=launch.launch_wave_around_unit("ForHire",
41  self.faction,
42  self.wingship,
43  "default",
44  self.numships,
45  500,
46  1000,
47  self.you)
48  if (self.diff>0):
49  lead.SetTarget(self.you)
50  VS.IOmessage (0,lead.getName(),"all","You don't have the agreed money... prepare to DIE!")
51  else:
52  VS.IOmessage (0,lead.getName(),"all","You don't have the money. A fool like you won't last long!")
53  def Execute (self):
54 
55  if (self.adjsys.Execute()):
56  self.GenerateWingmen()
57  VS.terminateMission(1)
58  def initbriefing(self):
59  print "ending briefing"
60  def loopbriefing(self):
61  print "loop briefing"
62  Briefing.terminate();
63  def endbriefing(self):
64  print "ending briefing"