minigame: you can now play some minigames
some will crash
This commit is contained in:
parent
f2740bab51
commit
187eb4b50c
|
|
@ -43,6 +43,7 @@ class ToontownAIRepository(ToontownInternalRepository):
|
||||||
self.districtName = districtName
|
self.districtName = districtName
|
||||||
self.doLiveUpdates = config.GetBool('want-live-updates', True)
|
self.doLiveUpdates = config.GetBool('want-live-updates', True)
|
||||||
self.wantCogdominiums = config.GetBool('want-cogdominiums', True)
|
self.wantCogdominiums = config.GetBool('want-cogdominiums', True)
|
||||||
|
self.useAllMinigames = config.GetBool('want-all-minigames', True)
|
||||||
self.districtId = None
|
self.districtId = None
|
||||||
self.district = None
|
self.district = None
|
||||||
self.districtStats = None
|
self.districtStats = None
|
||||||
|
|
@ -50,6 +51,8 @@ class ToontownAIRepository(ToontownInternalRepository):
|
||||||
self.zoneDataStore = None
|
self.zoneDataStore = None
|
||||||
self.petMgr = None
|
self.petMgr = None
|
||||||
self.suitInvasionManager = None
|
self.suitInvasionManager = None
|
||||||
|
self.zoneAllocator = None
|
||||||
|
self.zoneId2owner = {}
|
||||||
self.questManager = None
|
self.questManager = None
|
||||||
self.promotionMgr = None
|
self.promotionMgr = None
|
||||||
self.cogPageManager = None
|
self.cogPageManager = None
|
||||||
|
|
@ -109,6 +112,9 @@ class ToontownAIRepository(ToontownInternalRepository):
|
||||||
# Create our suit invasion manager...
|
# Create our suit invasion manager...
|
||||||
self.suitInvasionManager = SuitInvasionManagerAI(self)
|
self.suitInvasionManager = SuitInvasionManagerAI(self)
|
||||||
|
|
||||||
|
# Create our zone allocator...
|
||||||
|
self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)
|
||||||
|
|
||||||
# Create our quest manager...
|
# Create our quest manager...
|
||||||
self.questManager = QuestManagerAI(self)
|
self.questManager = QuestManagerAI(self)
|
||||||
|
|
||||||
|
|
@ -330,5 +336,18 @@ class ToontownAIRepository(ToontownInternalRepository):
|
||||||
def decrementPopulation(self):
|
def decrementPopulation(self):
|
||||||
self.districtStats.b_setAvatarCount(self.districtStats.getAvatarCount() - 1)
|
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):
|
def sendQueryToonMaxHp(self, avId, callback):
|
||||||
pass # TODO?
|
pass # TODO?
|
||||||
|
|
|
||||||
|
|
@ -24,3 +24,6 @@ class QuestManagerAI:
|
||||||
|
|
||||||
def toonKilledCogdo(self, toon, difficulty, numFloors, zoneId, activeToons):
|
def toonKilledCogdo(self, toon, difficulty, numFloors, zoneId, activeToons):
|
||||||
pass # TODO
|
pass # TODO
|
||||||
|
|
||||||
|
def toonPlayedMinigame(self, toon, toons):
|
||||||
|
pass # TODO
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ class Trolley(StateData.StateData):
|
||||||
['start'])],
|
['start'])],
|
||||||
'start', 'final')
|
'start', 'final')
|
||||||
self.parentFSM = parentFSM
|
self.parentFSM = parentFSM
|
||||||
|
self.leavingCameraSeq = None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
|
|
@ -180,7 +181,8 @@ class Trolley(StateData.StateData):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def enterTrolleyLeaving(self):
|
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)
|
self.acceptOnce('playMinigame', self.handlePlayMinigame)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
@ -194,7 +196,9 @@ class Trolley(StateData.StateData):
|
||||||
|
|
||||||
def exitTrolleyLeaving(self):
|
def exitTrolleyLeaving(self):
|
||||||
self.ignore('playMinigame')
|
self.ignore('playMinigame')
|
||||||
taskMgr.remove('leavingCamera')
|
if self.leavingCameraSeq:
|
||||||
|
self.leavingCameraSeq.finish()
|
||||||
|
self.leavingCameraSeq = None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def enterExiting(self):
|
def enterExiting(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue