Flippy will now turn you into a black cat on October 31

This commit is contained in:
DenialMC 2015-04-07 17:55:39 +03:00
parent 04233eb9f3
commit 9568591627
11 changed files with 54 additions and 62 deletions

View file

@ -2789,7 +2789,7 @@ dclass DistributedAprilToonsMgr : DistributedObject {
}; };
dclass DistributedBlackCatMgr : DistributedObject { dclass DistributedBlackCatMgr : DistributedObject {
doBlackCatTransformation(uint32 avId) broadcast; doBlackCatTransformation() broadcast;
requestBlackCatTransformation() airecv clsend; requestBlackCatTransformation() airecv clsend;
}; };

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 781330651 hashVal = 1472811447
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot
@ -14,7 +14,7 @@ from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiv
from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManager from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManager
from toontown.groups import GroupManager from toontown.groups import GroupManager
from toontown.uberdog.ClientServicesManager import ClientServicesManager from toontown.uberdog.ClientServicesManager import ClientServicesManager
from toontown.ai import NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedPolarBearMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedSillyMeterMgr from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedPolarBearMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedSillyMeterMgr
from toontown.ai.DistributedTrashcanZeroMgr import DistributedTrashcanZeroMgr from toontown.ai.DistributedTrashcanZeroMgr import DistributedTrashcanZeroMgr
from toontown.uberdog.DistributedMailManager import DistributedMailManager from toontown.uberdog.DistributedMailManager import DistributedMailManager
from otp.chat import ChatAgent from otp.chat import ChatAgent

View file

@ -9,16 +9,19 @@ def getDustCloudIval(toon):
dustCloud.setZ(3) dustCloud.setZ(3)
dustCloud.setScale(0.4) dustCloud.setScale(0.4)
dustCloud.createTrack() dustCloud.createTrack()
if getattr(toon, 'laffMeter', None):
if hasattr(toon, 'laffMeter'):
toon.laffMeter.color = toon.style.getBlackColor() toon.laffMeter.color = toon.style.getBlackColor()
seq = Sequence(Wait(0.5), Func(dustCloud.reparentTo, toon), dustCloud.track, Func(dustCloud.destroy))
seq.append(Func(messenger.send, 'blackcat-transformed')) sequence = Sequence(Wait(0.5), Func(dustCloud.reparentTo, toon), dustCloud.track, Func(dustCloud.destroy))
if getattr(toon, 'laffMeter', None):
seq.append(Func(toon.laffMeter.adjustFace, toon.hp, toon.maxHp)) if hasattr(toon, 'laffMeter'):
return seq sequence.append(Func(toon.laffMeter.adjustFace, toon.hp, toon.maxHp))
return sequence
class DistributedBlackCatMgr(DistributedObject.DistributedObject): class DistributedBlackCatMgr(DistributedObject.DistributedObject):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBlackCatMgr') notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBlackCatMgr')
def __init__(self, cr): def __init__(self, cr):
@ -26,28 +29,15 @@ class DistributedBlackCatMgr(DistributedObject.DistributedObject):
def announceGenerate(self): def announceGenerate(self):
DistributedObject.DistributedObject.announceGenerate(self) DistributedObject.DistributedObject.announceGenerate(self)
DistributedBlackCatMgr.notify.debug('announceGenerate') base.cr.blackCatMgr = self
self.acceptOnce('DistributedBlackCatMgr-activate', self.d_requestBlackCatTransformation)
self.dustCloudIval = None
def delete(self): def delete(self):
if self.dustCloudIval: base.cr.blackCatMgr = None
self.dustCloudIval.finish()
del self.dustCloudIval
self.ignore('DistributedBlackCatMgr-activate')
DistributedObject.DistributedObject.delete(self) DistributedObject.DistributedObject.delete(self)
def d_requestBlackCatTransformation(self): def requestBlackCatTransformation(self):
self.sendUpdate('requestBlackCatTransformation', []) self.sendUpdate('requestBlackCatTransformation')
def doBlackCatTransformation(self, avId): def doBlackCatTransformation(self):
DistributedBlackCatMgr.notify.debug('doBlackCatTransformation') print 'doit'
toon = self.cr.doId2do.get(avId) getDustCloudIval(base.localAvatar).start()
if not toon:
DistributedBlackCatMgr.notify.warning("couldn't find Toon %s" % self.avId)
return
if toon.style.getAnimal() != 'cat':
DistributedBlackCatMgr.notify.warning('not a cat: %s' % self.avId)
return
self.dustCloudIval = getDustCloudIval(toon)
self.dustCloudIval.start()

