oldschool-toontown/toontown/ai/DistributedScavengerHuntTargetAI.py

22 lines
774 B
Python
Raw Permalink Normal View History

2019-11-08 22:55:55 -06:00
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObjectAI
2019-11-08 22:55:55 -06:00
class DistributedScavengerHuntTargetAI(DistributedObjectAI.DistributedObjectAI):
"""
This class is instanced several times by ScavengerHuntManagerAI. Each one sits in
in its assigned zone and listens for an event on the client
"""
notify = DirectNotifyGlobal.directNotify.newCategory(
'DistributedScavengerHuntTargetAI')
def __init__(self, air, hunt, goal, shMgr):
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
self.goal = goal
self.shMgr = shMgr
def attemptScavengerHunt(self):
avId = self.air.getAvatarIdFromSender()
self.shMgr.avatarAttemptingGoal(avId, self.goal)