本文整理汇总了Python中toontown.hood.ZoneUtil.getCanonicalBranchZone方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getCanonicalBranchZone方法的具体用法?Python ZoneUtil.getCanonicalBranchZone怎么用?Python ZoneUtil.getCanonicalBranchZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.getCanonicalBranchZone方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateQuestInfo
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def updateQuestInfo(self):
for marker in self.buildingMarkers:
marker.destroy()
self.buildingMarkers = []
dnaData = base.cr.playGame.dnaData
for questIndex in self.av.questPage.quests.keys():
questDesc = self.av.questPage.quests.get(questIndex)
if questDesc is None:
continue
mapIndex = questIndex + 1
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
quest = Quests.getQuest(questId)
fComplete = quest.getCompletionStatus(self.av, questDesc) == Quests.COMPLETE
if not fComplete:
if quest.getType() == Quests.RecoverItemQuest:
if quest.getHolder() == Quests.AnyFish:
self.putBuildingMarker(self.fishingSpotInfo, mapIndex=mapIndex)
continue
elif quest.getType() != Quests.DeliverGagQuest and quest.getType() != Quests.DeliverItemQuest and quest.getType() != Quests.VisitQuest and quest.getType() != Quests.TrackChoiceQuest:
continue
if toNpcId == Quests.ToonHQ:
self.putBuildingMarker(self.hqPosInfo, mapIndex=mapIndex)
else:
npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
branchId = ZoneUtil.getCanonicalBranchZone(npcZone)
if self.hoodId == hoodId and self.zoneId == branchId:
for blockId, block in dnaData.getBlocks():
zone = block.zone
branchZone = zone - zone % 100
finalZone = branchZone + 500 + blockId
if npcZone == finalZone:
building = block.node
self.putBuildingMarker(Point3(building.getPos()), building.getHpr(), mapIndex=mapIndex)
示例2: updateMap
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def updateMap(self):
if self.av:
hoodId = ZoneUtil.getCanonicalHoodId(self.av.getLocation()[1])
zoneId = ZoneUtil.getCanonicalBranchZone(self.av.getLocation()[1])
try:
mapsGeom = loader.loadModel('phase_4/models/questmap/%s_maps' % ToontownGlobals.dnaMap[hoodId])
except:
self.stop()
return
mapImage = mapsGeom.find('**/%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
if not mapImage.isEmpty():
self.container['image'] = mapImage
self.resetFrameSize()
self.cornerPosInfo = QuestMapGlobals.CornerPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.hqPosInfo = QuestMapGlobals.HQPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.fishingSpotInfo = QuestMapGlobals.FishingSpotPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.cogInfoPos = QuestMapGlobals.CogInfoPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.cogInfoFrame.setPos(self.cogInfoPos)
self.hide()
self.hoodId = hoodId
self.zoneId = zoneId
self.updateQuestInfo()
self.updateCogInfo()
taskMgr.add(self.update, 'questMapUpdate')
else:
self.stop()
mapsGeom.removeNode()
示例3: enter
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def enter(self):
ShtikerPage.ShtikerPage.enter(self)
try:
zone = base.cr.playGame.getPlace().getZoneId()
except:
zone = 0
if base.localAvatar.lastHood >= ToontownGlobals.BossbotHQ:
self.safeZoneButton['text'] = TTLocalizer.MapPageBackToCogHQ
else:
self.safeZoneButton['text'] = TTLocalizer.MapPageBackToPlayground
if zone and ZoneUtil.isPlayground(zone) or self.book.safeMode:
self.safeZoneButton.hide()
else:
self.safeZoneButton.show()
if base.cr.playGame.getPlaceId() == ToontownGlobals.MyEstate and base.cr.playGame.hood.loader.atMyEstate() or self.book.safeMode:
self.goHomeButton.hide()
elif base.housingEnabled:
self.goHomeButton.show()
if base.cr.playGame.getPlaceId() == ToontownGlobals.MyEstate:
if base.cr.playGame.hood.loader.atMyEstate():
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtHome
self.hoodLabel.show()
else:
avatar = base.cr.identifyAvatar(base.cr.playGame.hood.loader.estateOwnerId)
if avatar:
avName = avatar.getName()
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtSomeonesHome % TTLocalizer.GetPossesive(avName)
self.hoodLabel.show()
elif zone:
hoodName = ToontownGlobals.hoodNameMap.get(ZoneUtil.getCanonicalHoodId(zone), ('',))[-1]
streetName = ToontownGlobals.StreetNames.get(ZoneUtil.getCanonicalBranchZone(zone), ('',))[-1]
if hoodName:
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreHere % (hoodName, streetName)
self.hoodLabel.show()
else:
self.hoodLabel.hide()
else:
self.hoodLabel.hide()
safeZonesVisited = base.localAvatar.hoodsVisited
hoodTeleportList = base.localAvatar.getTeleportAccess()
for hood in self.allZones:
label = self.labels[self.allZones.index(hood)]
clouds = self.clouds[self.allZones.index(hood)]
if not self.book.safeMode and hood in safeZonesVisited:
label['text_fg'] = (0, 0, 0, 1)
label.show()
for cloud in clouds:
cloud.hide()
fullname = base.cr.hoodMgr.getFullnameFromId(hood)
if hood in hoodTeleportList:
text = TTLocalizer.MapPageGoTo % fullname
label['text'] = ('', text, text)
else:
label['text'] = ('', fullname, fullname)
else:
label.hide()
for cloud in clouds:
cloud.show()
示例4: load
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def load(self, zoneId):
self.zoneId = zoneId
self.parentFSMState.addChild(self.fsm)
self.loadBattleAnims()
self.branchZone = ZoneUtil.getBranchZone(zoneId)
self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
self.music = base.loadMusic(self.musicFile)
self.activityMusic = base.loadMusic(self.activityMusicFile)
self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_bg.ogg')
self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent)
self.townBattle.load()
示例5: updateQuestInfo
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def updateQuestInfo(self):
for marker in self.buildingMarkers:
marker.destroy()
self.buildingMarkers = []
dnaStore = base.cr.playGame.dnaStore
for questIndex in self.av.questPage.quests.keys():
questDesc = self.av.questPage.quests.get(questIndex)
if questDesc is None:
continue
mapIndex = questIndex + 1
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
quest = Quests.getQuest(questId)
fComplete = quest.getCompletionStatus(self.av, questDesc) == Quests.COMPLETE
if not fComplete:
if quest.getType() == Quests.RecoverItemQuest:
if quest.getHolder() == Quests.AnyFish:
self.putBuildingMarker(self.fishingSpotInfo, mapIndex=mapIndex)
continue
elif (
quest.getType() != Quests.DeliverGagQuest
and quest.getType() != Quests.DeliverItemQuest
and quest.getType() != Quests.VisitQuest
and quest.getType() != Quests.TrackChoiceQuest
):
continue
if toNpcId == Quests.ToonHQ:
self.putBuildingMarker(self.hqPosInfo, mapIndex=mapIndex)
else:
npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
branchId = ZoneUtil.getCanonicalBranchZone(npcZone)
if self.hoodId == hoodId and self.zoneId == branchId:
for blockIndex in xrange(dnaStore.getNumBlockTitles()):
blockNumber = dnaStore.getTitleBlockAt(blockIndex)
zone = dnaStore.getZoneFromBlockNumber(blockNumber)
branchZone = zone - zone % 100
finalZone = branchZone + 500 + blockNumber
buildingType = dnaStore.getBlockBuildingType(blockNumber)
if npcZone == finalZone:
self.putBuildingMarker(
dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getPos(),
dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getHpr(),
mapIndex=mapIndex,
)
return
示例6: load
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def load(self, zoneId):
self.zoneId = zoneId
self.parentFSMState.addChild(self.fsm)
self.loadBattleAnims()
self.branchZone = ZoneUtil.getBranchZone(zoneId)
self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
self.music = base.loadMusic(self.musicFile)
self.activityMusic = base.loadMusic(self.activityMusicFile)
self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_tt.ogg')
self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent)
self.townBattle.load()
if config.GetBool('want-april-toons', 0):
self.npc = NPCToons.createLocalNPC(91915)
self.npc.reparentTo(base.localAvatar)
self.npc.setZ(30)
self.npc.hide()
self.piano = loader.loadModel('phase_5/models/props/piano-mod')
self.piano.setZ(250)
self.piano.setHpr(0, 90, 0)
self.piano.reparentTo(base.localAvatar)
self.piano.setScale(0)
self.pianoSfx = base.loadSfx('phase_5/audio/sfx/AA_drop_piano.ogg')
self.dropSfx = base.loadSfx('phase_5/audio/sfx/cogbldg_drop.ogg')
self.pianoDropSound = Sequence(
Func(base.playSfx, self.dropSfx),
Wait(6.7),
Func(base.playSfx, self.pianoSfx),
Func(base.localAvatar.b_setAnimState, 'Squish'),
Wait(2.5),
Func(self.pianoSfx.stop)
)
self.pianoDropSequence = Sequence(
Wait(randint(10, 60)),
Func(self.pianoDropSound.start),
Parallel(self.piano.scaleInterval(1, (3, 3, 3)), self.piano.posInterval(7, (0, 0, 0))),
self.piano.posInterval(0.1, (0, 0, 0.5)),
self.piano.posInterval(0.1, (0, 0, 0)),
Wait(0.4),
Parallel(Func(self.npc.addActive), Func(self.npc.setChatAbsolute, 'Whoops! My bad!', CFSpeech|CFTimeout)),
self.piano.scaleInterval(1, (0, 0, 0)),
Wait(5),
Func(self.npc.removeActive)
)
self.pianoDropSequence.loop()
示例7: updateQuestInfo
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalBranchZone [as 别名]
def updateQuestInfo(self):
for marker in self.buildingMarkers:
marker.destroy()
self.buildingMarkers = []
for (i, questDesc) in enumerate(self.av.quests):
mapIndex = i + 1
quest = Quests.getQuest(questDesc[0])
toNpcId = questDesc[2]
completed = quest.getCompletionStatus(self.av, questDesc) == Quests.COMPLETE
if not completed:
if quest.getType() == Quests.RecoverItemQuest:
if quest.getHolder() == Quests.AnyFish:
self.putBuildingMarker(self.fishingSpotInfo, mapIndex=mapIndex)
continue
elif quest.getType() not in (
Quests.DeliverGagQuest, Quests.DeliverItemQuest,
Quests.VisitQuest, Quests.TrackChoiceQuest):
continue
if toNpcId == Quests.ToonHQ:
self.putBuildingMarker(self.hqPosInfo, mapIndex=mapIndex)
continue
npcZoneId = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZoneId)
branchId = ZoneUtil.getCanonicalBranchZone(npcZoneId)
if (self.hoodId != hoodId) or (self.zoneId != branchId):
continue
for blockIndex in xrange(base.cr.playGame.dnaStore.getNumBlockNumbers()):
blockNumber = base.cr.playGame.dnaStore.getBlockNumberAt(blockIndex)
zoneId = base.cr.playGame.dnaStore.getZoneFromBlockNumber(blockNumber)
interiorZoneId = (zoneId - (zoneId%100)) + 500 + blockNumber
if npcZoneId == interiorZoneId:
self.putBuildingMarker(
base.cr.playGame.dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getPos(render),
base.cr.playGame.dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getHpr(render),
mapIndex=mapIndex)