mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-26 21:22:27 -06:00
41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
|
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
|