本文整理汇总了Python中toontown.building.ElevatorUtils类的典型用法代码示例。如果您正苦于以下问题:Python ElevatorUtils类的具体用法?Python ElevatorUtils怎么用?Python ElevatorUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ElevatorUtils类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupElevator
def setupElevator(self, elevatorModel):
self.elevatorModel = elevatorModel
self.leftDoor = self.elevatorModel.find('**/left-door')
if self.leftDoor.isEmpty():
self.leftDoor = self.elevatorModel.find('**/left_door')
self.rightDoor = self.elevatorModel.find('**/right-door')
if self.rightDoor.isEmpty():
self.rightDoor = self.elevatorModel.find('**/right_door')
self.openSfx = base.loadSfx(
'phase_9/audio/sfx/CHQ_FACT_door_open_sliding.ogg')
self.finalOpenSfx = base.loadSfx(
'phase_9/audio/sfx/CHQ_FACT_door_open_final.ogg')
self.closeSfx = base.loadSfx(
'phase_9/audio/sfx/CHQ_FACT_door_open_sliding.ogg')
self.finalCloseSfx = base.loadSfx(
'phase_9/audio/sfx/CHQ_FACT_door_open_final.ogg')
self.openDoors = ElevatorUtils.getOpenInterval(
self,
self.leftDoor,
self.rightDoor,
self.openSfx,
self.finalOpenSfx,
self.elevatorType)
self.closeDoors = ElevatorUtils.getCloseInterval(
self,
self.leftDoor,
self.rightDoor,
self.closeSfx,
self.finalCloseSfx,
self.elevatorType)
self.closeDoors.start()
self.closeDoors.finish()
示例2: exitIntroduction
def exitIntroduction(self):
self.notify.debug('DistributedBossCog.exitIntroduction:')
intervalName = 'IntroductionMovie'
self.clearInterval(intervalName)
self.unstickToons()
self.releaseToons()
NametagGlobals.setWant2dNametags(True)
ElevatorUtils.closeDoors(self.leftDoor, self.rightDoor, self.elevatorType)
示例3: exitElevator
def exitElevator(self):
intervalName = 'ElevatorMovie'
self.clearInterval(intervalName)
self.elevatorMusic.stop()
ElevatorUtils.closeDoors(
self.leftDoor,
self.rightDoor,
self.elevatorType)
示例4: loadEnvironment
def loadEnvironment(self):
DistributedBossCog.DistributedBossCog.loadEnvironment(self)
self.midVault = loader.loadModel('phase_10/models/cogHQ/MidVault')
self.endVault = loader.loadModel('phase_10/models/cogHQ/EndVault')
self.lightning = loader.loadModel('phase_10/models/cogHQ/CBLightning')
self.magnet = loader.loadModel('phase_10/models/cogHQ/CBMagnet')
self.craneArm = loader.loadModel('phase_10/models/cogHQ/CBCraneArm')
self.controls = loader.loadModel(
'phase_10/models/cogHQ/CBCraneControls')
self.stick = loader.loadModel('phase_10/models/cogHQ/CBCraneStick')
self.safe = loader.loadModel('phase_10/models/cogHQ/CBSafe')
self.eyes = loader.loadModel('phase_10/models/cogHQ/CashBotBossEyes')
self.cableTex = self.craneArm.findTexture('MagnetControl')
self.eyes.setPosHprScale(4.5, 0, -2.5, 90, 90, 0, 0.4, 0.4, 0.4)
self.eyes.reparentTo(self.neck)
self.eyes.hide()
self.midVault.setPos(0, -222, -70.7)
self.endVault.setPos(84, -201, -6)
self.geom = NodePath('geom')
self.midVault.reparentTo(self.geom)
self.endVault.reparentTo(self.geom)
self.endVault.findAllMatches('**/MagnetArms').detach()
self.endVault.findAllMatches('**/Safes').detach()
self.endVault.findAllMatches('**/MagnetControlsAll').detach()
cn = self.endVault.find('**/wallsCollision').node()
cn.setIntoCollideMask(OTPGlobals.WallBitmask |
ToontownGlobals.PieBitmask)
self.door1 = self.midVault.find('**/SlidingDoor1/')
self.door2 = self.midVault.find('**/SlidingDoor/')
self.door3 = self.endVault.find('**/SlidingDoor/')
elevatorModel = loader.loadModel('phase_10/models/cogHQ/CFOElevator')
elevatorOrigin = self.midVault.find('**/elevator_origin')
elevatorOrigin.setScale(1)
elevatorModel.reparentTo(elevatorOrigin)
leftDoor = elevatorModel.find('**/left_door')
leftDoor.setName('left-door')
rightDoor = elevatorModel.find('**/right_door')
rightDoor.setName('right-door')
self.setupElevator(elevatorOrigin)
ElevatorUtils.closeDoors(
leftDoor, rightDoor, ElevatorConstants.ELEVATOR_CFO)
walls = self.endVault.find('**/RollUpFrameCillison')
walls.detachNode()
self.evWalls = self.replaceCollisionPolysWithPlanes(walls)
self.evWalls.reparentTo(self.endVault)
self.evWalls.stash()
floor = self.endVault.find('**/EndVaultFloorCollision')
floor.detachNode()
self.evFloor = self.replaceCollisionPolysWithPlanes(floor)
self.evFloor.reparentTo(self.endVault)
self.evFloor.setName('floor')
plane = CollisionPlane(Plane(Vec3(0, 0, 1), Point3(0, 0, -50)))
planeNode = CollisionNode('dropPlane')
planeNode.addSolid(plane)
planeNode.setCollideMask(ToontownGlobals.PieBitmask)
self.geom.attachNewNode(planeNode)
self.geom.reparentTo(render)
示例5: enterIntroduction
def enterIntroduction(self):
self.controlToons()
ElevatorUtils.openDoors(self.leftDoor, self.rightDoor, self.elevatorType)
NametagGlobals.setWant2dNametags(False)
intervalName = 'IntroductionMovie'
delayDeletes = []
seq = Sequence(self.makeIntroductionMovie(delayDeletes), Func(self.__beginBattleOne), name=intervalName)
seq.delayDeletes = delayDeletes
seq.start()
self.storeInterval(seq, intervalName)
示例6: exitPrepareBattleThree
def exitPrepareBattleThree(self):
intervalName = 'PrepareBattleThreeMovie'
self.clearInterval(intervalName)
self.unstickToons()
self.releaseToons()
if self.newState == 'BattleThree':
self.movieCrane.request('Free')
NametagGlobals.setWant2dNametags(True)
ElevatorUtils.closeDoors(self.leftDoor, self.rightDoor, ElevatorConstants.ELEVATOR_CFO)
taskMgr.remove(self.uniqueName('physics'))
示例7: close
def close(self, animate = True):
if not self._open:
return
if animate:
self._finishIval()
self._ival = Sequence(Parallel(SoundInterval(self._closeSfx), self._leftDoor.posInterval(self.getOpenCloseDuration(), ElevatorUtils.getLeftClosePoint(ElevatorConstants.ELEVATOR_NORMAL), startPos=ElevatorUtils.getLeftOpenPoint(ElevatorConstants.ELEVATOR_NORMAL), blendType='easeIn'), self._rightDoor.posInterval(self.getOpenCloseDuration(), ElevatorUtils.getRightClosePoint(ElevatorConstants.ELEVATOR_NORMAL), startPos=ElevatorUtils.getRightOpenPoint(ElevatorConstants.ELEVATOR_NORMAL), blendType='easeIn')))
self._ival.start()
else:
ElevatorUtils.closeDoors(self._leftDoor, self._rightDoor, type=ElevatorConstants.ELEVATOR_NORMAL)
self._open = False
示例8: enterIntroduction
def enterIntroduction(self):
self.controlToons()
ElevatorUtils.openDoors(self.leftDoor, self.rightDoor, self.elevatorType)
NametagGlobals.setMasterArrowsOn(0)
intervalName = 'IntroductionMovie'
delayDeletes = []
seq = Parallel(self.showTitleText(), Sequence(self.makeIntroductionMovie(delayDeletes), Func(self.__beginBattleOne)), name=intervalName)
seq.delayDeletes = delayDeletes
seq.start()
self.storeInterval(seq, intervalName)
示例9: exitPrepareBattleThree
def exitPrepareBattleThree(self):
intervalName = "PrepareBattleThreeMovie"
self.clearInterval(intervalName)
self.unstickToons()
self.releaseToons()
if self.newState == "BattleThree":
self.movieCrane.request("Free")
self.movieSafe.request("Initial")
NametagGlobals.setWant2dNametags(True)
ElevatorUtils.closeDoors(self.leftDoor, self.rightDoor, ElevatorConstants.ELEVATOR_CFO)
taskMgr.remove(self.uniqueName("physics"))
示例10: __playReservesJoining
def __playReservesJoining(self, ts, name, callback):
index = 0
for suit in self.joiningReserves:
suit.reparentTo(render)
suit.setPos(
self.elevatorModelOut,
Point3(ElevatorPoints[index][0], ElevatorPoints[index][1], ElevatorPoints[index][2]),
)
index += 1
suit.setH(180)
suit.loop("neutral")
if len(self.suits) == len(self.joiningReserves):
camSequence = Sequence(
Func(camera.wrtReparentTo, localAvatar),
Func(camera.setPos, Point3(0, 5, 5)),
Func(camera.headsUp, self.elevatorModelOut),
)
else:
camSequence = Sequence(
Func(camera.wrtReparentTo, self.elevatorModelOut),
Func(camera.setPos, Point3(0, -8, 2)),
Func(camera.setHpr, Vec3(0, 10, 0)),
)
track = Sequence(
camSequence,
Parallel(
SoundInterval(self.openSfx),
LerpPosInterval(
self.leftDoorOut,
ElevatorData[ELEVATOR_NORMAL]["closeTime"],
Point3(0, 0, 0),
startPos=ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
blendType="easeOut",
),
LerpPosInterval(
self.rightDoorOut,
ElevatorData[ELEVATOR_NORMAL]["closeTime"],
Point3(0, 0, 0),
startPos=ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
blendType="easeOut",
),
),
Wait(SUIT_HOLD_ELEVATOR_TIME),
Func(camera.wrtReparentTo, render),
Func(callback),
)
track.start(ts)
self.activeIntervals[name] = track
示例11: enterElevator
def enterElevator(self):
for toonId in self.involvedToons:
toon = self.cr.doId2do.get(toonId)
if toon:
toon.stopLookAround()
toon.stopSmooth()
self.placeToonInElevator(toon)
self.toMovieMode()
camera.reparentTo(self.elevatorModel)
camera.setPosHpr(0, 30, 8, 180, 0, 0)
base.playMusic(self.elevatorMusic, looping=1, volume=1.0)
ival = Sequence(ElevatorUtils.getRideElevatorInterval(self.elevatorType), ElevatorUtils.getRideElevatorInterval(self.elevatorType), self.openDoors, Func(camera.wrtReparentTo, render), Func(self.__doneElevator))
intervalName = 'ElevatorMovie'
ival.start()
self.storeInterval(ival, intervalName)
示例12: __playCloseElevatorOut
def __playCloseElevatorOut(self, name, delay=0):
track = Sequence(
Wait(delay + SUIT_LEAVE_ELEVATOR_TIME),
Parallel(
SoundInterval(self.closeSfx),
LerpPosInterval(
self.leftDoorOut,
ElevatorData[ELEVATOR_NORMAL]["closeTime"],
ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
startPos=Point3(0, 0, 0),
blendType="easeOut",
),
LerpPosInterval(
self.rightDoorOut,
ElevatorData[ELEVATOR_NORMAL]["closeTime"],
ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
startPos=Point3(0, 0, 0),
blendType="easeOut",
),
),
)
track.start()
self.activeIntervals[name] = track
示例13: __playElevator
#.........这里部分代码省略.........
self.cagePos = []
for height in self.cageHeights:
self.cagePos.append(Point3(pos[0], pos[1], height))
self.cageDoor = self.floorModel.find('**/cage_door')
self.cageDoor.wrtReparentTo(self.cage)
if self.FOType:
paintingModelName = PAINTING_DICT.get(self.FOType)
for i in xrange(4):
paintingModel = loader.loadModel('phase_5/models/cogdominium/%s' % paintingModelName)
loc = self.floorModel.find('**/loc_painting%d' % (i + 1))
paintingModel.reparentTo(loc)
if not self.floorModel.find('**/trophyCase').isEmpty():
for i in xrange(4):
goldEmblem = loader.loadModel('phase_5/models/cogdominium/tt_m_ara_crg_goldTrophy.bam')
loc = self.floorModel.find('**/gold_0%d' % (i + 1))
goldEmblem.reparentTo(loc)
for i in xrange(20):
silverEmblem = loader.loadModel('phase_5/models/cogdominium/tt_m_ara_crg_silverTrophy.bam')
loc = self.floorModel.find('**/silver_0%d' % (i + 1))
silverEmblem.reparentTo(loc)
SuitHs = self.BossOffice_SuitHs
SuitPositions = self.BossOffice_SuitPositions
self.__makeShopOwnerNpc()
else:
if self._wantBarrelRoom:
self.barrelRoom.load()
self.barrelRoom.hide()
SuitHs = self.Cubicle_SuitHs
SuitPositions = self.Cubicle_SuitPositions
if self.floorModel:
self.floorModel.reparentTo(render)
if self.isBossFloor(self.currentFloor):
self.notify.info('Load boss_suit_office')
elevIn = self.floorModel.find(CogdoGameConsts.PenthouseElevatorInPath).copyTo(render)
elevOut = self.floorModel.find(CogdoGameConsts.PenthouseElevatorOutPath)
frame = self.elevatorModelOut.find('**/frame')
if not frame.isEmpty():
frame.hide()
frame = self.elevatorModelIn.find('**/frame')
if not frame.isEmpty():
frame.hide()
self.elevatorModelOut.reparentTo(elevOut)
self.elevatorModelOut.setY(0)
else:
elevIn = self.floorModel.find('**/elevator-in')
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
elevIn = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorInPath)
elevOut = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorOutPath)
y = elevOut.getY(render)
elevOut = elevOut.copyTo(render)
elevOut.setY(render, y - 0.75)
else:
floorModel = loader.loadModel('phase_7/models/modules/boss_suit_office')
elevIn = floorModel.find('**/elevator-in').copyTo(render)
elevOut = floorModel.find('**/elevator-out').copyTo(render)
floorModel.removeNode()
self.elevIn = elevIn
self.elevOut = elevOut
self._haveEntranceElevator.set(True)
for index in xrange(len(self.suits)):
if not self.suits[index].isEmpty():
self.suits[index].setPos(SuitPositions[index])
if len(self.suits) > 2:
self.suits[index].setH(SuitHs[index])
else:
self.suits[index].setH(170)
self.suits[index].loop('neutral')
for toon in self.toons:
toon.reparentTo(self.elevatorModelIn)
index = self.toonIds.index(toon.doId)
toon.setPos(ElevatorPoints[index][0], ElevatorPoints[index][1], ElevatorPoints[index][2])
toon.setHpr(180, 0, 0)
toon.loop('neutral')
self.elevatorModelIn.reparentTo(elevIn)
self.leftDoorIn.setPos(3.5, 0, 0)
self.rightDoorIn.setPos(-3.5, 0, 0)
camera.reparentTo(self.elevatorModelIn)
camera.setH(180)
camera.setP(0)
camera.setPos(0, 14, 4)
base.playMusic(self.elevatorMusic, looping=1, volume=0.8)
track = Sequence(Func(base.transitions.noTransitions), ElevatorUtils.getRideElevatorInterval(ELEVATOR_NORMAL), ElevatorUtils.getOpenInterval(self, self.leftDoorIn, self.rightDoorIn, self.openSfx, None, type=ELEVATOR_NORMAL), Func(camera.wrtReparentTo, render))
for toon in self.toons:
track.append(Func(toon.wrtReparentTo, render))
track.append(Func(callback))
track.start(ts)
self.activeIntervals[name] = track
示例14: __playElevator
def __playElevator(self, ts, name, callback):
SuitHs = []
SuitPositions = []
if self.floorModel:
self.floorModel.removeNode()
self.floorModel = None
if self.cage:
self.cage = None
if self.currentFloor == 0:
SuitHs = self.BottomFloor_SuitHs
SuitPositions = self.BottomFloor_SuitPositions
if self.isBossFloor(self.currentFloor):
self.barrelRoom.unload()
self.floorModel = loader.loadModel("phase_5/models/cogdominium/tt_m_ara_crg_penthouse")
self.cage = self.floorModel.find("**/cage")
pos = self.cage.getPos()
self.cagePos = []
for height in self.cageHeights:
self.cagePos.append(Point3(pos[0], pos[1], height))
self.cageDoor = self.floorModel.find("**/cage_door")
self.cageDoor.wrtReparentTo(self.cage)
if self.FOType:
paintingModelName = PAINTING_DICT.get(self.FOType)
for i in range(4):
paintingModel = loader.loadModel("phase_5/models/cogdominium/%s" % paintingModelName)
loc = self.floorModel.find("**/loc_painting%d" % (i + 1))
paintingModel.reparentTo(loc)
SuitHs = self.BossOffice_SuitHs
SuitPositions = self.BossOffice_SuitPositions
self.__makeShopOwnerNpc()
else:
if self._wantBarrelRoom:
self.barrelRoom.load()
self.barrelRoom.hide()
SuitHs = self.Cubicle_SuitHs
SuitPositions = self.Cubicle_SuitPositions
if self.floorModel:
self.floorModel.reparentTo(render)
if self.isBossFloor(self.currentFloor):
self.notify.debug("Load boss_suit_office")
elevIn = self.floorModel.find(CogdoGameConsts.PenthouseElevatorInPath).copyTo(render)
elevOut = self.floorModel.find(CogdoGameConsts.PenthouseElevatorOutPath)
frame = self.elevatorModelOut.find("**/frame")
if not frame.isEmpty():
frame.hide()
frame = self.elevatorModelIn.find("**/frame")
if not frame.isEmpty():
frame.hide()
self.elevatorModelOut.reparentTo(elevOut)
else:
elevIn = self.floorModel.find("**/elevator-in")
elevOut = self.floorModel.find("**/elevator-out")
elif self._wantBarrelRoom and self.barrelRoom.isLoaded():
elevIn = self.barrelRoom.dummyElevInNode
elevOut = self.barrelRoom.model.find(CogdoBarrelRoomConsts.BarrelRoomElevatorOutPath)
y = elevOut.getY(render)
elevOut = elevOut.copyTo(render)
elevOut.setY(render, y - 0.75)
else:
floorModel = loader.loadModel("phase_7/models/modules/boss_suit_office")
elevIn = floorModel.find("**/elevator-in").copyTo(render)
elevOut = floorModel.find("**/elevator-out").copyTo(render)
floorModel.removeNode()
self.elevIn = elevIn
self.elevOut = elevOut
self._haveEntranceElevator.set(True)
for index in range(len(self.suits)):
self.suits[index].setPos(SuitPositions[index])
if len(self.suits) > 2:
self.suits[index].setH(SuitHs[index])
else:
self.suits[index].setH(170)
self.suits[index].loop("neutral")
for toon in self.toons:
toon.reparentTo(self.elevatorModelIn)
index = self.toonIds.index(toon.doId)
toon.setPos(ElevatorPoints[index][0], ElevatorPoints[index][1], ElevatorPoints[index][2])
toon.setHpr(180, 0, 0)
toon.loop("neutral")
self.elevatorModelIn.reparentTo(elevIn)
self.leftDoorIn.setPos(3.5, 0, 0)
self.rightDoorIn.setPos(-3.5, 0, 0)
camera.reparentTo(self.elevatorModelIn)
camera.setH(180)
camera.setP(0)
camera.setPos(0, 14, 4)
base.playMusic(self.elevatorMusic, looping=1, volume=0.8)
track = Sequence(
Func(base.transitions.noTransitions),
ElevatorUtils.getRideElevatorInterval(ELEVATOR_NORMAL),
ElevatorUtils.getOpenInterval(
self, self.leftDoorIn, self.rightDoorIn, self.openSfx, None, type=ELEVATOR_NORMAL
),
Func(camera.wrtReparentTo, render),
)
for toon in self.toons:
#.........这里部分代码省略.........