minigame: you can now play some minigames

some will crash
This commit is contained in:
John Cote 2019-12-30 22:43:40 -05:00
parent f2740bab51
commit 187eb4b50c
3 changed files with 28 additions and 2 deletions

View file

@ -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?

View file

@ -24,3 +24,6 @@ class QuestManagerAI:
def toonKilledCogdo(self, toon, difficulty, numFloors, zoneId, activeToons):
pass # TODO
def toonPlayedMinigame(self, toon, toons):
pass # TODO

View file

@ -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):