Exemplo n.º 1
0
 def getFactory(cls):
     activity = bs.getActivity()
     if activity is None: raise Exception("no current activity")
     try:
         return activity._sharedPowerupFactory
     except Exception:
         f = activity._sharedPowerupFactory = PowerupFactory()
         return f
Exemplo n.º 2
0
 def getRandomPowerupType(self, forceType=None, excludeTypes=None):
     if excludeTypes:
         # exclude custom powerups if there is some custom powerup logic
         # example: bsFootball.py:456
         excludeTypes.append('snoball')
         excludeTypes.append('bunny')
     else:
         excludeTypes = []
     return PowerupFactory.getRandomPowerupType(self, forceType,
                                                excludeTypes)
Exemplo n.º 3
0
 def getFactory(cls):
     """
     Returns a shared bs.PowerupFactory object, creating it if necessary.
     """
     activity = bs.getActivity()
     if activity is None: raise Exception("no current activity")
     try:
         return activity._sharedPowerupFactory
     except Exception:
         f = activity._sharedPowerupFactory = PowerupFactory()
         return f
Exemplo n.º 4
0
 def getRandomPowerupType(self, forceType=None, excludeTypes=None):
     if excludeTypes:
         #FIXME bsFootball.py:456
         #FIXME runaround and onslaught !
         excludeTypes.append('superStar')
         excludeTypes.append('speed')
         excludeTypes.append('iceCube')
         excludeTypes.append('surprise')
         excludeTypes.append('martyrdom')
     else:
         excludeTypes = []
     return PowerupFactory.getRandomPowerupType(self, forceType,
                                                excludeTypes)