Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
cleansweep.py
Go to the documentation of this file.
1 import patrol_enemies
2 import unit
4  def __init__(self,numsystemsaway, num_points,distance,creds,jumps,donevar,minships,maxships,encounterprob,capshipprob,faction, forceattack,canrunaway):
5  patrol_enemies.patrol_enemies.__init__(self,numsystemsaway, num_points,distance,creds,jumps,donevar,minships,maxships,encounterprob,capshipprob,faction,forceattack)
6  self.enum=0
7  self.canrunaway=canrunaway
8  self.activeships=[]
9  self.guaranteed_success=False
10 
11  def Track(self,shiptype):
12  import VS
13  obj=VS.addObjective("Destroy %s."%(unit.getUnitFullName(shiptype,True)))
14  VS.setOwner(obj,self.you)
15  VS.setCompleteness(obj,-1.0)
16  self.activeships.append((shiptype,obj))
17  def SuccessMission(self):
18  self.guaranteed_success=True
19  def RealSuccessMission(self):
21  def DeletePatrolPoint(self,num,nam):
23  def Dead(self,activeship):
24  import VS
25  runawaydist=7000
26  tmp = (self.canrunaway and activeship[0].GetHullPercent()<.7)
27  if tmp:
28  VS.setCompleteness(activeship[1],0.0)
29  return ((tmp and self.you.getDistance(activeship[0])>runawaydist) or not activeship[0])
30  def Execute(self):
31  if (self.enum>=len(self.activeships)):
32  self.enum=0
33  else:
34  if (self.Dead(self.activeships[self.enum])):
35  import VS
36  VS.setCompleteness(self.activeships[self.enum][1],1.0)
37  del self.activeships[self.enum]
38  else:
39  self.enum+=1
40  if (len(self.activeships)==0 and self.guaranteed_success):
41  self.RealSuccessMission()
42  else: