本文整理汇总了Python中toontown.hood.ZoneUtil.getToonWhereName方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getToonWhereName方法的具体用法?Python ZoneUtil.getToonWhereName怎么用?Python ZoneUtil.getToonWhereName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.getToonWhereName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: kickToPlayground
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def kickToPlayground(self, retCode):
if retCode == 0:
msg = TTLocalizer.EstateOwnerLeftMessage % HouseGlobals.BOOT_GRACE_PERIOD
self.__popupKickoutMessage(msg)
elif retCode == 1:
zoneId = base.localAvatar.lastHood
self.doneStatus = {'loader': ZoneUtil.getBranchLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': 'teleportIn',
'hoodId': zoneId,
'zoneId': zoneId,
'shardId': None,
'avId': -1}
messenger.send(self.doneEvent)
elif retCode == 2:
zoneId = base.localAvatar.lastHood
self.doneStatus = {'loader': ZoneUtil.getBranchLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': 'teleportIn',
'hoodId': zoneId,
'zoneId': zoneId,
'shardId': None,
'avId': -1}
messenger.send(self.doneEvent)
else:
self.notify.error('unknown reason for exiting estate')
示例2: handleStageWinEvent
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def handleStageWinEvent(self):
StageInterior.notify.debug("handleStageWinEvent")
if base.cr.playGame.getPlace().fsm.getCurrentState().getName() == "died":
return
self.stageDefeated = 1
if 1:
zoneId = ZoneUtil.getHoodId(self.zoneId)
else:
zoneId = ZoneUtil.getSafeZoneId(base.localAvatar.defaultZone)
self.fsm.request(
"teleportOut",
[
{
"loader": ZoneUtil.getLoaderName(zoneId),
"where": ZoneUtil.getToonWhereName(zoneId),
"how": "teleportIn",
"hoodId": zoneId,
"zoneId": zoneId,
"shardId": None,
"avId": -1,
}
],
)
示例3: __lightDecorationOn__
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def __lightDecorationOn__():
try:
geom = base.cr.playGame.getPlace().loader.geom
except:
loaderId = ZoneUtil.getBranchLoaderName(2000) # TEMP hack. This will port you to ttc if ^ fails
whereId = ZoneUtil.getToonWhereName(200)
how = 'teleportIn'
print ("This Should not happen.")
requestStatus = [{
'loader': loaderId,
'where': whereId,
'how': how,
'hoodId': 2000,
'zoneId': 2000,
'shardId': None,
'avId': -1
}]
base.cr.playGame.getPlace().fsm.forceTransition('teleportOut', requestStatus)
self.loader.hood.eventLights = geom.findAllMatches('**/*light*')
self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*')
self.loader.hood.eventLights += geom.findAllMatches('**/prop_snow_tree*')
self.loader.hood.eventLights += geom.findAllMatches('**/prop_tree*')
self.loader.hood.eventLights += geom.findAllMatches('**/*christmas*')
for light in self.loader.hood.eventLights:
light.setColorScaleOff(1)
示例4: enter
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def enter(self, hoodId, zoneId, avId):
if hoodId == ToontownGlobals.Tutorial:
loaderName = "townLoader"
whereName = "toonInterior"
elif hoodId == ToontownGlobals.MyEstate:
self.getEstateZoneAndGoHome(avId, zoneId)
return
elif hoodId == ToontownGlobals.PartyHood:
self.getPartyZoneAndGoToParty(avId, zoneId)
return
else:
loaderName = ZoneUtil.getLoaderName(zoneId)
whereName = ZoneUtil.getToonWhereName(zoneId)
self.fsm.request(
"quietZone",
[
{
"loader": loaderName,
"where": whereName,
"how": "teleportIn",
"hoodId": hoodId,
"zoneId": zoneId,
"shardId": None,
"avId": avId,
}
],
)
return
示例5: requestTeleport
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def requestTeleport(self, loaderId, whereId, hoodId, zoneId, avId):
place = base.cr.playGame.getPlace()
if loaderId == "":
loaderId = ZoneUtil.getBranchLoaderName(zoneId)
if whereId == "":
whereId = ZoneUtil.getToonWhereName(zoneId)
if hoodId == 0:
hoodId = place.loader.hood.id
if avId == 0:
avId = -1
place.fsm.forceTransition(
"teleportOut",
[
{
"loader": loaderId,
"where": whereId,
"how": "teleportIn",
"hoodId": hoodId,
"zoneId": zoneId,
"shardId": None,
"avId": avId,
}
],
)
return
示例6: goHomeFailed
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def goHomeFailed(self, task):
self.notify.debug("goHomeFailed")
failedToVisitAvId = self.doneStatus.get("avId")
if failedToVisitAvId > 0:
message = TTLocalizer.EstateTeleportFailedNotFriends % base.cr.identifyAvatar(failedToVisitAvId).getName()
else:
message = TTLocalizer.EstateTeleportFailed
self.notify.debug("goHomeFailed, why =: %s" % message)
self.ignore("setLocalEstateZone")
zoneId = base.localAvatar.lastHood
loaderName = ZoneUtil.getLoaderName(zoneId)
whereName = ZoneUtil.getToonWhereName(zoneId)
base.localAvatar.setSystemMessage(0, message)
self.fsm.request(
"quietZone",
[
{
"loader": loaderName,
"where": whereName,
"how": "teleportIn",
"hoodId": zoneId,
"zoneId": zoneId,
"shardId": None,
}
],
)
return Task.done
示例7: addLinkTunnelHooks
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def addLinkTunnelHooks(self, hoodPart, nodeList, currentZoneId):
tunnelOriginList = []
for i in nodeList:
linkTunnelNPC = i.findAllMatches('**/linktunnel*')
for p in range(linkTunnelNPC.getNumPaths()):
linkTunnel = linkTunnelNPC.getPath(p)
name = linkTunnel.getName()
nameParts = name.split('_')
hoodStr = nameParts[1]
zoneStr = nameParts[2]
hoodId = self.getIdFromName(hoodStr)
zoneId = int(zoneStr)
hoodId = ZoneUtil.getTrueZoneId(hoodId, currentZoneId)
zoneId = ZoneUtil.getTrueZoneId(zoneId, currentZoneId)
linkSphere = linkTunnel.find('**/tunnel_trigger')
if linkSphere.isEmpty():
linkSphere = linkTunnel.find('**/tunnel_sphere')
if not linkSphere.isEmpty():
cnode = linkSphere.node()
cnode.setName('tunnel_trigger_' + hoodStr + '_' + zoneStr)
cnode.setCollideMask(ToontownGlobals.WallBitmask
| ToontownGlobals.GhostBitmask)
else:
linkSphere = linkTunnel.find('**/tunnel_trigger_' +
hoodStr + '_' + zoneStr)
if linkSphere.isEmpty():
self.notify.error('tunnel_trigger not found')
tunnelOrigin = linkTunnel.find('**/tunnel_origin')
if tunnelOrigin.isEmpty():
self.notify.error('tunnel_origin not found')
tunnelOriginPlaceHolder = render.attachNewNode(
'toph_' + hoodStr + '_' + zoneStr)
tunnelOriginList.append(tunnelOriginPlaceHolder)
tunnelOriginPlaceHolder.setPos(tunnelOrigin.getPos(render))
tunnelOriginPlaceHolder.setHpr(tunnelOrigin.getHpr(render))
hood = base.localAvatar.cr.playGame.hood
if ZoneUtil.tutorialDict:
how = 'teleportIn'
tutorialFlag = 1
else:
how = 'tunnelIn'
tutorialFlag = 0
hoodPart.accept('enter' + linkSphere.getName(),
hoodPart.handleEnterTunnel,
[{
'loader': ZoneUtil.getLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': how,
'hoodId': hoodId,
'zoneId': zoneId,
'shardId': None,
'tunnelOrigin': tunnelOriginPlaceHolder,
'tutorial': tutorialFlag
}])
return tunnelOriginList
示例8: kickToonsOut
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def kickToonsOut(self):
if not self.localToonOnBoard:
zoneId = self.cr.playGame.hood.hoodId
self.cr.playGame.getPlace().fsm.request(
'teleportOut',
[{'loader': ZoneUtil.getLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': 'teleportIn', 'hoodId': zoneId, 'zoneId': zoneId,
'shardId': None, 'avId': -1}])
return
示例9: enterReward
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def enterReward(self, ts = 0):
base.localAvatar.b_setParent(ToontownGlobals.SPHidden)
request = {'loader': ZoneUtil.getBranchLoaderName(self.extZoneId),
'where': ZoneUtil.getToonWhereName(self.extZoneId),
'how': 'elevatorIn',
'hoodId': ZoneUtil.getHoodId(self.extZoneId),
'zoneId': self.extZoneId,
'shardId': None,
'avId': -1,
'bldgDoId': self.distBldgDoId}
messenger.send('DSIDoneEvent', [request])
return
示例10: getRequestStatus
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def getRequestStatus(self):
zoneId = self.otherZoneId
request = {'loader': ZoneUtil.getBranchLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': 'doorIn',
'hoodId': ZoneUtil.getHoodId(zoneId),
'zoneId': zoneId,
'shardId': None,
'avId': -1,
'allowRedirect': 0,
'doorDoId': self.otherDoId}
return request
示例11: enterReward
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def enterReward(self, ts=0):
base.localAvatar.b_setParent(ToontownGlobals.SPHidden)
request = {
"loader": ZoneUtil.getBranchLoaderName(self.extZoneId),
"where": ZoneUtil.getToonWhereName(self.extZoneId),
"how": "elevatorIn",
"hoodId": ZoneUtil.getHoodId(self.extZoneId),
"zoneId": self.extZoneId,
"shardId": None,
"avId": base.localAvatar.doId,
"bldgDoId": self.distBldgDoId,
}
messenger.send("DSIDoneEvent", [request])
return
示例12: exitCogdoBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def exitCogdoBuilding(self):
if base.localAvatar.hp < 0:
return
base.localAvatar.b_setParent(ToontownGlobals.SPHidden)
request = {
"loader": ZoneUtil.getBranchLoaderName(self.extZoneId),
"where": ZoneUtil.getToonWhereName(self.extZoneId),
"how": "elevatorIn",
"hoodId": ZoneUtil.getHoodId(self.extZoneId),
"zoneId": self.extZoneId,
"shardId": None,
"avId": -1,
"bldgDoId": self.distBldgDoId,
}
messenger.send("DSIDoneEvent", [request])
return
示例13: handleMintWinEvent
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def handleMintWinEvent(self):
MintInterior.notify.debug('handleMintWinEvent')
if base.cr.playGame.getPlace().fsm.getCurrentState().getName() == 'died':
return
self.mintDefeated = 1
if 1:
zoneId = ZoneUtil.getHoodId(self.zoneId)
else:
zoneId = ZoneUtil.getSafeZoneId(base.localAvatar.defaultZone)
self.fsm.request('teleportOut', [{'loader': ZoneUtil.getLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId),
'how': 'teleportIn',
'hoodId': zoneId,
'zoneId': zoneId,
'shardId': None,
'avId': -1}])
示例14: goToPartyFailed
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def goToPartyFailed(self, reason):
self.notify.debug('goToPartyFailed')
failedToVisitAvId = self.doneStatus.get('avId')
message = base.cr.partyManager.getGoToPartyFailedMessage(reason)
self.notify.debug('goToPartyFailed, why =: %s' % message)
self.ignore('gotLocalPartyZone')
zoneId = base.localAvatar.lastHood
loaderName = ZoneUtil.getLoaderName(zoneId)
whereName = ZoneUtil.getToonWhereName(zoneId)
base.localAvatar.setSystemMessage(0, message)
self.fsm.request('quietZone', [{'loader': loaderName,
'where': whereName,
'how': 'teleportIn',
'hoodId': zoneId,
'zoneId': zoneId,
'shardId': None}])
return Task.done
示例15: requestTeleport
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getToonWhereName [as 别名]
def requestTeleport(self, loaderId, whereId, hoodId, zoneId, avId):
place = base.cr.playGame.getPlace()
if loaderId == '':
loaderId = ZoneUtil.getBranchLoaderName(zoneId)
if whereId == '':
whereId = ZoneUtil.getToonWhereName(zoneId)
if hoodId == 0:
hoodId = place.loader.hood.id
if avId == 0:
avId = -1
place.fsm.forceTransition('teleportOut', [{'loader': loaderId,
'where': whereId,
'how': 'teleportIn',
'hoodId': hoodId,
'zoneId': zoneId,
'shardId': None,
'avId': avId}])
return