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

Public Member Functions

def __init__
 
def __call__
 
- Public Member Functions inherited from Script
def __init__
 
def __call__
 

Data Fields

 cargname
 
 cargnum
 
 missionflag
 
- Data Fields inherited from Script
 nextscript
 

Detailed Description

Definition at line 303 of file campaign_lib.py.

Constructor & Destructor Documentation

def __init__ (   self,
  name,
  num,
  missionflag,
  nextscript = None 
)

Definition at line 304 of file campaign_lib.py.

305  def __init__(self,name,num,missionflag,nextscript=None):
306  Script.__init__(self,nextscript)
307  self.cargname=name
308  self.cargnum=num
self.missionflag=missionflag

Member Function Documentation

def __call__ (   self,
  room,
  subnodes 
)

Definition at line 309 of file campaign_lib.py.

References RemoveCargo.cargname, RemoveCargo.cargnum, debug.debug, RemoveCargo.missionflag, and locale.str().

310  def __call__(self,room,subnodes):
311  Script.__call__(self,room,subnodes)
312  if VS.networked():
313  return True
314  you=VS.getPlayer()
315  removenum=you.removeCargo(self.cargname,self.cargnum,True)
316  if self.missionflag:
317  has=you.hasCargo(self.cargname)
318  if (has):
319  mpart=VS.GetMasterPartList()
320  newcarg=mpart.GetCargo(self.cargname)
321  has=you.removeCargo(self.cargname,has,1)
322  newcarg.SetMissionFlag(0)
323  newcarg.SetContent(self.cargname)
324  newcarg.SetQuantity(has)
325  you.addCargo(newcarg) #It seems that removing and then adding it again is the only way...
326  debug.debug('*********** Remove cargo '+self.cargname+'('+str(self.cargnum)+')')
327  if removenum<self.cargnum:
328  debug.debug(' ...strict failed to remove cargo')
329  return False #since we force add all cargo, we can fail if not all is removed
330  if removenum<1:#self.cargnum less strict
331  debug.debug(' ...really failed :-(')
332  return False
333  return True
334 
# Should use this with GoToSubnodeIfTrue.

Field Documentation

cargname

Definition at line 306 of file campaign_lib.py.

cargnum

Definition at line 307 of file campaign_lib.py.

missionflag

Definition at line 308 of file campaign_lib.py.


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