本文整理汇总了Python中hearthbreaker.game_objects.Minion.bind方法的典型用法代码示例。如果您正苦于以下问题:Python Minion.bind方法的具体用法?Python Minion.bind怎么用?Python Minion.bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hearthbreaker.game_objects.Minion
的用法示例。
在下文中一共展示了Minion.bind方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_minion
# 需要导入模块: from hearthbreaker.game_objects import Minion [as 别名]
# 或者: from hearthbreaker.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def add_effect(m, index):
m.add_aura(1, 0, [player], lambda mini: mini is not minion)
minion = Minion(2, 4, MINION_TYPE.BEAST)
minion.bind("added_to_board", add_effect)
return minion
示例2: create_minion
# 需要导入模块: from hearthbreaker.game_objects import Minion [as 别名]
# 或者: from hearthbreaker.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def did_damage(amount, target):
target.freeze()
minion = Minion(3, 6)
minion.bind("did_damage", did_damage)
return minion
示例3: create_minion
# 需要导入模块: from hearthbreaker.game_objects import Minion [as 别名]
# 或者: from hearthbreaker.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def poisonous(amount, target):
if type(target) is Minion:
target.die(self)
minion = Minion(1, 1, stealth=True)
minion.bind("did_damage", poisonous)
minion.bind_once("silenced", lambda: minion.unbind("did_damage", poisonous))
return minion
示例4: create_minion
# 需要导入模块: from hearthbreaker.game_objects import Minion [as 别名]
# 或者: from hearthbreaker.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def increase_attack():
minion.change_attack(6)
def decrease_attack():
minion.change_attack(-6)
def silenced():
minion.unbind("enraged", increase_attack)
minion.unbind("unenraged", decrease_attack)
minion = Minion(4, 9, charge=True)
minion.bind("enraged", increase_attack)
minion.bind("unenraged", decrease_attack)
minion.bind("silenced", silenced)
return minion