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


Python SuitBattleGlobals.pickFromFreqList方法代码示例

本文整理汇总了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)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:14,代码来源:DistributedSuitPlannerAI.py

示例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
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:14,代码来源:DistributedSuitBaseAI.py

示例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
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:14,代码来源:DistributedSuitBaseAI.py

示例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
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:17,代码来源:DistributedSuitBaseAI.py


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