mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-26 13:12:30 -06:00
24 lines
678 B
Python
24 lines
678 B
Python
|
from direct.directnotify.DirectNotifyGlobal import *
|
||
|
from direct.distributed import DistributedObjectAI
|
||
|
|
||
|
|
||
|
HealFrequency = 10.0 # The time in seconds between each Toon-up pulse.
|
||
|
|
||
|
|
||
|
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
|
||
|
av.startToonUp(HealFrequency)
|
||
|
|
||
|
def exitSafeZone(self):
|
||
|
avId = self.air.getAvatarIdFromSender()
|
||
|
av = self.air.doId2do.get(avId)
|
||
|
if not av:
|
||
|
return
|
||
|
av.stopToonUp()
|