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

Public Member Functions

def __init__
 
def refreshJumpPoints
 
def checkDistances
 
def Execute
 
- Public Member Functions inherited from quest
def NoSignificantsNear
 
def SignificantsNear
 
def setOwner
 
def removeQuest
 
def makeQuestPersistent
 
def isPersistent
 
def Execute
 

Data Fields

 playa
 
 jps
 
- Data Fields inherited from quest
 name
 
 playernum
 

Detailed Description

Definition at line 31 of file quest_intro.py.

Constructor & Destructor Documentation

def __init__ (   self)

Definition at line 33 of file quest_intro.py.

33 
34  def __init__(self):
35  self.playa = VS.getPlayer()
36  self.jps = list()
37  self.refreshJumpPoints()
38  Director.eraseSaveData(self.playa.isPlayerStarship(),TRIGGER_SAVE,0)
39  Director.pushSaveData(self.playa.isPlayerStarship(),TRIGGER_SAVE,DEFAULT_VALUE)
40 #I work on the assumption that only one value exists in the TRIGGER_SAVE var,
41 # thus before writing to it, you must delete the first value :-)

Member Function Documentation

def checkDistances (   self)
Determines whether \'self.playa\' (the player) is close enough to
a jumppoint to trigger the IOMessage.

Definition at line 52 of file quest_intro.py.

References quest_introduction.jps.

52 
53  def checkDistances(self):
54  """Determines whether \'self.playa\' (the player) is close enough to
55  a jumppoint to trigger the IOMessage."""
56 #You will find yourself doing this a lot :-)
57  for jp in self.jps:
58  if self.playa.getDistance(jp) <= JP_DISTANCE:
59  return 1
60  return 0
def Execute (   self)

Definition at line 61 of file quest_intro.py.

References quest_introduction.checkDistances(), quest.checkSaveValue(), and quest.removeQuest().

61 
62  def Execute(self):
63  if self.checkDistances() and quest.checkSaveValue(self.playa.isPlayerStarship(),TRIGGER_SAVE,DEFAULT_VALUE):
64  VS.IOmessage (0,TRIGGER_MESSAGE[0],"all",TRIGGER_MESSAGE[1])
65  Director.eraseSaveData(self.playa.isPlayerStarship(),TRIGGER_SAVE,0)
66  Director.pushSaveData(self.playa.isPlayerStarship(),TRIGGER_SAVE,TRIGGER_VALUE)
67  elif quest.checkSaveValue(self.playa.isPlayerStarship(),TRIGGER_SAVE,DONE_VALUE):
68  Director.eraseSaveData(self.playa.isPlayerStarship(),TRIGGER_SAVE,0)
69  fixers.eraseCFixer(self.playa.isPlayerStarship(), FIXER_NAME)
70  self.removeQuest()
71 #You only want to remove the quest once the fixer has finished doing his thing :-)
72  return 0
73  return 1
74 
def refreshJumpPoints (   self)
Updates the jumppoint list \'self.jps\' used by \'self.checkDistances()\'.

Definition at line 42 of file quest_intro.py.

References quest_introduction.jps.

42 
43  def refreshJumpPoints(self):
44  """Updates the jumppoint list \'self.jps\' used by \'self.checkDistances()\'."""
45  self.jps = list()
46 #This is how to use the unit iterator. *Very useful*
47  iter = VS.getUnitList()
48  while iter.notDone():
49  if iter.current().isJumppoint():
50  self.jps.append(iter.current())
51  iter.advance()

Field Documentation

jps

Definition at line 35 of file quest_intro.py.

playa

Definition at line 34 of file quest_intro.py.


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