本文整理汇总了Python中hsgame.game_objects.Minion类的典型用法代码示例。如果您正苦于以下问题:Python Minion类的具体用法?Python Minion怎么用?Python Minion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Minion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_minion
def create_minion(self, player):
# These are basically placeholders to give the agent something to
# choose
class CatForm(Card):
def __init__(self):
super().__init__("Cat Form", 0, CHARACTER_CLASS.DRUID,
CARD_RARITY.SPECIAL)
class BearForm(Card):
def __init__(self):
super().__init__("Bear Form", 0, CHARACTER_CLASS.DRUID,
CARD_RARITY.SPECIAL)
cat = CatForm()
bear = BearForm()
option = player.agent.choose_option(cat, bear)
if option is cat:
minion = Minion(4, 4)
minion.charge = True
else:
minion = Minion(4, 6)
minion.taunt = True
return minion
示例2: create_minion
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
示例3: create_minion
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
def create_minion(self, player):
minion = Minion(2, 2)
for combo in range(0, player.cards_played):
minion.increase_health(2)
minion.change_attack(2)
return minion
示例5: create_minion
def create_minion(self, player):
def increase_attack(card):
minion.increase_attack(1)
minion = Minion(1, 3)
player.bind("spell_cast", increase_attack)
minion.bind_once("silenced", lambda: player.unbind("spell_cast", increase_attack))
return minion
示例6: create_minion
def create_minion(self, player):
minion = Minion(3, 5)
minion.windfury = True
minion.charge = True
minion.divine_shield = True
minion.taunt = True
return minion
示例7: create_minion
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
示例8: create_minion
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
示例9: create_minion
def create_minion(self, player):
def draw_card():
player.draw()
minion = Minion(1, 3)
player.game.bind("minion_healed", draw_card)
minion.bind_once("silenced",
lambda: player.game.unbind("minion_healed",
draw_card))
return minion
示例10: summon_treant
def summon_treant(*args):
class Treant(MinionCard):
def __init__(self):
super().__init__("Treant", 1, CHARACTER_CLASS.DRUID, CARD_RARITY.COMMON)
def create_minion(self):
return Minion(2, 2)
treant = Minion(2, 2)
treant.add_to_board(Treant(), game, player, len(player.minions))
示例11: use
def use(self, player, game):
class Panther(MinionCard):
def __init__(self):
super().__init__("Panther", 2, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL)
def create_minion(self):
return Minion(3, 2, MINION_TYPE.BEAST)
panther = Minion(3, 2, MINION_TYPE.BEAST)
panther.add_to_board(Panther(), game, player, len(player.minions))
示例12: create_minion
def create_minion(self, player):
def increase_stats():
if len(player.secrets) > 0:
minion.change_attack(2)
minion.increase_health(2)
def silence():
player.unbind("turn_ended", increase_stats)
minion = Minion(3, 3)
player.bind("turn_ended", increase_stats)
minion.bind_once("silenced", silence)
return minion
示例13: create_minion
def create_minion(self, player):
class Ashbringer(WeaponCard):
def __init__(self):
super().__init__("Ashbringer", 5, CHARACTER_CLASS.PALADIN, CARD_RARITY.LEGENDARY)
def create_weapon(self, player):
weapon = Weapon(5, 3)
return weapon
def equip_ashbringer(minion):
ashbringer = Ashbringer().create_weapon(player)
ashbringer.equip(player)
minion = Minion(6, 6, deathrattle=equip_ashbringer)
minion.divine_shield = True
minion.taunt = True
return minion
示例14: create_minion
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
示例15: use
def use(self, player, game):
super().use(player, game)
class MirrorImageMinion(MinionCard):
def __init__(self):
super().__init__("Mirror Image", 0, CHARACTER_CLASS.MAGE, CARD_RARITY.SPECIAL, False)
def create_minion(self, player):
minion = Minion(0, 2)
minion.taunt = True
return minion
minion1 = Minion(0, 2)
minion2 = Minion(0, 2)
minion1.taunt = True
minion2.taunt = True
minion1.add_to_board(MirrorImageMinion(), game, player, 0)
minion2.add_to_board(MirrorImageMinion(), game, player, 0)