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


Python ToontownGlobals.cogHQZoneId2deptIndex方法代码示例

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


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

示例1: checkBoard

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def checkBoard(self, av):
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.zone)
     if av.hp < self.minLaff:
         return REJECT_MINLAFF
     if not av.readyForPromotion(dept):
         return REJECT_PROMOTION
     return 0
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:9,代码来源:DistributedBossElevatorAI.py

示例2: initToonState

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
    def initToonState(self):
        self.setAnimState('neutral', 0.9, None, None)
        self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId), rental=True)

        if self.name in NPCToons.LaffRestockPositions:
            pos = NPCToons.LaffRestockPositions[self.name]
            self.setPos(*pos[0])
            self.setH(pos[1])
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:10,代码来源:DistributedNPCLaffRestock.py

示例3: setFromAvatar

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
    def setFromAvatar(self, av):
        rewardIds = []
        for q in av.quests:
            questId, fromNpcId, toNpcId, rewardId, toonProgress = q
            if rewardId == Quests.NA:
                rewardId = Quests.getFinalRewardId(questId, fAll=1)
            rewardIds.append(rewardId)

        self.notify.debug('Ignoring rewards: %s' % rewardIds)
        self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
        fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % fishHp)
        self.maxHp += fishHp
        flowerHp = int(len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % flowerHp)
        self.maxHp += flowerHp
        HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.SellbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.LawbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.CashbotHQ))
        levels = av.getCogLevels()
        cogTypes = av.getCogTypes()
        suitHp = 0
        for dept in HQdepts:
            level = levels[dept]
            type = cogTypes[dept]
            if type >= SuitDNA.suitsPerDept - 1:
                for milestoneLevel in ToontownGlobals.CogSuitHPLevels:
                    if level >= milestoneLevel:
                        suitHp += 1
                    else:
                        break

        self.notify.debug('Adding %s hp for cog suits' % suitHp)
        self.maxHp += suitHp
        kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
        self.maxHp += kartingHp
        golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for golf trophies' % golfHp)
        self.maxHp += golfHp
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:40,代码来源:QuestRewardCounter.py

示例4: handleToonsWon

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def handleToonsWon(self, toons):
     extraMerits = [0, 0, 0, 0]
     amount = ToontownGlobals.CountryClubCogBuckRewards[self.level.countryClubId]
     index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.countryClubId)
     extraMerits[index] = amount
     for toon in toons:
         recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId())
         self.toonItems[toon.doId][0].extend(recovered)
         self.toonItems[toon.doId][1].extend(notRecovered)
         meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getCountryClubCreditMultiplier(self.getTaskZoneId()), extraMerits=extraMerits)
         if toon.doId in self.helpfulToons:
             self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
         else:
             self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:16,代码来源:DistributedCountryClubBattleAI.py

示例5: requestExit

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def requestExit(self):
     avatarID = self.air.getAvatarIdFromSender()
     if avatarID in self.avatarsWhoAreEntering:
         del self.avatarsWhoAreEntering[avatarID]
     if avatarID not in self.avatarsWhoAreExiting:
         dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
         self.avatarsWhoAreExiting[avatarID] = 1
         self.sendUpdate('avatarExit', [avatarID])
         self.openDoor(self.exitDoorFSM)
         if self.lockedDoor:
             av = self.air.doId2do[avatarID]
             if self.doorType == DoorTypes.EXT_COGHQ:
                 av.b_setCogIndex(-1)
             else:
                 av.b_setCogIndex(dept)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:17,代码来源:DistributedCogHQDoorAI.py

示例6: requestEnter

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def requestEnter(self):
     avId = self.air.getAvatarIdFromSender()
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
     av = self.air.doId2do.get(avId)
     if av:
         if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
             parts = av.getCogParts()
             if CogDisguiseGlobals.isSuitComplete(parts, dept):
                 allowed = 1
             else:
                 allowed = 0
         else:
             allowed = 1
         if not allowed:
             self.sendReject(avId, self.isLockedDoor())
         else:
             print("********\nRequesting Lobby GUI...\n********")
             self.sendUpdate('selectLobby', [avId])
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:20,代码来源:DistributedCogHQExteriorDoorAI.py

示例7: requestEnter

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def requestEnter(self):
     avatarID = self.air.getAvatarIdFromSender()
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
     av = self.air.doId2do.get(avatarID)
     if av:
         if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
             parts = av.getCogParts()
             if CogDisguiseGlobals.isSuitComplete(parts, dept):
                 allowed = 1
             else:
                 allowed = 0
         else:
             allowed = 1
         if not allowed:
             self.sendReject(avatarID, self.isLockedDoor())
         else:
             self.enqueueAvatarIdEnter(avatarID)
             self.sendUpdateToAvatarId(avatarID, 'setOtherZoneIdAndDoId', [self.destinationZone, self.otherDoor.getDoId()])
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:20,代码来源:DistributedCogHQDoorAI.py

示例8: __init__

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
 def __init__(self, air, bldg, mintId, antiShuffle = 0, minLaff = 0):
     DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, antiShuffle=antiShuffle, minLaff=minLaff)
     self.mintId = mintId
     self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId)
     self.type = ELEVATOR_MINT
     self.countdownTime = ElevatorData[self.type]['countdown']
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:8,代码来源:DistributedMintElevatorExtAI.py

示例9: initToonState

# 需要导入模块: from src.toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from src.toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
    def initToonState(self):
        if self.name in NPCToons.ClerkPositions:
            self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId), rental=True)

        self.setAnimState('neutral', 0.9, None, None)
        self.updatePosition()
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:8,代码来源:DistributedNPCClerk.py


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