diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 6f8a7aa..f54c249 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -43,6 +43,7 @@ class ToontownAIRepository(ToontownInternalRepository): self.districtName = districtName self.doLiveUpdates = config.GetBool('want-live-updates', True) self.wantCogdominiums = config.GetBool('want-cogdominiums', True) + self.useAllMinigames = config.GetBool('want-all-minigames', True) self.districtId = None self.district = None self.districtStats = None @@ -50,6 +51,8 @@ class ToontownAIRepository(ToontownInternalRepository): self.zoneDataStore = None self.petMgr = None self.suitInvasionManager = None + self.zoneAllocator = None + self.zoneId2owner = {} self.questManager = None self.promotionMgr = None self.cogPageManager = None @@ -109,6 +112,9 @@ class ToontownAIRepository(ToontownInternalRepository): # Create our suit invasion manager... self.suitInvasionManager = SuitInvasionManagerAI(self) + # Create our zone allocator... + self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd) + # Create our quest manager... self.questManager = QuestManagerAI(self) @@ -330,5 +336,18 @@ class ToontownAIRepository(ToontownInternalRepository): def decrementPopulation(self): self.districtStats.b_setAvatarCount(self.districtStats.getAvatarCount() - 1) + def allocateZone(self, owner=None): + zoneId = self.zoneAllocator.allocate() + if owner: + self.zoneId2owner[zoneId] = owner + + return zoneId + + def deallocateZone(self, zone): + if self.zoneId2owner.get(zone): + del self.zoneId2owner[zone] + + self.zoneAllocator.free(zone) + def sendQueryToonMaxHp(self, avId, callback): pass # TODO? diff --git a/toontown/quest/QuestManagerAI.py b/toontown/quest/QuestManagerAI.py index 4800e43..1aa581e 100644 --- a/toontown/quest/QuestManagerAI.py +++ b/toontown/quest/QuestManagerAI.py @@ -24,3 +24,6 @@ class QuestManagerAI: def toonKilledCogdo(self, toon, difficulty, numFloors, zoneId, activeToons): pass # TODO + + def toonPlayedMinigame(self, toon, toons): + pass # TODO diff --git a/toontown/trolley/Trolley.py b/toontown/trolley/Trolley.py index 4a55934..d57cadf 100644 --- a/toontown/trolley/Trolley.py +++ b/toontown/trolley/Trolley.py @@ -64,6 +64,7 @@ class Trolley(StateData.StateData): ['start'])], 'start', 'final') self.parentFSM = parentFSM + self.leavingCameraSeq = None return None def load(self): @@ -180,7 +181,8 @@ class Trolley(StateData.StateData): return None def enterTrolleyLeaving(self): - camera.lerpPosHprXYZHPR(0, 18.55, 3.75, -180, 0, 0, 3, blendType='easeInOut', task='leavingCamera') + self.leavingCameraSeq = camera.posHprInterval(3, (0, 18.55, 3.75), (-180, 0, 0), blendType='easeInOut', name='leavingCamera') + self.leavingCameraSeq.start() self.acceptOnce('playMinigame', self.handlePlayMinigame) return None @@ -194,7 +196,9 @@ class Trolley(StateData.StateData): def exitTrolleyLeaving(self): self.ignore('playMinigame') - taskMgr.remove('leavingCamera') + if self.leavingCameraSeq: + self.leavingCameraSeq.finish() + self.leavingCameraSeq = None return None def enterExiting(self):