Example #1
0
 def use(self, player, game):
     super().use(player, game)
     query = CardQuery(conditions=[IsMinion()])
     new_minon = query.get_card(player, self)
     new_minon.add_buff(Buff(ManaChange(-3)))
     player.hand.append(new_minon)
     new_minon.attach(new_minon, player)
Example #2
0
 def __init__(self, card, count=1, add_to_deck=False):
     if isinstance(card, CardQuery):
         self.card = card
     else:
         self.card = CardQuery(card.ref_name)
     self.add_to_deck = add_to_deck
     self.count = count
Example #3
0
 def use(self, player, game):
     super().use(player, game)
     if self.target.health <= player.effective_spell_damage(2) and \
             (isinstance(self.target, Minion) and not self.target.divine_shield):
         self.target.damage(player.effective_spell_damage(2), self)
         demons = CardQuery(conditions=[IsType(MINION_TYPE.DEMON)])
         demons.get_card(player, player, self).summon(player, game, len(player.minions))
     else:
         self.target.damage(player.effective_spell_damage(2), self)
Example #4
0
 def use(self, player, game):
     super().use(player, game)
     if self.target.health <= player.effective_spell_damage(2) and \
             (isinstance(self.target, Minion) and not self.target.divine_shield):
         self.target.damage(player.effective_spell_damage(2), self)
         demons = CardQuery(conditions=[IsType(MINION_TYPE.DEMON)])
         demons.get_card(player, self).summon(player, game,
                                              len(player.minions))
     else:
         self.target.damage(player.effective_spell_damage(2), self)
Example #5
0
class ApplySecret(Action):

    def __init__(self, source):
        self.source = source
        self._query = CardQuery(conditions=[IsSecret()], source=source)

    def act(self, actor, target, other=None):
        secret = self._query.get_card(target, target, actor)
        if secret:
            target.secrets.append(secret)
            secret.player = target
            if target is target.game.other_player:
                secret.player = target
                # To allow for Mad Scientist not to be redeemed or duplicated as a result of its death,
                # but still allow other minions that die during the same cycle to be duplicated.
                # Based on testing for patch 2.1.0.7785
                if actor.dead:
                    target.bind_once("after_death", secret.activate)
                else:
                    secret.activate(target)

    def __to_json__(self):
        return {
            'name': 'apply_secret',
            'source': CARD_SOURCE.to_str(self.source)
        }

    def __from_json__(self, source):
        self.source = CARD_SOURCE.from_str(source)
        self._query = CardQuery(conditions=[IsSecret()], source=self.source)
        return self
Example #6
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, actor)
        if target.is_card():
            target.replace(card)
        elif target.is_minion():
            minion = card.create_minion(target.player)
            minion.card = card
            target.replace(minion)
        elif target.is_hero():
            hero = card.create_hero(target.player)
            hero.card = card
            target.player.trigger("minion_played", actor)
            hero.buffs = copy.deepcopy(actor.buffs)
            hero.health = actor.health
            target.replace(hero)
            if hero.health <= 0:
                hero.die(None)

    def __to_json__(self):
        return {'name': 'transform', 'card': self.card}

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
 def __init__(self, card, count=1, add_to_deck=False):
     if isinstance(card, CardQuery):
         self.card = card
     else:
         self.card = CardQuery(card.ref_name)
     self.add_to_deck = add_to_deck
     self.count = count
