本文整理汇总了Python中toontown.battle.SuitBattleGlobals.pickFromFreqList方法的典型用法代码示例。如果您正苦于以下问题:Python SuitBattleGlobals.pickFromFreqList方法的具体用法?Python SuitBattleGlobals.pickFromFreqList怎么用?Python SuitBattleGlobals.pickFromFreqList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.battle.SuitBattleGlobals
的用法示例。
在下文中一共展示了SuitBattleGlobals.pickFromFreqList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pickLevelTypeAndTrack
# 需要导入模块: from toontown.battle import SuitBattleGlobals [as 别名]
# 或者: from toontown.battle.SuitBattleGlobals import pickFromFreqList [as 别名]
def pickLevelTypeAndTrack(self, level=None, type=None, track=None):
if level is None:
level = random.choice(self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_LVL])
if type is None:
typeChoices = range(max(level - 4, 1), min(level, self.MAX_SUIT_TYPES) + 1)
type = random.choice(typeChoices)
else:
level = min(max(level, type), type + 4)
if track is None:
track = SuitDNA.suitDepts[SuitBattleGlobals.pickFromFreqList(self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_TRACK])]
self.notify.debug('pickLevelTypeAndTrack: %s %s %s' % (level, type, track))
return (level, type, track)
示例2: setLevel
# 需要导入模块: from toontown.battle import SuitBattleGlobals [as 别名]
# 或者: from toontown.battle.SuitBattleGlobals import pickFromFreqList [as 别名]
def setLevel(self, lvl=None):
attributes = SuitBattleGlobals.SuitAttributes[self.dna.name]
if lvl is not None:
self.level = lvl - attributes["level"] - 1
else:
self.level = SuitBattleGlobals.pickFromFreqList(attributes["freq"])
self.notify.debug("Assigning level " + str(lvl))
if hasattr(self, "doId"):
self.d_setLevelDist(self.level)
hp = attributes["hp"][self.level]
self.maxHP = hp
self.currHP = hp
示例3: setLevel
# 需要导入模块: from toontown.battle import SuitBattleGlobals [as 别名]
# 或者: from toontown.battle.SuitBattleGlobals import pickFromFreqList [as 别名]
def setLevel(self, lvl = None):
attributes = SuitBattleGlobals.SuitAttributes[self.dna.name]
if lvl is not None:
self.level = lvl - attributes['level'] - 1
else:
self.level = SuitBattleGlobals.pickFromFreqList(attributes['freq'])
self.notify.debug('Assigning level ' + str(lvl))
if hasattr(self, 'doId'):
self.d_setLevelDist(self.level)
hp = attributes['hp'][self.level]
self.maxHP = hp
self.currHP = hp
示例4: setLevel
# 需要导入模块: from toontown.battle import SuitBattleGlobals [as 别名]
# 或者: from toontown.battle.SuitBattleGlobals import pickFromFreqList [as 别名]
def setLevel(self, lvl = None):
attributes = SuitBattleGlobals.SuitAttributes[self.dna.name]
if lvl is not None:
self.level = lvl - attributes['level'] - 1
else:
self.level = SuitBattleGlobals.pickFromFreqList(attributes['freq'])
self.notify.debug('Assigning level ' + str(lvl))
if hasattr(self, 'doId'):
self.d_setLevelDist(self.level)
if len(attributes['hp'])<=self.level:
print "HP is less then level, Oops!"
raise Exception("invalid list index: len(attributes['hp') = %d, self.level=%d" % (len(attributes['hp']), self.level))
hp = attributes['hp'][self.level]
self.maxHP = hp
self.currHP = hp