View file

@ -1,21 +1,23 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.toon.ToonDNA import ToonDNA from toontown.toon.ToonDNA import ToonDNA
from toontown.toonbase import ToontownGlobals
class DistributedBlackCatMgrAI(DistributedObjectAI): class DistributedBlackCatMgrAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedBlackCatMgrAI") notify = DirectNotifyGlobal.directNotify.newCategory("DistributedBlackCatMgrAI")
def requestBlackCatTransformation(self): def requestBlackCatTransformation(self):
if not self.air.holidayManager.isHolidayRunning(ToontownGlobals.BLACK_CAT_DAY):
return
avId = self.air.getAvatarIdFromSender() avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId) av = self.air.doId2do.get(avId)
if not av: return
if not av or av.dna.getAnimal() != 'cat' or av.dna.headColor == 0x1a:
if av.dna.getAnimal() == 'cat' and av.dna.headColor != 0x1a: return
newDNA = ToonDNA()
newDNA.makeFromNetString(av.getDNAString()) newDNA = ToonDNA()
newDNA.headColor = 0x1a newDNA.makeFromNetString(av.getDNAString())
newDNA.armColor = 0x1a newDNA.updateToonProperties(armColor=26, legColor=26, headColor=26)
newDNA.legColor = 0x1a taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId)
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId) self.sendUpdateToAvatarId(avId, 'doBlackCatTransformation', [])
self.sendUpdate('doBlackCatTransformation', [avId])

View file

@ -1,4 +1,5 @@
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from datetime import datetime
class HolidayManagerAI: class HolidayManagerAI:
@ -10,11 +11,19 @@ class HolidayManagerAI:
def setup(self): def setup(self):
holidays = config.GetString('active-holidays','') holidays = config.GetString('active-holidays','')
if holidays != '': if holidays != '':
for holiday in holidays.split(","): for holiday in holidays.split(","):
holiday = int(holiday) holiday = int(holiday)
self.currentHolidays.append(holiday) self.currentHolidays.append(holiday)
simbase.air.newsManager.setHolidayIdList([self.currentHolidays])
date = datetime.now()
if date.month == 10 and date.day == 31:
# Halloween: Black Cat Day
self.currentHolidays.append(ToontownGlobals.BLACK_CAT_DAY)
simbase.air.newsManager.setHolidayIdList([self.currentHolidays])
def isHolidayRunning(self, holidayId): def isHolidayRunning(self, holidayId):
return holidayId in self.currentHolidays return holidayId in self.currentHolidays

View file

@ -15,6 +15,7 @@ from toontown.ai.FishManagerAI import FishManagerAI
from toontown.ai.HolidayManagerAI import HolidayManagerAI from toontown.ai.HolidayManagerAI import HolidayManagerAI
from toontown.ai.NewsManagerAI import NewsManagerAI from toontown.ai.NewsManagerAI import NewsManagerAI
from toontown.ai.QuestManagerAI import QuestManagerAI from toontown.ai.QuestManagerAI import QuestManagerAI
from toontown.ai.DistributedBlackCatMgrAI import DistributedBlackCatMgrAI
from toontown.ai import BankManagerAI from toontown.ai import BankManagerAI
from toontown.catalog.AccountDateAI import AccountDateAI from toontown.catalog.AccountDateAI import AccountDateAI
from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI
@ -113,6 +114,8 @@ class ToontownAIRepository(ToontownInternalRepository):
self.banManager = BanManagerAI.BanManagerAI(self) self.banManager = BanManagerAI.BanManagerAI(self)
self.achievementsManager = AchievementsManagerAI(self) self.achievementsManager = AchievementsManagerAI(self)
self.suitInvasionManager = SuitInvasionManagerAI(self) self.suitInvasionManager = SuitInvasionManagerAI(self)
self.blackCatMgr = DistributedBlackCatMgrAI(self)
self.blackCatMgr.generateWithRequired(2)
self.trophyMgr = DistributedTrophyMgrAI(self) self.trophyMgr = DistributedTrophyMgrAI(self)
self.trophyMgr.generateWithRequired(2) self.trophyMgr.generateWithRequired(2)
self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self) self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)

