2015-03-03 16:10:12 -06:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
|
|
|
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|
|
|
from toontown.toon.ToonDNA import ToonDNA
|
2015-04-07 09:55:39 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
class DistributedBlackCatMgrAI(DistributedObjectAI):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedBlackCatMgrAI")
|
|
|
|
|
|
|
|
def requestBlackCatTransformation(self):
|
2015-06-21 14:46:17 -05:00
|
|
|
if not self.air.newsManager.isHolidayRunning(ToontownGlobals.BLACK_CAT_DAY):
|
2015-04-07 09:55:39 -05:00
|
|
|
return
|
2015-04-28 23:01:52 -05:00
|
|
|
|
2015-03-03 16:10:12 -06:00
|
|
|
avId = self.air.getAvatarIdFromSender()
|
|
|
|
av = self.air.doId2do.get(avId)
|
2015-04-28 23:01:52 -05:00
|
|
|
|
2015-06-22 05:10:54 -05:00
|
|
|
if not av or av.getTutorialAck() or av.dna.getAnimal() != 'cat' or av.dna.headColor == 0x1a:
|
2015-04-07 09:55:39 -05:00
|
|
|
return
|
2015-04-28 23:01:52 -05:00
|
|
|
|
2015-04-07 09:55:39 -05:00
|
|
|
newDNA = ToonDNA()
|
|
|
|
newDNA.makeFromNetString(av.getDNAString())
|
|
|
|
newDNA.updateToonProperties(armColor=26, legColor=26, headColor=26)
|
|
|
|
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId)
|
2015-07-05 18:59:25 -05:00
|
|
|
self.sendUpdateToAvatarId(avId, 'doBlackCatTransformation', [])
|