mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
Cleanup many Cogdo files.
This commit is contained in:
parent
e7b0cb751a
commit
cc33dee614
23 changed files with 204 additions and 283 deletions
|
@ -3,4 +3,3 @@ from toontown.cogdominium.DistCogdoLevelGameAI import DistCogdoLevelGameAI
|
||||||
|
|
||||||
class DistCogdoBoardroomGameAI(DistCogdoLevelGameAI):
|
class DistCogdoBoardroomGameAI(DistCogdoLevelGameAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoBoardroomGameAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoBoardroomGameAI")
|
||||||
|
|
||||||
|
|
|
@ -18,4 +18,3 @@ class DistCogdoCraneAI(DistributedObjectAI):
|
||||||
|
|
||||||
def setCablePos(self, todo0, todo1, todo2, todo3, todo4):
|
def setCablePos(self, todo0, todo1, todo2, todo3, todo4):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,3 @@ class DistCogdoCraneCogAI(DistributedObjectAI):
|
||||||
|
|
||||||
def setSpawnInfo(self, todo0, todo1):
|
def setSpawnInfo(self, todo0, todo1):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,12 @@ class DistCogdoCraneGameAI(DistCogdoLevelGameAI, CogdoCraneGameBase):
|
||||||
self._cranes[i].requestDelete()
|
self._cranes[i].requestDelete()
|
||||||
self._cranes[i] = None
|
self._cranes[i] = None
|
||||||
continue
|
continue
|
||||||
|
|
||||||
DistCogdoLevelGameAI.exitLoaded(self)
|
DistCogdoLevelGameAI.exitLoaded(self)
|
||||||
|
|
||||||
def enterGame(self):
|
def enterGame(self):
|
||||||
DistCogdoLevelGameAI.enterGame(self)
|
DistCogdoLevelGameAI.enterGame(self)
|
||||||
for i in xrange(self.getNumPlayers()):
|
for i in xrange(self.getNumPlayers()):
|
||||||
self._cranes[i].request('Controlled', self.getToonIds()[i])
|
self._cranes[i].request('Controlled', self.getToonIds()[i])
|
||||||
|
|
||||||
self._scheduleGameDone()
|
self._scheduleGameDone()
|
||||||
|
|
||||||
def _scheduleGameDone(self):
|
def _scheduleGameDone(self):
|
||||||
|
|
|
@ -9,4 +9,3 @@ class DistCogdoCraneMoneyBagAI(DistributedObjectAI):
|
||||||
|
|
||||||
def requestInitial(self):
|
def requestInitial(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -23,49 +23,38 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI):
|
||||||
for toon in self.toons:
|
for toon in self.toons:
|
||||||
if toon not in self.completed:
|
if toon not in self.completed:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.gameDone()
|
self.gameDone()
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.BladeLost:
|
elif action == Globals.AI.GameActions.BladeLost:
|
||||||
self.sendUpdate("toonBladeLost", [avId])
|
self.sendUpdate("toonBladeLost", [avId])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.SetBlades:
|
elif action == Globals.AI.GameActions.SetBlades:
|
||||||
self.sendUpdate("toonSetBlades", [avId, data])
|
self.sendUpdate("toonSetBlades", [avId, data])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.Died:
|
elif action == Globals.AI.GameActions.Died:
|
||||||
damage = Globals.AI.SafezoneId2DeathDamage[self.getSafezoneId()]
|
damage = Globals.AI.SafezoneId2DeathDamage[self.getSafezoneId()]
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
self.sendUpdate("toonDied", [avId, globalClockDelta.getRealNetworkTime()])
|
self.sendUpdate("toonDied", [avId, globalClockDelta.getRealNetworkTime()])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.Spawn:
|
elif action == Globals.AI.GameActions.Spawn:
|
||||||
self.sendUpdate("toonSpawn", [avId, globalClockDelta.getRealNetworkTime()])
|
self.sendUpdate("toonSpawn", [avId, globalClockDelta.getRealNetworkTime()])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.RequestEnterEagleInterest:
|
elif action == Globals.AI.GameActions.RequestEnterEagleInterest:
|
||||||
if not self.eagles.get(data):
|
if not self.eagles.get(data):
|
||||||
self.eagles[data] = avId
|
self.eagles[data] = avId
|
||||||
self.sendUpdate("toonSetAsEagleTarget", [avId, data, globalClockDelta.getRealNetworkTime()])
|
self.sendUpdate("toonSetAsEagleTarget", [avId, data, globalClockDelta.getRealNetworkTime()])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.RequestExitEagleInterest:
|
elif action == Globals.AI.GameActions.RequestExitEagleInterest:
|
||||||
if self.eagles.get(data) == avId:
|
if self.eagles.get(data) == avId:
|
||||||
self.eagles[data] = 0
|
self.eagles[data] = 0
|
||||||
self.sendUpdate("toonClearAsEagleTarget", [avId, data, globalClockDelta.getRealNetworkTime()])
|
self.sendUpdate("toonClearAsEagleTarget", [avId, data, globalClockDelta.getRealNetworkTime()])
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.HitLegalEagle:
|
elif action == Globals.AI.GameActions.HitLegalEagle:
|
||||||
damage = Globals.AI.SafezoneId2LegalEagleDamage[self.getSafezoneId()]
|
damage = Globals.AI.SafezoneId2LegalEagleDamage[self.getSafezoneId()]
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.HitMinion:
|
elif action == Globals.AI.GameActions.HitMinion:
|
||||||
damage = Globals.AI.SafezoneId2MinionDamage[self.getSafezoneId()]
|
damage = Globals.AI.SafezoneId2MinionDamage[self.getSafezoneId()]
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.HitWhirlwind:
|
elif action == Globals.AI.GameActions.HitWhirlwind:
|
||||||
damage = Globals.AI.SafezoneId2WhirlwindDamage[self.getSafezoneId()]
|
damage = Globals.AI.SafezoneId2WhirlwindDamage[self.getSafezoneId()]
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
|
|
||||||
elif action == Globals.AI.GameActions.RanOutOfTimePenalty:
|
elif action == Globals.AI.GameActions.RanOutOfTimePenalty:
|
||||||
damage = int(20 * self.getDifficulty())
|
damage = int(20 * self.getDifficulty())
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
||||||
|
|
||||||
|
@ -79,10 +68,8 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI):
|
||||||
self.sendUpdate("pickUp", [avId, pickupNum, globalClockDelta.getRealNetworkTime()])
|
self.sendUpdate("pickUp", [avId, pickupNum, globalClockDelta.getRealNetworkTime()])
|
||||||
if pickupType == Globals.Level.GatherableTypes.LaffPowerup:
|
if pickupType == Globals.Level.GatherableTypes.LaffPowerup:
|
||||||
av.toonUp(int(27 * self.getDifficulty()) + 3)
|
av.toonUp(int(27 * self.getDifficulty()) + 3)
|
||||||
|
|
||||||
if pickupType == Globals.Level.GatherableTypes.Memo:
|
if pickupType == Globals.Level.GatherableTypes.Memo:
|
||||||
self.totalMemos += 1
|
self.totalMemos += 1
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType)
|
self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType)
|
||||||
|
|
||||||
|
@ -125,4 +112,3 @@ def endFly():
|
||||||
game = simbase.air.cogdoGame
|
game = simbase.air.cogdoGame
|
||||||
game.requestAction(Globals.AI.GameActions.LandOnWinPlatform, 0)
|
game.requestAction(Globals.AI.GameActions.LandOnWinPlatform, 0)
|
||||||
return 'Finished cogdo flying game!'
|
return 'Finished cogdo flying game!'
|
||||||
|
|
|
@ -18,10 +18,8 @@ class DistCogdoGameAI(DistributedObjectAI):
|
||||||
|
|
||||||
def announceGenerate(self):
|
def announceGenerate(self):
|
||||||
DistributedObjectAI.announceGenerate(self)
|
DistributedObjectAI.announceGenerate(self)
|
||||||
|
|
||||||
self.finishEvent = self.uniqueName('CogdoMazeGameDone')
|
self.finishEvent = self.uniqueName('CogdoMazeGameDone')
|
||||||
self.gameOverEvent = self.uniqueName('CogdoMazeGameLose')
|
self.gameOverEvent = self.uniqueName('CogdoMazeGameLose')
|
||||||
|
|
||||||
self.resetRequests()
|
self.resetRequests()
|
||||||
|
|
||||||
def d_startIntro(self):
|
def d_startIntro(self):
|
||||||
|
@ -105,4 +103,3 @@ class DistCogdoGameAI(DistributedObjectAI):
|
||||||
|
|
||||||
def getSafezoneId(self):
|
def getSafezoneId(self):
|
||||||
return CogdoGameConsts.getSafezoneId(self.exteriorZone)
|
return CogdoGameConsts.getSafezoneId(self.exteriorZone)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
class DistCogdoGameBase:
|
class DistCogdoGameBase:
|
||||||
|
|
||||||
def local2GameTime(self, timestamp):
|
def local2GameTime(self, timestamp):
|
||||||
|
|
|
@ -4,4 +4,3 @@ from otp.level.DistributedLevelAI import DistributedLevelAI
|
||||||
|
|
||||||
class DistCogdoLevelGameAI(DistCogdoGameAI, DistributedLevelAI):
|
class DistCogdoLevelGameAI(DistCogdoGameAI, DistributedLevelAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoLevelGameAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoLevelGameAI")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ from direct.task import Timer
|
||||||
from toontown.battle import BattleBase
|
from toontown.battle import BattleBase
|
||||||
from toontown.building.ElevatorConstants import *
|
from toontown.building.ElevatorConstants import *
|
||||||
|
|
||||||
ALL_ABOARD_LAG = .7
|
ALL_ABOARD_LAG = 3.7
|
||||||
|
|
||||||
BASE_TOON_UP = 10
|
BASE_TOON_UP = 10
|
||||||
JOKE_TOON_UP = 5
|
JOKE_TOON_UP = 5
|
||||||
|
@ -92,7 +92,6 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
|
|
||||||
if avId in self.numJokes:
|
if avId in self.numJokes:
|
||||||
self.numJokes[avId] += 1
|
self.numJokes[avId] += 1
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.numJokes[avId] = 1
|
self.numJokes[avId] = 1
|
||||||
|
|
||||||
|
@ -140,7 +139,6 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
self.doAction(CogdoMazeGameGlobals.GameActions.OpenDoor, 0)
|
self.doAction(CogdoMazeGameGlobals.GameActions.OpenDoor, 0)
|
||||||
self.__startTimeout()
|
self.__startTimeout()
|
||||||
return task.done
|
return task.done
|
||||||
|
|
||||||
return task.again
|
return task.again
|
||||||
|
|
||||||
def __startTimeout(self):
|
def __startTimeout(self):
|
||||||
|
@ -150,7 +148,6 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
for toon in self.toons:
|
for toon in self.toons:
|
||||||
if not toon in self.toonsInDoor:
|
if not toon in self.toonsInDoor:
|
||||||
self.killToon(toon)
|
self.killToon(toon)
|
||||||
|
|
||||||
self.removeAll()
|
self.removeAll()
|
||||||
self.gameDone()
|
self.gameDone()
|
||||||
|
|
||||||
|
@ -158,7 +155,6 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
if self.timer.getT() <= CogdoMazeGameGlobals.SecondsForTimeAlert:
|
if self.timer.getT() <= CogdoMazeGameGlobals.SecondsForTimeAlert:
|
||||||
self.doAction(CogdoMazeGameGlobals.GameActions.TimeAlert, 0)
|
self.doAction(CogdoMazeGameGlobals.GameActions.TimeAlert, 0)
|
||||||
return task.done
|
return task.done
|
||||||
|
|
||||||
return task.again
|
return task.again
|
||||||
|
|
||||||
def killToon(self, avId):
|
def killToon(self, avId):
|
||||||
|
@ -174,7 +170,6 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
toon = self.air.doId2do.get(toonId)
|
toon = self.air.doId2do.get(toonId)
|
||||||
if not toon:
|
if not toon:
|
||||||
self.__playerDisconnected(toonId)
|
self.__playerDisconnected(toonId)
|
||||||
|
|
||||||
return task.again
|
return task.again
|
||||||
|
|
||||||
def __playerDisconnected(self, avId):
|
def __playerDisconnected(self, avId):
|
||||||
|
@ -194,23 +189,19 @@ class DistCogdoMazeGameAI(DistCogdoGameAI):
|
||||||
if not self.doorRevealed:
|
if not self.doorRevealed:
|
||||||
self.doAction(action, avId)
|
self.doAction(action, avId)
|
||||||
self.doorRevealed = True
|
self.doorRevealed = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Toon tried to reveal door but it\'s already revealed! Ignoring.')
|
self.notify.warning('Toon tried to reveal door but it\'s already revealed! Ignoring.')
|
||||||
|
|
||||||
elif action == Globals.GameActions.EnterDoor:
|
elif action == Globals.GameActions.EnterDoor:
|
||||||
if not avId in self.toonsInDoor:
|
if not avId in self.toonsInDoor:
|
||||||
self.doAction(action, avId)
|
self.doAction(action, avId)
|
||||||
self.toonsInDoor.append(avId)
|
self.toonsInDoor.append(avId)
|
||||||
self.toonUpToon(avId)
|
self.toonUpToon(avId)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Toon tried to enter into door but already entered! Ignoring.')
|
self.notify.warning('Toon tried to enter into door but already entered! Ignoring.')
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(self.toonsInDoor) >= len(self.toons):
|
if len(self.toonsInDoor) >= len(self.toons):
|
||||||
self.__handleAllAboard()
|
self.__handleAllAboard()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
||||||
|
|
||||||
|
|
|
@ -32,5 +32,4 @@ class DistributedCogdoBarrelAI(DistributedObjectAI.DistributedObjectAI):
|
||||||
av = self.air.doId2do.get(avId)
|
av = self.air.doId2do.get(avId)
|
||||||
if not av:
|
if not av:
|
||||||
return
|
return
|
||||||
|
|
||||||
av.toonUp(self.brLaff)
|
av.toonUp(self.brLaff)
|
||||||
|
|
|
@ -3,4 +3,3 @@ from toontown.battle.DistributedBattleBldgAI import DistributedBattleBldgAI
|
||||||
|
|
||||||
class DistributedCogdoBattleBldgAI(DistributedBattleBldgAI):
|
class DistributedCogdoBattleBldgAI(DistributedBattleBldgAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedCogdoBattleBldgAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedCogdoBattleBldgAI")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# File: D (Python 2.4)
|
|
||||||
|
|
||||||
from toontown.building.DistributedElevatorExt import DistributedElevatorExt
|
from toontown.building.DistributedElevatorExt import DistributedElevatorExt
|
||||||
from toontown.building.ElevatorConstants import *
|
from toontown.building.ElevatorConstants import *
|
||||||
from toontown.building.ElevatorUtils import *
|
from toontown.building.ElevatorUtils import *
|
||||||
|
@ -13,10 +11,8 @@ class DistributedCogdoElevatorExt(DistributedElevatorExt):
|
||||||
def getElevatorModel(self):
|
def getElevatorModel(self):
|
||||||
return self.bldg.getCogdoElevatorNodePath()
|
return self.bldg.getCogdoElevatorNodePath()
|
||||||
|
|
||||||
|
|
||||||
def getBldgDoorOrigin(self):
|
def getBldgDoorOrigin(self):
|
||||||
return self.bldg.getCogdoDoorOrigin()
|
return self.bldg.getCogdoDoorOrigin()
|
||||||
|
|
||||||
|
|
||||||
def _getDoorsClosedInfo(self):
|
def _getDoorsClosedInfo(self):
|
||||||
return ('cogdoInterior', 'cogdoInterior')
|
return ('cogdoInterior', 'cogdoInterior')
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# File: D (Python 2.4)
|
|
||||||
|
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.building.DistributedElevatorExtAI import DistributedElevatorExtAI
|
from toontown.building.DistributedElevatorExtAI import DistributedElevatorExtAI
|
||||||
|
|
||||||
|
@ -8,5 +6,3 @@ class DistributedCogdoElevatorExtAI(DistributedElevatorExtAI):
|
||||||
|
|
||||||
def _createInterior(self):
|
def _createInterior(self):
|
||||||
self.bldg.createCogdoInterior()
|
self.bldg.createCogdoInterior()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,3 @@ from toontown.building.DistributedElevatorIntAI import DistributedElevatorIntAI
|
||||||
|
|
||||||
class DistributedCogdoElevatorIntAI(DistributedElevatorIntAI):
|
class DistributedCogdoElevatorIntAI(DistributedElevatorIntAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedCogdoElevatorIntAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedCogdoElevatorIntAI")
|
||||||
|
|
||||||
|
|
|
@ -344,11 +344,10 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
|
||||||
self.joiningReserves.append(suit)
|
self.joiningReserves.append(suit)
|
||||||
|
|
||||||
if 'Elevator' in repr(self.fsm):
|
if 'Elevator' in repr(self.fsm):
|
||||||
# fix the pos
|
# Fix the position.
|
||||||
pos, h = BattleBase.BattleBase.suitPoints[len(suitIds) - 1][suitIds.index(suitId)]
|
pos, h = BattleBase.BattleBase.suitPoints[len(suitIds) - 1][suitIds.index(suitId)]
|
||||||
suit.setPos(pos)
|
suit.setPos(pos)
|
||||||
suit.setH(h)
|
suit.setH(h)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('setSuits() - no suit: %d' % suitId)
|
self.notify.warning('setSuits() - no suit: %d' % suitId)
|
||||||
|
|
||||||
|
@ -468,7 +467,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
|
||||||
SuitHs = self.BossOffice_SuitHs
|
SuitHs = self.BossOffice_SuitHs
|
||||||
SuitPositions = self.BossOffice_SuitPositions
|
SuitPositions = self.BossOffice_SuitPositions
|
||||||
self.__makeShopOwnerNpc()
|
self.__makeShopOwnerNpc()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if self._wantBarrelRoom:
|
if self._wantBarrelRoom:
|
||||||
self.barrelRoom.load()
|
self.barrelRoom.load()
|
||||||
|
@ -494,18 +492,15 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
|
||||||
|
|
||||||
self.elevatorModelOut.reparentTo(elevOut)
|
self.elevatorModelOut.reparentTo(elevOut)
|
||||||
self.elevatorModelOut.setY(0)
|
self.elevatorModelOut.setY(0)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
elevIn = self.floorModel.find('**/elevator-in')
|
elevIn = self.floorModel.find('**/elevator-in')
|
||||||
elevOut = self.floorModel.find('**/elevator-out')
|
elevOut = self.floorModel.find('**/elevator-out')
|
||||||
|
|
||||||
elif self._wantBarrelRoom and self.barrelRoom.isLoaded() and self.currentFloor == 2 and self.FOType == 'l': #i know this is really ugly
|
elif self._wantBarrelRoom and self.barrelRoom.isLoaded() and self.currentFloor == 2 and self.FOType == 'l': #i know this is really ugly
|
||||||
elevIn = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorInPath)
|
elevIn = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorInPath)
|
||||||
elevOut = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorOutPath)
|
elevOut = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorOutPath)
|
||||||
y = elevOut.getY(render)
|
y = elevOut.getY(render)
|
||||||
elevOut = elevOut.copyTo(render)
|
elevOut = elevOut.copyTo(render)
|
||||||
elevOut.setY(render, y - 0.75)
|
elevOut.setY(render, y - 0.75)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
floorModel = loader.loadModel('phase_7/models/modules/boss_suit_office')
|
floorModel = loader.loadModel('phase_7/models/modules/boss_suit_office')
|
||||||
elevIn = floorModel.find('**/elevator-in').copyTo(render)
|
elevIn = floorModel.find('**/elevator-in').copyTo(render)
|
||||||
|
|
|
@ -39,15 +39,12 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
self.bldgDoId = exterior.doId
|
self.bldgDoId = exterior.doId
|
||||||
self.numFloors = NUM_FLOORS_DICT[exterior.track]
|
self.numFloors = NUM_FLOORS_DICT[exterior.track]
|
||||||
self.sosNPC = self.__generateSOS(exterior.difficulty)
|
self.sosNPC = self.__generateSOS(exterior.difficulty)
|
||||||
|
|
||||||
self.shopOwnerNpcId = 0
|
self.shopOwnerNpcId = 0
|
||||||
|
|
||||||
self.extZoneId, self.zoneId = exterior.getExteriorAndInteriorZoneId()
|
self.extZoneId, self.zoneId = exterior.getExteriorAndInteriorZoneId()
|
||||||
npcIdList = NPCToons.zone2NpcDict.get(self.zoneId, [])
|
npcIdList = NPCToons.zone2NpcDict.get(self.zoneId, [])
|
||||||
|
|
||||||
if len(npcIdList) == 0:
|
if len(npcIdList) == 0:
|
||||||
self.notify.info('No NPC in taken cogdo at %s' % self.zoneId)
|
self.notify.info('No NPC in taken cogdo at %s' % self.zoneId)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if len(npcIdList) > 1:
|
if len(npcIdList) > 1:
|
||||||
self.notify.warning('Multiple NPCs in taken cogdo at %s' % self.zoneId)
|
self.notify.warning('Multiple NPCs in taken cogdo at %s' % self.zoneId)
|
||||||
|
@ -63,9 +60,7 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
self.planner = self.exterior.planner
|
self.planner = self.exterior.planner
|
||||||
self.savedByMap = { }
|
self.savedByMap = { }
|
||||||
self.battle = None
|
self.battle = None
|
||||||
|
|
||||||
self.FOType = exterior.track
|
self.FOType = exterior.track
|
||||||
|
|
||||||
self.gameFloor = 1
|
self.gameFloor = 1
|
||||||
self.battleFloor = 2
|
self.battleFloor = 2
|
||||||
self.barrelFloor = -1
|
self.barrelFloor = -1
|
||||||
|
@ -167,7 +162,6 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
toonId = self.air.getAvatarIdFromSender()
|
toonId = self.air.getAvatarIdFromSender()
|
||||||
if self.ignoreResponses == 1:
|
if self.ignoreResponses == 1:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
elif self.toons.count(toonId) == 0:
|
elif self.toons.count(toonId) == 0:
|
||||||
self.notify.warning('elevatorDone() - toon not in toon list: %d' % toonId)
|
self.notify.warning('elevatorDone() - toon not in toon list: %d' % toonId)
|
||||||
|
|
||||||
|
@ -177,10 +171,8 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
if self.FOType == "s":
|
if self.FOType == "s":
|
||||||
self.game = DistCogdoMazeGameAI.DistCogdoMazeGameAI(self.air)
|
self.game = DistCogdoMazeGameAI.DistCogdoMazeGameAI(self.air)
|
||||||
self.game.setNumSuits(CogdoMazeGameGlobals.NumSuits)
|
self.game.setNumSuits(CogdoMazeGameGlobals.NumSuits)
|
||||||
|
|
||||||
elif self.FOType == "l":
|
elif self.FOType == "l":
|
||||||
self.game = DistCogdoFlyingGameAI.DistCogdoFlyingGameAI(self.air)
|
self.game = DistCogdoFlyingGameAI.DistCogdoFlyingGameAI(self.air)
|
||||||
|
|
||||||
elif self.FOType == "m":
|
elif self.FOType == "m":
|
||||||
self.game = DistCogdoCraneGameAI.DistCogdoCraneGameAI(self.air)
|
self.game = DistCogdoCraneGameAI.DistCogdoCraneGameAI(self.air)
|
||||||
|
|
||||||
|
@ -235,11 +227,9 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
if self.curFloor == self.battleFloor:
|
if self.curFloor == self.battleFloor:
|
||||||
self.planner.myPrint()
|
self.planner.myPrint()
|
||||||
suitHandles = self.planner.genFloorSuits(0)
|
suitHandles = self.planner.genFloorSuits(0)
|
||||||
|
|
||||||
self.suits = suitHandles['activeSuits']
|
self.suits = suitHandles['activeSuits']
|
||||||
self.activeSuits = self.suits[:]
|
self.activeSuits = self.suits[:]
|
||||||
self.reserveSuits = suitHandles['reserveSuits']
|
self.reserveSuits = suitHandles['reserveSuits']
|
||||||
|
|
||||||
self.d_setSuits()
|
self.d_setSuits()
|
||||||
|
|
||||||
def exitElevator(self):
|
def exitElevator(self):
|
||||||
|
@ -248,11 +238,9 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
def serverElevatorDone(self):
|
def serverElevatorDone(self):
|
||||||
if self.curFloor == self.gameFloor:
|
if self.curFloor == self.gameFloor:
|
||||||
self.d_setState('Game')
|
self.d_setState('Game')
|
||||||
|
|
||||||
elif self.curFloor == self.battleFloor:
|
elif self.curFloor == self.battleFloor:
|
||||||
self.b_setState('BattleIntro')
|
self.b_setState('BattleIntro')
|
||||||
self.timer.startCallback(BATTLE_INTRO_DURATION, self.battleIntroDone)
|
self.timer.startCallback(BATTLE_INTRO_DURATION, self.battleIntroDone)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Unknown floor %s (track=%s)' % (self.curFloor, self.FOType))
|
self.notify.warning('Unknown floor %s (track=%s)' % (self.curFloor, self.FOType))
|
||||||
|
|
||||||
|
@ -284,18 +272,14 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
def barrelRewardDone(self):
|
def barrelRewardDone(self):
|
||||||
if not self.air:
|
if not self.air:
|
||||||
return
|
return
|
||||||
|
|
||||||
barrelPlanner = SuitPlannerCogdoInteriorAI(self.exterior._cogdoLayout, max(0, self.exterior.difficulty - 5),
|
barrelPlanner = SuitPlannerCogdoInteriorAI(self.exterior._cogdoLayout, max(0, self.exterior.difficulty - 5),
|
||||||
self.FOType, self.exterior.getExteriorAndInteriorZoneId()[1])
|
self.FOType, self.exterior.getExteriorAndInteriorZoneId()[1])
|
||||||
barrelPlanner.myPrint()
|
barrelPlanner.myPrint()
|
||||||
suitHandles = barrelPlanner.genFloorSuits(0)
|
suitHandles = barrelPlanner.genFloorSuits(0)
|
||||||
|
|
||||||
self.suits = suitHandles['activeSuits']
|
self.suits = suitHandles['activeSuits']
|
||||||
self.activeSuits = self.suits[:]
|
self.activeSuits = self.suits[:]
|
||||||
self.reserveSuits = suitHandles['reserveSuits']
|
self.reserveSuits = suitHandles['reserveSuits']
|
||||||
|
|
||||||
self.d_setSuits()
|
self.d_setSuits()
|
||||||
|
|
||||||
self.battleIntroDone()
|
self.battleIntroDone()
|
||||||
|
|
||||||
def handleAllAboard(self, seats):
|
def handleAllAboard(self, seats):
|
||||||
|
@ -306,7 +290,6 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
if numOfEmptySeats == 4:
|
if numOfEmptySeats == 4:
|
||||||
self.exterior.deleteSuitInterior()
|
self.exterior.deleteSuitInterior()
|
||||||
return
|
return
|
||||||
|
|
||||||
elif not 0 <= numOfEmptySeats <= 3:
|
elif not 0 <= numOfEmptySeats <= 3:
|
||||||
self.notify.error('Bad number of empty seats: %s' % numOfEmptySeats)
|
self.notify.error('Bad number of empty seats: %s' % numOfEmptySeats)
|
||||||
|
|
||||||
|
@ -316,7 +299,6 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
|
|
||||||
self.toons = filter(None, seats)
|
self.toons = filter(None, seats)
|
||||||
self.d_setToons()
|
self.d_setToons()
|
||||||
|
|
||||||
self.request('Elevator')
|
self.request('Elevator')
|
||||||
|
|
||||||
def enterGame(self):
|
def enterGame(self):
|
||||||
|
@ -361,9 +343,7 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
self.battle.helpfulToons = self.helpfulToons
|
self.battle.helpfulToons = self.helpfulToons
|
||||||
self.battle.setInitialMembers(self.toons, self.suits)
|
self.battle.setInitialMembers(self.toons, self.suits)
|
||||||
self.battle.generateWithRequired(self.zoneId)
|
self.battle.generateWithRequired(self.zoneId)
|
||||||
|
|
||||||
mult = getCreditMultiplier(self.curFloor)
|
mult = getCreditMultiplier(self.curFloor)
|
||||||
|
|
||||||
self.battle.battleCalc.setSkillCreditMultiplier(self.battle.battleCalc.getSkillCreditMultiplier() * mult)
|
self.battle.battleCalc.setSkillCreditMultiplier(self.battle.battleCalc.getSkillCreditMultiplier() * mult)
|
||||||
|
|
||||||
def enterBattleDone(self, toonIds):
|
def enterBattleDone(self, toonIds):
|
||||||
|
@ -374,17 +354,14 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
if toonIds.count(toon) == 0:
|
if toonIds.count(toon) == 0:
|
||||||
deadToons.append(toon)
|
deadToons.append(toon)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for toon in deadToons:
|
for toon in deadToons:
|
||||||
self.removeToon(toon)
|
self.removeToon(toon)
|
||||||
|
|
||||||
self.d_setToons()
|
self.d_setToons()
|
||||||
if len(self.toons) == 0:
|
if len(self.toons) == 0:
|
||||||
self.exterior.deleteSuitInterior()
|
self.exterior.deleteSuitInterior()
|
||||||
|
|
||||||
elif self.curFloor == self.topFloor:
|
elif self.curFloor == self.topFloor:
|
||||||
self.battle.resume(self.curFloor, topFloor = 1)
|
self.battle.resume(self.curFloor, topFloor = 1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.battle.resume(self.curFloor, topFloor = 0)
|
self.battle.resume(self.curFloor, topFloor = 0)
|
||||||
|
|
||||||
|
@ -489,11 +466,9 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
if self.FOType == 's':
|
if self.FOType == 's':
|
||||||
if not toon.attemptAddNPCFriend(self.sosNPC):
|
if not toon.attemptAddNPCFriend(self.sosNPC):
|
||||||
self.notify.info('%s unable to add NPCFriend %s to %s.' % (self.doId, self.sosNPC, v))
|
self.notify.info('%s unable to add NPCFriend %s to %s.' % (self.doId, self.sosNPC, v))
|
||||||
|
|
||||||
elif self.FOType == 'l':
|
elif self.FOType == 'l':
|
||||||
reward = self.getEmblemsReward()
|
reward = self.getEmblemsReward()
|
||||||
toon.addEmblems(reward)
|
toon.addEmblems(reward)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.notify.warning('%s unable to reward %s: unknown reward for track %s' % (self.doId, v, self.FOType))
|
self.notify.warning('%s unable to reward %s: unknown reward for track %s' % (self.doId, v, self.FOType))
|
||||||
|
|
||||||
|
@ -542,18 +517,17 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM):
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
|
||||||
def getEmblemsReward(self):
|
def getEmblemsReward(self):
|
||||||
hoodIdMap = {2: .5, # ttc
|
hoodIdMap = {2: .5, # Toontown Central
|
||||||
1: 1., # dd
|
1: 1., # Donald's Dock
|
||||||
5: 1.5, # dg
|
5: 1.5, # Daisy Gardens
|
||||||
4: 2., # mm
|
4: 2., # Minnie's Melodyland
|
||||||
3: 2.7, # br
|
3: 2.7, # The Brrrgh
|
||||||
9: 3.5, # dl
|
9: 3.5, # Donald's Dreamland
|
||||||
7: 4 # ff
|
7: 4 # Funny Farm
|
||||||
}
|
}
|
||||||
|
|
||||||
hoodValue = hoodIdMap[int(self.exterior.zoneId // 1000)]
|
hoodValue = hoodIdMap[int(self.exterior.zoneId // 1000)]
|
||||||
diff = max(self.exterior.difficulty, 1)
|
diff = max(self.exterior.difficulty, 1)
|
||||||
memos = self.game.getTotalMemos()
|
memos = self.game.getTotalMemos()
|
||||||
|
|
||||||
E = (hoodValue * max(memos, 1) * diff) / 2.5
|
E = (hoodValue * max(memos, 1) * diff) / 2.5
|
||||||
return divmod(E, 100)[::-1]
|
return divmod(E, 100)[::-1]
|
||||||
|
|
|
@ -20,7 +20,7 @@ def filterReviveChance(track, revive):
|
||||||
return revive
|
return revive
|
||||||
|
|
||||||
return random.randint(config.GetInt('min-lt-vs', 0), config.GetInt('max-lt-vs', 2))
|
return random.randint(config.GetInt('min-lt-vs', 0), config.GetInt('max-lt-vs', 2))
|
||||||
# implements difficulty 19 / LT
|
# Implements difficulty 19 / LT.
|
||||||
|
|
||||||
def getMaxReserves(track):
|
def getMaxReserves(track):
|
||||||
return int(math.ceil(MAX_RESERVES[track]))
|
return int(math.ceil(MAX_RESERVES[track]))
|
||||||
|
@ -32,7 +32,6 @@ class SuitPlannerCogdoInteriorAI:
|
||||||
self.zoneId = zoneId
|
self.zoneId = zoneId
|
||||||
self.numFloors = layout.getNumFloors()
|
self.numFloors = layout.getNumFloors()
|
||||||
difficulty = min(difficulty + 4, len(SuitBuildingGlobals.SuitBuildingInfo) - 1)
|
difficulty = min(difficulty + 4, len(SuitBuildingGlobals.SuitBuildingInfo) - 1)
|
||||||
|
|
||||||
self.respectInvasions = 1
|
self.respectInvasions = 1
|
||||||
|
|
||||||
if isinstance(difficulty, types.StringType):
|
if isinstance(difficulty, types.StringType):
|
||||||
|
@ -63,7 +62,6 @@ class SuitPlannerCogdoInteriorAI:
|
||||||
|
|
||||||
if numActive == 1:
|
if numActive == 1:
|
||||||
newBossSpot = numActive - 1
|
newBossSpot = numActive - 1
|
||||||
|
|
||||||
else:
|
else:
|
||||||
newBossSpot = numActive - 2
|
newBossSpot = numActive - 2
|
||||||
|
|
||||||
|
@ -75,7 +73,6 @@ class SuitPlannerCogdoInteriorAI:
|
||||||
|
|
||||||
if len(bldgInfo) > SuitBuildingGlobals.SUIT_BLDG_INFO_REVIVES:
|
if len(bldgInfo) > SuitBuildingGlobals.SUIT_BLDG_INFO_REVIVES:
|
||||||
revives = bldgInfo[SuitBuildingGlobals.SUIT_BLDG_INFO_REVIVES][0]
|
revives = bldgInfo[SuitBuildingGlobals.SUIT_BLDG_INFO_REVIVES][0]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
revives = 0
|
revives = 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue