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


Python NPCToons.getNPCTrack方法代码示例

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


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

示例1: findToonAttack

# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import getNPCTrack [as 别名]
def findToonAttack(toons, attacks, track):
    foundAttacks = []
    for t in toons:
        if attacks.has_key(t):
            attack = attacks[t]
            local_track = attack[TOON_TRACK_COL]
            if track != NPCSOS and attack[TOON_TRACK_COL] == NPCSOS:
                local_track = NPCToons.getNPCTrack(attack[TOON_TGT_COL])
            if local_track == track:
                if local_track == FIRE:
                    canFire = 1
                    for attackCheck in foundAttacks:
                        if attackCheck[TOON_TGT_COL] == attack[TOON_TGT_COL]:
                            canFire = 0

                    if canFire:
                        foundAttacks.append(attack)
                else:
                    foundAttacks.append(attack)

    def compFunc(a, b):
        if a[TOON_LVL_COL] > b[TOON_LVL_COL]:
            return 1
        elif a[TOON_LVL_COL] < b[TOON_LVL_COL]:
            return -1
        return 0

    foundAttacks.sort(compFunc)
    return foundAttacks
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:31,代码来源:BattleBase.py

示例2: __updateNPCFriendsPanel

# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import getNPCTrack [as 别名]
    def __updateNPCFriendsPanel(self):
        self.NPCFriends = {}
        for friend, count in base.localAvatar.NPCFriendsDict.items():
            track = NPCToons.getNPCTrack(friend)
            if track == ToontownBattleGlobals.LURE_TRACK and self.canLure == 0 or track == ToontownBattleGlobals.TRAP_TRACK and self.canTrap == 0:
                self.NPCFriends[friend] = 0
            else:
                self.NPCFriends[friend] = count

        self.NPCFriendPanel.update(self.NPCFriends, fCallable=1)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:12,代码来源:TownBattleSOSPanel.py


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