Poodletooth-iLand/toontown/ai/DistributedBlackCatMgr.py

40 lines
1.3 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.interval.IntervalGlobal import *
from toontown.effects import DustCloud
def getDustCloudIval(toon):
dustCloud = DustCloud.DustCloud(fBillboard=0)
dustCloud.setBillboardAxis(2.0)
dustCloud.setZ(3)
dustCloud.setScale(0.4)
dustCloud.createTrack()
2015-04-28 23:01:52 -05:00
if hasattr(toon, 'laffMeter'):
2015-03-03 16:10:12 -06:00
toon.laffMeter.color = toon.style.getBlackColor()
2015-04-28 23:01:52 -05:00
sequence = Sequence(Wait(0.5), Func(dustCloud.reparentTo, toon), dustCloud.track, Func(dustCloud.destroy))
2015-04-28 23:01:52 -05:00
if hasattr(toon, 'laffMeter'):
sequence.append(Func(toon.laffMeter.adjustFace, toon.hp, toon.maxHp))
2015-04-28 23:01:52 -05:00
return sequence
2015-03-03 16:10:12 -06:00
class DistributedBlackCatMgr(DistributedObject.DistributedObject):
neverDisable = 1
2015-03-03 16:10:12 -06:00
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBlackCatMgr')
def announceGenerate(self):
DistributedObject.DistributedObject.announceGenerate(self)
base.cr.blackCatMgr = self
2015-03-03 16:10:12 -06:00
def delete(self):
base.cr.blackCatMgr = None
2015-03-03 16:10:12 -06:00
DistributedObject.DistributedObject.delete(self)
def requestBlackCatTransformation(self):
self.sendUpdate('requestBlackCatTransformation')
2015-03-03 16:10:12 -06:00
def doBlackCatTransformation(self):
2015-04-28 23:01:52 -05:00
getDustCloudIval(base.localAvatar).start()