Example #8
0
class ReplaceHeroWithMinion(Action):
    # Used only for Jaraxxus currently
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target.player, actor)

        hero = card.create_hero(target.player)
        hero.card = card
        target.player.trigger("minion_played", actor)
        hero.buffs = copy.deepcopy(actor.buffs)
        hero.health = actor.health
        target.replace(hero)
        if hero.health <= 0:
            hero.die(None)

    def __to_json__(self):
        return {
            'name': 'replace_hero_with_minion',
            'card': self.card
        }

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #9
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target.player, actor)
        if target.is_card():
            target.replace(card)
        elif target.is_minion():
            minion = card.create_minion(target.player)
            minion.card = card
            target.replace(minion)
        elif target.is_hero():
            hero = card.create_hero(target.player)
            hero.card = card
            target.player.trigger("minion_played", actor)
            hero.buffs = copy.deepcopy(actor.buffs)
            hero.health = actor.health
            target.replace(hero)
            if hero.health <= 0:
                hero.die(None)

    def __to_json__(self):
        return {
            'name': 'transform',
            'card': self.card
        }

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #10
0
class ApplySecret(Action):
    def __init__(self, source):
        self.source = source
        self._query = CardQuery(conditions=[IsSecret()], source=source)

    def act(self, actor, target, other=None):
        secret = self._query.get_card(target, actor)
        if secret:
            target.secrets.append(secret)
            secret.player = target
            if target is target.game.other_player:
                secret.player = target
                # To allow for Mad Scientist not to be redeemed or duplicated as a result of its death,
                # but still allow other minions that die during the same cycle to be duplicated.
                # Based on testing for patch 2.1.0.7785
                if actor.dead:
                    target.bind_once("after_death", secret.activate)
                else:
                    secret.activate(target)

    def __to_json__(self):
        return {
            'name': 'apply_secret',
            'source': CARD_SOURCE.to_str(self.source)
        }

    def __from_json__(self, source):
        self.source = CARD_SOURCE.from_str(source)
        self._query = CardQuery(conditions=[IsSecret()], source=self.source)
        return self
Example #11
0
class ApplySecret(Action):

    def __init__(self, source):
        self.source = source
        self._query = CardQuery(conditions=[IsSecret()], source=source)

    def act(self, actor, target):
        secret = self._query.get_card(target)
        if secret:
            target.secrets.append(secret)
            secret.player = target
            if target is target.game.other_player:
                secret.player = target
                secret.activate(target)

    def __to_json__(self):
        return {
            'name': 'apply_secret',
            'source': CARD_SOURCE.to_str(self.source)
        }

    def __from_json__(self, source):
        self.source = CARD_SOURCE.from_str(source)
        self._query = CardQuery(conditions=[IsSecret()], source=self.source)
        return self
Example #12
0
 def create_minion(self, player):
     return Minion(
         1,
         1,
         deathrattle=Deathrattle(
             AddCard(CardQuery(conditions=[IsType(MINION_TYPE.BEAST)])),
             PlayerSelector()))
Example #13
0
 def create_minion(self, player):
     return Minion(5, 8, effects=[Effect(SpellCast(Not(HasCardName("Gallywix's Coin")), EnemyPlayer()),
                                         ActionTag(AddCard(CardQuery(source=CARD_SOURCE.LAST_CARD)),
                                         PlayerSelector(FriendlyPlayer()))),
                                  Effect(SpellCast(Not(HasCardName("Gallywix's Coin")), EnemyPlayer()),
                                         ActionTag(AddCard(GallywixsCoin()),
                                         PlayerSelector(EnemyPlayer())))])
Example #14
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target.player, actor)
        if target.is_card():
            target.replace(card)
        elif target.is_minion():
            minion = card.create_minion(target.player)
            minion.card = card
            target.replace(minion)
        elif target.is_hero():
            hero = card.create_hero(target.player)
            target.replace(hero)

    def __to_json__(self):
        return {
            'name': 'transform',
            'card': self.card
        }

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #15
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target.player, actor)
        if target.is_card():
            target.replace(card)
        elif target.is_minion():
            minion = card.create_minion(target.player)
            minion.card = card
            target.replace(minion)
        elif target.is_hero():
            hero = card.create_hero(target.player)
            target.replace(hero)

    def __to_json__(self):
        return {'name': 'transform', 'card': self.card}

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #16
0
 def __init__(self):
     from hearthbreaker.cards.minions.neutral import BluegillWarrior, ColdlightOracle, ColdlightSeer, \
         GrimscaleOracle, MurlocRaider, MurlocTidecaller, MurlocTidehunter, MurlocWarleader, OldMurkEye, \
         Puddlestomper
     murloc_list = [
         BluegillWarrior(),
         ColdlightOracle(),
         ColdlightSeer(),
         GrimscaleOracle(),
         MurlocRaider(),
         MurlocTidecaller(),
         MurlocTidehunter(),
         MurlocWarleader(),
         OldMurkEye(),
         Puddlestomper(),
         SiltfinSpiritwalker()
     ]
     super().__init__("Neptulon",
                      7,
                      CHARACTER_CLASS.SHAMAN,
                      CARD_RARITY.LEGENDARY,
                      overload=3,
                      battlecry=Battlecry(
                          AddCard(
                              CardQuery(source=CARD_SOURCE.LIST,
                                        source_list=murloc_list), 4),
                          PlayerSelector()))