View file

@ -8340,7 +8340,6 @@ WHITELIST = [
'crazycorner', 'crazycorner',
"crazycorner's", "crazycorner's",
'crazycorners', 'crazycorners',
'crazyknucklesthebestblackcat',
'crazyquilt', 'crazyquilt',
"crazyquilt's", "crazyquilt's",
'crazyquilts', 'crazyquilts',

View file

@ -862,7 +862,7 @@ class NPCMoviePlayer(DirectObject.DirectObject):
def phraseSaid(phraseId): def phraseSaid(phraseId):
toontastic = 315 toontastic = 315
if phraseId == toontastic: if phraseId == toontastic:
messenger.send('DistributedBlackCatMgr-activate') base.cr.blackCatMgr.requestBlackCatTransformation()
def enableBlackCatListen(): def enableBlackCatListen():
self.acceptOnce(SpeedChatGlobals.SCStaticTextMsgEvent, phraseSaid) self.acceptOnce(SpeedChatGlobals.SCStaticTextMsgEvent, phraseSaid)

View file

@ -2682,3 +2682,10 @@ def promote(deptIndex):
invoker = spellbook.getInvoker() invoker = spellbook.getInvoker()
invoker.sendUpdate('requestPromotion', [deptIndex]) invoker.sendUpdate('requestPromotion', [deptIndex])
return 'Your promotion request has been sent.' return 'Your promotion request has been sent.'
@magicWord(category=CATEGORY_ADMINISTRATOR)
def blackCat():
"""
Ask the black cat manager to turn you into a cat.
"""
base.cr.blackCatMgr.requestBlackCatTransformation()

View file

@ -2515,17 +2515,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def isToonedUp(self): def isToonedUp(self):
return self.hp >= self.maxHp return self.hp >= self.maxHp
def makeBlackCat(self):
if self.dna.getAnimal() != 'cat':
return 'not a cat'
self.air.writeServerEvent('blackCat', self.doId, '')
newDna = ToonDNA.ToonDNA()
newDna.makeFromNetString(self.dna.makeNetString())
black = 26
newDna.updateToonProperties(armColor=black, legColor=black, headColor=black)
self.b_setDNAString(newDna.makeNetString())
return None
def b_announceBingo(self): def b_announceBingo(self):
self.d_announceBingo() self.d_announceBingo()
self.announceBingo self.announceBingo

View file

@ -1,8 +1,6 @@
from direct.directnotify.DirectNotifyGlobal import * from direct.directnotify.DirectNotifyGlobal import *
from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.fsm.FSM import FSM from direct.fsm.FSM import FSM
from toontown.ai import DistributedBlackCatMgrAI
from toontown.building import FADoorCodes from toontown.building import FADoorCodes
from toontown.building.HQBuildingAI import HQBuildingAI from toontown.building.HQBuildingAI import HQBuildingAI
from toontown.building.TutorialBuildingAI import TutorialBuildingAI from toontown.building.TutorialBuildingAI import TutorialBuildingAI
@ -64,11 +62,6 @@ class TutorialFSM(FSM):
def enterTunnel(self): def enterTunnel(self):
npcDesc = NPCToons.NPCToonDict.get(20001) npcDesc = NPCToons.NPCToonDict.get(20001)
self.flippy = NPCToons.createNPC(self.air, 20001, npcDesc, self.zones['street'], 0) self.flippy = NPCToons.createNPC(self.air, 20001, npcDesc, self.zones['street'], 0)
if simbase.air.wantHalloween:
self.BlackCatManager = DistributedBlackCatMgrAI.DistributedBlackCatMgrAI(self.air)
self.BlackCatManager.generateWithRequired(self.zones['street'])
self.hq.insideDoor0.setDoorLock(FADoorCodes.WRONG_DOOR_HQ) self.hq.insideDoor0.setDoorLock(FADoorCodes.WRONG_DOOR_HQ)
self.hq.insideDoor1.setDoorLock(FADoorCodes.UNLOCKED) self.hq.insideDoor1.setDoorLock(FADoorCodes.UNLOCKED)
self.hq.door0.setDoorLock(FADoorCodes.GO_TO_PLAYGROUND) self.hq.door0.setDoorLock(FADoorCodes.GO_TO_PLAYGROUND)