Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
wc1_mis1.py
Go to the documentation of this file.
1 import vsrandom
2 import VS
3 import unit
4 import launch
5 from Vector import Add
6 from wc1 import findOriginAndMove
7 class wc1_mis1:
8  def __init__(self):
9  pass
10  def Start(self,carrier):
11  self.inflight=0
12  self.jump = findOriginAndMove(carrier,(0,0,-20000));
13  self.carrier=carrier
14  self.origin = carrier.Position();
15  self.wingman= launch.launch (VS.getPlayer().getFlightgroupName(),"confed","nova","default",1,1,Add((1000,200,0),self.origin))
16  self.transport= launch.launch ("Transport","confed","cargoship","default",1,1,Add((-1000,200,0),self.origin))
17  self.transport.ActivateJumpDrive(0)
18  self.transport.SetTarget(self.jump)
19 
20  self.launched=[0,0]
21  self.nav=[launch.launch("nav1","neutral","eject","sitting_duck",1,1,Add(self.origin,(20000,000,10000))),
22  self.jump]
23  self.roids = [VS.launch("Asteroids","AFieldSparse","neutral","asteroid","default",1,1,Add(self.origin,(0000,00000,10000)),"")]
24  def moveTrans (self,targ):
25  print "moving trans"
26  self.transport.SetPosAndCumPos(Add(targ.Position(),(0,0,-1000)))
27 
28  def LaunchNav (self,i,playa):
29  print "launching %d" % i
30  if (i==0):
31  launch.launch_wave_around_unit("BadGuys","aera","lekra","default",3,100,1000,playa)
32  self.moveTrans(self.nav[0])
33  elif (i==1):
34  if (self.launched[0]):
35  self.moveTrans(self.nav[1])
36  launch.launch_wave_around_unit("BadGuys","aera","kyta","default",2,100,1000,playa)
37  def EndMission (self):
38  print "endmission"
39  self.wingman.Kill()
40  for n in self.nav:
41  n.Kill()
42  for n in self.roids:
43  n.Kill()
44  VS.terminateMission(1)
45  if (self.transport):
46  if (not unit.inSystem(self.transport)):
47  print "success"
48  return ("vega_sector/vega",0)
49  #success (change debrief maybe?)
50  return ("vega_sector/hellskitchen",0)
51  def Execute(self):
52  playa= VS.getPlayer()
53  if (playa):
54  for i in range (len(self.nav)):
55  if (self.nav[i]):
56  if (not self.launched[i]):
57  if (playa.getDistance (self.nav[i])<1000):
58  self.LaunchNav(i,playa)
59  self.launched[i]=1
60  if (playa.isDocked(self.carrier) or self.carrier.isDocked(playa)):
61  if (self.inflight):
62  return self.EndMission()
63  else:
64  self.inflight=1
65  return