From 84dc9372cfa225bc83cef32bb3a83d631730bcb6 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 31 Aug 2015 20:10:57 +0300 Subject: [PATCH] Holocaust elevator antishuffle --- dependencies/astron/dclass/stride.dc | 36 ++++++------ toontown/building/DistributedBBElevatorAI.py | 4 +- .../building/DistributedBossElevatorAI.py | 4 +- toontown/building/DistributedCFOElevatorAI.py | 4 +- toontown/building/DistributedCJElevatorAI.py | 4 +- toontown/building/DistributedClubElevator.py | 7 +-- .../building/DistributedClubElevatorAI.py | 13 ++--- toontown/building/DistributedElevator.py | 57 +++++++------------ toontown/building/DistributedElevatorAI.py | 33 +---------- toontown/building/DistributedElevatorExt.py | 2 - toontown/building/DistributedElevatorExtAI.py | 35 ++---------- toontown/building/DistributedElevatorFSM.py | 57 +++++++------------ toontown/building/DistributedElevatorFSMAI.py | 34 +---------- toontown/building/DistributedElevatorFloor.py | 3 +- .../building/DistributedElevatorFloorAI.py | 13 ++--- toontown/building/DistributedVPElevatorAI.py | 4 +- toontown/building/Elevator.py | 8 --- toontown/building/ElevatorConstants.py | 9 ++- toontown/coghq/DistributedCogKart.py | 4 +- .../coghq/DistributedFactoryElevatorExtAI.py | 4 +- .../DistributedLawOfficeElevatorExtAI.py | 4 +- .../coghq/DistributedMintElevatorExtAI.py | 4 +- toontown/hood/CashbotHQAI.py | 3 +- toontown/hood/CogHQAI.py | 2 +- toontown/hood/LawbotHQAI.py | 3 +- toontown/toon/LocalToon.py | 1 - toontown/toonbase/TTLocalizerEnglish.py | 2 - 27 files changed, 101 insertions(+), 253 deletions(-) diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index 5cc646c6..51b805ab 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -1829,19 +1829,17 @@ dclass DistributedElevator : DistributedObject { fillSlot5(uint32, uint8) broadcast ram; fillSlot6(uint32, uint8) broadcast ram; fillSlot7(uint32, uint8) broadcast ram; - emptySlot0(uint32, int8, int16, int16) broadcast ram; - emptySlot1(uint32, int8, int16, int16) broadcast ram; - emptySlot2(uint32, int8, int16, int16) broadcast ram; - emptySlot3(uint32, int8, int16, int16) broadcast ram; - emptySlot4(uint32, int8, int16, int16) broadcast ram; - emptySlot5(uint32, int8, int16, int16) broadcast ram; - emptySlot6(uint32, int8, int16, int16) broadcast ram; - emptySlot7(uint32, int8, int16, int16) broadcast ram; + emptySlot0(uint32, int16, int16) broadcast ram; + emptySlot1(uint32, int16, int16) broadcast ram; + emptySlot2(uint32, int16, int16) broadcast ram; + emptySlot3(uint32, int16, int16) broadcast ram; + emptySlot4(uint32, int16, int16) broadcast ram; + emptySlot5(uint32, int16, int16) broadcast ram; + emptySlot6(uint32, int16, int16) broadcast ram; + emptySlot7(uint32, int16, int16) broadcast ram; requestBoard() airecv clsend; rejectBoard(uint32, uint8); requestExit() airecv clsend; - setElevatorTripId(uint32) required broadcast ram; - setAntiShuffle(uint8) required broadcast ram; }; dclass DistributedElevatorFSM : DistributedObject { @@ -1855,19 +1853,17 @@ dclass DistributedElevatorFSM : DistributedObject { fillSlot5(uint32) broadcast ram; fillSlot6(uint32) broadcast ram; fillSlot7(uint32) broadcast ram; - emptySlot0(uint32, int8, int16) broadcast ram; - emptySlot1(uint32, int8, int16) broadcast ram; - emptySlot2(uint32, int8, int16) broadcast ram; - emptySlot3(uint32, int8, int16) broadcast ram; - emptySlot4(uint32, int8, int16) broadcast ram; - emptySlot5(uint32, int8, int16) broadcast ram; - emptySlot6(uint32, int8, int16) broadcast ram; - emptySlot7(uint32, int8, int16) broadcast ram; + emptySlot0(uint32, int16) broadcast ram; + emptySlot1(uint32, int16) broadcast ram; + emptySlot2(uint32, int16) broadcast ram; + emptySlot3(uint32, int16) broadcast ram; + emptySlot4(uint32, int16) broadcast ram; + emptySlot5(uint32, int16) broadcast ram; + emptySlot6(uint32, int16) broadcast ram; + emptySlot7(uint32, int16) broadcast ram; requestBoard() airecv clsend; rejectBoard(uint32, uint8); requestExit() airecv clsend; - setElevatorTripId(uint32) required broadcast ram; - setAntiShuffle(uint8) required broadcast ram; }; dclass DistributedElevatorFloor : DistributedElevatorFSM { diff --git a/toontown/building/DistributedBBElevatorAI.py b/toontown/building/DistributedBBElevatorAI.py index 8e2095d9..f953e91e 100755 --- a/toontown/building/DistributedBBElevatorAI.py +++ b/toontown/building/DistributedBBElevatorAI.py @@ -3,7 +3,7 @@ import DistributedBossElevatorAI class DistributedBBElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI): - def __init__(self, air, bldg, zone, antiShuffle = 0): - DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle) + def __init__(self, air, bldg, zone): + DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone) self.type = ELEVATOR_BB self.countdownTime = ElevatorData[self.type]['countdown'] \ No newline at end of file diff --git a/toontown/building/DistributedBossElevatorAI.py b/toontown/building/DistributedBossElevatorAI.py index a020c10d..bdb43f91 100755 --- a/toontown/building/DistributedBossElevatorAI.py +++ b/toontown/building/DistributedBossElevatorAI.py @@ -12,8 +12,8 @@ from toontown.suit import DistributedSellbotBossAI class DistributedBossElevatorAI(DistributedElevatorExtAI.DistributedElevatorExtAI): - def __init__(self, air, bldg, zone, antiShuffle = 0): - DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, numSeats=8, antiShuffle=antiShuffle) + def __init__(self, air, bldg, zone): + DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, numSeats=8) self.zone = zone self.type = ELEVATOR_VP self.countdownTime = ElevatorData[self.type]['countdown'] diff --git a/toontown/building/DistributedCFOElevatorAI.py b/toontown/building/DistributedCFOElevatorAI.py index 4f75cd8d..9d93acba 100755 --- a/toontown/building/DistributedCFOElevatorAI.py +++ b/toontown/building/DistributedCFOElevatorAI.py @@ -3,7 +3,7 @@ import DistributedBossElevatorAI class DistributedCFOElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI): - def __init__(self, air, bldg, zone, antiShuffle = 0): - DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle) + def __init__(self, air, bldg, zone): + DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone) self.type = ELEVATOR_CFO self.countdownTime = ElevatorData[self.type]['countdown'] diff --git a/toontown/building/DistributedCJElevatorAI.py b/toontown/building/DistributedCJElevatorAI.py index d3821778..ce3e11fb 100755 --- a/toontown/building/DistributedCJElevatorAI.py +++ b/toontown/building/DistributedCJElevatorAI.py @@ -3,7 +3,7 @@ import DistributedBossElevatorAI class DistributedCJElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI): - def __init__(self, air, bldg, zone, antiShuffle = 0): - DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle) + def __init__(self, air, bldg, zone): + DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone) self.type = ELEVATOR_CJ self.countdownTime = ElevatorData[self.type]['countdown'] diff --git a/toontown/building/DistributedClubElevator.py b/toontown/building/DistributedClubElevator.py index 1cd7783c..7b1cf4e6 100755 --- a/toontown/building/DistributedClubElevator.py +++ b/toontown/building/DistributedClubElevator.py @@ -306,9 +306,8 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM): return self.elevatorModel def kickEveryoneOut(self): - bailFlag = 0 for avId, slot in self.boardedAvIds.items(): - self.emptySlot(slot, avId, bailFlag, globalClockDelta.getRealNetworkTime()) + self.emptySlot(slot, avId, globalClockDelta.getRealNetworkTime()) if avId == base.localAvatar.doId: pass @@ -450,7 +449,7 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM): jumpTrack = Sequence(Parallel(toonJumpTrack, Sequence(Wait(1), toonSitTrack)), Func(av.wrtReparentTo, self.golfKart)) return jumpTrack - def emptySlot(self, index, avId, bailFlag, timestamp): + def emptySlot(self, index, avId, timestamp, timeSent=0): if avId == 0: pass elif not self.isSetup: @@ -461,7 +460,7 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM): self.deferredSlots = newSlots elif avId in self.cr.doId2do: - if bailFlag == 1 and hasattr(self, 'clockNode'): + if hasattr(self, 'clockNode'): if timestamp < self.countdownTime and timestamp >= 0: self.countdown(self.countdownTime - timestamp) else: diff --git a/toontown/building/DistributedClubElevatorAI.py b/toontown/building/DistributedClubElevatorAI.py index 9be1de41..9157e2d0 100755 --- a/toontown/building/DistributedClubElevatorAI.py +++ b/toontown/building/DistributedClubElevatorAI.py @@ -41,13 +41,12 @@ class DistributedClubElevatorAI(DistributedElevatorFSMAI.DistributedElevatorFSMA id = 0 DoBlockedRoomCheck = simbase.config.GetBool('elevator-blocked-rooms-check', 1) - def __init__(self, air, lawOfficeId, bldg, avIds, markerId = None, numSeats = 4, antiShuffle = 0): - DistributedElevatorFSMAI.DistributedElevatorFSMAI.__init__(self, air, bldg, numSeats, antiShuffle = antiShuffle) + def __init__(self, air, lawOfficeId, bldg, avIds, markerId = None, numSeats = 4): + DistributedElevatorFSMAI.DistributedElevatorFSMAI.__init__(self, air, bldg, numSeats) FSM.__init__(self, 'ElevatorFloor_%s_FSM' % self.id) self.type = ElevatorConstants.ELEVATOR_COUNTRY_CLUB self.countdownTime = ElevatorConstants.ElevatorData[self.type]['countdown'] self.lawOfficeId = lawOfficeId - self.anyToonsBailed = 0 self.avIds = avIds self.isEntering = 0 self.isLocked = 0 @@ -121,12 +120,8 @@ class DistributedClubElevatorAI(DistributedElevatorFSMAI.DistributedElevatorFSMA if seatIndex == None: pass self.clearFullNow(seatIndex) - bailFlag = 0 - if self.anyToonsBailed == 0: - bailFlag = 1 - self.resetCountdown() - self.anyToonsBailed = 1 - self.sendUpdate('emptySlot' + str(seatIndex), [avId, bailFlag, globalClockDelta.getRealNetworkTime()]) + self.resetCountdown() + self.sendUpdate('emptySlot' + str(seatIndex), [avId, globalClockDelta.getRealNetworkTime()]) if self.countFullSeats() == 0: self.request('WaitEmpty') taskMgr.doMethodLater(ElevatorConstants.TOON_EXIT_ELEVATOR_TIME, self.clearEmptyNow, self.uniqueName('clearEmpty-%s' % seatIndex), extraArgs = (seatIndex,)) diff --git a/toontown/building/DistributedElevator.py b/toontown/building/DistributedElevator.py index 8f0ad08a..3a901b0d 100755 --- a/toontown/building/DistributedElevator.py +++ b/toontown/building/DistributedElevator.py @@ -250,29 +250,29 @@ class DistributedElevator(DistributedObject.DistributedObject): self.boardedAvIds[avId] = None return - def emptySlot0(self, avId, bailFlag, timestamp, time): - self.emptySlot(0, avId, bailFlag, timestamp, time) + def emptySlot0(self, avId, timestamp, time): + self.emptySlot(0, avId, timestamp, time) - def emptySlot1(self, avId, bailFlag, timestamp, time): - self.emptySlot(1, avId, bailFlag, timestamp, time) + def emptySlot1(self, avId, timestamp, time): + self.emptySlot(1, avId, timestamp, time) - def emptySlot2(self, avId, bailFlag, timestamp, time): - self.emptySlot(2, avId, bailFlag, timestamp, time) + def emptySlot2(self, avId, timestamp, time): + self.emptySlot(2, avId, timestamp, time) - def emptySlot3(self, avId, bailFlag, timestamp, time): - self.emptySlot(3, avId, bailFlag, timestamp, time) + def emptySlot3(self, avId, timestamp, time): + self.emptySlot(3, avId, timestamp, time) - def emptySlot4(self, avId, bailFlag, timestamp, time): - self.emptySlot(4, avId, bailFlag, timestamp, time) + def emptySlot4(self, avId, timestamp, time): + self.emptySlot(4, avId, timestamp, time) - def emptySlot5(self, avId, bailFlag, timestamp, time): - self.emptySlot(5, avId, bailFlag, timestamp) + def emptySlot5(self, avId, timestamp, time): + self.emptySlot(5, avId, timestamp) - def emptySlot6(self, avId, bailFlag, timestamp, time): - self.emptySlot(6, avId, bailFlag, timestamp, time) + def emptySlot6(self, avId, timestamp, time): + self.emptySlot(6, avId, timestamp, time) - def emptySlot7(self, avId, bailFlag, timestamp, time): - self.emptySlot(7, avId, bailFlag, timestamp, time) + def emptySlot7(self, avId, timestamp, time): + self.emptySlot(7, avId, timestamp, time) def notifyToonOffElevator(self, toon): toon.setAnimState('neutral', 1.0) @@ -285,7 +285,7 @@ class DistributedElevator(DistributedObject.DistributedObject): else: toon.startSmooth() - def emptySlot(self, index, avId, bailFlag, timestamp, timeSent = 0): + def emptySlot(self, index, avId, timestamp, timeSent = 0): if self.fillSlotTrack: self.fillSlotTrack.finish() self.fillSlotTrack = None @@ -303,7 +303,7 @@ class DistributedElevator(DistributedObject.DistributedObject): if timeSent > 0: timeToSet = timeSent if avId in self.cr.doId2do: - if bailFlag == 1 and hasattr(self, 'clockNode'): + if hasattr(self, 'clockNode'): if timestamp < timeToSet and timestamp >= 0: self.countdown(timeToSet - timestamp) else: @@ -333,18 +333,14 @@ class DistributedElevator(DistributedObject.DistributedObject): def handleEnterSphere(self, collEntry): self.notify.debug('Entering Elevator Sphere....') - if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId: - self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE) - elif base.localAvatar.hp > 0: + if base.localAvatar.hp > 0: self.cr.playGame.getPlace().detectedElevatorCollision(self) toon = base.localAvatar self.sendUpdate('requestBoard', []) def rejectBoard(self, avId, reason = 0): if hasattr(base.localAvatar, 'elevatorNotifier'): - if reason == REJECT_SHUFFLE: - base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorHoppedOff) - elif reason == REJECT_PROMOTION: + if reason == REJECT_PROMOTION: base.localAvatar.elevatorNotifier.showMe(TTLocalizer.BossElevatorRejectMessage) doneStatus = {'where': 'reject'} elevator = self.getPlaceElevator() @@ -368,7 +364,6 @@ class DistributedElevator(DistributedObject.DistributedObject): return taskMgr.add(countdownTask, self.uniqueName('elevatorTimerTask')) def handleExitButton(self): - localAvatar.lastElevatorLeft = self.elevatorTripId self.sendUpdate('requestExit') def enterWaitCountdown(self, ts): @@ -481,18 +476,6 @@ class DistributedElevator(DistributedObject.DistributedObject): self.notify.warning("Place didn't exist") return None - def setElevatorTripId(self, id): - self.elevatorTripId = id - - def getElevatorTripId(self): - return self.elevatorTripId - - def setAntiShuffle(self, antiShuffle): - self.antiShuffle = antiShuffle - - def getAntiShuffle(self): - return self.antiShuffle - def storeToonTrack(self, avId, track): self.clearToonTrack(avId) self.__toonTracks[avId] = track diff --git a/toontown/building/DistributedElevatorAI.py b/toontown/building/DistributedElevatorAI.py index 93151702..0e20833c 100755 --- a/toontown/building/DistributedElevatorAI.py +++ b/toontown/building/DistributedElevatorAI.py @@ -11,21 +11,13 @@ from direct.directnotify import DirectNotifyGlobal class DistributedElevatorAI(DistributedObjectAI.DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedElevatorAI') - def __init__(self, air, bldg, numSeats = 4, antiShuffle = 0): + def __init__(self, air, bldg, numSeats = 4): DistributedObjectAI.DistributedObjectAI.__init__(self, air) self.type = ELEVATOR_NORMAL self.countdownTime = ElevatorData[self.type]['countdown'] self.bldg = bldg self.bldgDoId = bldg.getDoId() self.seats = [] - self.setAntiShuffle(antiShuffle) - if self.antiShuffle: - if not hasattr(simbase.air, 'elevatorTripId'): - simbase.air.elevatorTripId = 1 - self.elevatorTripId = simbase.air.elevatorTripId - simbase.air.elevatorTripId += 1 - else: - self.elevatorTripId = 0 for seat in xrange(numSeats): self.seats.append(None) @@ -237,7 +229,6 @@ class DistributedElevatorAI(DistributedObjectAI.DistributedObjectAI): def exitWaitCountdown(self): self.accepting = 0 taskMgr.remove(self.uniqueName('countdown-timer')) - self.newTrip() def enterAllAboard(self): self.accepting = 0 @@ -265,24 +256,4 @@ class DistributedElevatorAI(DistributedObjectAI.DistributedObjectAI): self.accepting = 1 def exitWaitEmpty(self): - self.accepting = 0 - - def setElevatorTripId(self, id): - self.elevatorTripId = id - - def getElevatorTripId(self): - return self.elevatorTripId - - def newTrip(self): - if self.antiShuffle: - self.elevatorTripId = simbase.air.elevatorTripId - if simbase.air.elevatorTripId > 2100000000: - simbase.air.elevatorTripId = 1 - simbase.air.elevatorTripId += 1 - self.sendUpdate('setElevatorTripId', [self.elevatorTripId]) - - def setAntiShuffle(self, antiShuffle): - self.antiShuffle = antiShuffle - - def getAntiShuffle(self): - return self.antiShuffle \ No newline at end of file + self.accepting = 0 \ No newline at end of file diff --git a/toontown/building/DistributedElevatorExt.py b/toontown/building/DistributedElevatorExt.py index ad33cfa2..2fc3a673 100755 --- a/toontown/building/DistributedElevatorExt.py +++ b/toontown/building/DistributedElevatorExt.py @@ -99,8 +99,6 @@ class DistributedElevatorExt(DistributedElevator.DistributedElevator): if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId): if localAvatar.boardingParty.getGroupLeader(localAvatar.doId) == localAvatar.doId: localAvatar.boardingParty.handleEnterElevator(self) - elif self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId: - self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE) elif base.localAvatar.hp > 0: toon = base.localAvatar self.sendUpdate('requestBoard', []) diff --git a/toontown/building/DistributedElevatorExtAI.py b/toontown/building/DistributedElevatorExtAI.py index 58f3b041..426a46c8 100755 --- a/toontown/building/DistributedElevatorExtAI.py +++ b/toontown/building/DistributedElevatorExtAI.py @@ -11,11 +11,9 @@ from direct.directnotify import DirectNotifyGlobal class DistributedElevatorExtAI(DistributedElevatorAI.DistributedElevatorAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedElevatorExtAI') - def __init__(self, air, bldg, numSeats = 4, antiShuffle = 0): - DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg, numSeats, antiShuffle=antiShuffle) - self.anyToonsBailed = 0 + def __init__(self, air, bldg, numSeats = 4): + DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg, numSeats) self.boardingParty = None - return def delete(self): for seatIndex in xrange(len(self.seats)): @@ -52,33 +50,11 @@ class DistributedElevatorExtAI(DistributedElevatorAI.DistributedElevatorAI): pass else: self.clearFullNow(seatIndex) - bailFlag = 0 + self.s timeToSend = self.countdownTime - if self.antiShuffle: - myTask = taskMgr.getTasksNamed(self.uniqueName('countdown-timer'))[0] - timeLeft = myTask.wakeTime - globalClock.getFrameTime() - timeLeft = max(0, timeLeft) - timeToSet = timeLeft + 10.0 - timeToSet = min(timeLeft + 10.0, self.countdownTime) - self.setCountdown(timeToSet) - timeToSend = timeToSet - self.sendUpdate('emptySlot' + str(seatIndex), [avId, - 1, + self.sendUpdate('emptySlot' + str(seatIndex), [avId, globalClockDelta.getRealNetworkTime(), - timeToSend]) - elif self.anyToonsBailed == 0: - bailFlag = 1 - self.resetCountdown() - self.anyToonsBailed = 1 - self.sendUpdate('emptySlot' + str(seatIndex), [avId, - bailFlag, - globalClockDelta.getRealNetworkTime(), - timeToSend]) - else: - self.sendUpdate('emptySlot' + str(seatIndex), [avId, - bailFlag, - globalClockDelta.getRealNetworkTime(), - timeToSend]) + self.countdownTime]) if self.countFullSeats() == 0: self.fsm.request('waitEmpty') taskMgr.doMethodLater(TOON_EXIT_ELEVATOR_TIME, self.clearEmptyNow, self.uniqueName('clearEmpty-%s' % seatIndex), extraArgs=(seatIndex,)) @@ -94,7 +70,6 @@ class DistributedElevatorExtAI(DistributedElevatorAI.DistributedElevatorAI): def enterWaitEmpty(self): DistributedElevatorAI.DistributedElevatorAI.enterWaitEmpty(self) - self.anyToonsBailed = 0 def enterWaitCountdown(self): DistributedElevatorAI.DistributedElevatorAI.enterWaitCountdown(self) diff --git a/toontown/building/DistributedElevatorFSM.py b/toontown/building/DistributedElevatorFSM.py index e24c6110..5e0cb737 100755 --- a/toontown/building/DistributedElevatorFSM.py +++ b/toontown/building/DistributedElevatorFSM.py @@ -223,29 +223,29 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): track.start() self.boardedAvIds[avId] = index - def emptySlot0(self, avId, bailFlag, timestamp): - self.emptySlot(0, avId, bailFlag, timestamp) + def emptySlot0(self, avId, timestamp): + self.emptySlot(0, avId, timestamp) - def emptySlot1(self, avId, bailFlag, timestamp): - self.emptySlot(1, avId, bailFlag, timestamp) + def emptySlot1(self, avId, timestamp): + self.emptySlot(1, avId, timestamp) - def emptySlot2(self, avId, bailFlag, timestamp): - self.emptySlot(2, avId, bailFlag, timestamp) + def emptySlot2(self, avId, timestamp): + self.emptySlot(2, avId, timestamp) - def emptySlot3(self, avId, bailFlag, timestamp): - self.emptySlot(3, avId, bailFlag, timestamp) + def emptySlot3(self, avId, timestamp): + self.emptySlot(3, avId, timestamp) - def emptySlot4(self, avId, bailFlag, timestamp): - self.emptySlot(4, avId, bailFlag, timestamp) + def emptySlot4(self, avId, timestamp): + self.emptySlot(4, avId, timestamp) - def emptySlot5(self, avId, bailFlag, timestamp): - self.emptySlot(5, avId, bailFlag, timestamp) + def emptySlot5(self, avId, timestamp): + self.emptySlot(5, avId, timestamp) - def emptySlot6(self, avId, bailFlag, timestamp): - self.emptySlot(6, avId, bailFlag, timestamp) + def emptySlot6(self, avId, timestamp): + self.emptySlot(6, avId, timestamp) - def emptySlot7(self, avId, bailFlag, timestamp): - self.emptySlot(7, avId, bailFlag, timestamp) + def emptySlot7(self, avId, timestamp): + self.emptySlot(7, avId, timestamp) def notifyToonOffElevator(self, toon): if self.cr: @@ -260,7 +260,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): toon.startSmooth() return - def emptySlot(self, index, avId, bailFlag, timestamp): + def emptySlot(self, index, avId, timestamp): print 'Emptying slot: %d for %d' % (index, avId) if avId == 0: pass @@ -272,7 +272,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): self.deferredSlots = newSlots elif avId in self.cr.doId2do: - if bailFlag == 1 and hasattr(self, 'clockNode'): + if hasattr(self, 'clockNode'): if timestamp < self.countdownTime and timestamp >= 0: self.countdown(self.countdownTime - timestamp) else: @@ -303,10 +303,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): def handleEnterSphere(self, collEntry): self.notify.debug('Entering Elevator Sphere....') - print 'FSMhandleEnterSphere elevator%s avatar%s' % (self.elevatorTripId, localAvatar.lastElevatorLeft) - if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId: - self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE) - elif base.localAvatar.hp > 0: + if base.localAvatar.hp > 0: self.cr.playGame.getPlace().detectedElevatorCollision(self) toon = base.localAvatar self.sendUpdate('requestBoard', []) @@ -314,9 +311,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): def rejectBoard(self, avId, reason = 0): print 'rejectBoard %s' % reason if hasattr(base.localAvatar, 'elevatorNotifier'): - if reason == REJECT_SHUFFLE: - base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorHoppedOff) - elif reason == REJECT_PROMOTION: + if reason == REJECT_PROMOTION: base.localAvatar.elevatorNotifier.showMe(TTLocalizer.BossElevatorRejectMessage) elif reason == REJECT_BLOCKED_ROOM: base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorBlockedRoom) @@ -461,17 +456,5 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM): point = self.elevatorPoints[index] return point - def setElevatorTripId(self, id): - self.elevatorTripId = id - - def getElevatorTripId(self): - return self.elevatorTripId - - def setAntiShuffle(self, antiShuffle): - self.antiShuffle = antiShuffle - - def getAntiShuffle(self): - return self.antiShuffle - def getDestName(self): return None diff --git a/toontown/building/DistributedElevatorFSMAI.py b/toontown/building/DistributedElevatorFSMAI.py index 3284a81b..6ca7ba5a 100755 --- a/toontown/building/DistributedElevatorFSMAI.py +++ b/toontown/building/DistributedElevatorFSMAI.py @@ -38,7 +38,7 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM): 'Opening'] } id = 0 - def __init__(self, air, bldg, numSeats = 4, antiShuffle = 0): + def __init__(self, air, bldg, numSeats = 4): DistributedObjectAI.DistributedObjectAI.__init__(self, air) FSM.__init__(self, 'Elevator_%s_FSM' % self.id) self.type = ELEVATOR_NORMAL @@ -49,15 +49,6 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM): for seat in xrange(numSeats): self.seats.append(None) self.accepting = 0 - self.setAntiShuffle(antiShuffle) - if self.antiShuffle: - if not hasattr(simbase.air, 'elevatorTripId'): - simbase.air.elevatorTripId = 1 - - self.elevatorTripId = simbase.air.elevatorTripId - simbase.air.elevatorTripId += 1 - else: - self.elevatorTripId = 0 def delete(self): del self.bldg @@ -216,7 +207,6 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM): def exitWaitCountdown(self): self.accepting = 0 taskMgr.remove(self.uniqueName('countdown-timer')) - self.newTrip() def enterAllAboard(self): self.accepting = 0 @@ -249,24 +239,4 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM): self.accepting = 1 def exitWaitEmpty(self): - self.accepting = 0 - - def setElevatorTripId(self, id): - self.elevatorTripId = id - - def getElevatorTripId(self): - return self.elevatorTripId - - def newTrip(self): - if self.antiShuffle: - self.elevatorTripId = simbase.air.elevatorTripId - if simbase.air.elevatorTripId > 2100000000: - simbase.air.elevatorTripId = 1 - simbase.air.elevatorTripId += 1 - self.sendUpdate('setElevatorTripId', [self.elevatorTripId]) - - def setAntiShuffle(self, antiShuffle): - self.antiShuffle = antiShuffle - - def getAntiShuffle(self): - return self.antiShuffle \ No newline at end of file + self.accepting = 0 \ No newline at end of file diff --git a/toontown/building/DistributedElevatorFloor.py b/toontown/building/DistributedElevatorFloor.py index 80027576..f96b3af9 100755 --- a/toontown/building/DistributedElevatorFloor.py +++ b/toontown/building/DistributedElevatorFloor.py @@ -264,9 +264,8 @@ class DistributedElevatorFloor(DistributedElevatorFSM.DistributedElevatorFSM): return self.elevatorModel def kickEveryoneOut(self): - bailFlag = 0 for avId, slot in self.boardedAvIds.items(): - self.emptySlot(slot, avId, bailFlag, globalClockDelta.getRealNetworkTime()) + self.emptySlot(slot, avId, globalClockDelta.getRealNetworkTime()) if avId == base.localAvatar.doId: pass diff --git a/toontown/building/DistributedElevatorFloorAI.py b/toontown/building/DistributedElevatorFloorAI.py index 32b9ea53..dcd7029b 100755 --- a/toontown/building/DistributedElevatorFloorAI.py +++ b/toontown/building/DistributedElevatorFloorAI.py @@ -40,13 +40,12 @@ class DistributedElevatorFloorAI(DistributedElevatorFSMAI.DistributedElevatorFSM 'Opening'] } id = 0 - def __init__(self, air, lawOfficeId, bldg, avIds, markerId = None, numSeats = 4, antiShuffle = 0): - DistributedElevatorFSMAI.DistributedElevatorFSMAI.__init__(self, air, bldg, numSeats, antiShuffle = antiShuffle) + def __init__(self, air, lawOfficeId, bldg, avIds, markerId = None, numSeats = 4): + DistributedElevatorFSMAI.DistributedElevatorFSMAI.__init__(self, air, bldg, numSeats) FSM.__init__(self, 'ElevatorFloor_%s_FSM' % self.id) self.type = ELEVATOR_STAGE self.countdownTime = ElevatorData[self.type]['countdown'] self.lawOfficeId = lawOfficeId - self.anyToonsBailed = 0 self.avIds = avIds self.isEntering = 0 self.isLocked = 0 @@ -120,12 +119,8 @@ class DistributedElevatorFloorAI(DistributedElevatorFSMAI.DistributedElevatorFSM if seatIndex == None: pass self.clearFullNow(seatIndex) - bailFlag = 0 - if self.anyToonsBailed == 0: - bailFlag = 1 - self.resetCountdown() - self.anyToonsBailed = 1 - self.sendUpdate('emptySlot' + str(seatIndex), [avId, bailFlag, globalClockDelta.getRealNetworkTime()]) + self.resetCountdown() + self.sendUpdate('emptySlot' + str(seatIndex), [avId, globalClockDelta.getRealNetworkTime()]) if self.countFullSeats() == 0: self.request('WaitEmpty') taskMgr.doMethodLater(TOON_EXIT_ELEVATOR_TIME, self.clearEmptyNow, self.uniqueName('clearEmpty-%s' % seatIndex), extraArgs = (seatIndex,)) diff --git a/toontown/building/DistributedVPElevatorAI.py b/toontown/building/DistributedVPElevatorAI.py index d172f705..2eaa9d3a 100755 --- a/toontown/building/DistributedVPElevatorAI.py +++ b/toontown/building/DistributedVPElevatorAI.py @@ -3,7 +3,7 @@ import DistributedBossElevatorAI class DistributedVPElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI): - def __init__(self, air, bldg, zone, antiShuffle = 0): - DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle) + def __init__(self, air, bldg, zone): + DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone) self.type = ELEVATOR_VP self.countdownTime = ElevatorData[self.type]['countdown'] diff --git a/toontown/building/Elevator.py b/toontown/building/Elevator.py index 027a7a47..e2f6c7ab 100755 --- a/toontown/building/Elevator.py +++ b/toontown/building/Elevator.py @@ -91,16 +91,8 @@ class Elevator(StateData.StateData): if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId) and localAvatar.boardingParty.getGroupLeader(localAvatar.doId) != localAvatar.doId: self.exitButton['command'] = None self.exitButton.hide() - if self.distElevator.antiShuffle: - self.hopWarning = DirectLabel(parent=self.exitButton, relief=None, pos=Vec3(0, 0, 0.0), text=TTLocalizer.ElevatorStayOff, text_fg=(0.9, 0.9, 0.9, 1), text_pos=(0, -1.1), text_scale=0.6) - self.hopWarning.reparentTo(self.exitButton.stateNodePath[2]) - else: - self.hopWarning = None - return def disableExitButton(self): - if self.hopWarning: - self.hopWarning.destroy() self.exitButton.destroy() def enterRequestExit(self): diff --git a/toontown/building/ElevatorConstants.py b/toontown/building/ElevatorConstants.py index dd483ed1..0578a269 100755 --- a/toontown/building/ElevatorConstants.py +++ b/toontown/building/ElevatorConstants.py @@ -10,11 +10,10 @@ ELEVATOR_BB = 7 ELEVATOR_COUNTRY_CLUB = 8 ELEVATOR_FIELD = 9 REJECT_NOREASON = 0 -REJECT_SHUFFLE = 1 -REJECT_NOSEAT = 2 -REJECT_PROMOTION = 3 -REJECT_BLOCKED_ROOM = 4 -REJECT_BOARDINGPARTY = 5 +REJECT_NOSEAT = 1 +REJECT_PROMOTION = 2 +REJECT_BLOCKED_ROOM = 3 +REJECT_BOARDINGPARTY = 4 MAX_GROUP_BOARDING_TIME = 6.0 ElevatorData = {ELEVATOR_NORMAL: {'openTime': 2.0, 'closeTime': 2.0, diff --git a/toontown/coghq/DistributedCogKart.py b/toontown/coghq/DistributedCogKart.py index 2384dfa5..f20c1dc5 100755 --- a/toontown/coghq/DistributedCogKart.py +++ b/toontown/coghq/DistributedCogKart.py @@ -353,9 +353,7 @@ class DistributedCogKart(DistributedElevatorExt.DistributedElevatorExt): def rejectBoard(self, avId, reason = 0): print 'rejectBoard %s' % reason if hasattr(base.localAvatar, 'elevatorNotifier'): - if reason == ElevatorConstants.REJECT_SHUFFLE: - base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorHoppedOff) - elif reason == ElevatorConstants.REJECT_PROMOTION: + if reason == ElevatorConstants.REJECT_PROMOTION: base.localAvatar.elevatorNotifier.showMe(TTLocalizer.BossElevatorRejectMessage) doneStatus = {'where': 'reject'} elevator = self.getPlaceElevator() diff --git a/toontown/coghq/DistributedFactoryElevatorExtAI.py b/toontown/coghq/DistributedFactoryElevatorExtAI.py index b7207812..3211466a 100755 --- a/toontown/coghq/DistributedFactoryElevatorExtAI.py +++ b/toontown/coghq/DistributedFactoryElevatorExtAI.py @@ -9,8 +9,8 @@ from direct.task import Task class DistributedFactoryElevatorExtAI(DistributedElevatorExtAI.DistributedElevatorExtAI): - def __init__(self, air, bldg, factoryId, entranceId, antiShuffle = 0): - DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, antiShuffle=antiShuffle) + def __init__(self, air, bldg, factoryId, entranceId): + DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg) self.factoryId = factoryId self.entranceId = entranceId diff --git a/toontown/coghq/DistributedLawOfficeElevatorExtAI.py b/toontown/coghq/DistributedLawOfficeElevatorExtAI.py index 41161e7a..be0a1bde 100755 --- a/toontown/coghq/DistributedLawOfficeElevatorExtAI.py +++ b/toontown/coghq/DistributedLawOfficeElevatorExtAI.py @@ -9,8 +9,8 @@ from toontown.toonbase import ToontownGlobals class DistributedLawOfficeElevatorExtAI(DistributedElevatorExtAI.DistributedElevatorExtAI): - def __init__(self, air, bldg, lawOfficeId, entranceId, antiShuffle = 0): - DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, antiShuffle = antiShuffle) + def __init__(self, air, bldg, lawOfficeId, entranceId): + DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg) self.lawOfficeId = lawOfficeId self.entranceId = entranceId diff --git a/toontown/coghq/DistributedMintElevatorExtAI.py b/toontown/coghq/DistributedMintElevatorExtAI.py index d3fd5313..568f61ca 100755 --- a/toontown/coghq/DistributedMintElevatorExtAI.py +++ b/toontown/coghq/DistributedMintElevatorExtAI.py @@ -10,8 +10,8 @@ import CogDisguiseGlobals class DistributedMintElevatorExtAI(DistributedElevatorExtAI.DistributedElevatorExtAI): - def __init__(self, air, bldg, mintId, antiShuffle = 0): - DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, antiShuffle=antiShuffle) + def __init__(self, air, bldg, mintId): + DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg) self.mintId = mintId self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId) self.type = ELEVATOR_MINT diff --git a/toontown/hood/CashbotHQAI.py b/toontown/hood/CashbotHQAI.py index eb69bd61..24343eff 100755 --- a/toontown/hood/CashbotHQAI.py +++ b/toontown/hood/CashbotHQAI.py @@ -39,8 +39,7 @@ class CashbotHQAI(CogHQAI.CogHQAI): ) for i in xrange(len(destZones)): mintElevator = DistributedMintElevatorExtAI( - self.air, self.air.mintMgr, destZones[i], - antiShuffle=0) + self.air, self.air.mintMgr, destZones[i]) mintElevator.generateWithRequired(self.zoneId) self.mintElevators.append(mintElevator) diff --git a/toontown/hood/CogHQAI.py b/toontown/hood/CogHQAI.py index dfcd7a1a..e75efcfa 100755 --- a/toontown/hood/CogHQAI.py +++ b/toontown/hood/CogHQAI.py @@ -52,7 +52,7 @@ class CogHQAI: def createLobbyElevator(self): self.lobbyElevator = self.lobbyElevatorCtor( - self.air, self.lobbyMgr, self.lobbyZoneId, antiShuffle=1) + self.air, self.lobbyMgr, self.lobbyZoneId) self.lobbyElevator.generateWithRequired(self.lobbyZoneId) def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=0): diff --git a/toontown/hood/LawbotHQAI.py b/toontown/hood/LawbotHQAI.py index a13eaaa5..f91f7f07 100755 --- a/toontown/hood/LawbotHQAI.py +++ b/toontown/hood/LawbotHQAI.py @@ -52,8 +52,7 @@ class LawbotHQAI(CogHQAI.CogHQAI): ) for i in xrange(len(destZones)): lawOfficeElevator = DistributedLawOfficeElevatorExtAI( - self.air, self.air.lawOfficeMgr, destZones[i], i, - antiShuffle=0) + self.air, self.air.lawOfficeMgr, destZones[i], i) lawOfficeElevator.generateWithRequired( ToontownGlobals.LawbotOfficeExt) self.lawOfficeElevators.append(lawOfficeElevator) diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index 7e80bb59..ddf604c9 100755 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -140,7 +140,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): self.touchingPlantList = [] self.inGardenAction = None self.guiConflict = 0 - self.lastElevatorLeft = 0 self.elevatorNotifier = ElevatorNotifier.ElevatorNotifier() self._zoneId = None self.accept('system message aknowledge', self.systemWarning) diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 57d71e14..c09c063a 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3056,9 +3056,7 @@ SuitAttackTaunts = {'Audit': ["I believe your books don't balance.", WaitingForOtherToons = 'Waiting for other toons...' WaitingForOtherToonsDots = 'Waiting for other toons%s' ElevatorHopOff = 'Hop off' -ElevatorStayOff = "If you hop off, you'll need to wait\nfor the elevator to leave or empty." ElevatorLeaderOff = 'Only your leader can decide when to hop off.' -ElevatorHoppedOff = 'You need to wait for the next elevator.' ElevatorHopOK = 'Okay' ElevatorGroupMember = 'Only your group leader can\n decide when to board.' CogsIncExt = ', Inc.'