From b0fffa92e4196cdee935749c8c571b9bed1e9761 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sun, 10 May 2015 22:36:44 +0300 Subject: [PATCH 1/8] Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "fuck daniel""""""""""""""" This reverts commit dedd65445300d9f6c49e9a012a4a661bee96eb71. --- toontown/distributed/HoodMgr.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/toontown/distributed/HoodMgr.py b/toontown/distributed/HoodMgr.py index 02f10640..f34284d2 100644 --- a/toontown/distributed/HoodMgr.py +++ b/toontown/distributed/HoodMgr.py @@ -219,23 +219,6 @@ class HoodMgr(DirectObject.DirectObject): self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList) return dropPointList[droppnt] - def getAvailableZones(self): - return self.getZonesInPhase(4) + \ - self.getZonesInPhase(6) + \ - self.getZonesInPhase(8) + \ - self.getZonesInPhase(9) + \ - self.getZonesInPhase(10) + \ - self.getZonesInPhase(11) + \ - self.getZonesInPhase(12) + \ - self.getZonesInPhase(13) - - def getZonesInPhase(self, phase): - p = [] - for i in ToontownGlobals.phaseMap.items(): - if i[1] == phase: - p.append(i[0]) - return p - def getPhaseFromHood(self, hoodId): hoodId = ZoneUtil.getCanonicalHoodId(hoodId) return ToontownGlobals.phaseMap[hoodId] From 32cb6371acf22401e519d27e2ec4ddfa4d083ed7 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sun, 10 May 2015 22:37:01 +0300 Subject: [PATCH 2/8] Revert "removed it. sry. k" This reverts commit 74ac72d5b394da0e2c2b082f5fe3ed80d9facc9d. --- toontown/toon/Toon.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index 23e73db0..afe0c341 100644 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -1789,6 +1789,19 @@ class Toon(Avatar.Avatar, ToonHead): self.holeClipPath = self.attachNewNode(holeClip) self.getGeomNode().setClipPlane(self.holeClipPath) self.nametag3d.setClipPlane(self.holeClipPath) + avHeight = max(self.getHeight(), 3) + def lerpCam(task): + degrees = task.time * 52.941 + radians = degrees * (math.pi / 180.0) + x = -12 * math.sin(radians) + y = -12 * math.cos(radians) + z = base.localAvatar.getHeight() + camera.setPos(x, y, z) + camera.setH(-degrees) + if task.time > 3.4: + return Task.done + return Task.cont + taskMgr.add(lerpCam, 'lerpCam') self.track.start(ts) self.setActiveShadow(0) From 83e859ae4c03ea44e1e958af3fb80bb3f38a60f0 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sun, 10 May 2015 22:39:47 +0300 Subject: [PATCH 3/8] Add base.localAvatar check to lerpCam and add createTalkSequence --- toontown/safezone/DDSafeZoneLoader.py | 11 ++----- toontown/toon/DistributedNPCToon.py | 2 +- toontown/toon/Toon.py | 41 ++++++++++++++++----------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/toontown/safezone/DDSafeZoneLoader.py b/toontown/safezone/DDSafeZoneLoader.py index 1fbdfe9e..bd648c6c 100644 --- a/toontown/safezone/DDSafeZoneLoader.py +++ b/toontown/safezone/DDSafeZoneLoader.py @@ -40,16 +40,9 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): self.donald.setPos(0, -1, 3.95) self.donald.reparentTo(self.boat) self.donald.setHat(48, 0, 0) - - self.donaldSpeech = Sequence() + random.shuffle(TTLocalizer.DonaldChatter) - - for speechText in TTLocalizer.DonaldChatter: - self.donaldSpeech.append(Func(self.donald.setChatAbsolute, speechText, CFSpeech)) - self.donaldSpeech.append(Wait(len(speechText.split(' ')))) - self.donaldSpeech.append(Func(self.donald.clearChat)) - self.donaldSpeech.append(Wait(15)) - + self.donaldSpeech = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15) self.donaldSpeech.loop(0) def unload(self): diff --git a/toontown/toon/DistributedNPCToon.py b/toontown/toon/DistributedNPCToon.py index ff0ccc42..cf8454a7 100644 --- a/toontown/toon/DistributedNPCToon.py +++ b/toontown/toon/DistributedNPCToon.py @@ -221,4 +221,4 @@ class DistributedNPCToon(DistributedNPCToonBase): if self.trackChoiceGui: self.trackChoiceGui.destroy() self.trackChoiceGui = None - self.sendUpdate('chooseTrack', [trackId]) + self.sendUpdate('chooseTrack', [trackId]) \ No newline at end of file diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index afe0c341..247f3364 100644 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -1790,18 +1790,21 @@ class Toon(Avatar.Avatar, ToonHead): self.getGeomNode().setClipPlane(self.holeClipPath) self.nametag3d.setClipPlane(self.holeClipPath) avHeight = max(self.getHeight(), 3) - def lerpCam(task): - degrees = task.time * 52.941 - radians = degrees * (math.pi / 180.0) - x = -12 * math.sin(radians) - y = -12 * math.cos(radians) - z = base.localAvatar.getHeight() - camera.setPos(x, y, z) - camera.setH(-degrees) - if task.time > 3.4: - return Task.done - return Task.cont - taskMgr.add(lerpCam, 'lerpCam') + + if self == base.localAvatar: + def lerpCam(task): + degrees = task.time * 52.941 + radians = degrees * (math.pi / 180.0) + x = -12 * math.sin(radians) + y = -12 * math.cos(radians) + z = base.localAvatar.getHeight() + camera.setPos(x, y, z) + camera.setH(-degrees) + if task.time > 3.4: + return Task.done + return Task.cont + taskMgr.add(lerpCam, 'lerpCam') + self.track.start(ts) self.setActiveShadow(0) @@ -2990,8 +2993,6 @@ class Toon(Avatar.Avatar, ToonHead): def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []): self.loop('scientistJealous') - if hasattr(self, 'showScientistProp'): - self.showScientistProp() def exitScientistJealous(self): self.stop() @@ -3016,12 +3017,20 @@ class Toon(Avatar.Avatar, ToonHead): def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []): self.loop('scientistGame') - if hasattr(self, 'scientistPlay'): - self.scientistPlay() def exitScientistPlay(self): self.stop() + def createTalkSequence(self, speech, waitTime): + sequence = Sequence() + + for text in speech: + sequence.append(Func(self.setChatAbsolute, text, CFSpeech)) + sequence.append(Wait(len(text.split(' ')))) + sequence.append(Func(self.clearChat)) + sequence.append(Wait(waitTime)) + + return sequence loadModels() compileGlobalAnimList() From 41d1fda2c206583461a6c6595961d668994d3d6a Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sun, 10 May 2015 23:05:09 +0300 Subject: [PATCH 4/8] Silly Meter is now done! --- astron/dclass/united.dc | 1 - otp/distributed/DCClassImports.py | 2 +- .../building/DistributedToonHallInterior.py | 22 +- toontown/safezone/DDSafeZoneLoader.py | 5 +- toontown/toon/DistributedNPCScientist.py | 138 ++++------ toontown/toon/DistributedNPCScientistAI.py | 243 +----------------- toontown/toon/NPCToons.py | 4 +- toontown/toonbase/TTLocalizerEnglish.py | 142 +++------- 8 files changed, 96 insertions(+), 461 deletions(-) diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 53ee95e9..6de965d5 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -1911,7 +1911,6 @@ dclass DistributedNPCFlippyInToonHall : DistributedNPCToon { }; dclass DistributedNPCScientist : DistributedNPCToonBase { - setChat(char [0-1024], uint8, uint32, uint8, uint8) ownsend broadcast; }; dclass DistributedNPCClerk : DistributedNPCToonBase { diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 772d00bb..15320eea 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 3327868546L +hashVal = 216435383 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 diff --git a/toontown/building/DistributedToonHallInterior.py b/toontown/building/DistributedToonHallInterior.py index 6c06616b..7fe4d11b 100644 --- a/toontown/building/DistributedToonHallInterior.py +++ b/toontown/building/DistributedToonHallInterior.py @@ -358,24 +358,6 @@ class DistributedToonHallInterior(DistributedToonInterior): self.sillyMeter.stop() self.ignore('SillyMeterPhase') - def enterPhase15(self): - self.animSeq = Parallel(ActorInterval(self.sillyMeter, 'phaseFive', duration=604800, constrainedLoop=1, startFrame=1, endFrame=48), Sequence(Func(self.phase5Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase5Sfx, self.sillyMeter))) - self.animSeq.start() - self.smPhase2.show() - self.smPhase3.show() - self.smPhase4.show() - self.accept('SillyMeterPhase', self.startSillyMeter) - - def exitPhase15(self): - self.animSeq.finish() - del self.animSeq - self.smPhase2.hide() - self.smPhase3.hide() - self.smPhase4.hide() - self.audio3d.detachSound(self.phase5Sfx) - self.phase5Sfx.stop() - self.sillyMeter.stop() - def enterOff(self): self.ignore('SillyMeterPhase') if hasattr(self, 'sillyMeter'): @@ -440,8 +422,8 @@ def sillyPhase(phase): Set the silly meter phase. """ - if phase < -1 or phase > 15: - return 'Phase number must be between 0 and 15!' + if phase < -1 or phase > 14: + return 'Phase number must be between 0 and 14!' messenger.send('SillyMeterPhase', [phase]) return 'Successfully set the silly meter phase!' \ No newline at end of file diff --git a/toontown/safezone/DDSafeZoneLoader.py b/toontown/safezone/DDSafeZoneLoader.py index bd648c6c..5ba6d683 100644 --- a/toontown/safezone/DDSafeZoneLoader.py +++ b/toontown/safezone/DDSafeZoneLoader.py @@ -1,7 +1,4 @@ -from direct.interval.IntervalGlobal import Sequence, Func, Wait -from toontown.safezone import SafeZoneLoader -from toontown.safezone import DDPlayground -from toontown.chat.ChatGlobals import CFSpeech +from toontown.safezone import SafeZoneLoader, DDPlayground from toontown.toon import NPCToons from toontown.toonbase import TTLocalizer import random diff --git a/toontown/toon/DistributedNPCScientist.py b/toontown/toon/DistributedNPCScientist.py index 381b1376..f9ef6995 100644 --- a/toontown/toon/DistributedNPCScientist.py +++ b/toontown/toon/DistributedNPCScientist.py @@ -1,26 +1,7 @@ -from pandac.PandaModules import * -from toontown.toonbase import TTLocalizer, ToontownGlobals -import DistributedNPCToonBase +from toontown.toonbase import TTLocalizer +from DistributedNPCToonBase import DistributedNPCToonBase -class DistributedNPCScientist(DistributedNPCToonBase.DistributedNPCToonBase): - - def __init__(self, cr): - DistributedNPCToonBase.DistributedNPCToonBase.__init__(self, cr) - if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.show() - else: - self.hide() - self.accept('SillyMeterIsRunning', self.sillyMeterIsRunning) - - def disable(self): - self.ignore('SillyMeterIsRunning') - DistributedNPCToonBase.DistributedNPCToonBase.disable(self) - - def sillyMeterIsRunning(self, isRunning): - if isRunning: - self.show() - else: - self.hide() +class DistributedNPCScientist(DistributedNPCToonBase): def getCollSphereRadius(self): return 2.5 @@ -33,86 +14,53 @@ class DistributedNPCScientist(DistributedNPCToonBase.DistributedNPCToonBase): self.nametag3d.setDepthTest(0) self.nametag3d.setBin('fixed', 0) - def setChat(self, topic, partPos, partId, progress, flags): - msg = TTLocalizer.toontownDialogues[topic][partPos, partId][progress] - self.setChatMuted(msg, flags) - - def announceGenerate(self): - DistributedNPCToonBase.DistributedNPCToonBase.announceGenerate(self) - if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.show() - else: - self.hide() + def setModelHand(self, path): + model = loader.loadModel(path) + + for hand in self.getRightHands(): + placeholder = hand.attachNewNode('RightHandObj') + placeholder.setH(180) + placeholder.setScale(render, 1.0) + placeholder.setPos(0, 0, 0.1) + model.instanceTo(placeholder) def generateToon(self): - self.setLODs() - self.generateToonLegs() - self.generateToonHead() - self.generateToonTorso() - self.generateToonColor() - self.parentToonParts() - self.rescaleToon() - self.resetHeight() - self.rightHands = [] - self.leftHands = [] - self.headParts = [] - self.hipsParts = [] - self.torsoParts = [] - self.legsParts = [] - self.__bookActors = [] - self.__holeActors = [] + DistributedNPCToonBase.generateToon(self) self.setupToonNodes() - if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': - sillyReader = loader.loadModel('phase_4/models/props/tt_m_prp_acs_sillyReader') - for rHand in self.getRightHands(): - placeholder = rHand.attachNewNode('SillyReader') - sillyReader.instanceTo(placeholder) - placeholder.setH(180) - placeholder.setScale(render, 1.0) - placeholder.setPos(0, 0, 0.1) - - elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey' or self.style.getTorsoSize() == 'medium' and self.style.getAnimal() == 'horse': - clipBoard = loader.loadModel('phase_4/models/props/tt_m_prp_acs_clipboard') - for rHand in self.getRightHands(): - placeholder = rHand.attachNewNode('ClipBoard') - clipBoard.instanceTo(placeholder) - placeholder.setH(180) - placeholder.setScale(render, 1.0) - placeholder.setPos(0, 0, 0.1) + self.setModelHand('phase_4/models/props/tt_m_prp_acs_%s' % ('sillyReader' if self.style.getAnimal() == 'duck' else 'clipboard')) + self.startSequence(config.GetInt('silly-meter-phase', 12)) + self.accept('SillyMeterPhase', self.startSequence) def startLookAround(self): pass + + def startSequence(self, phase): + if not self.style.getAnimal() == 'horse': + return - def scientistPlay(self): - if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': - sillyReaders = self.findAllMatches('**/SillyReader') - for sillyReader in sillyReaders: - if not sillyReader.isEmpty(): - sillyReader.stash() - sillyReader = None + if phase < 4: + dialogue = TTLocalizer.ScientistPhase1Dialogue + elif phase < 8: + dialogue = TTLocalizer.ScientistPhase2Dialogue + elif phase < 12: + dialogue = TTLocalizer.ScientistPhase3Dialogue + elif phase == 12: + dialogue = TTLocalizer.ScientistPhase4Dialogue + elif phase == 13: + dialogue = TTLocalizer.ScientistPhase5Dialogue + else: + dialogue = TTLocalizer.ScientistPhase6Dialogue - elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey': - clipBoards = self.findAllMatches('**/ClipBoard') - for clipBoard in clipBoards: - if not clipBoard.isEmpty(): - clipBoard.stash() - clipBoard = None + self.stopSequence() + self.sequence = self.createTalkSequence(dialogue, 1) + self.sequence.loop(0) - return + def stopSequence(self): + if hasattr(self, 'sequence'): + self.sequence.pause() + del self.sequence - def showScientistProp(self): - if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': - sillyReaders = self.findAllMatches('**/SillyReader;+s') - for sillyReader in sillyReaders: - if not sillyReader.isEmpty(): - sillyReader.unstash() - sillyReader = None - - elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey': - clipBoards = self.findAllMatches('**/ClipBoard;+s') - for clipBoard in clipBoards: - if not clipBoard.isEmpty(): - clipBoard.unstash() - clipBoard = None - - return + def disable(self): + self.stopSequence() + self.ignore('SillyMeterPhase') + DistributedNPCToonBase.disable(self) \ No newline at end of file diff --git a/toontown/toon/DistributedNPCScientistAI.py b/toontown/toon/DistributedNPCScientistAI.py index d3ff9eaa..0b5281d5 100644 --- a/toontown/toon/DistributedNPCScientistAI.py +++ b/toontown/toon/DistributedNPCScientistAI.py @@ -1,239 +1,8 @@ -import DistributedNPCToonBaseAI -from toontown.toonbase import TTLocalizer, ToontownGlobals -from direct.fsm import ClassicFSM, State -from direct.task.Task import Task +import DistributedNPCToonBaseAI, random + +Animation = random.choice(["ScientistPlay", "ScientistWork", "ScientistLessWork", "ScientistJealous"]) class DistributedNPCScientistAI(DistributedNPCToonBaseAI.DistributedNPCToonBaseAI): - - def __init__(self, air, npcId, questCallback = None, hq = 0): - DistributedNPCToonBaseAI.DistributedNPCToonBaseAI.__init__(self, air, npcId, questCallback) - self.scientistFSM = ClassicFSM.ClassicFSM('Scientist', [ - State.State('Neutral', - self.enterNeutral, - self.exitNeutral, [ - 'Phase0', - 'Phase1', - 'Phase2', - 'Phase2_5', - 'Phase3', - 'Phase4', - 'Phase5', - 'Off']), - State.State('Phase0', - self.enterPhase0, - self.exitPhase0, [ - 'Phase1', - 'Neutral']), - State.State('Phase1', - self.enterPhase1, - self.exitPhase1, [ - 'Phase2', - 'Neutral']), - State.State('Phase2', - self.enterPhase2, - self.exitPhase2, [ - 'Phase2_5', - 'Neutral']), - State.State('Phase2_5', - self.enterPhase2_5, - self.exitPhase2_5, [ - 'Phase3', - 'Neutral']), - State.State('Phase3', - self.enterPhase3, - self.exitPhase3, [ - 'Phase4', - 'Neutral']), - State.State('Phase4', - self.enterPhase4, - self.exitPhase4, [ - 'Phase5', - 'Neutral']), - State.State('Phase5', - self.enterPhase5, - self.exitPhase5, [ - 'Neutral']), - State.State('Off', - self.enterOff, - self.exitOff, [])], - 'Neutral', 'Off') - - if self.npcId == 2018 or self.npcId == 2019: - self.startAnimState = 'ScientistJealous' - elif self.npcId == 2020: - self.startAnimState = 'ScientistEmcee' - self.scientistFSM.enterInitialState() - - def selectPhase(self, newPhase): - try: - if newPhase <= 4: - gotoPhase = '0' - elif newPhase <= 6: - gotoPhase = '1' - elif newPhase <= 11: - gotoPhase = '2' - elif newPhase <= 12: - gotoPhase = '2_5' - elif newPhase <= 13: - gotoPhase = '3' - elif newPhase <= 14: - gotoPhase = '4' - elif newPhase <= 15: - gotoPhase = '5' - else: - if not self.scientistFSM.getCurrentState() == self.scientistFSM.getStateNamed('Neutral'): - self.scientistFSM.request('Neutral') - return - gotoPhase = 'Phase' + gotoPhase - if not self.scientistFSM.getCurrentState() == self.scientistFSM.getStateNamed(gotoPhase): - self.scientistFSM.request(gotoPhase) - except: - self.notify.warning('Illegal phase transition requested') - - def startIfNeeded(self): - if hasattr(simbase.air, 'holidayManager') and simbase.air.holidayManager: - self.curPhase = self.getPhaseToRun() - if self.curPhase != -1: - self.selectPhase(self.curPhase) - - def getPhaseToRun(self): - result = -1 - enoughInfoToRun = False - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - if hasattr(simbase.air, 'SillyMeterMgr'): - enoughInfoToRun = True - else: - self.notify.debug('simbase.air does not have SillyMeterMgr') - else: - self.notify.debug('holiday is not running') - self.notify.debug('enoughInfoToRun = %s' % enoughInfoToRun) - if enoughInfoToRun and simbase.air.SillyMeterMgr.getIsRunning(): - result = simbase.air.SillyMeterMgr.getCurPhase() - return result - - def enterNeutral(self): - self.accept('SillyMeterPhase', self.selectPhase) - self.startIfNeeded() - - def exitNeutral(self): - self.ignore('SillyMeterPhase') - - def enterPhase0(self): - if self.npcId == 2020: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistJealous', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase0(self): - if self.npcId == 2020: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase1(self): - if self.npcId == 2020: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistJealous', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase1(self): - if self.npcId == 2020: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase2(self): - if self.npcId == 2020: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistWork', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase2(self): - if self.npcId == 2020: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase2_5(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30) - else: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhaseTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistLessWork', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase2_5(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic) - else: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhaseTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase3(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30) - else: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistPlay', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase3(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic) - else: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase4(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30) - else: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistPlay', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase4(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic) - else: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic) - self.ignore('SillyMeterPhase') - - def enterPhase5(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30) - else: - self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30) - elif self.npcId == 2018 or self.npcId == 2019: - self.d_setAnimState('ScientistPlay', 1.0) - self.accept('SillyMeterPhase', self.selectPhase) - - def exitPhase5(self): - if self.npcId == 2020: - if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic) - else: - self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic) - self.ignore('SillyMeterPhase') - - def enterOff(self): - pass - - def exitOff(self): - pass - - def delete(self): - self.scientistFSM.requestFinalState() - if hasattr(self, 'scientistFSM'): - del self.scientistFSM - DistributedNPCToonBaseAI.DistributedNPCToonBaseAI.delete(self) + + def getStartAnimState(self): + return 'ScientistEmcee' if self.npcId == 2020 else Animation \ No newline at end of file diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index 2e768cd0..45fffbd0 100644 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -133,8 +133,8 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None): npc.setMaxHp(15) npc.setPositionIndex(posIndex) npc.generateWithRequired(zoneId) - if hasattr(npc, 'startAnimState'): - npc.d_setAnimState(npc.startAnimState, 1.0) + if hasattr(npc, 'getStartAnimState'): + npc.d_setAnimState(npc.getStartAnimState(), 1.0) else: npc.d_setAnimState('neutral', 1.0) return npc diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index a360e18c..efebb2eb 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3190,107 +3190,47 @@ KnockKnockJokes = [['Who', "Bad echo in here, isn't there?"], ['Ida', "It's not Ida who, it's Idaho."], ['Zippy', 'Mrs. Zippy.'], ['Yukon', 'Yukon go away and come back another time.']] -SillyPhase1Chatter = ["If you haven't seen the Silly Meter, head to Toon Hall!", - 'Toontown is getting sillier by the day!', - "Cause silly surges in battle to boost Toontown's silly levels!", - 'Objects on the street are starting to animate!', - 'I saw a fire hydrant on Silly Street move!'] -SillyPhase2Chatter = ['Silly levels are still rising!', - 'The Silly Meter has climbed higher and gotten crazier!', - 'Someone saw a trash can moving on Maple Street!', - 'A lot of hydrants on Silly Street have come alive!', - 'A mailbox on Lighthouse Lane has gone nuts!', - 'Go see the Silly Meter in Toon Hall!', - 'Keep causing those silly surges!'] -SillyPhase3Chatter = ['The Cogs hate how silly Toontown is becoming!', - 'Keep a sharp eye out for Cog Invasions!', - 'Cog Invasions have caused the silly levels to drop!', - 'The Silly Meter went down after the Cog Invasions!', - 'Every street of Toontown has animated objects now!', - 'Toontown is sillier than ever!'] -SillyPhase4Chatter = ['Fire hydrants make your Squirt Gags squirtier!', - 'Mail Boxes give your Throw Gags a special delivery!', - 'Those crazy Trash Cans can help boost your Toon-up!', - 'Objects on the street can help you in battle!', - "I just know we'll get the Silly Meter back up soon!", - 'Enjoy the sillier Toontown!'] - -BoringTopic = 'Boring' -EmceeDialoguePhase1Topic = 'EmceeDialoguePhase1' -EmceeDialoguePhase2Topic = 'EmceeDialoguePhase2' -EmceeDialoguePhase3Topic = 'EmceeDialoguePhase3' -EmceeDialoguePhase3_5Topic = 'EmceeDialoguePhase3.5' -EmceeDialoguePhase4Topic = 'EmceeDialoguePhase4' -EmceeDialoguePhase5Topic = 'EmceeDialoguePhase5' -EmceeDialoguePhase6Topic = 'EmceeDialoguePhase6' -AprilToonsPhasePreTopTopic = 'AprilToonsPhasePreTopTopic' -AprilToonsPhaseTopTopic = 'AprilToonsPhaseTopTopic' -AprilToonsExtPhaseTopTopic = 'AprilToonsExtPhaseTopTopic' -AprilToonsPhasePostTopTopic = 'AprilToonsPhasePostTopTopic' -toontownDialogues = {BoringTopic: {(1, 2018): ['Hello Albert', 'It looks like the sillyness levels are rising', 'Yes and dont forget April Toons!'], - (2, 2019): ['Hello Newton', 'Yes I wonder how much the parties are contributing to all this'], - (3, 2020): ['Why hello there Albert and Newton', 'Halloween was pretty silly too!']}, - AprilToonsPhasePreTopTopic: {(1, 2020): ['Gadzooks! The Silly Meter has come back to life!', - "It's rising every day, and will reach the top soon!", - 'When it does, something silly is sure to happen!', - 'So get ready to get ridiculous!']}, - AprilToonsPhaseTopTopic: {(1, 2020): ['The Silly Meter has hit the top!', - 'Doodles are talking, Estates are bouncy!', - "There's only one thing to say\xe2\x80\xa6", - 'HAPPY APRIL TOONS!']}, - AprilToonsExtPhaseTopTopic: {(1, 2020): ['The Silly Meter has hit the top!', 'Doodles are talking, Estates are bouncy!']}, - AprilToonsPhasePostTopTopic: {(1, 2020): ['April Toons is over!', - "It's time for us to return to our lab.", - 'But when things get REALLY crazy again\xe2\x80\xa6', - 'The Silly Meter will return!']}, - EmceeDialoguePhase1Topic: {(1, 2020): ['Fellow Toons, this is the Silly Meter!', - "It is tracking Toontown's rising silly levels...", - 'Which are causing objects on the street to animate!', - 'And YOU can help push these levels higher!', - 'Battle Cogs to cause Silly Surges...', - 'Make Toontown sillier than ever...', - "And let's watch the world come alive!", - "Now I'll repeat what I said, but only once more."]}, - EmceeDialoguePhase2Topic: {(1, 2020): ['Good Gag work, Toons!', - "You're keeping those silly levels rising...", - 'And Toontown is getting sillier every day!', - 'Fire hydrants, trash cans, and mailboxes are springing to life...', - 'Making the world more animated than ever!', - "You know the Cogs aren't happy about this...", - 'But Toons sure are!']}, - EmceeDialoguePhase3Topic: {(1, 2020): ['Gadzooks! The Silly Meter is even crazier than expected!', - 'Your Silly Surges are working wonders...', - 'And Toontown is getting more animated every day!', - 'Keep up the good Gag work...', - 'And lets see how silly we can make Toontown!', - "You know the Cogs aren't happy about what's going on...", - 'But Toons sure are!']}, - EmceeDialoguePhase3_5Topic: {(1, 2020): ['YOU DID IT TOONS!', - 'You brought the streets of Toontown to life!', - 'You deserve a reward!', - 'Enter the code SILLYMETER in your Shticker Book...', - '...to get a Silly Meter T-Shirt!']}, - EmceeDialoguePhase4Topic: {(1, 2020): ['Attention all Toons!', - 'The sudden Cog invasions have been an unhappy event.', - 'As a result, silly levels have rapidly fallen...', - 'And no new objects are coming to life.', - 'But those that have are very thankful...', - "So perhaps they'll find a way to show their appreciation!", - 'Stay Tooned!']}, - EmceeDialoguePhase5Topic: {(1, 2020): ['Attention all Toons!', - 'The Cog invasions have been an unhappy event.', - 'As a result, silly levels have rapidly fallen...', - 'And no new objects are coming to life.', - 'But those that have are very thankful...', - 'And are showing their appreciation by helping in battle!', - 'We may hold off the Cogs yet, so keep up the fight!']}, - EmceeDialoguePhase6Topic: {(1, 2020): ['Congratulations Toons!', - 'You all succesfully held off the Cog Invasions...', - 'With a little help from our newly animated friends...', - 'And brought Toontown back to its usual silly self!', - 'We hope to get the Silly Meter rising again soon...', - 'So in the meantime, keep up the Cog fight...', - 'And enjoy the silliest place ever, Toontown!']}} +ScientistPhase1Dialogue = ['Fellow Toons, this is the Silly Meter!', + "It is tracking Toontown's rising silly levels...", + 'Which are causing objects on the street to animate!', + 'And YOU can help push these levels higher!', + 'Battle Cogs to cause Silly Surges...', + 'Make Toontown sillier than ever...', + "And let's watch the world come alive!", + "Now I'll repeat what I said, but only once more."] +ScientistPhase2Dialogue = ['Good Gag work, Toons!', + "You're keeping those silly levels rising...", + 'And Toontown is getting sillier every day!', + 'Fire hydrants, trash cans, and mailboxes are springing to life...', + 'Making the world more animated than ever!', + "You know the Cogs aren't happy about this...", + 'But Toons sure are!'] +ScientistPhase3Dialogue = ['Gadzooks! The Silly Meter is even crazier than expected!', + 'Your Silly Surges are working wonders...', + 'And Toontown is getting more animated every day!', + 'Keep up the good Gag work...', + 'And lets see how silly we can make Toontown!', + "You know the Cogs aren't happy about what's going on...", + 'But Toons sure are!'] +ScientistPhase4Dialogue = ['YOU DID IT TOONS!', + 'You brought the streets of Toontown to life!', + 'You deserve a reward!', + 'Enter the code SILLYMETER in your Shticker Book...', + '...to get a Silly Meter T-Shirt!'] +ScientistPhase5Dialogue = ['Attention all Toons!', + 'The Cog invasions have been an unhappy event.', + 'As a result, silly levels have rapidly fallen...', + 'And no new objects are coming to life.', + 'But those that have are very thankful...', + 'And are showing their appreciation by helping in battle!', + 'We may hold off the Cogs yet, so keep up the fight!'] +ScientistPhase6Dialogue = ['Congratulations Toons!', + 'You all succesfully held off the Cog Invasions...', + 'With a little help from our newly animated friends...', + 'And brought Toontown back to its usual silly self!', + 'We hope to get the Silly Meter rising again soon...', + 'So in the meantime, keep up the Cog fight...', + 'And enjoy the silliest place ever, Toontown!'] FriendsListPanelNewFriend = 'New Friend' FriendsListPanelSecrets = 'True Friend' FriendsListPanelOnlineFriends = 'ONLINE TOON\nFRIENDS' From de561c6fc3fd9816be70c0b407eabadfcd7e30b8 Mon Sep 17 00:00:00 2001 From: John Cote Date: Sun, 10 May 2015 16:48:14 -0400 Subject: [PATCH 5/8] add this back --- toontown/suit/DistributedSellbotBossAI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toontown/suit/DistributedSellbotBossAI.py b/toontown/suit/DistributedSellbotBossAI.py index dc8aad7d..ede8b33c 100644 --- a/toontown/suit/DistributedSellbotBossAI.py +++ b/toontown/suit/DistributedSellbotBossAI.py @@ -398,6 +398,9 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS return self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack) + def enterReward(self): + DistributedBossCogAI.DistributedBossCogAI.enterReward(self) + @magicWord(category=CATEGORY_ADMINISTRATOR) def skipVP(): """ From bd25086f69765f39198a6c65fa3044839fe22458 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Mon, 11 May 2015 01:09:48 +0300 Subject: [PATCH 6/8] Add silly meter code and make codes case insensitive --- toontown/coderedemption/TTCodeRedemptionMgrAI.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toontown/coderedemption/TTCodeRedemptionMgrAI.py b/toontown/coderedemption/TTCodeRedemptionMgrAI.py index ea955c48..141b04c4 100644 --- a/toontown/coderedemption/TTCodeRedemptionMgrAI.py +++ b/toontown/coderedemption/TTCodeRedemptionMgrAI.py @@ -43,7 +43,6 @@ only include the comma if there are multiple arguments. class TTCodeRedemptionMgrAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("TTCodeRedemptionMgrAI") codes = { - # weed code is for testing purposes, remove when done. 'weed': { 'items': [ CatalogClothingItem.CatalogClothingItem(1821, 0) @@ -55,6 +54,11 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI): 'items': [ CatalogGardenStarterItem.CatalogGardenStarterItem() ] + }, + 'sillymeter': { + 'items': [ + CatalogClothingItem.CatalogClothingItem(1753, 0) + ] } } @@ -77,6 +81,8 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI): if not av: return + code = code.lower() + if code in self.codes: if av.isCodeRedeemed(code): self.sendUpdateToAvatarId(avId, 'redeemCodeResult', [4]) From 578e1a03883f494a0e48e17f66fcd3a26170dc96 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Mon, 11 May 2015 01:13:05 +0300 Subject: [PATCH 7/8] We aren't gonna have long codes --- astron/dclass/united.dc | 2 +- otp/distributed/DCClassImports.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 6de965d5..363a4c54 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -3279,7 +3279,7 @@ dclass ClientServicesManager : DistributedObjectGlobal { }; dclass TTCodeRedemptionMgr : DistributedObject { - redeemCode(char [0-256]) airecv clsend; + redeemCode(char [0-25]) airecv clsend; redeemCodeResult(uint32); }; diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 15320eea..b05f8b38 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 216435383 +hashVal = 215595236 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 12cfac948aa278fa6bfd68640fa56c50d17e3794 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Mon, 11 May 2015 01:15:15 +0300 Subject: [PATCH 8/8] No comment --- astron/dclass/united.dc | 2 +- otp/distributed/DCClassImports.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 363a4c54..cd62154d 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -3279,7 +3279,7 @@ dclass ClientServicesManager : DistributedObjectGlobal { }; dclass TTCodeRedemptionMgr : DistributedObject { - redeemCode(char [0-25]) airecv clsend; + redeemCode(char [0-50]) airecv clsend; redeemCodeResult(uint32); }; diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index b05f8b38..d3ef1961 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 215595236 +hashVal = 215686161 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