本文整理汇总了Python中hsgame.game_objects.Minion.bind方法的典型用法代码示例。如果您正苦于以下问题:Python Minion.bind方法的具体用法?Python Minion.bind怎么用?Python Minion.bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hsgame.game_objects.Minion
的用法示例。
在下文中一共展示了Minion.bind方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def silence():
minion.spell_targettable = lambda : True
minion = Minion(3, 2, MINION_TYPE.DRAGON)
minion.spell_targettable = lambda: False
minion.bind("silenced", silence())
return minion
示例2: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.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 hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def first_secret_cost_zero(m):
class Filter:
def __init__(self):
#To make sure that no matter what the cost of a secret, it will be 0
self.amount = 100
self.filter = lambda c: type(c) in SecretCard.__subclasses__()
self.min = 0
def card_used(card):
if type(card) in SecretCard.__subclasses__():
player.unbind("card_used", card_used)
player.unbind("turn_ended", turn_ended)
player.mana_filters.remove(mana_filter)
def turn_ended():
player.unbind("card_used", card_used)
player.mana_filters.remove(mana_filter)
mana_filter = Filter()
player.bind("card_used", card_used)
player.bind_once("turn_ended", turn_ended)
player.mana_filters.append(mana_filter)
minion = Minion(4, 3)
minion.bind("added_to_board", first_secret_cost_zero)
return minion
示例4: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def add_effect(m, index):
m.add_aura(2, 0, lambda mini: mini.index is m.index - 1 or mini.index is m.index + 1)
minion = Minion(0, 3, MINION_TYPE.TOTEM)
minion.bind("added_to_board", add_effect)
return minion
示例5: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def add_effect(m, index):
m.add_aura(1, 1, lambda mini: mini is not minion)
minion = Minion(6, 6)
minion.bind("added_to_board", add_effect)
return minion
示例6: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def add_effect(m, index):
m.add_aura(1, 0, lambda mini: mini is not minion and mini.minion_type is MINION_TYPE.BEAST)
minion = Minion(1, 1, MINION_TYPE.BEAST)
minion.bind("added_to_board", add_effect)
return minion
示例7: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
def poisonous(amount, target):
if type(target) is Minion and not target.dead:
target.die(self)
minion = Minion(1, 1)
minion.stealth = True
minion.bind("did_damage", poisonous)
minion.bind_once("silenced", lambda: minion.unbind("did_damage", poisonous))
return minion
示例8: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
class Moonfire(Card):
def __init__(self):
super().__init__("Moonfire", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.RARE, False)
class Dispel(Card):
def __init__(self):
super().__init__("Dispel", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.RARE, False)
moonfire = Moonfire()
dispell = Dispel()
option = player.agent.choose_option(moonfire, dispell)
minion = Minion(2, 4)
if option == moonfire:
minion.bind("added_to_board", deal_two_damage)
else:
minion.bind("added_to_board", silence)
return minion
示例9: create_minion
# 需要导入模块: from hsgame.game_objects import Minion [as 别名]
# 或者: from hsgame.game_objects.Minion import bind [as 别名]
def create_minion(self, player):
minion = Minion(2, 2)
minion.bind("added_to_board", give_divine_shield)
return minion