Poodletooth-iLand/toontown/building/DistributedKnockKnockDoorAI.py
Master Jumblespeed d882959bfa switch to remote
2015-05-18 22:11:33 -04:00

40 lines
1.5 KiB
Python
Executable file

import DistributedAnimatedPropAI
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.task.Task import Task
from otp.ai.AIBaseGlobal import *
class DistributedKnockKnockDoorAI(DistributedAnimatedPropAI.DistributedAnimatedPropAI):
def __init__(self, air, propId):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.__init__(self, air, propId)
self.fsm.setName('DistributedKnockKnockDoor')
self.propId = propId
self.doLaterTask = None
def enterOff(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.enterOff(self)
def exitOff(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.exitOff(self)
def attractTask(self, task):
self.fsm.request('attract')
return Task.done
def enterAttract(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.enterAttract(self)
def exitAttract(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.exitAttract(self)
def enterPlaying(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.enterPlaying(self)
self.doLaterTask = taskMgr.doMethodLater(9, self.attractTask, self.uniqueName('knockKnock-timer'))
def exitPlaying(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.exitPlaying(self)
taskMgr.remove(self.doLaterTask)
self.doLaterTask = None