def create_minion(self, player): return Minion(7, 7, auras=[ Aura(MultiplySpellDamage(2), PlayerSelector()), Aura(MultiplyHealAmount(2), PlayerSelector()) ])
def create_minion(self, player): create_dict = { 'attack': card_def['attack'], 'health': card_def['health'] } if "impl" in card_def: impl = card_def['impl'] if 'effects' in impl: create_dict['effects'] = [ Effect.from_json(**effect) for effect in impl['effects'] ] if 'auras' in impl: create_dict['auras'] = [ Aura.from_json(**aura) for aura in impl['auras'] ] if 'buffs' in impl: create_dict['buffs'] = [ Buff.from_json(**buff) for buff in impl['buffs'] ] if 'enrage' in card_def: create_dict['enrage'] = [ Aura.from_json(**enrage) for enrage in card_def['enrage'] ] if 'deathrattle' in card_def: create_dict['deathrattle'] = [ Deathrattle.from_json(**deathrattle) for deathrattle in card_def['deathrattle'] ] return Minion(**create_dict)
def create_minion(self, player): return Minion(7, 7, auras=[ Aura(SetTo(PLAYER_STATUS.SPELL_DAMAGE_MULTIPLIER, 2), PlayerSelector()), Aura(SetTo(PLAYER_STATUS.HEAL_MULTIPLIER, 2), PlayerSelector()) ])
def create_minion(self, player): return Minion(9, 7, auras=[ Aura(ChangeHealth(2), MinionSelector(IsType(MINION_TYPE.DEMON))), Aura(ChangeAttack(2), MinionSelector(IsType(MINION_TYPE.DEMON))), Aura(Immune(), HeroSelector()) ])
def create_minion(self, player): return Minion(9, 7, auras=[ Aura(Add(CHARACTER_STATUS.ATTACK, 2), MinionSelector(IsType(MINION_TYPE.DEMON))), Aura(Add(CHARACTER_STATUS.HEALTH, 2), MinionSelector(IsType(MINION_TYPE.DEMON))), Aura(SetTrue(CHARACTER_STATUS.IMMUNE), HeroSelector()) ])
def __init__(self): super().__init__("Houndmaster", 4, CHARACTER_CLASS.HUNTER, CARD_RARITY.FREE, MINION_TYPE.NONE, battlecry=Battlecry( Give([ Aura(ChangeHealth(2), SelfSelector()), Aura(ChangeAttack(2), SelfSelector()), Aura(Taunt(), SelfSelector()) ]), MinionSelector(MinionIsType(MINION_TYPE.BEAST), picker=UserPicker())))
def __init__(self): super().__init__( "Anodized Robo Cub", 2, CHARACTER_CLASS.DRUID, CARD_RARITY.COMMON, minion_type=MINION_TYPE.MECH, choices=[ Choice(AttackMode(), Give([Aura(ChangeAttack(1), SelfSelector())]), SelfSelector()), Choice(TankMode(), Give([Aura(ChangeHealth(1), SelfSelector())]), SelfSelector()) ])
def create_minion(self, player): return Minion(2, 5, auras=[ Aura(SetTrue(CHARACTER_STATUS.NO_SPELL_TARGET), MinionSelector(Adjacent())) ])
def create_minion(self, player): return Minion(0, 4, auras=[ Aura(Subtract(CARD_STATUS.MANA, 2, minimum=1), CardSelector(condition=IsMinion())) ])
def create_minion(self, player): create_dict = { 'attack': card_def['attack'], 'health': card_def['health'] } if 'effects' in card_def: create_dict['effects'] = [ Effect.from_json(player.game, **effect) for effect in card_def['effects'] ] if 'auras' in card_def: create_dict['auras'] = [ Aura.from_json(**aura) for aura in card_def['auras'] ] if 'enrage' in card_def: create_dict['enrage'] = [ Action.from_json(**action) for action in card_def['enrage'] ] if 'deathrattle' in card_def: create_dict['deathrattle'] = Deathrattle.from_json( **card_def['deathrattle']) return Minion(**create_dict)
def create_minion(self, player): return Minion(0, 3, auras=[ Aura(Add(CHARACTER_STATUS.ATTACK, 2), MinionSelector(Adjacent())) ])
def create_minion(self, player): return Minion(3, 2, auras=[ Aura(Subtract(CARD_STATUS.MANA, 1), CardSelector(condition=IsSpell())) ])
def __init__(self): init_dict = { 'name': card_def['name'], 'mana': card_def['mana'], 'rarity': CARD_RARITY.from_str(card_def['rarity']) } if 'character_class' in card_def: init_dict['character_class'] = CHARACTER_CLASS.from_str(card_def['character_class']) if 'minion_type' in card_def: init_dict['minion_type'] = MINION_TYPE.from_str(card_def['minion_type']) if 'battlecry' in card_def: init_dict['battlecry'] = tuple(Battlecry.from_json(**battlecry) for battlecry in card_def['battlecry']) if 'choices' in card_def: init_dict['choices'] = [Choice.from_json(**choice) for choice in card_def['choices']] if 'combo' in card_def: init_dict['combo'] = Battlecry.from_json(**card_def['combo']) if 'overload' in card_def: init_dict['overload'] = card_def['overload'] if 'buffs' in card_def: init_dict['buffs'] = [Buff.from_json(**buff) for buff in card_def['buffs']] if 'auras' in card_def: init_dict['auras'] = [Aura.from_json(**aura) for aura in card_def['auras']] if 'effects' in card_def: init_dict['effects'] = [Effect.from_json(**effect) for effect in card_def['effects']] MinionCard.__init__(self, **init_dict)
def __init_weapon__(self): init_dict = { 'name': card_def['name'], 'mana': card_def['mana'], 'rarity': CARD_RARITY.from_str(card_def['rarity']) } if 'character_class' in card_def: init_dict['character_class'] = CHARACTER_CLASS.from_str( card_def['character_class']) if 'battlecry' in card_def: init_dict['battlecry'] = Battlecry.from_json( **card_def['battlecry']) if 'combo' in card_def: init_dict['combo'] = Battlecry.from_json(**card_def['combo']) if 'overload' in card_def: init_dict['overload'] = card_def['overload'] if 'buffs' in card_def: init_dict['buffs'] = [ Buff.from_json(**buff) for buff in card_def['buffs'] ] if 'auras' in card_def: init_dict['auras'] = [ Aura.from_json(**aura) for aura in card_def['auras'] ] if 'effects' in card_def: init_dict['effects'] = [ Effect.from_json(**effect) for effect in card_def['effects'] ] WeaponCard.__init__(self, **init_dict)
def create_minion(self, player): return Minion(1, 1, auras=[ Aura(Add(CHARACTER_STATUS.ATTACK, 1), MinionSelector(IsType(MINION_TYPE.BEAST))) ])
def create_minion(self, player): return Minion(3, 5, auras=[ Aura(SetTrue(PLAYER_STATUS.HEAL_AS_DAMAGE), PlayerSelector()) ])
def __init_weapon__(self): init_dict = { 'name': card_def['name'], 'mana': card_def['mana'], 'rarity': CARD_RARITY.from_str(card_def['rarity']) } if 'character_class' in card_def: init_dict['character_class'] = CHARACTER_CLASS.from_str(card_def['character_class']) if 'battlecry' in card_def: init_dict['battlecry'] = Battlecry.from_json(**card_def['battlecry']) if 'combo' in card_def: init_dict['combo'] = Battlecry.from_json(**card_def['combo']) if 'overload' in card_def: init_dict['overload'] = card_def['overload'] if 'buffs' in card_def: init_dict['buffs'] = [Buff.from_json(**buff) for buff in card_def['buffs']] if 'auras' in card_def: init_dict['auras'] = [Aura.from_json(**aura) for aura in card_def['auras']] if 'effects' in card_def: init_dict['effects'] = [Effect.from_json(**effect) for effect in card_def['effects']] WeaponCard.__init__(self, **init_dict)
def create_minion(self, player): return Minion(1, 1, auras=[ Aura(ChangeAttack(1), MinionSelector(IsType(MINION_TYPE.BEAST))) ])
def create_minion(self, player): return Minion(0, 4, auras=[ Aura(ManaChange(-2, 1, minimum=1), CardSelector(condition=IsMinion())) ])
def create_weapon(self, player): create_dict = { 'attack_power': card_def['attack'], 'durability': card_def['durability'] } if "impl" in card_def: impl = card_def['impl'] if 'effects' in impl: create_dict['effects'] = [ Effect.from_json(**effect) for effect in impl['effects'] ] if 'auras' in impl: create_dict['auras'] = [ Aura.from_json(**aura) for aura in impl['auras'] ] if 'buffs' in impl: create_dict['buffs'] = [ Buff.from_json(**buff) for buff in impl['buffs'] ] if 'deathrattle' in card_def: create_dict['deathrattle'] = Deathrattle.from_json( **card_def['deathrattle']) return Weapon(**create_dict)
def __init__(self): super().__init__("Cenarius", 9, CHARACTER_CLASS.DRUID, CARD_RARITY.LEGENDARY, choices=[ Choice( IncreaseStats(), Give([ Aura(ChangeAttack(2), SelfSelector()), Aura(ChangeHealth(2), SelfSelector()), Aura(Taunt(), SelfSelector()) ]), MinionSelector()), Choice(SummonTreants(), Summon(Treant(), 2), PlayerSelector()) ])
def create_minion(self, player): return Minion(2, 3, auras=[ Aura(SetTrue(PLAYER_STATUS.POWER_TARGETS_MINIONS), HeroSelector()) ])
def use(self, player, game): super().use(player, game) self.target.change_attack(2) self.target.increase_health(4) self.target.add_aura( Aura(Add(PLAYER_STATUS.SPELL_DAMAGE, 1), PlayerSelector()))
def __from_json__(self, auras): self.auras = [] for aura in auras: if "until" in aura: self.auras.append(AuraUntil.from_json(**aura)) else: self.auras.append(Aura.from_json(**aura)) return self
def create_minion(self, player): return Minion(2, 5, charge=True, auras=[ Aura(Charge(), MinionSelector(MinionIsType(MINION_TYPE.BEAST))) ])
def use(self, player, game): super().use(player, game) for minion in player.minions: if not minion.stealth: aura = Aura(Stealth(), SelfSelector()) minion.add_aura(aura) minion.add_effect( Effect(TurnStarted(), Take(aura), SelfSelector()))
def create_minion(self, player): return Minion(2, 5, charge=True, auras=[ Aura(SetTrue(CHARACTER_STATUS.CHARGE), MinionSelector(IsType(MINION_TYPE.BEAST))) ])
def __init__(self): super().__init__("Ancient of War", 7, CHARACTER_CLASS.DRUID, CARD_RARITY.EPIC, choices=[ Choice( Health(), Give([ Aura(ChangeHealth(5), SelfSelector()), Aura(Taunt(), SelfSelector()) ]), SelfSelector()), Choice( Attack(), Give([Aura(ChangeAttack(5), SelfSelector())]), SelfSelector()), ])
def __init__(self, auras): if isinstance(auras, Action): from hearthbreaker.tags.selector import SelfSelector self.auras = [Aura(auras, SelfSelector())] elif isinstance(auras, list): self.auras = auras else: self.auras = [auras]
def __from_json__(self, auras=None, effects=None): if effects: # To allow for give to work with effects as well, we check at load time effects = [Effect.from_json(**effect) for effect in effects] return GiveEffect(effects) self.auras = [] for aura in auras: if "until" in aura: self.auras.append(AuraUntil.from_json(**aura)) else: self.auras.append(Aura.from_json(**aura)) return self
def create_minion(self, player): create_dict = { 'attack': card_def['attack'], 'health': card_def['health'] } if "impl" in card_def: impl = card_def['impl'] if 'effects' in impl: create_dict['effects'] = [Effect.from_json(**effect) for effect in impl['effects']] if 'auras' in impl: create_dict['auras'] = [Aura.from_json(**aura) for aura in impl['auras']] if 'buffs' in impl: create_dict['buffs'] = [Buff.from_json(**buff) for buff in impl['buffs']] if 'enrage' in card_def: create_dict['enrage'] = [Aura.from_json(**enrage) for enrage in card_def['enrage']] if 'deathrattle' in card_def: create_dict['deathrattle'] = [Deathrattle.from_json(**deathrattle) for deathrattle in card_def['deathrattle']] return Minion(**create_dict)
def __from_json__(minion, effects=None, auras=None, buffs=None, **kwargs): if effects: minion.effects = [Effect.from_json(**effect) for effect in effects] else: minion.effects = [] if auras: minion.auras = [AuraUntil.from_json(**aura) if 'until' in aura else Aura.from_json(**aura) for aura in auras] else: minion.auras = [] if buffs: minion.buffs = [BuffUntil.from_json(**buff) if 'until' in buff else Buff.from_json(**buff) for buff in buffs] else: minion.buffs = []
def __init__(self): init_dict = { 'name': card_def['name'], 'mana': card_def['mana'], 'rarity': CARD_RARITY.from_str(card_def['rarity']) } if 'character_class' in card_def: init_dict['character_class'] = CHARACTER_CLASS.from_str( card_def['character_class']) if 'minion_type' in card_def: init_dict['minion_type'] = MINION_TYPE.from_str( card_def['minion_type']) if 'battlecry' in card_def: init_dict['battlecry'] = tuple( Battlecry.from_json(**battlecry) for battlecry in card_def['battlecry']) if 'choices' in card_def: init_dict['choices'] = [ Choice.from_json(**choice) for choice in card_def['choices'] ] if 'combo' in card_def: init_dict['combo'] = Battlecry.from_json(**card_def['combo']) if 'overload' in card_def: init_dict['overload'] = card_def['overload'] if 'buffs' in card_def: init_dict['buffs'] = [ Buff.from_json(**buff) for buff in card_def['buffs'] ] if 'auras' in card_def: init_dict['auras'] = [ Aura.from_json(**aura) for aura in card_def['auras'] ] if 'effects' in card_def: init_dict['effects'] = [ Effect.from_json(**effect) for effect in card_def['effects'] ] MinionCard.__init__(self, **init_dict)
def __from_json__(md, player, game): from hearthbreaker.engine import card_lookup minion = Minion(md['attack'], md['max_health']) GameObject.__from_json__(minion, **md) minion.health = md['max_health'] - md['damage'] minion.exhausted = md['exhausted'] minion.attacks_performed = not md['attacks_performed'] minion.born = md['sequence_id'] if 'enrage' in md: minion.enrage = [Aura.from_json(**enrage) for enrage in md['enrage']] minion.deathrattle = [] for rattle in md['deathrattles']: minion.deathrattle.append(Deathrattle.from_json(**rattle)) minion.card = card_lookup(md["name"]) minion.game = game minion.player = player return minion
def create_minion(self, player): create_dict = { 'attack': card_def['attack'], 'health': card_def['health'] } if 'effects' in card_def: create_dict['effects'] = [Effect.from_json(player.game, **effect) for effect in card_def['effects']] if 'auras' in card_def: create_dict['auras'] = [Aura.from_json(**aura) for aura in card_def['auras']] if 'enrage' in card_def: create_dict['enrage'] = [Action.from_json(**action) for action in card_def['enrage']] if 'deathrattle' in card_def: create_dict['deathrattle'] = Deathrattle.from_json(**card_def['deathrattle']) return Minion(**create_dict)
def create_weapon(self, player): create_dict = { 'attack_power': card_def['attack'], 'durability': card_def['durability'] } if 'effects' in card_def: create_dict['effects'] = [Effect.from_json(**effect) for effect in card_def['effects']] if 'auras' in card_def: create_dict['auras'] = [Aura.from_json(**aura) for aura in card_def['auras']] if 'buffs' in card_def: create_dict['buffs'] = [Buff.from_json(**buff) for buff in card_def['buffs']] if 'deathrattle' in card_def: create_dict['deathrattle'] = Deathrattle.from_json(**card_def['deathrattle']) return Weapon(**create_dict)
def __from_json__(md, player, game): from hearthbreaker.engine import card_lookup minion = Minion(md['attack'], md['max_health']) GameObject.__from_json__(minion, **md) minion.health = md['max_health'] - md['damage'] minion.exhausted = md['exhausted'] minion.attacks_performed = not md['attacks_performed'] minion.born = md['sequence_id'] if 'enrage' in md: minion.enrage = [ Aura.from_json(**enrage) for enrage in md['enrage'] ] minion.deathrattle = [] for rattle in md['deathrattles']: minion.deathrattle.append(Deathrattle.from_json(**rattle)) minion.card = card_lookup(md["name"]) minion.game = game minion.player = player return minion
def create_minion(self, player): create_dict = { 'attack': card_def['attack'], 'health': card_def['health'] } if 'effects' in card_def: create_dict['effects'] = [Effect.from_json(**effect) for effect in card_def['effects']] if 'auras' in card_def: create_dict['auras'] = [Aura.from_json(**aura) for aura in card_def['auras']] if 'buffs' in card_def: create_dict['buffs'] = [Buff.from_json(**buff) for buff in card_def['buffs']] if 'enrage' in card_def: create_dict['enrage'] = Enrage.from_json(**card_def['enrage']) if 'deathrattle' in card_def: create_dict['deathrattle'] = Deathrattle.from_json(**card_def['deathrattle']) return Minion(**create_dict)
def __from_json__(self, aura): self.aura = Aura.from_json(**aura) return self