From 1e248a081ac1a56363ff9645e25b1381bc00e80c Mon Sep 17 00:00:00 2001 From: Loudrob Date: Wed, 6 May 2015 13:17:08 -0400 Subject: [PATCH 1/2] ARGManager for future purposes. --- astron/dclass/united.dc | 4 ++ otp/distributed/DCClassImports.py | 3 +- otp/distributed/OtpDoGlobals.py | 3 +- .../distributed/ToontownClientRepository.py | 2 + toontown/uberdog/ARGManager.py | 67 +++++++++++++++++++ toontown/uberdog/ARGManagerAI.py | 4 ++ toontown/uberdog/ARGManagerUD.py | 4 ++ 7 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 toontown/uberdog/ARGManager.py create mode 100644 toontown/uberdog/ARGManagerAI.py create mode 100644 toontown/uberdog/ARGManagerUD.py diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index fc7436e0..89a8e598 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -521,6 +521,7 @@ from toontown.cogdominium import DistCogdoCrane/AI from toontown.cogdominium import DistCogdoCraneMoneyBag/AI from toontown.cogdominium import DistCogdoCraneCog/AI from toontown.parties.GlobalPartyManager/AI/UD import GlobalPartyManager/AI/UD +from toontown.uberdog.ARGManager/AI/UD import ARGManager/AI/UD struct GiftItem { blob Item; @@ -3379,3 +3380,6 @@ dclass DistributedSillyMeterMgr : DistributedObject { setCurPhase(int8) required broadcast ram; setIsRunning(bool) required broadcast ram; }; + +dclass ARGManager : DistributedObjectGlobal { +}; diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 916488f9..c4325665 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 1046852636 +hashVal = 1067289706 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 @@ -32,6 +32,7 @@ from toontown.parties import DistributedParty, DistributedPartyActivity, Distrib from toontown.friends.TrueFriendsMgr import TrueFriendsMgr from toontown.friends import TTUFriendsManager from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog +from toontown.uberdog.ARGManager import ARGManager from otp.distributed import Account, DistributedDistrict, DistributedDirectory from toontown.estate import DistributedCannon, DistributedTarget, EstateManager, DistributedEstate, DistributedHouse, DistributedHouseInterior, DistributedGarden, DistributedHouseDoor, DistributedMailbox, DistributedFurnitureManager, DistributedFurnitureItem, DistributedBank, DistributedCloset, DistributedTrunk, DistributedPhone, DistributedFireworksCannon, DistributedLawnDecor, DistributedGardenPlot, DistributedGardenBox, DistributedFlower, DistributedGagTree, DistributedStatuary, DistributedToonStatuary, DistributedChangingStatuary, DistributedAnimatedStatuary, DistributedPlantBase, DistributedLawnDecor from toontown.toon import DistributedToon, DistributedNPCToonBase, DistributedNPCToon, DistributedSmartNPC, DistributedNPCSpecialQuestGiver, DistributedNPCFlippyInToonHall, DistributedNPCScientist, DistributedNPCClerk, DistributedNPCTailor, DistributedNPCBlocker, DistributedNPCFisherman, DistributedNPCPartyPerson, DistributedNPCPetclerk, DistributedNPCKartClerk, DistributedNPCGlove diff --git a/otp/distributed/OtpDoGlobals.py b/otp/distributed/OtpDoGlobals.py index d101a570..a45e8830 100644 --- a/otp/distributed/OtpDoGlobals.py +++ b/otp/distributed/OtpDoGlobals.py @@ -4,6 +4,7 @@ OTP_DO_ID_TOONTOWN = 1337 OTP_DO_ID_CLIENT_SERVICES_MANAGER = 4665 OTP_DO_ID_TTU_FRIENDS_MANAGER = 4666 OPT_DO_ID_GROUP_MANAGER = 4667 +OTP_DO_ID_TTU_ARG_MANAGER = 4668 OTP_DO_ID_GLOBAL_PARTY_MANAGER = 4477 OTP_DO_ID_CHAT_MANAGER = 4681 OTP_ZONE_ID_MANAGEMENT = 2 @@ -11,4 +12,4 @@ OTP_ZONE_ID_DISTRICTS = 3 OTP_ZONE_ID_DISTRICTS_STATS = 4 OTP_MOD_CHANNEL = 6200 OTP_ADMIN_CHANNEL = 6400 -OTP_SYSADMIN_CHANNEL = 6500 \ No newline at end of file +OTP_SYSADMIN_CHANNEL = 6500 diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index a6286b0e..6481890f 100644 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -78,6 +78,8 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.csm = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager') self.ttuFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTU_FRIENDS_MANAGER, 'TTUFriendsManager') + self.argManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTU_ARG_MANAGER, 'ARGManager') + self.furnitureManager = None self.objectManager = None self.openAvatarPanels = set() diff --git a/toontown/uberdog/ARGManager.py b/toontown/uberdog/ARGManager.py new file mode 100644 index 00000000..e5c0e426 --- /dev/null +++ b/toontown/uberdog/ARGManager.py @@ -0,0 +1,67 @@ +from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal +from toontown.toonbase import ToontownGlobals +from otp.speedchat import SpeedChatGlobals +from direct.directnotify.DirectNotifyGlobal import directNotify +from toontown.hood import ZoneUtil +from pandac.PandaModules import Vec3 + +# Portable Hole settings +Hood2Details = { + # hood : [pos, speedchatIndex, destination] + 2665: [(6, 7, 9), 103, 2665], # TTC, Howdy! + 1832: [(6, 7, 9), 103, 1832], # Howdy! + 5502: [(6, 7, 9), 103, 5502], # Howdy! + 4612: [(6, 7, 9), 103, 4612], # Howdy! + 3636: [(6, 7, 9), 103, 3636], # Howdy! + 9705: [(6, 7, 9), 103, 9705], # Howdy! + 3823: [(6, 7, 9), 103, 3823], # Howdy! +} +Interior2Messages = { + 2665: ["Mary: Oh, Hello! Oh, Hello! Say, that's the keyword that Doctor Surlee told myself and other shopkeepers just like me to remember. I take it he sent you?", "Mary: The word I'm supposed to remember is 'Sillyness'"], # DD to TTC + 1832: ["Melville: Say, you don't look like Doctor Surlee. That is the trigger phrase, though...", "Melville: He told me to remember 'Lafter'"], # TTC to TB + 5502: ["HQ Officer: Oh, Surlee sent you? Keep this key safe, he said it's going to be important later on.", "HQ Officer: The word is 'Springy Partlicles' -- Whatever that means."], # TB to MML + 4612: ["Dr. Fret: Aahhh, brilliant. Surlee is up to something again, I'm sure.", "Dr. Fret: He told me to remember 'Creating Equiment'"], # MML to DG + 3636: ["Gus Gooseburger: Keep it down! Surlee didn't give me these gloves to just give the word away.", "Gus Gooseburger: Just kidding! I have no idea why he wanted me to remember this word. It's 'Portil'"], # DG to DDL + 9705: ["Drowsy Dave: Huh? Oh, oh! Hi. Surlee's word, right. Uhh...", "Drowsy Dave: I seem to have dozed off... Professor Flake is a good friend of the Doc, though. I bet he knows."], # DDL to AA + 3823: ["Professor Flake: Hmm? So soon? Surlee told me that something big would be happening whenever he needed this...", "Professor Flake: I hope that you have a photographic memory like myself, because this is a long one."], # DDL to AA +} + +class ARGManager(DistributedObjectGlobal): + """ + This is a client-view of the manager that handles everything to do + with the portable hole ARG event. + """ + + notify = directNotify.newCategory('ARGManager') + + def __init__(self, cr): + DistributedObjectGlobal.__init__(self, cr) + self.setupPortableHoleEvent() + + def disable(self): + self.cleanupPortableHoleEvent() + DistributedObjectGlobal.disable(self) + + def delete(self): + self.cleanupPortableHoleEvent() + DistributedObjectGlobal.delete(self) + + def setupPortableHoleEvent(self): + def phraseSaid(phraseId): + position, speedchatIndex, destination = Hood2Details.get(base.cr.playGame.getPlace().getZoneId(), [None, None, None]) + if not position or not speedchatIndex or not destination: + return + if speedchatIndex != phraseId: + return + msgBefore, msgAfter = Interior2Messages.get(destination, [None, None]) + if not msgBefore: + self.notify.warning("Interior %d has no message definitions!" % destination) + return + taskMgr.doMethodLater(2, base.localAvatar.setSystemMessage, self.uniqueName("arg-before-msg"), extraArgs=[0, msgBefore]) + taskMgr.doMethodLater(7, base.localAvatar.setSystemMessage, self.uniqueName("arg-after-msg"), extraArgs=[0, msgAfter]) + if destination == 3823: + taskMgr.doMethodLater(15, base.localAvatar.setSystemMessage, self.uniqueName("arg-after-after-msg"), extraArgs=[0, "'ttr://assets/LL-memo-607630003555.txt'. Keep it safe. I have no idea what it means, but Surlee certainly will."]) + self.accept(SpeedChatGlobals.SCStaticTextMsgEvent, phraseSaid) + + def cleanupPortableHoleEvent(self): + self.ignore(SpeedChatGlobals.SCStaticTextMsgEvent) diff --git a/toontown/uberdog/ARGManagerAI.py b/toontown/uberdog/ARGManagerAI.py new file mode 100644 index 00000000..1b180a83 --- /dev/null +++ b/toontown/uberdog/ARGManagerAI.py @@ -0,0 +1,4 @@ +from direct.distributed.DistributedObjectGlobalAI import DistributedObjectGlobalAI + +class ARGManagerAI(DistributedObjectGlobalAI): + pass diff --git a/toontown/uberdog/ARGManagerUD.py b/toontown/uberdog/ARGManagerUD.py new file mode 100644 index 00000000..50ca2705 --- /dev/null +++ b/toontown/uberdog/ARGManagerUD.py @@ -0,0 +1,4 @@ +from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD + +class ARGManagerUD(DistributedObjectGlobalUD): + pass From a96e9e8910ccc93ff55f0f830c55d51bb255198a Mon Sep 17 00:00:00 2001 From: Loudrob Date: Wed, 6 May 2015 13:19:29 -0400 Subject: [PATCH 2/2] Added v2.0 and skelecog to cog level gui. --- toontown/town/TownBattleCogPanel.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/toontown/town/TownBattleCogPanel.py b/toontown/town/TownBattleCogPanel.py index f661a256..7bd78f3b 100644 --- a/toontown/town/TownBattleCogPanel.py +++ b/toontown/town/TownBattleCogPanel.py @@ -39,6 +39,7 @@ class TownBattleCogPanel(DirectFrame): self.setScale(0.8) self.initialiseoptions(TownBattleCogPanel) self.levelText = DirectLabel(parent=self, text='', pos=(-0.06, 0, -0.075), text_scale=0.055) + self.suitType = DirectLabel(parent=self, text='', pos=(0.12, 0, -0.075), text_scale=0.055) self.healthBar = None self.healthBarGlow = None self.hpChangeEvent = None @@ -59,6 +60,12 @@ class TownBattleCogPanel(DirectFrame): return self.suit = suit self.setLevelText(self.suit.getActualLevel()) + if self.suit.isSkeleton == 1: + self.type = "Skel" + self.setTypeText(self.type) + if self.suit.revives == 1: + self.type = "V2.0" + self.setTypeText(self.type) if self.head: self.head.removeNode() self.setSuitHead(self.suit.getStyleName()) @@ -75,9 +82,12 @@ class TownBattleCogPanel(DirectFrame): def getSuit(self, suit): return self.suit - def setLevelText(self, level): + def setLevelText(self, level): self.levelText['text'] = 'Level '+ str(level) + def setTypeText(self, suitType): + self.suitType['text'] = suitType + def setSuitHead(self, suitName): self.head = Suit.attachSuitHead(self, suitName) self.head.setX(0.1)