Poodletooth-iLand/toontown/safezone/SZTreasurePlannerAI.py

23 lines
1 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from RegenTreasurePlannerAI import RegenTreasurePlannerAI
from direct.directnotify import DirectNotifyGlobal
2015-06-25 13:43:32 -05:00
from toontown.toonbase import ToontownGlobals
2015-03-03 16:10:12 -06:00
class SZTreasurePlannerAI(RegenTreasurePlannerAI):
notify = DirectNotifyGlobal.directNotify.newCategory('SZTreasurePlannerAI')
def __init__(self, zoneId, treasureType, healAmount, spawnPoints, spawnRate, maxTreasures):
self.zoneId = zoneId
self.spawnPoints = spawnPoints
self.healAmount = healAmount
RegenTreasurePlannerAI.__init__(self, zoneId, treasureType, 'SZTreasurePlanner-%d' % zoneId, spawnRate, maxTreasures)
def initSpawnPoints(self):
pass
def validAvatar(self, treasure, av):
# Avatars can only heal if they are missing some health, but aren't sad.
if av.getHp() < av.getMaxHp() and av.getHp() > 0:
2015-06-25 13:43:32 -05:00
av.toonUp(self.healAmount * 2 if simbase.air.newsManager.isHolidayRunning(ToontownGlobals.VALENTOONS_DAY) else self.healAmount)
2015-03-03 16:10:12 -06:00
return True
else:
2015-06-25 13:43:32 -05:00
return False