Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
ShipTracker Class Reference

Public Member Functions

def __init__
 
def Check
 

Data Fields

 un
 
 fgname
 
 faction
 
 starsystem
 
 type
 

Detailed Description

Definition at line 31 of file dynamic_universe.py.

Constructor & Destructor Documentation

def __init__ (   self,
  fgname,
  faction,
  typ,
  un 
)

Definition at line 32 of file dynamic_universe.py.

32 
33  def __init__ (self,fgname,faction,typ,un):
34  self.un=un
35  self.fgname=fgname
36  self.faction= faction
37  self.starsystem = VS.getSystemFile()
self.type=typ

Member Function Documentation

def Check (   self)

Definition at line 38 of file dynamic_universe.py.

References debug.debug, SystemInformation.faction, ShipTracker.faction, ClearFactionRecord.faction, PushRelation.faction, PopRelation.faction, LaunchWingmen.faction, ChangeSystemOwner.faction, ChangeShipOwners.faction, ShipTracker.fgname, faction_ships.get_enemy_of(), dynamic_battle.getImportanceOfType(), fg_util.LandShip(), fg_util.NumShipsInFG(), fg_util.RemoveShipFromFG(), ShipTracker.starsystem, locale.str(), Message.type, ShipTracker.type, CargoSpaceCondition.type, URLopener.type, Request.type, MiniFieldStorage.type, FieldStorage.type, ShipTracker.un, and dynamic_universe.updatePlayerKillList().

38 
39  def Check(self):
40  dead=not self.un
41  if (not dead):
42  dead = self.un.GetHull()<=0
43  if (dead):
44  debug.debug("Uunit died")
45  if (VS.systemInMemory (self.starsystem)):
46  if fg_util.RemoveShipFromFG(self.fgname,self.faction,self.type)!=0:
47  if (VS.getPlayerX(0)):
48  debug.debug('unit died for real')
49  if (VS.GetRelation(self.faction,VS.getPlayerX(0).getFactionName())>0):
50  dynamic_battle.rescuelist[self.starsystem]=(self.faction,"Shadow",faction_ships.get_enemy_of(self.faction))
51  debug.debug("friend in trouble")
52  global dnewsman_
53  numships = updatePlayerKillList(0,self.faction)
54  debug.debug("num ships killed ")
55  debug.debug(numships)
56  if ((numships>0 and VS.getPlayer()) or fg_util.NumShipsInFG(self.fgname,self.faction)==0): #generate news here fg killed IRL
57  varList=[str(Director.getSaveData(0,"stardate",0)),dnewsman_.TYPE_DESTROYED,dnewsman_.STAGE_END,"unknown",self.faction,dnewsman_.SUCCESS_WIN,str(dynamic_battle.getImportanceOfType(self.type)),self.starsystem,dnewsman_.KEYWORD_DEFAULT,"unknown","unknown",self.fgname,self.type]
58  if (numships>0 and VS.getPlayer()):
59  varList=[str(Director.getSaveData(0,"stardate",0)),dnewsman_.TYPE_DESTROYED,dnewsman_.STAGE_END,VS.getPlayer().getFactionName(),self.faction,dnewsman_.SUCCESS_WIN,str(dynamic_battle.getImportanceOfType(self.type)),self.starsystem,dnewsman_.KEYWORD_DEFAULT,VS.getPlayer().getFlightgroupName(),VS.getPlayer().getName(),self.fgname,self.type]
60  dnewsman_.writeDynamicString(varList)
61  debug.debug('news about unit dying')
62  else:
63  fg_util.LandShip(self.fgname,self.faction,self.type)
64  return 0
65  else:
66  sys=self.un.getUnitSystemFile()
67  if (len(sys)):
68  self.starsystem=sys
return 1

Field Documentation

faction

Definition at line 35 of file dynamic_universe.py.

fgname

Definition at line 34 of file dynamic_universe.py.

starsystem

Definition at line 36 of file dynamic_universe.py.

type

Definition at line 37 of file dynamic_universe.py.

un

Definition at line 33 of file dynamic_universe.py.


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