本文整理汇总了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
示例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)