2015-03-03 16:10:12 -06:00
|
|
|
from direct.directnotify.DirectNotifyGlobal import *
|
|
|
|
from direct.distributed import DistributedObjectAI
|
2015-08-01 13:13:36 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
class SafeZoneManagerAI(DistributedObjectAI.DistributedObjectAI):
|
|
|
|
notify = directNotify.newCategory('SafeZoneManagerAI')
|
|
|
|
|
|
|
|
def enterSafeZone(self):
|
|
|
|
avId = self.air.getAvatarIdFromSender()
|
|
|
|
av = self.air.doId2do.get(avId)
|
|
|
|
if not av:
|
|
|
|
return
|
2015-08-01 13:13:36 -05:00
|
|
|
av.startToonUp(ToontownGlobals.TOONUP_FREQUENCY)
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
def exitSafeZone(self):
|
|
|
|
avId = self.air.getAvatarIdFromSender()
|
|
|
|
av = self.air.doId2do.get(avId)
|
|
|
|
if not av:
|
|
|
|
return
|
|
|
|
av.stopToonUp()
|