• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python hood.ZoneUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中toontown.hood.ZoneUtil的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil类的具体用法?Python ZoneUtil怎么用?Python ZoneUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ZoneUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: enteringARace

 def enteringARace(self, status):
     if not status['where'] == 'racetrack':
         return 0
     if ZoneUtil.isDynamicZone(status['zoneId']):
         return status['hoodId'] == self.hood.hoodId
     else:
         return ZoneUtil.getHoodId(status['zoneId']) == self.hood.hoodId
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:7,代码来源:GSSafeZoneLoader.py


示例2: requestTeleport

 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
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:25,代码来源:ToontownMagicWordManager.py


示例3: updateMap

 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()
开发者ID:CalebSmith376,项目名称:src,代码行数:27,代码来源:QuestMap.py


示例4: enteringAGolfCourse

 def enteringAGolfCourse(self, status):
     if not status['where'] == 'golfcourse':
         return 0
     if ZoneUtil.isDynamicZone(status['zoneId']):
         return status['hoodId'] == self.hood.hoodId
     else:
         return ZoneUtil.getHoodId(status['zoneId']) == self.hood.hoodId
开发者ID:nate97,项目名称:src,代码行数:7,代码来源:OZSafeZoneLoader.py


示例5: enter

    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])
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:26,代码来源:CashbotHQExterior.py


示例6: updateQuestInfo

    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)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:35,代码来源:QuestMap.py


示例7: enter

 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
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:28,代码来源:PlayGame.py


示例8: handleStageWinEvent

    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,
                }
            ],
        )
开发者ID:GangStarrG,项目名称:src,代码行数:27,代码来源:StageInterior.py


示例9: teleportToShop

    def teleportToShop(self, npcId):
        if base.cr.playGame.getPlace().getState() != 'walk':
            return

        npcZone = NPCToons.getNPCZone(npcId)
        npcHood = ZoneUtil.getCanonicalHoodId(npcZone)
        hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505}

        if npcZone in (-1, 0, None):
            zoneId = base.localAvatar.getZoneId()
            if ZoneUtil.isDynamicZone(zoneId) or ZoneUtil.isCogHQZone(zoneId):
                zoneId = 2000 
            npcHood = ZoneUtil.getCanonicalHoodId(zoneId)
            npcZone = hqZone.get(npcHood, 2520)
        
        cost = ToontownGlobals.getTeleportButtonCost(npcHood)
        self.destroyDialog()
        base.cr.playGame.getPlace().setState('stopped')
        
        if base.localAvatar.getTotalMoney() < cost:
            self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.TeleportButtonNoMoney % cost, command=self.destroyDialog)
        else:
            self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.TeleportButtonConfirm % cost, command=lambda value: self.teleportToShopConfirm(npcZone, npcHood, cost, value))

        self.dialog.show()
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:25,代码来源:QuestPoster.py


示例10: kickToPlayground

 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')
开发者ID:CalebSmith376,项目名称:src,代码行数:26,代码来源:EstateHood.py


示例11: goHomeFailed

 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
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:27,代码来源:PlayGame.py


示例12: createStartingBlocks

 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)
开发者ID:nate97,项目名称:src,代码行数:28,代码来源:GSHoodAI.py


示例13: __lightDecorationOn__

		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)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:25,代码来源:Street.py


示例14: canAccess

 def canAccess(self, zoneId=None):
     if base.cr.isPaid():
         return True
     allowed = False
     allowedZones = [
         ToontownGlobals.ToontownCentral,
         ToontownGlobals.MyEstate,
         ToontownGlobals.GoofySpeedway,
         ToontownGlobals.Tutorial,
     ]
     specialZones = [ToontownGlobals.SellbotLobby]
     if hasattr(base.cr, "newsManager") and base.cr.newsManager:
         holidayIds = base.cr.newsManager.getHolidayIdList()
         if ToontownGlobals.SELLBOT_NERF_HOLIDAY in holidayIds:
             specialZones.append(ToontownGlobals.SellbotHQ)
     place = base.cr.playGame.getPlace()
     if zoneId:
         myHoodId = ZoneUtil.getCanonicalHoodId(zoneId)
     else:
         myHoodId = ZoneUtil.getCanonicalHoodId(place.zoneId)
     if hasattr(place, "id"):
         myHoodId = place.id
     if myHoodId in allowedZones:
         allowed = True
     elif zoneId and zoneId in specialZones:
         allowed = True
     return allowed
