本文整理汇总了Python中toontown.hood.ZoneUtil.getTrueZoneId方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getTrueZoneId方法的具体用法?Python ZoneUtil.getTrueZoneId怎么用?Python ZoneUtil.getTrueZoneId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.getTrueZoneId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addLinkTunnelHooks
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [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
示例2: makeDictionaries
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def makeDictionaries(self, dnaStore):
self.nodeDict = {}
self.zoneDict = {}
self.zoneVisDict = {}
self.nodeList = []
self.fadeInDict = {}
self.fadeOutDict = {}
a1 = Vec4(1, 1, 1, 1)
a0 = Vec4(1, 1, 1, 0)
numVisGroups = dnaStore.getNumDNAVisGroupsAI()
for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
zoneId = int(groupName)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
groupNode = self.geom.find('**/' + groupFullName)
if groupNode.isEmpty():
self.notify.error('Could not find visgroup')
else:
if ':' in groupName:
groupName = '%s%s' % (zoneId, groupName[groupName.index(':'):])
else:
groupName = '%s' % zoneId
groupNode.setName(groupName)
groupNode.flattenMedium()
self.nodeDict[zoneId] = []
self.nodeList.append(groupNode)
self.zoneDict[zoneId] = groupNode
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.visibles[i]))
visibles.append(ZoneUtil.getBranchZone(zoneId))
self.zoneVisDict[zoneId] = visibles
fadeDuration = 0.5
self.fadeOutDict[groupNode] = Sequence(Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a0, startColorScale=a1), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), Func(groupNode.stash), name='fadeZone-' + str(zoneId), autoPause=1)
self.fadeInDict[groupNode] = Sequence(Func(groupNode.unstash), Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a1, startColorScale=a0), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), name='fadeZone-' + str(zoneId), autoPause=1)
for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i)
zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
visName = dnaStore.getVisibleName(i, j)
groupName = base.cr.hoodMgr.extractGroupName(visName)
nextZoneId = int(groupName)
nextZoneId = ZoneUtil.getTrueZoneId(nextZoneId, self.zoneId)
visNode = self.zoneDict[nextZoneId]
self.nodeDict[zoneId].append(visNode)
self.hood.dnaStore.resetPlaceNodes()
self.hood.dnaStore.resetDNAGroups()
self.hood.dnaStore.resetDNAVisGroups()
self.hood.dnaStore.resetDNAVisGroupsAI()
示例3: getExteriorAndInteriorZoneId
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def getExteriorAndInteriorZoneId(self):
blockNumber = self.block
dnaStore = self.air.getStorage(self.canonicalZoneId)
zoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
interiorZoneId = (zoneId - zoneId % 100) + 500 + blockNumber
return (zoneId, interiorZoneId)
示例4: createStartingBlocks
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def createStartingBlocks(self):
self.racingPads = []
self.viewingPads = []
racingPadGroups = []
viewingPadGroups = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaData, zoneId, area, padType='racing_pad')
(foundViewingPads, foundViewingPadGroups) = self.findRacingPads(dnaData, zoneId, area, padType='viewing_pad')
self.racingPads.extend(foundRacingPads)
racingPadGroups.extend(foundRacingPadGroups)
self.viewingPads.extend(foundViewingPads)
viewingPadGroups.extend(foundViewingPadGroups)
self.startingBlocks = []
for (dnaGroup, racePad) in zip(racingPadGroups, self.racingPads):
foundStartingBlocks = self.findStartingBlocks(dnaGroup, racePad)
self.startingBlocks.extend(foundStartingBlocks)
for startingBlock in foundStartingBlocks:
racePad.addStartingBlock(startingBlock)
self.viewingBlocks = []
for (dnaGroup, viewPad) in zip(viewingPadGroups, self.viewingPads):
foundViewingBlocks = self.findStartingBlocks(dnaGroup, viewPad)
self.viewingBlocks.extend(foundViewingBlocks)
for viewingBlock in foundViewingBlocks:
viewPad.addStartingBlock(viewingBlock)
示例5: enter
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def enter(self, requestStatus):
CogHQExterior.CogHQExterior.enter(self, requestStatus)
for train in self.trains:
train.show()
# Load the CogHQ DNA file:
dnaStore = DNAStorage()
dnaFileName = self.genDNAFileName(self.zoneId)
loadDNAFileAI(dnaStore, dnaFileName)
# Collect all of the vis group zone IDs:
self.zoneVisDict = {}
for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))
visibles.append(ZoneUtil.getBranchZone(visZoneId))
self.zoneVisDict[visZoneId] = visibles
# Next, we want interest in all vis groups due to this being a Cog HQ:
base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
示例6: findRacingPads
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def findRacingPads(self, dnaGroup, zoneId, area, padType='racing_pad'):
racingPads = []
racingPadGroups = []
if isinstance(dnaGroup, DNAGroup) and (padType in dnaGroup.getName()):
racingPadGroups.append(dnaGroup)
if padType == 'racing_pad':
nameInfo = dnaGroup.getName().split('_')
racingPad = DistributedRacePadAI(simbase.air)
racingPad.setArea(zoneId)
racingPad.nameType = nameInfo[3]
racingPad.index = int(nameInfo[2])
nextRaceInfo = RaceGlobals.getNextRaceInfo(-1, racingPad.nameType, racingPad.index)
racingPad.setTrackInfo([nextRaceInfo[0], nextRaceInfo[1]])
racingPad.generateWithRequired(zoneId)
elif padType == 'viewing_pad':
racingPad = DistributedViewPadAI(simbase.air)
racingPad.setArea(zoneId)
racingPad.generateWithRequired(zoneId)
else:
self.notify.error('Invalid racing pad type: ' + padType)
racingPads.append(racingPad)
elif isinstance(dnaGroup, DNAVisGroup):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
for i in xrange(dnaGroup.getNumChildren()):
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaGroup.at(i), zoneId, area, padType=padType)
racingPads.extend(foundRacingPads)
racingPadGroups.extend(foundRacingPadGroups)
return (racingPads, racingPadGroups)
示例7: getExteriorAndInteriorZoneId
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def getExteriorAndInteriorZoneId(self):
blockNumber = self.block
dnaStore = self.air.dnaStoreMap[self.canonicalZoneId]
zoneId = dnaStore.getBlock(blockNumber).zone
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
interiorZoneId = zoneId - zoneId % 100 + 500 + blockNumber
return zoneId, interiorZoneId
示例8: newKartShopBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def newKartShopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchID]
exteriorZoneId = dnaStore.getBlock(blockNumber).zone
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchID)
interiorZoneId = self.branchID - self.branchID % 100 + 500 + blockNumber
building = KartShopBuildingAI(self.air, exteriorZoneId, interiorZoneId, blockNumber)
self.__buildings[blockNumber] = building
return building
示例9: createPartyPeople
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def createPartyPeople(self):
self.partyGates = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
foundPartyGates = self.findPartyGates(dnaData, zoneId)
self.partyGates.extend(foundPartyGates)
示例10: createBuildingManagers
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def createBuildingManagers(self):
for zoneId in self.getZoneTable():
dnaStore = self.air.dnaStoreMap[zoneId]
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
buildingManager = DistributedBuildingMgrAI.DistributedBuildingMgrAI(
self.air, zoneId, dnaStore, self.air.trophyMgr)
self.buildingManagers.append(buildingManager)
self.air.buildingManagers[zoneId] = buildingManager
示例11: createPartyPeople
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def createPartyPeople(self):
self.partyGates = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if isinstance(dnaData, DNAData):
foundPartyGates = self.findPartyGates(dnaData, zoneId)
self.partyGates.extend(foundPartyGates)
示例12: newKartShopBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def newKartShopBuilding(self, blockNumber):
dnaStore = self.air.getStorage(self.canonicalBranchID)
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchID)
interiorZoneId = (self.branchID - self.branchID % 100) + 500 + blockNumber
building = KartShopBuildingAI(self.air, exteriorZoneId, interiorZoneId, blockNumber)
self.__buildings[blockNumber] = building
return building
示例13: newGagshopBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def newGagshopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchID]
exteriorZoneId = dnaStore.getBlock(blockNumber).zone
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchID)
interiorZoneId = self.branchID - self.branchID % 100 + 500 + blockNumber
self.notify.debug("Spawning GagShop ext: {0} int: {1}".format(exteriorZoneId, interiorZoneId))
building = GagshopBuildingAI.GagshopBuildingAI(self.air, exteriorZoneId, interiorZoneId, blockNumber)
self.__buildings[blockNumber] = building
return building
示例14: createGameTables
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def createGameTables(self):
self.gameTables = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if isinstance(dnaData, DNAData):
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundGameTables = self.findGameTables(dnaData, zoneId, area, overrideDNAZone=True)
self.gameTables.extend(foundGameTables)
示例15: newLibraryBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getTrueZoneId [as 别名]
def newLibraryBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = LibraryBuildingAI.LibraryBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber)
self.__buildings[blockNumber] = building
return building