Poodletooth-iLand/toontown/coghq/BarrelBase.py

32 lines
1.1 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
import random
class BarrelBase:
def getRng(self):
return random.Random(self.entId * self.level.doId)
def getRewardPerGrab(self):
if not hasattr(self, '_reward'):
if self.rewardPerGrabMax > self.rewardPerGrab:
self._reward = self.getRng().randrange(self.rewardPerGrab, self.rewardPerGrabMax + 1)
else:
self._reward = self.rewardPerGrab
return self._reward
def getGagLevel(self):
if not hasattr(self, '_gagLevel'):
if self.gagLevelMax > self.gagLevel:
self._gagLevel = self.getRng().randrange(self.gagLevel, self.gagLevelMax + 1)
else:
self._gagLevel = self.gagLevel
return self._gagLevel
def getGagTrack(self):
if not hasattr(self, '_gagTrack'):
if self.gagTrack == 'random':
tracks = (0, 1, 2, 3, 4, 4, 5, 5, 6)
self._gagTrack = self.getRng().choice(tracks)
else:
self._gagTrack = self.gagTrack
2015-06-15 19:56:12 -05:00
return self._gagTrack