当前位置: 首页>>代码示例>>Python>>正文


Python ZoneUtil.isCogHQZone方法代码示例

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


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

示例1: handleWaitForSetZoneResponse

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isCogHQZone [as 别名]
 def handleWaitForSetZoneResponse(self, requestStatus):
     hoodId = requestStatus['hoodId']
     canonicalHoodId = ZoneUtil.getCanonicalZoneId(hoodId)
     toHoodPhrase = ToontownGlobals.hoodNameMap[canonicalHoodId][0]
     hoodName = ToontownGlobals.hoodNameMap[canonicalHoodId][-1]
     zoneId = requestStatus['zoneId']
     requestStatus['loader'] = 'cogHQLoader' if ZoneUtil.isCogHQZone(hoodId) else requestStatus['loader']
     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, zoneId)
             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, zoneId)
                     else:
                         self.notify.warning("we can't perform this teleport")
                         return
                 else:
                     avName = owner.getName()
                     loader.beginBulkLoad('hood', TTLocalizer.HeadingToEstate % avName, count, 1, TTLocalizer.TIP_ESTATE, zoneId)
         elif ZoneUtil.isCogHQZone(zoneId):
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {'to': toHoodPhrase,
              'hood': hoodName}, count, 1, TTLocalizer.TIP_COGHQ, zoneId)
         elif ZoneUtil.isGoofySpeedwayZone(zoneId):
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {'to': toHoodPhrase,
              'hood': hoodName}, count, 1, TTLocalizer.TIP_KARTING, zoneId)
         else:
             loader.beginBulkLoad('hood', TTLocalizer.HeadingToHood % {'to': toHoodPhrase,
              'hood': hoodName}, count, 1, TTLocalizer.TIP_GENERAL, zoneId)
     if hoodId == ToontownGlobals.Tutorial:
         self.loadDnaStoreTutorial()
     else:
         if not hasattr(self, 'dnaStore'):
             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')
     return
开发者ID:MasterLoopyBM,项目名称:Toontown,代码行数:57,代码来源:PlayGame.py

示例2: teleportToShop

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isCogHQZone [as 别名]
    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,代码行数:27,代码来源:QuestPoster.py

示例3: begin

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isCogHQZone [as 别名]
 def begin(self, range, label, gui, tipCategory, zoneId):
     info = self.textures[ZoneUtil.isCogHQZone(zoneId) if zoneId else 2]
     self.waitBar['range'] = range
     self.title['text'] = label
     self.__count = 0
     self.__expectedCount = range
     if gui:
         if base.localAvatarStyle:
             from toontown.toon import Toon
             bored = {'emote':'bored', 'frame':135} #must define before list
             run = {'emote':'run', 'frame':7}
             victory = {'emote':'victory', 'frame':10}
             applause = {'emote':'applause', 'frame':23}
             dust = {'emote':'sprinkle-dust', 'frame':40}
             hypno = {'emote':'hypnotize', 'frame':25}
             cringe = {'emote':'cringe', 'frame':25}
             wave = {'emote':'wave', 'frame':25}
             shrug = {'emote':'shrug', 'frame':30}
             duck = {'emote':'duck', 'frame':40}
             up = {'emote':'up', 'frame':60}
             pushup = {'emote':'down', 'frame':23}
             bow = {'emote':'bow', 'frame':45}
             emotelist = [bored, run, victory, applause, dust,
                          hypno, cringe, wave, shrug, duck,
                          up, pushup, bow]
             emotechosen = random.choice(emotelist)
             self.toon = Toon.Toon()
             self.toon.setDNA(base.localAvatarStyle)
             self.toon.pose(emotechosen['emote'], emotechosen['frame'])
             self.toon.getGeomNode().setDepthWrite(1)
             self.toon.getGeomNode().setDepthTest(1)
             self.toon.setHpr(205, 0, 0)
             self.toon.setScale(0.18)
             self.toon.setPos(base.a2dBottomRight.getX()/1.25, 0, -0.034)
             self.toon.reparentTo(self.waitBar)
         self.waitBar['frameSize'] = (base.a2dLeft+(base.a2dRight/4.95), base.a2dRight-(base.a2dRight/4.95), -0.03, 0.03)
         self.title['text_font'] = info[1]
         self.title['text_fg'] = info[2]
         self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
         self.title.setPos(base.a2dRight/5, 0, 0.235)
         self.tip['text'] = self.getTip(tipCategory)
         self.gui.setPos(0, -0.1, 0)
         self.gui.reparentTo(aspect2d, LOADING_SCREEN_SORT_INDEX)
         self.gui.setTexture(info[0], 1)
         self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
     else:
         self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
         self.gui.reparentTo(hidden)
         self.logo.reparentTo(hidden)
     self.tip.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
     self.waitBar.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
     self.waitBar.update(self.__count)
开发者ID:crater0,项目名称:Toontown-2,代码行数:54,代码来源:ToontownLoadingScreen.py

示例4: begin

# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isCogHQZone [as 别名]
 def begin(self, range, label, gui, tipCategory, zoneId):
     info = self.textures[ZoneUtil.isCogHQZone(zoneId) if zoneId else 2]
     self.waitBar['range'] = range
     self.title['text'] = label
     self.__count = 0
     self.__expectedCount = range
     if gui:
         self.waitBar['frameSize'] = (base.a2dLeft+(base.a2dRight/4.95), base.a2dRight-(base.a2dRight/4.95), -0.03, 0.03)
         self.title['text_font'] = info[1]
         self.title['text_fg'] = info[2]
         self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
         self.title.setPos(base.a2dRight/5, 0, 0.235)
         self.tip['text'] = self.getTip(tipCategory)
         self.gui.setPos(0, -0.1, 0)
         self.gui.reparentTo(aspect2d, LOADING_SCREEN_SORT_INDEX)
         self.gui.setTexture(info[0], 1)
         self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
     else:
         self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
         self.gui.reparentTo(hidden)
         self.logo.reparentTo(hidden)
     self.tip.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
     self.waitBar.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
     self.waitBar.update(self.__count)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:26,代码来源:ToontownLoadingScreen.py


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