Example #17
0
class ReplaceHeroWithMinion(Action):
    # Used only for Jaraxxus currently
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target.player, actor)

        hero = card.create_hero(target.player)
        hero.card = card
        target.player.trigger("minion_played", actor)
        hero.buffs = copy.deepcopy(actor.buffs)
        hero.health = actor.health
        target.replace(hero)
        if hero.health <= 0:
            hero.die(None)

    def __to_json__(self):
        return {'name': 'replace_hero_with_minion', 'card': self.card}

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #18
0
 def create_minion(self, player):
     return Minion(3,
                   4,
                   deathrattle=Deathrattle(
                       Summon(
                           CardQuery(conditions=[IsType(MINION_TYPE.DEMON)],
                                     source=CARD_SOURCE.MY_HAND)),
                       PlayerSelector()))
Example #19
0
 def create_minion(self, player):
     return Minion(9,
                   7,
                   deathrattle=[
                       Deathrattle(
                           AddCard(CardQuery(source=CARD_SOURCE.MINION,
                                             minion=SelfSelector()),
                                   add_to_deck=True), PlayerSelector()),
                       Deathrattle(Remove(), SelfSelector())
                   ])
Example #20
0
 def create_minion(self, player):
     return Minion(7,
                   6,
                   effects=[
                       Effect(
                           Damaged(),
                           ActionTag(
                               AddCard(
                                   CardQuery(source=CARD_SOURCE.LIST,
                                             source_list=spare_part_list)),
                               PlayerSelector()))
                   ])
Example #21
0
class AddCard(Action):
    def __init__(self, card, count=1, add_to_deck=False):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.add_to_deck = add_to_deck
        self.count = count

    def act(self, actor, target, other=None):
        if self.add_to_deck:
            for i in range(self.count):
                target.deck.put_back(self.card.get_card(target, target, actor))
        else:
            for i in range(self.count):
                if len(target.hand) < 10:
                    card = self.card.get_card(target, target, actor)
                    if card:
                        target.hand.append(copy.copy(card))
                        card.drawn = True

    def __to_json__(self):
        if self.add_to_deck:
            return {
                'name': 'add_card',
                'card': self.card,
                'count': self.count,
                'add_to_deck': self.add_to_deck,
            }
        return {
            'name': 'add_card',
            'card': self.card,
            'count': self.count
        }

    def __from_json__(self, card, count=1, add_to_deck=False):
        self.card = CardQuery.from_json(**card)
        self.count = count
        self.add_to_deck = add_to_deck
        return self
