From d4974e8d540cadbda010151efc6160e2ca1a9796 Mon Sep 17 00:00:00 2001 From: Zach Date: Sun, 10 May 2015 22:53:28 -0500 Subject: [PATCH] Jor-El Cam --- astron/dclass/united.dc | 4 +++ config/release/dev.prc | 1 + otp/distributed/DCClassImports.py | 4 +-- toontown/ai/DistributedJorElCam.py | 53 ++++++++++++++++++++++++++++ toontown/ai/DistributedJorElCamAI.py | 24 +++++++++++++ toontown/ai/ToontownAIRepository.py | 1 + toontown/hood/TTHoodAI.py | 6 +++- 7 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 toontown/ai/DistributedJorElCam.py create mode 100644 toontown/ai/DistributedJorElCamAI.py diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index cd62154d..e5f0cad0 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -408,6 +408,7 @@ from toontown.ai import DistributedResistanceEmoteMgr/AI from toontown.ai import DistributedScavengerHuntTarget/AI from toontown.ai import DistributedTrickOrTreatTarget/AI from toontown.ai import DistributedWinterCarolingTarget/AI +from toontown.ai import DistributedJorElCam/AI from toontown.coghq import DistributedMint/AI from toontown.coghq import DistributedMintRoom/AI from toontown.coghq import DistributedMintBattle/AI @@ -2542,6 +2543,9 @@ dclass DistributedWinterCarolingTarget : DistributedObject { requestScavengerHunt() airecv clsend; }; +dclass DistributedJorElCam : DistributedObject { +}; + dclass DistributedVehicle : DistributedSmoothNode { setOwner(uint32) required broadcast ram; setState(char, uint32) broadcast ram; diff --git a/config/release/dev.prc b/config/release/dev.prc index 97817422..4deec769 100644 --- a/config/release/dev.prc +++ b/config/release/dev.prc @@ -40,6 +40,7 @@ want-resistance-dance #t # Optional: want-glove-npc #t +want-jor-el-cam #f # Developer options: show-population #t diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index d3ef1961..4b7d6498 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 215686161 +hashVal = 2946007471L 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.groups import GroupManager from toontown.uberdog.ClientServicesManager import ClientServicesManager -from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedReportMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget +from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedReportMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedJorElCam from otp.chat import ChatAgent from toontown.parties.GlobalPartyManager import GlobalPartyManager from toontown.racing.DistributedStartingBlock import DistributedViewingBlock diff --git a/toontown/ai/DistributedJorElCam.py b/toontown/ai/DistributedJorElCam.py new file mode 100644 index 00000000..748a199d --- /dev/null +++ b/toontown/ai/DistributedJorElCam.py @@ -0,0 +1,53 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObject import DistributedObject +from direct.interval.IntervalGlobal import * +from toontown.toon import ToonHead +from toontown.nametag import NametagGroup +from otp.otpbase import OTPGlobals + +class DistributedJorElCam(DistributedObject): + notify = DirectNotifyGlobal.directNotify.newCategory('DistributedJorElCam') + + def __init__(self, cr): + DistributedObject.__init__(self, cr) + self.head = None + self.dna = None + + def generate(self): + DistributedObject.generate(self) + self.dna = ToonDNA.ToonDNA() + self.dna.newToonRandom() + self.head = ToonHead.ToonHead() + self.head.setupHead(self.dna) + self.head.reparentTo(self.cr.playGame.hood.loader) + self.head.setPos(75, 0, 20) + self.head.setHpr(90, 0, 0) + self.head.setScale(10) + self.head.startBlink() + self.head.startLookAround() + + pieces = [['*head*', '*muzzle*'], ['*ears*', '*nose*']] + for p in pieces[0]: + pc = '**/%s' % p + for node in self.head.findAllMatches(pc): + if not node.is_empty(): + node.setColor(1, 1, 1, 1) + for p in pieces[1]: + pc = '**/%s' % p + for node in self.head.findAllMatches(pc): + if not node.is_empty(): + node.setColor(0, 0, 0, 1) + + base.cr.jorElHead = self.head + + def delete(self): + self.head.removeNode() + self.head = None + del base.cr.jorElHead + DistributedObject.delete(self) + + def disable(self): + self.head.removeNode() + self.head = None + del base.cr.jorElHead + DistributedObject.disable(self) diff --git a/toontown/ai/DistributedJorElCamAI.py b/toontown/ai/DistributedJorElCamAI.py new file mode 100644 index 00000000..0d891ad5 --- /dev/null +++ b/toontown/ai/DistributedJorElCamAI.py @@ -0,0 +1,24 @@ +from direct.directnotify import DirectNotifyGlobal +from direct.distributed.DistributedObjectAI import DistributedObjectAI +from toontown.toon import ToonDNA + +class DistributedJorElCamAI(DistributedObjectAI): + notify = DirectNotifyGlobal.directNotify.newCategory("DistributedJorElCamAI") + + def __init__(self, air): + DistributedObjectAI.__init__(self, air) + self.air = air + self.dna = None + + def generate(self): + self.dna = ToonDNA.ToonDNA() + self.dna.newToonRandom() + DistributedObjectAI.generate(self) + + def delete(self): + del self.dna + DistributedObjectAI.delete(self) + + def disable(self): + del self.dna + DistributedObjectAI.disable(self) diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 29514b17..ddb0fae1 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -91,6 +91,7 @@ class ToontownAIRepository(ToontownInternalRepository): self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0) self.wantHalloween = self.config.GetBool('want-halloween', False) self.wantChristmas = self.config.GetBool('want-christmas', False) + self.wantJorElCam = self.config.GetBool('want-jor-el-cam', False) self.cogSuitMessageSent = False diff --git a/toontown/hood/TTHoodAI.py b/toontown/hood/TTHoodAI.py index 730650d8..9bc94b2f 100644 --- a/toontown/hood/TTHoodAI.py +++ b/toontown/hood/TTHoodAI.py @@ -7,6 +7,7 @@ from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownGlobals from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedWinterCarolingTargetAI +from toontown.ai import DistributedJorElCamAI class TTHoodAI(HoodAI.HoodAI): @@ -41,9 +42,12 @@ class TTHoodAI(HoodAI.HoodAI): self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(self.air) self.WinterCarolingTargetManager.generateWithRequired(2649) + if simbase.air.wantJorElCam: + self.JorElCamManager = DistributedJorElCamAI.DistributedJorElCamAI(self.air) + self.JorElCamManager.generateWithRequired(self.zoneId) + def shutdown(self): HoodAI.HoodAI.shutdown(self) - ButterflyGlobals.clearIndexes(self.zoneId) def createTrolley(self):