oldschool-toontown/toontown/coghq/DistributedStomperPairAI.py

33 lines
1 KiB
Python
Raw Normal View History

2019-11-02 17:27:54 -05:00
from otp.ai.AIBase import *
from direct.directnotify import DirectNotifyGlobal
from otp.level import DistributedEntityAI
from . import StomperGlobals
2019-11-02 17:27:54 -05:00
from direct.distributed import ClockDelta
class DistributedStomperPairAI(DistributedEntityAI.DistributedEntityAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedStomperAI')
def __init__(self, level, entId):
DistributedEntityAI.DistributedEntityAI.__init__(self, level, entId)
self.stompers = [None, None]
self.hitPtsTaken = 3
return
def generate(self):
DistributedEntityAI.DistributedEntityAI.generate(self)
def delete(self):
DistributedEntityAI.DistributedEntityAI.delete(self)
def setChildren(self, doIds):
for id in doIds:
self.children = simbase.air.doId2do[id]
self.sendUpdate('setChildren', [doIds])
def setSquash(self):
avId = self.air.getAvatarIdFromSender()
av = simbase.air.doId2do.get(avId)
if av:
av.takeDamage(self.hitPtsTaken)