diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 340edea..19e549c 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -36,12 +36,14 @@ from toontown.hood.TTHoodDataAI import TTHoodDataAI from toontown.pets.PetManagerAI import PetManagerAI from toontown.quest.QuestManagerAI import QuestManagerAI from toontown.racing import RaceGlobals +from toontown.fishing.DistributedFishingPondAI import DistributedFishingPondAI from toontown.racing.DistributedLeaderBoardAI import DistributedLeaderBoardAI from toontown.racing.DistributedRacePadAI import DistributedRacePadAI from toontown.racing.DistributedStartingBlockAI import DistributedStartingBlockAI from toontown.racing.DistributedStartingBlockAI import DistributedViewingBlockAI from toontown.racing.DistributedViewPadAI import DistributedViewPadAI from toontown.racing.RaceManagerAI import RaceManagerAI +from toontown.uberdog.DistributedPartyManagerAI import DistributedPartyManagerAI from toontown.safezone.SafeZoneManagerAI import SafeZoneManagerAI from toontown.shtiker.CogPageManagerAI import CogPageManagerAI from toontown.spellbook.ToontownMagicWordManagerAI import ToontownMagicWordManagerAI @@ -91,6 +93,7 @@ class ToontownAIRepository(ToontownInternalRepository): self.trophyMgr = None self.safeZoneManager = None self.magicWordManager = None + self.partyManager = None self.zoneTable = {} self.dnaStoreMap = {} self.dnaDataMap = {} @@ -225,6 +228,10 @@ class ToontownAIRepository(ToontownInternalRepository): self.tutorialManager = TutorialManagerAI(self) self.tutorialManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT) + # Generate our party manager... + self.partyManager = DistributedPartyManagerAI(self) + self.partyManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT) + def generateHood(self, hoodConstructor, zoneId): # Bossbot HQ doesn't use DNA, so we skip over that. if zoneId != ToontownGlobals.BossbotHQ: @@ -374,7 +381,29 @@ class ToontownAIRepository(ToontownInternalRepository): return loadDNAFileAI(dnaStore, dnaFileName) def findFishingPonds(self, dnaData, zoneId, area): - return [], [] # TODO + fishingPonds, fishingPondGroups = [], [] + + if "fishing_pond" in dnaData.getName(): + fishingPondGroups.append(dnaData) + pond = DistributedFishingPondAI(self) + pond.setArea(area) + pond.generateWithRequired(zoneId) + fishingPonds.append(pond) + else: + if isinstance(dnaData, DNAVisGroup): + name = dnaData.getName() + visId = int(name.split(":", 1)[0]) % 1000 + zoneId = ZoneUtil.getHoodId(zoneId) + visId + + for i in range(dnaData.getNumChildren()): + foundFishingPonds, foundFishingPondGroups = self.findFishingPonds(dnaData.at(i), zoneId, area) + fishingPonds.extend(foundFishingPonds) + fishingPondGroups.extend(foundFishingPondGroups) + + return fishingPonds, fishingPondGroups + + def findFishingSpots(self, dnaData, pond): + return [] # TODO def findPartyHats(self, dnaData, zoneId): return [] # TODO diff --git a/toontown/fishing/DistributedFishingPondAI.py b/toontown/fishing/DistributedFishingPondAI.py index 68754c4..d2e86ab 100644 --- a/toontown/fishing/DistributedFishingPondAI.py +++ b/toontown/fishing/DistributedFishingPondAI.py @@ -3,3 +3,13 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedFishingPondAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedFishingPondAI') + + def __init__(self, air): + DistributedObjectAI.__init__(self, air) + self.area = None + + def setArea(self, area): + self.area = area + + def getArea(self): + return self.area diff --git a/toontown/uberdog/DistributedPartyManagerAI.py b/toontown/uberdog/DistributedPartyManagerAI.py index 2de29d9..75866e7 100644 --- a/toontown/uberdog/DistributedPartyManagerAI.py +++ b/toontown/uberdog/DistributedPartyManagerAI.py @@ -3,3 +3,6 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedPartyManagerAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedPartyManagerAI') + + def canBuyParties(self): + return False # TODO