本文整理汇总了Python中monster.Monster.new_from_race方法的典型用法代码示例。如果您正苦于以下问题:Python Monster.new_from_race方法的具体用法?Python Monster.new_from_race怎么用?Python Monster.new_from_race使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monster.Monster
的用法示例。
在下文中一共展示了Monster.new_from_race方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import new_from_race [as 别名]
def __init__(self, _base):
GameState.__init__(self, _base)
self.accept("enter", self.cb_next_turn)
self.clock = ClockObject()
g_race = "golem" if self.player.monster.race.lower() == "ogre" else "ogre"
hpr_list = ((-90, 0, 0), (90, 0, 0))
pos_list = ((-2, 2, 0), (2, 2, 0))
monster_list = ((self.player.monster,)*3, (Monster.new_from_race(g_race),)*3)
# self.teams = [CombatTeam(monster_list[i], pos_list[i], hpr_list[i]) for i in range(2)]
self.combat_world = CombatWorld()
self.combat_world.add_team(monster_list[0], pos_list[0], hpr_list[0])
self.combat_world.add_team(monster_list[1], pos_list[1], hpr_list[1])
self.teams = self.combat_world.teams
self.teams[0].set_targets(self.teams[1])
self.teams[1].set_targets(self.teams[0])
# Combatants
self.combatants = {}
self.combatants['red'] = self.player.monster
self.combatants['red'].current_stamina = 50
self.combatants['red'].current_hp = self.combatants['red'].hp
g_race = "golem" if self.player.monster.race.lower() == "ogre" else "ogre"
self.combatants['green'] = Monster.new_from_race(g_race)
self.combatants['green'].current_hp = self.combatants['green'].hp
self.combatants['green'].current_stamina = 50
self.combatants['red'].target = self.combatants['green']
self.combatants['green'].target = self.combatants['red']
# Combat vars
self.combat_time = 60.0
self.turn = 60
self.player_spells = [
commands.Attack,
commands.Wait,
]
self.base.background.setImage("art/background.png")
self.player_command = None
self.setup_ui()
示例2: set_monster
# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import new_from_race [as 别名]
def set_monster(race):
self.player.monster = Monster.new_from_race(race)
self.load_monster_mesh()