开发者ID:LittleNed,项目名称:Toontown-Online-No-TTR,代码行数:27,代码来源:ToontownAccess.py


示例15: enter

    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()
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:60,代码来源:MapPage.py


示例16: addLinkTunnelHooks

    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
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:59,代码来源:HoodMgr.py


示例17: genDNAFileName

 def genDNAFileName(self, zoneId):
     zoneId = ZoneUtil.getCanonicalZoneId(zoneId)
     hoodId = ZoneUtil.getCanonicalHoodId(zoneId)
     hood = ToontownGlobals.dnaMap[hoodId]
     phase = ToontownGlobals.streetPhaseMap[hoodId]
     if hoodId == zoneId:
         zoneId = 'sz'
     return 'phase_%s/dna/%s_%s.pdna' % (phase, hood, zoneId)
开发者ID:CalebSmith376,项目名称:src,代码行数:8,代码来源:BattlePlace.py


示例18: handleWaitForSetZoneResponse

 def handleWaitForSetZoneResponse(self, requestStatus):
     hoodId = requestStatus['hoodId']
     canonicalHoodId = ZoneUtil.getCanonicalZoneId(hoodId)
     toHoodPhrase = ToontownGlobals.hoodNameMap[canonicalHoodId][0]
     hoodName = ToontownGlobals.hoodNameMap[canonicalHoodId][-1]
     zoneId = requestStatus['zoneId']
     loaderName = requestStatus['loader']
     avId = requestStatus.get('avId', -1)
     ownerId = requestStatus.get('ownerId', avId)
     if base.config.GetBool('want-qa-regression', 0):
         self.notify.info('QA-REGRESSION: NEIGHBORHOODS: Visit %s' % hoodName)
     
     count = ToontownGlobals.hoodCountMap[canonicalHoodId]
     if loaderName == 'safeZoneLoader':
         count += ToontownGlobals.safeZoneCountMap[canonicalHoodId]
     elif loaderName == 'townLoader':
         count += ToontownGlobals.townCountMap[canonicalHoodId]
     
     if not loader.inBulkBlock:
         if hoodId == ToontownGlobals.MyEstate:
             if avId == -1:
                 loader.beginBulkLoad('hood', TTLocalizer.HeadingToYourEstate, count, 1, TTLocalizer.TIP_ESTATE)
             else:
                 owner = base.cr.identifyAvatar(ownerId)
                 if owner == None:
                     friend = base.cr.identifyAvatar(avId)
                     if friend != None:
                         avName = friend.getName()
                         loader.beginBulkLoad('hood', TTLocalizer.HeadingToFriend % avName, count, 1, TTLocalizer.TIP_ESTATE)
                     else:
                         self.notify.warning("we can't perform this teleport")
                         return None
                 else:
                     avName = owner.getName()
                     loader.beginBulkLoad('hood', TTLocalizer.HeadingToEstate % avName, count, 1, TTLocalizer.TIP_ESTATE)
         elif ZoneUtil.isCogHQZone(zoneId):
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {
                 'to': toHoodPhrase,
                 'hood': hoodName }, count, 1, TTLocalizer.TIP_COGHQ)
         elif ZoneUtil.isGoofySpeedwayZone(zoneId):
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {
                 'to': toHoodPhrase,
                 'hood': hoodName }, count, 1, TTLocalizer.TIP_KARTING)
         else:
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {
                 'to': toHoodPhrase,
                 'hood': hoodName }, count, 1, TTLocalizer.TIP_GENERAL)
     
     if hoodId == ToontownGlobals.Tutorial:
         self.loadDnaStoreTutorial()
     else:
         self.loadDnaStore()
     hoodClass = self.getHoodClassByNumber(canonicalHoodId)
     self.hood = hoodClass(self.fsm, self.hoodDoneEvent, self.dnaStore, hoodId)
     self.hood.load()
     self.hood.loadLoader(requestStatus)
     if not base.placeBeforeObjects:
         loader.endBulkLoad('hood')
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:58,代码来源:PlayGame.py