Example #22
0
class AddCard(Action):
    def __init__(self, card, count=1, add_to_deck=False):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.add_to_deck = add_to_deck
        self.count = count

    def act(self, actor, target, other=None):
        if self.add_to_deck:
            for i in range(self.count):
                target.deck.put_back(self.card.get_card(target, actor))
        else:
            for i in range(self.count):
                if len(target.hand) < 10:
                    card = self.card.get_card(target, actor)
                    if card:
                        target.hand.append(card)

    def __to_json__(self):
        if self.add_to_deck:
            return {
                'name': 'add_card',
                'card': self.card,
                'count': self.count,
                'add_to_deck': self.add_to_deck,
            }
        return {
            'name': 'add_card',
            'card': self.card,
            'count': self.count
        }

    def __from_json__(self, card, count=1, add_to_deck=False):
        self.card = CardQuery.from_json(**card)
        self.count = count
        self.add_to_deck = add_to_deck
        return self
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target):
        card = self.card.get_card(target)
        if card is None:
            return

        if actor.is_minion() and actor.player is target:
            # Cenaurius and Dr. Boom are special snowflakes that summon minions on either side of themselves
            if self.count == 2:
                card.summon(target, target.game, actor.index)
                card.summon(target, target.game, actor.index + 1)
            else:
                if actor.removed:
                    index = actor.index
                else:
                    index = actor.index + 1
                for summon in range(self.count):
                    card.summon(target, target.game, index)
                    index += 1
        else:
            for summon in range(self.count):
                card.summon(target, target.game, len(target.minions))

    def __to_json__(self):
        if self.count > 1:
            return {
                'name': 'summon',
                'card': self.card,
                'count': self.count
            }
        return {
            'name': 'summon',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #24
0
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, actor)
        if card is None:
            return

        if actor.is_minion() and actor.player is target:
            # When a minion is summoned around another minion, they alternate between left and right,
            # starting on the right
            if actor.removed:
                c = 0
            else:
                c = 1
            for summon in range(self.count):
                index = actor.index + (c % 2)
                card.summon(target, target.game, index)
                if not actor.removed:
                    c += 1
        else:
            for summon in range(self.count):
                card.summon(target, target.game, len(target.minions))

    def __to_json__(self):
        if self.count > 1:
            return {
                'name': 'summon',
                'card': self.card,
                'count': self.count
            }
        return {
            'name': 'summon',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #25
0
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target, other=None):
        card = self.card.get_card(target, target, actor)
        if card is None:
            return

        if actor.is_minion() and actor.player is target:
            # When a minion is summoned around another minion, they alternate between left and right,
            # starting on the right
            if actor.removed:
                c = 0
            else:
                c = 1
            for summon in range(self.count):
                index = actor.index + (c % 2)
                card.summon(target, target.game, index)
                if not actor.removed:
                    c += 1
        else:
            for summon in range(self.count):
                card.summon(target, target.game, len(target.minions))

    def __to_json__(self):
        if self.count > 1:
            return {
                'name': 'summon',
                'card': self.card,
                'count': self.count
            }
        return {
            'name': 'summon',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #26
0
 def __init__(self):
     super().__init__("Burrowing Mine",
                      0,
                      CHARACTER_CLASS.WARRIOR,
                      CARD_RARITY.COMMON,
                      False,
                      effects=[
                          Effect(Drawn(),
                                 ActionTag(Damage(10), HeroSelector())),
                          Effect(
                              Drawn(),
                              ActionTag(
                                  Discard(query=CardQuery(
                                      source=CARD_SOURCE.LAST_DRAWN)),
                                  PlayerSelector())),
                          Effect(Drawn(), ActionTag(Draw(),
                                                    PlayerSelector()))
                      ])
Example #27
0
class Equip(Action):
    def __init__(self, weapon):
        if isinstance(weapon, CardQuery):
            self.weapon = weapon
        else:
            self.weapon = CardQuery(weapon.ref_name)

    def act(self, actor, target):
        card = self.weapon.get_card(target)
        weapon = card.create_weapon(target)
        weapon.equip(target)

    def __to_json__(self):
        return {'name': 'equip', 'weapon': self.weapon}

    def __from_json__(self, weapon):
        self.weapon = CardQuery.from_json(**weapon)
        return self
Example #28
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target):
        card = self.card.get_card(target)
        minion = card.create_minion(target.player)
        minion.card = card
        target.replace(minion)

    def __to_json__(self):
        return {'name': 'transform', 'card': self.card}

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #29
0
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target):
        if actor.is_minion():
            if actor.removed:
                index = actor.index
            else:
                index = actor.index + 1
        else:
            for summon in range(self.count):
                index = len(target.minions)
        card = self.card.get_card(target)
        if card is None:
            return

        # TODO add explicit patters for multi minion summoning (if there is ever more than two)
        for summon in range(self.count):
            card.summon(target, target.game, index)
            if actor.is_minion():
                index = actor.index  # Move the later minions to the left of their originator

    def __to_json__(self):
        if self.count > 1:
            return {
                'name': 'summon',
                'card': self.card,
                'count': self.count
            }
        return {
            'name': 'summon',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #30
0
class AddCard(Action):
    def __init__(self, card):
        if isinstance(card, hearthbreaker.game_objects.Card):
            self.card = CardQuery(card.name)
        else:
            self.card = card

    def act(self, actor, target):
        if len(target.hand) < 10:
            target.hand.append(self.card.get_card(target))

    def __to_json__(self):
        return {
            'name': 'add_card',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        return self
Example #31
0
class AddCard(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target):
        for i in range(self.count):
            if len(target.hand) < 10:
                target.hand.append(self.card.get_card(target))

    def __to_json__(self):
        return {'name': 'add_card', 'card': self.card, 'count': self.count}

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #32
0
class Equip(Action):
    def __init__(self, weapon):
        if isinstance(weapon, CardQuery):
            self.weapon = weapon
        else:
            self.weapon = CardQuery(weapon.ref_name)

    def act(self, actor, target):
        card = self.weapon.get_card(target)
        weapon = card.create_weapon(target)
        weapon.equip(target)

    def __to_json__(self):
        return {
            'name': 'equip',
            'weapon': self.weapon
        }

    def __from_json__(self, weapon):
        self.weapon = CardQuery.from_json(**weapon)
        return self
Example #33
0
class Transform(Action):
    def __init__(self, card):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)

    def act(self, actor, target):
        card = self.card.get_card(target)
        minion = card.create_minion(target.player)
        minion.card = card
        target.replace(minion)

    def __to_json__(self):
        return {
            'name': 'transform',
            'card': self.card
        }

    def __from_json__(self, card):
        self.card = CardQuery.from_json(**card)
        return self
Example #34
0
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, hearthbreaker.game_objects.Card):
            self.card = CardQuery(card.name)
        else:
            self.card = card
        self.count = count

    def act(self, actor, target):
        if isinstance(actor, hearthbreaker.game_objects.Minion):
            if actor.removed:
                index = actor.index
            else:
                index = actor.index + 1
        else:
            for summon in range(self.count):
                index = len(target.minions)
        card = self.card.get_card(target)
        for summon in range(self.count):
            card.summon(target, target.game, index)

    def __to_json__(self):
        if self.count > 1:
            return {
                'name': 'summon',
                'card': self.card,
                'count': self.count
            }
        return {
            'name': 'summon',
            'card': self.card
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #35
0
class Summon(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target):
        if actor.is_minion():
            if actor.removed:
                index = actor.index
            else:
                index = actor.index + 1
        else:
            for summon in range(self.count):
                index = len(target.minions)
        card = self.card.get_card(target)
        if card is None:
            return

        # TODO add explicit patters for multi minion summoning (if there is ever more than two)
        for summon in range(self.count):
            card.summon(target, target.game, index)
            if actor.is_minion():
                index = actor.index  # Move the later minions to the left of their originator

    def __to_json__(self):
        if self.count > 1:
            return {'name': 'summon', 'card': self.card, 'count': self.count}
        return {'name': 'summon', 'card': self.card}

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #36
0
class ApplySecret(Action):
    def __init__(self, source):
        self.source = source
        self._query = CardQuery(conditions=[IsSecret()], source=source)

    def act(self, actor, target):
        secret = self._query.get_card(target)
        if secret:
            target.secrets.append(secret)
            secret.player = target
            if target is target.game.other_player:
                secret.player = target
                secret.activate(target)

    def __to_json__(self):
        return {
            'name': 'apply_secret',
            'source': CARD_SOURCE.to_str(self.source)
        }

    def __from_json__(self, source):
        self.source = CARD_SOURCE.from_str(source)
        self._query = CardQuery(conditions=[IsSecret()], source=self.source)
        return self
Example #37
0
class AddCard(Action):
    def __init__(self, card, count=1):
        if isinstance(card, CardQuery):
            self.card = card
        else:
            self.card = CardQuery(card.ref_name)
        self.count = count

    def act(self, actor, target):
        for i in range(self.count):
            if len(target.hand) < 10:
                target.hand.append(self.card.get_card(target))

    def __to_json__(self):
        return {
            'name': 'add_card',
            'card': self.card,
            'count': self.count
        }

    def __from_json__(self, card, count=1):
        self.card = CardQuery.from_json(**card)
        self.count = count
        return self
Example #38
0
 def __from_json__(self, card, count=1):
     self.card = CardQuery.from_json(**card)
     self.count = count
     return self
Example #39
0
 def __init__(self, card, count=1):
     if isinstance(card, CardQuery):
         self.card = card
     else:
         self.card = CardQuery(card.ref_name)
     self.count = count
Example #40
0
 def __from_json__(self, query):
     self.query = CardQuery.from_json(**query)
     return self
Example #41
0
 def __init__(self, weapon):
     if isinstance(weapon, CardQuery):
         self.weapon = weapon
     else:
         self.weapon = CardQuery(weapon.ref_name)
Example #42
0
 def __init__(self, weapon):
     if isinstance(weapon, CardQuery):
         self.weapon = weapon
     else:
         self.weapon = CardQuery(weapon.ref_name)
Example #43
0
 def __from_json__(self, source):
     self.source = CARD_SOURCE.from_str(source)
     self._query = CardQuery(conditions=[IsSecret()], source=self.source)
     return self
Example #44
0
 def __from_json__(self, secrets):
     self.secrets = CardQuery.from_json(secrets)
     return self
Example #45
0
 def __from_json__(self, source):
     self.source = CARD_SOURCE.from_str(source)
     self._query = CardQuery(conditions=[IsSecret()], source=self.source)
     return self
Example #46
0
 def __init__(self, card):
     if isinstance(card, CardQuery):
         self.card = card
     else:
         self.card = CardQuery(card.ref_name)
Example #47
0
 def __from_json__(self, card, count=1, add_to_deck=False):
     self.card = CardQuery.from_json(**card)
     self.count = count
     self.add_to_deck = add_to_deck
     return self
Example #48
0
 def __from_json__(self, card):
     self.card = CardQuery.from_json(**card)
     return self
Example #49
0
 def use(self, player, game):
     super().use(player, game)
     query = CardQuery(conditions=[IsMinion()])
     new_minon = query.get_card(player, player, self)
     new_minon.add_buff(Buff(ManaChange(-3)))
     player.hand.append(new_minon)
Example #50
0
 def __from_json__(self, weapon):
     self.weapon = CardQuery.from_json(**weapon)
     return self
Example #51
0
 def __init__(self, source):
     self.source = source
     self._query = CardQuery(conditions=[IsSecret()], source=source)
Example #52
0
 def __from_json__(self, card, count=1, add_to_deck=False):
     self.card = CardQuery.from_json(card)
     self.count = count
     self.add_to_deck = add_to_deck
     return self
 def __from_json__(self, query, amount):
     self.amount = amount
     self.query = CardQuery.from_json(**query)
     return self
Example #54
0
 def __from_json__(self, query):
     self.query = CardQuery.from_json(query)
     return self
Example #55
0
 def __from_json__(self, weapon):
     self.weapon = CardQuery.from_json(**weapon)
     return self
Example #56
0
 def __from_json__(self, card):
     self.card = CardQuery.from_json(**card)
     return self
Example #57
0
 def use(self, player, game):
     super().use(player, game)
     query = CardQuery(conditions=[HasCardName("Malorne")])
     new_minon = query.get_card(player, player, self)
     player.hand.append(new_minon)
Example #58
0
 def __init__(self, query=CardQuery(source=CARD_SOURCE.MY_HAND)):
     super().__init__()
     self.query = query
Example #59
0
 def __init__(self, source):
     self.source = source
     self._query = CardQuery(conditions=[IsSecret()], source=source)
Example #60
0
 def __init__(self, card):
     if isinstance(card, hearthbreaker.game_objects.Card):
         self.card = CardQuery(card.name)
     else:
         self.card = card