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
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
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
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
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
def create_minion(self, player): minion = Minion(3, 5) minion.windfury = True minion.charge = True minion.divine_shield = True minion.taunt = True return minion
def create_minion(self, player): def did_damage(amount, target): target.freeze() minion = Minion(3, 6) minion.bind("did_damage", did_damage) return 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
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
def create_minion(self, player): def draw_card(): player.draw() minion = Minion(0, 3, MINION_TYPE.TOTEM) player.bind("turn_ended", draw_card) minion.bind_once("silenced", lambda: player.unbind("turn_ended", draw_card)) return 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
def create_minion(self, player): enemy_hero = player.game.other_player def deal_enemy_hero_two_damage(minion): enemy_hero.damage(2) minion = Minion(2, 1) minion.deathrattle = deal_enemy_hero_two_damage return minion
def create_minion(self, player): def buff_minion(): minion.increase_health(1) minion.change_attack(1) minion = Minion(2, 4) player.bind("overloaded", buff_minion) minion.bind_once("silenced", lambda: player.unbind("overloaded", buff_minion)) return 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
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))
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))
def create_minion(self, player): def silence(): player.heal_multiplier //= 2 player.spell_multiplier //= 2 minion = Minion(7, 7) minion.bind_once("silenced", silence) player.heal_multiplier *= 2 player.spell_multiplier *= 2 return minion
def create_minion(self, player): def attack_equal_to_health(): return minion.health def silence(): minion.calculate_attack = old_calculate minion = Minion(0, 5) old_calculate = minion.calculate_attack minion.calculate_attack = attack_equal_to_health minion.bind_once("silenced", silence) return 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
def create_minion(self, player): class Filter: def __init__(self): self.amount = 1 self.filter = lambda c: c.is_spell() self.min = 0 filter = Filter() minion = Minion(3, 2) minion.bind_once("silence", lambda: player.mana_filters.remove(filter)) minion.bind_once("died", lambda x: player.mana_filters.remove(filter)) player.mana_filters.append(filter) return minion
def create_minion(self, player): def heal_damaged_friendly_character(): targets = hsgame.targeting.find_friendly_spell_target(player.game, lambda character: character.health != character.calculate_max_health()) if len(targets) != 0: targets[player.game.random(0, len(targets) - 1)].heal(player.effective_heal_power(3), minion) minion = Minion(0, 5) player.bind("turn_started", heal_damaged_friendly_character) minion.bind_once("silenced", lambda: player.unbind("turn_started", heal_damaged_friendly_character)) return minion
def create_minion(self, player): def silence(): player.heal_does_damage = False # If another Auchenai Soulpriest is alive and not silenced, keep # heal_does_damage as True for m in player.minions: if m.card.name == "Auchenai Soulpriest" and not m.silenced and m is not minion: player.heal_does_damage = True minion = Minion(3, 5) minion.bind_once("silenced", silence) player.heal_does_damage = True return minion
def create_minion(self, player): def reduce_mana(card): def increase_mana(c): c.mana += 1 if card.is_spell(): if card.mana > 0: card.mana -= 1 minion.bind("silence", increase_mana, card) minion.bind("died", lambda x, c: increase_mana(c), card) minion = Minion(3, 2) for hand_card in player.hand: reduce_mana(hand_card) player.bind("card_drawn", reduce_mana) minion.bind_once("silence", lambda: player.unbind("card_drawn", reduce_mana)) minion.bind_once("died", lambda x: player.unbind("card_drawn", reduce_mana)) return 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
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
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
def create_minion(self, player): # These are basically placeholders to give the agent something to # choose class Health(Card): def __init__(self): super().__init__("+5 Health and Taunt", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL) class Attack(Card): def __init__(self): super().__init__("+5 Attack", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL) health = Health() attack = Attack() option = player.agent.choose_option(health, attack) minion = Minion(5, 5) if option is health: minion.increase_health(5) minion.taunt = True else: minion.change_attack(5) return minion
def create_minion(self, player): class Moonfire(Card): def __init__(self): super().__init__("Moonfire", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.RARE) class Dispel(Card): def __init__(self): super().__init__("Dispel", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.RARE) moonfire = Moonfire() dispell = Dispel() option = player.agent.choose_option(moonfire, dispell) minion = Minion(2, 4) if option == moonfire: minion.battlecry = deal_two_damage else: minion.battlecry = silence return minion
def create_minion(self, player): def poisonous(amount, target): if type(target) is Minion and not target.dead: target.die(self) minion = Minion(2, 3, MINION_TYPE.BEAST) minion.bind("did_damage", poisonous) minion.bind_once("silenced", lambda: minion.unbind("did_damage", poisonous)) return minion
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)