示例19: __init__

 def __init__(self, air, zoneId):
     DistributedObjectAI.DistributedObjectAI.__init__(self, air)
     SuitPlannerBase.SuitPlannerBase.__init__(self)
     self.air = air
     self.zoneId = zoneId
     self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
     if simbase.air.wantCogdominiums:
         if not hasattr(self.__class__, 'CogdoPopAdjusted'):
             self.__class__.CogdoPopAdjusted = True
             for index in xrange(len(self.SuitHoodInfo)):
                 SuitBuildingGlobals[self.zoneId][0] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][0])
                 SuitBuildingGlobals[self.zoneId][1] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][1])
     self.hoodInfoIdx = -1
     for index in xrange(len(self.SuitHoodInfo)):
         currHoodInfo = self.SuitHoodInfo[index]
         if currHoodInfo[self.SUIT_HOOD_INFO_ZONE] == self.canonicalZoneId:
             self.hoodInfoIdx = index
     self.currDesired = None
     self.baseNumSuits = (
         self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN] +
         self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]) / 2
     self.targetNumSuitBuildings = SuitBuildingGlobals.buildingMinMax[self.zoneId][0]
     if ZoneUtil.isWelcomeValley(self.zoneId):
         self.targetNumSuitBuildings = 0
     self.pendingBuildingTracks = []
     self.pendingBuildingHeights = []
     self.suitList = []
     self.numFlyInSuits = 0
     self.numBuildingSuits = 0
     self.numAttemptingTakeover = 0
     self.zoneInfo = {}
     self.zoneIdToPointMap = None
     self.cogHQDoors = []
     self.battleList = []
     self.battleMgr = BattleManagerAI.BattleManagerAI(self.air)
     self.setupDNA()
     if self.notify.getDebug():
         self.notify.debug('Creating a building manager AI in zone' + str(self.zoneId))
     self.buildingMgr = self.air.buildingManagers.get(self.zoneId)
     if self.buildingMgr:
         (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, animBldgBlocks) = self.buildingMgr.getDNABlockLists()
         for currBlock in blocks:
             bldg = self.buildingMgr.getBuilding(currBlock)
             bldg.setSuitPlannerExt(self)
         for currBlock in animBldgBlocks:
             bldg = self.buildingMgr.getBuilding(currBlock)
             bldg.setSuitPlannerExt(self)
     self.dnaStore.resetBlockNumbers()
     self.initBuildingsAndPoints()
     numSuits = simbase.config.GetInt('suit-count', -1)
     if numSuits >= 0:
         self.currDesired = numSuits
     suitHood = simbase.config.GetInt('suits-only-in-hood', -1)
     if suitHood >= 0:
         if self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_ZONE] != suitHood:
             self.currDesired = 0
     self.suitCountAdjust = 0
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:57,代码来源:DistributedSuitPlannerAI.py


示例20: createGameTables

 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)
开发者ID:lolman8776,项目名称:ToontownInfinite,代码行数:9,代码来源:OZHoodAI.py



注:本文中的toontown.hood.ZoneUtil类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python minigame.PairingGameGlobals类代码示例发布时间:2022-05-27
下一篇:
Python hood.SkyUtil类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap