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

Functions

def removePersistentAdventure
 
def newAdventure
 
def persistentAdventure
 

Variables

dictionary adventures = {}
 
tuple persistent_adventures = list()
 

Function Documentation

def adventure.newAdventure (   playernum,
  oldsys,
  newsys 
)

Definition at line 57 of file adventure.py.

References removePersistentAdventure().

57 
58 def newAdventure(playernum,oldsys,newsys):
59  newfac=adventures.get (newsys)
60  if (newfac):
61  newq = newfac.factory(playernum)
62  if (newq):#only remove it if that player hasn't done it before
63  del adventures[newsys]
65  return newq
66  return
67 #that returns false
def adventure.persistentAdventure (   playernum)

Definition at line 68 of file adventure.py.

References quest_surplus.makeSurplusShortage(), and vsrandom.randrange().

68 
69 def persistentAdventure(playernum):
70  for index in range (len(persistent_adventures)):
71  ret = persistent_adventures[index].persistent_factory(playernum)
72  if (ret):
73  del persistent_adventures[index]
74  return ret
75  if (vsrandom.randrange(0,4)==0):
76  (key,val,news)=quest_surplus.makeSurplusShortage()
77  if (not adventures.get(key)):
78  adventures.setdefault(key,val)
79  VS.IOmessage (0,"game","news",news)
80  return
def adventure.removePersistentAdventure (   newq)

Definition at line 49 of file adventure.py.

49 
51  mylen = len(persistent_adventures)
52  if (mylen):
53  for x in range (mylen):
54  if (persistent_adventures[x]==newq):
55  del persistent_adventures[x]
56  return

Variable Documentation

dictionary adventures = {}

Definition at line 20 of file adventure.py.

list persistent_adventures = list()

Definition at line 21 of file adventure.py.