diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index e952ceda..bc1c1220 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -329,7 +329,6 @@ from toontown.coghq import DistributedSinkingPlatform/AI from toontown.suit import DistributedGoon/AI from toontown.suit import DistributedGridGoon/AI from toontown.coghq import BattleBlocker/AI -from toontown.ai import DistributedAprilToonsMgr/AI from toontown.ai import DistributedBlackCatMgr/AI from toontown.ai import DistributedReportMgr/AI from toontown.ai import DistributedPolarPlaceEffectMgr/AI @@ -1210,8 +1209,6 @@ dclass DistributedTargetGame : DistributedMinigame { }; dclass EstateManager : DistributedObject { - startAprilFools() broadcast; - stopAprilFools() broadcast; getEstateZone(uint32 avId) airecv clsend; setEstateZone(uint32 ownerId, uint32 zoneId); setAvHouseId(uint32, uint32[]) broadcast; @@ -2421,12 +2418,6 @@ dclass DistributedPetProxy : DistributedPet { setDominantMood(string) broadcast ram; }; -dclass DistributedAprilToonsMgr : DistributedObject { - setEventActive(uint8 eventId, bool) broadcast; - requestEventsList() clsend airecv; - requestEventsListResp(uint8 []); -}; - dclass DistributedBlackCatMgr : DistributedObject { doBlackCatTransformation() broadcast; requestBlackCatTransformation() airecv clsend; diff --git a/otp/otpbase/OTPLocalizerEnglish.py b/otp/otpbase/OTPLocalizerEnglish.py index 1713ab63..663d12a3 100755 --- a/otp/otpbase/OTPLocalizerEnglish.py +++ b/otp/otpbase/OTPLocalizerEnglish.py @@ -1618,20 +1618,6 @@ SpeedChatStaticTextToontown = {100: 'Hi!', 21206: 'Speak!', 30100: "Happy April Toons' Week!", 30101: "Welcome to my April Toons' Week party!", - 30102: 'The Silly Meter is back in Toon Hall!', - 30110: 'Mickey is in Daisy Gardens.', - 30111: 'Daisy is in Toontown Central.', - 30112: 'Minnie is in The Brrrgh.', - 30113: 'Pluto is in Melodyland.', - 30114: 'Donald is sleepwalking at the Speedway.', - 30115: 'Goofy is in Dreamland.', - 30120: 'Mickey is acting like Daisy!', - 30121: 'Daisy is acting like Mickey!', - 30122: 'Minnie is acting like Pluto!', - 30123: 'Pluto is acting like Minnie!', - 30124: 'Pluto is talking!', - 30125: 'Goofy is acting like Donald!', - 30126: 'Donald is dreaming he is Goofy!', 30130: 'Watch how far I can jump.', 30131: 'Wow, you jumped really far!', 30132: 'Hey, Doodles can talk!', @@ -2312,8 +2298,6 @@ KartRacingMenuSections = [-1, 'TAUNTS'] AprilToonsMenuSections = [-1, 'GREETINGS', - 'PLAYGROUNDS', - 'CHARACTERS', 'ESTATES'] SillyHolidayMenuSections = [-1, 'WORLD', 'BATTLE'] CarolMenuSections = [-1] diff --git a/toontown/ai/DistributedAprilToonsMgr.py b/toontown/ai/DistributedAprilToonsMgr.py deleted file mode 100755 index 2012cee0..00000000 --- a/toontown/ai/DistributedAprilToonsMgr.py +++ /dev/null @@ -1,43 +0,0 @@ -from direct.distributed.DistributedObject import DistributedObject -from direct.directnotify import DirectNotifyGlobal -from toontown.toonbase.AprilToonsGlobals import * -from toontown.toonbase import ToontownGlobals - -class DistributedAprilToonsMgr(DistributedObject): - notify = DirectNotifyGlobal.directNotify.newCategory('AprilToonsMgr') - - def __init__(self, cr): - DistributedObject.__init__(self, cr) - cr.aprilToonsMgr = self - self.events = [] - - def announceGenerate(self): - DistributedObject.announceGenerate(self) - self.d_requestEventsList() - - def d_requestEventsList(self): - self.notify.debug("Requesting events list from AI.") - self.sendUpdate('requestEventsList', []) - - def requestEventsListResp(self, eventIds): - self.events = eventIds - self.checkActiveEvents() - - def isEventActive(self, eventId): - # NOTE: Possible race condition where the client checks for if an event is active - # *before* it gets a response from the AI. - if not base.cr.config.GetBool('want-april-toons', False): - # If this DO is generated but we don't want april toons, always return - # false regardless. - return False - return eventId in self.events - - def setEventActive(self, eventId, active): - if active and eventId not in self.events: - self.events.append(eventId) - elif not active and eventId in self.events: - del self.events[eventId] - - def checkActiveEvents(self): - if self.isEventActive(EventGlobalGravity): - base.localAvatar.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 0.75) diff --git a/toontown/ai/DistributedAprilToonsMgrAI.py b/toontown/ai/DistributedAprilToonsMgrAI.py deleted file mode 100755 index 98c5ae7d..00000000 --- a/toontown/ai/DistributedAprilToonsMgrAI.py +++ /dev/null @@ -1,35 +0,0 @@ -from direct.distributed.DistributedObjectAI import DistributedObjectAI -from otp.ai.MagicWordGlobal import * -from direct.task import Task -from toontown.toonbase.AprilToonsGlobals import * - -class DistributedAprilToonsMgrAI(DistributedObjectAI): - def __init__(self, air): - DistributedObjectAI.__init__(self, air) - # Define the default events we want for this year - self.events = [EventRandomDialogue, - EventRandomEffects, - EventEstateGravity, - EventGlobalGravity] - - def getEvents(self): - return self.events - - def isEventActive(self, eventId): - if not self.air.config.GetBool('want-april-toons', False): - # If this DO is generated but we don't want april toons, always return - # false regardless. - return False - return eventId in self.events - - def requestEventsList(self): - avId = self.air.getAvatarIdFromSender() - self.sendUpdateToAvatarId(avId, 'requestEventsListResp', [self.getEvents()]) - - def toggleEvent(self, eventId): - if eventId in self.getEvents(): - del self.getEvents()[eventId] - self.sendUpdate('setEventActive', [eventId, False]) - else: - self.getEvents().append(eventId) - self.sendUpdate('setEventActive', [eventId, True]) diff --git a/toontown/ai/HolidayGlobals.py b/toontown/ai/HolidayGlobals.py index b6ca1e6a..4f0f163c 100644 --- a/toontown/ai/HolidayGlobals.py +++ b/toontown/ai/HolidayGlobals.py @@ -34,6 +34,15 @@ Holidays = { 'startMessage': TTLocalizer.BlackCatHolidayStart, 'ongoingMessage': TTLocalizer.BlackCatHolidayStart, 'endMessage': TTLocalizer.BlackCatHolidayEnd + }, + ToontownGlobals.APRIL_TOONS_WEEK: { + 'startMonth': 4, + 'startDay': 1, + 'endMonth': 4, + 'endDay': 7, + 'startMessage': TTLocalizer.AprilToonsWeekStart, + 'ongoingMessage': TTLocalizer.AprilToonsWeekStart, + 'endMessage': TTLocalizer.AprilToonsWeekEnd } } diff --git a/toontown/ai/NewsManager.py b/toontown/ai/NewsManager.py index 0dd57897..9673ad40 100755 --- a/toontown/ai/NewsManager.py +++ b/toontown/ai/NewsManager.py @@ -1,4 +1,5 @@ from direct.distributed.DistributedObject import DistributedObject +from toontown.estate import Estate from toontown.toonbase import ToontownGlobals import HolidayGlobals @@ -54,8 +55,18 @@ class NewsManager(DistributedObject): if id == ToontownGlobals.LAUGHING_MAN: for toon in base.cr.toons.values(): toon.generateLaughingMan() + elif id == ToontownGlobals.APRIL_TOONS_WEEK: + if isinstance(base.cr.playGame.getPlace(), Estate.Estate): + base.localAvatar.startAprilToonsControls() + + base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu() def endSpecialHoliday(self, id): if id == ToontownGlobals.LAUGHING_MAN: for toon in base.cr.toons.values(): - toon.swapToonHead(laughingMan=toon.getWantLaughingMan()) \ No newline at end of file + toon.swapToonHead(laughingMan=toon.getWantLaughingMan()) + elif id == ToontownGlobals.APRIL_TOONS_WEEK: + if isinstance(base.cr.playGame.getPlace(), Estate.Estate): + base.localAvatar.stopAprilToonsControls() + + base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu() \ No newline at end of file diff --git a/toontown/estate/Estate.py b/toontown/estate/Estate.py index 32f813a2..f0db502d 100755 --- a/toontown/estate/Estate.py +++ b/toontown/estate/Estate.py @@ -124,11 +124,7 @@ class Estate(Place.Place): self.loader.enterAnimatedProps(i) self.loader.geom.reparentTo(render) - # The client April Toons Manager is currently broken, so we have to do this hacky thing instead. :( - #if hasattr(base.cr, 'aprilToonsMgr'): - #if self.isEventActive(AprilToonsGlobals.EventEstateGravity): - #base.localAvatar.startAprilToonsControls() - if base.config.GetBool('want-april-toons'): + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK): base.localAvatar.startAprilToonsControls() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) @@ -136,7 +132,7 @@ class Estate(Place.Place): def exit(self): base.localAvatar.stopChat() - if base.config.GetBool('want-april-toons'): + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK): base.localAvatar.stopAprilToonsControls() self._telemLimiter.destroy() del self._telemLimiter @@ -362,11 +358,7 @@ class Estate(Place.Place): if hasattr(self, 'walkStateData'): self.walkStateData.fsm.request('walking') self.toonSubmerged = 0 - # The client April Toons Manager is currently broken, so we have to do this hacky thing instead. :( - #if hasattr(base.cr, 'aprilToonsMgr'): - #if self.isEventActive(AprilToonsGlobals.EventEstateGravity): - #base.localAvatar.startAprilToonsControls() - if base.config.GetBool('want-april-toons'): + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK): base.localAvatar.startAprilToonsControls() def __setUnderwaterFog(self): diff --git a/toontown/estate/EstateManager.py b/toontown/estate/EstateManager.py index 2ffb8fe8..899ddd71 100755 --- a/toontown/estate/EstateManager.py +++ b/toontown/estate/EstateManager.py @@ -68,12 +68,4 @@ class EstateManager(DistributedObject.DistributedObject): def removeFriend(self, ownerId, avId): self.notify.debug('removeFriend ownerId = %s, avId = %s' % (ownerId, avId)) - self.sendUpdate('removeFriend', [ownerId, avId]) - - def startAprilFools(self): - if isinstance(base.cr.playGame.getPlace(), Estate.Estate): - base.cr.playGame.getPlace().startAprilFoolsControls() - - def stopAprilFools(self): - if isinstance(base.cr.playGame.getPlace(), Estate.Estate): - base.cr.playGame.getPlace().stopAprilFoolsControls() + self.sendUpdate('removeFriend', [ownerId, avId]) \ No newline at end of file diff --git a/toontown/pets/Pet.py b/toontown/pets/Pet.py index 67f45c3d..8f8baa8f 100755 --- a/toontown/pets/Pet.py +++ b/toontown/pets/Pet.py @@ -29,6 +29,7 @@ Component2IconDict = {'boredom': 'Bored', from toontown.nametag import * from toontown.nametag.NametagGlobals import * +from toontown.chat.ChatGlobals import * class Pet(Avatar.Avatar): notify = DirectNotifyGlobal.directNotify.newCategory('Pet') @@ -280,7 +281,7 @@ class Pet(Avatar.Avatar): moodIcons = loader.loadModel('phase_4/models/char/petEmotes') self.moodIcons = self.attachNewNode('moodIcons') self.moodIcons.setScale(2.0) - self.moodIcons.setZ(3.65) + self.moodIcons.setZ(4.65) moods = moodIcons.findAllMatches('**/+GeomNode') for moodNum in range(0, moods.getNumPaths()): mood = moods.getPath(moodNum) @@ -295,13 +296,8 @@ class Pet(Avatar.Avatar): return def showMood(self, mood): - if hasattr(base.cr, 'newsManager') and base.cr.newsManager: - holidayIds = base.cr.newsManager.getHolidayIdList() - if (ToontownGlobals.APRIL_FOOLS_COSTUMES in holidayIds or ToontownGlobals.SILLYMETER_EXT_HOLIDAY in holidayIds) and not mood == 'confusion': - self.speakMood(mood) - return - else: - self.clearChat() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK) and mood != 'confusion': + self.speakMood(mood) else: self.clearChat() mood = Component2IconDict[mood] @@ -322,12 +318,7 @@ class Pet(Avatar.Avatar): return def speakMood(self, mood): - if self.moodModel: - self.moodModel.hide() - if base.config.GetBool('want-speech-bubble', 1): - self.nametag.setChat(random.choice(TTLocalizer.SpokenMoods[mood]), CFSpeech) - else: - self.nametag.setChat(random.choice(TTLocalizer.SpokenMoods[mood]), CFThought) + self.setChatAbsolute(random.choice(TTLocalizer.SpokenMoods[mood]), CFSpeech) def getGenderString(self): if self.style: diff --git a/toontown/speedchat/TTSpeedChatTypes.py b/toontown/speedchat/TTSpeedChatTypes.py index b9d742af..a5b45c5f 100755 --- a/toontown/speedchat/TTSpeedChatTypes.py +++ b/toontown/speedchat/TTSpeedChatTypes.py @@ -13,10 +13,8 @@ from otp.otpbase import OTPLocalizer from SCSpecialMenu import SCSpecialMenu AprilToonsMenu = [ - (OTPLocalizer.AprilToonsMenuSections[1], [30100, 30102]), - (OTPLocalizer.AprilToonsMenuSections[2], [30110, 30111, 30112, 30113, 30114, 30115]), - (OTPLocalizer.AprilToonsMenuSections[3], [30120, 30121, 30122, 30123, 30124, 30125, 30126]), - (OTPLocalizer.AprilToonsMenuSections[4], [30130, 30131, 30132, 30133]), + (OTPLocalizer.AprilToonsMenuSections[1], [30100]), + (OTPLocalizer.AprilToonsMenuSections[2], [30130, 30131, 30132, 30133]), (OTPLocalizer.AprilToonsMenuSections[0], [30140, 30141]) ] diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index bad6521c..47e5eff1 100755 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -1763,3 +1763,9 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): self.petId = petId if self.isLocal(): base.cr.addPetToFriendsMap() + + def startAprilToonsControls(self): + self.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 0.75) + + def stopAprilToonsControls(self): + self.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 2.0) \ No newline at end of file diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index 4afcc323..1116d5ff 100755 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -1187,7 +1187,10 @@ class Toon(Avatar.Avatar, ToonHead): return self.shoes def getDialogueArray(self): - animalType = self.style.getType() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK): + animalType = random.choice(TTLocalizer.AnimalToSpecies.keys()) + else: + animalType = self.style.getType() if animalType == 'dog': dialogueArray = DogDialogueArray elif animalType == 'cat': diff --git a/toontown/toonbase/AprilToonsGlobals.py b/toontown/toonbase/AprilToonsGlobals.py deleted file mode 100755 index c5d5d95f..00000000 --- a/toontown/toonbase/AprilToonsGlobals.py +++ /dev/null @@ -1,10 +0,0 @@ -# Events -EventRandomDialogue = 1 # Scrambles the dialogue SFX of toons -EventRandomEffects = 2 # Random cheesy effects (non-poof) are applied to the toon at random intervals -EventEstateGravity = 3 # Enables low gravity in estates -EventGlobalGravity = 4 # Enables low gravity everywhere - -# Constants -RandomCheesyList = [1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 11, 11] -RandomCheesyMinTime = 3 -RandomCheesyMaxTime = 60 diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 96e871f9..c309ecf4 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -7217,6 +7217,8 @@ FishBingoTypeBlockout = 'BLOCKOUT!' SillySaturdayStart = "It's time for Silly Saturday! Saturdays are silly with Fish Bingo and Grand Prix throughout the day!" SillySaturdayOngoing = 'Welcome! Silly Saturday is currently in progress.' SillySaturdayEnd = 'Silly Saturday is over. Hope you had fun. See you next week!' +AprilToonsWeekStart = "It's April Toons Week!" +AprilToonsWeekEnd = 'April Toons Week is over. See you next year!' FishBingoStart = "It's time for Fish Bingo! Go to any available pier to play!" FishBingoOngoing = 'Welcome! Fish Bingo is currently in progress.' FishBingoEnd = 'Hope you had fun playing Fish Bingo.' diff --git a/toontown/toonbase/ToontownGlobals.py b/toontown/toonbase/ToontownGlobals.py index be37d139..81b2eefd 100755 --- a/toontown/toonbase/ToontownGlobals.py +++ b/toontown/toonbase/ToontownGlobals.py @@ -847,7 +847,7 @@ MORE_XP_HOLIDAY = 25 HALLOWEEN_PROPS = 26 HALLOWEEN_COSTUMES = 27 DECEMBER_INVASION = 28 -APRIL_FOOLS_COSTUMES = 29 +APRIL_TOONS_WEEK = 29 OCTOBER31_FIREWORKS = 31 NOVEMBER19_FIREWORKS = 32 SELLBOT_SURPRISE_1 = 33