Holocaust elevator antishuffle

This commit is contained in:
John 2015-08-31 20:10:57 +03:00
parent a2ec779622
commit 84dc9372cf
27 changed files with 101 additions and 253 deletions

View file

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

View file

@ -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']

View file

@ -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']

View file

@ -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']

View file

@ -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']

View file

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

View file

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

View file

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

View file

@ -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
self.accepting = 0

View file

@ -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', [])

View file

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

View file

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

View file

@ -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
self.accepting = 0

View file

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

View file

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

View file

@ -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']

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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.'