diff --git a/fireplace/card.py b/fireplace/card.py index 676ccb4dd..5a1977d4c 100644 --- a/fireplace/card.py +++ b/fireplace/card.py @@ -861,6 +861,22 @@ def _hit(self, amount): def play(self, target=None, index=None, choose=None): armor = self.armor + + # Copy hero buff + for buff in self.controller.hero.buffs: + # Recreate the buff stack + new_buff = self.controller.card(buff.id) + new_buff.source = buff.source + attributes = ["atk", "max_health", "_xatk", "_xhealth", "_xcost", "store_card"] + for attribute in attributes: + if hasattr(buff, attribute): + setattr(new_buff, attribute, getattr(buff, attribute)) + new_buff.apply(self) + if buff in self.game.active_aura_buffs: + new_buff.tick = buff.tick + self.game.active_aura_buffs.append(new_buff) + + self.damage = self.controller.hero.damage self.armor = self.controller.hero.armor super().play(target, index, choose) if armor: diff --git a/fireplace/cards/__init__.py b/fireplace/cards/__init__.py index 27a730879..a07601eab 100644 --- a/fireplace/cards/__init__.py +++ b/fireplace/cards/__init__.py @@ -7,7 +7,7 @@ year = ZodiacYear.RAVEN -default_language = "zhCN" +default_language = "enUS" class CardDB(dict): diff --git a/fireplace/cards/gangs/kazakus_potions.py b/fireplace/cards/gangs/kazakus_potions.py index 52f81ae83..af0f6acac 100644 --- a/fireplace/cards/gangs/kazakus_potions.py +++ b/fireplace/cards/gangs/kazakus_potions.py @@ -6,7 +6,6 @@ class CFM_621t2: """Heart of Fire""" - requirements = {PlayReq.REQ_TARGET_TO_PLAY: 0} # 1 Cost: Deal 3 play = Hit(TARGET, 3) @@ -58,7 +57,6 @@ class CFM_621t10: class CFM_621t16: """Heart of Fire""" - requirements = {PlayReq.REQ_TARGET_TO_PLAY: 0} # 5 Cost: Deal 5 Dmg play = Hit(TARGET, 5) @@ -89,7 +87,6 @@ class CFM_621t20: class CFM_621t21: """Mystic Wool""" - requirements = {PlayReq.REQ_MINIMUM_TOTAL_MINIONS: 1} # 5 Cost: Polymorph 1 play = Morph(RANDOM_ENEMY_MINION, "CFM_621_m5") @@ -117,7 +114,6 @@ class CFM_621t24: class CFM_621t25: """Heart of Fire""" - requirements = {PlayReq.REQ_TARGET_TO_PLAY: 0} # 10 Cost: Deal 10 play = Hit(TARGET, 10) diff --git a/fireplace/cards/gangs/neutral_legendary.py b/fireplace/cards/gangs/neutral_legendary.py index 65019991c..f2c6bccb2 100644 --- a/fireplace/cards/gangs/neutral_legendary.py +++ b/fireplace/cards/gangs/neutral_legendary.py @@ -60,8 +60,10 @@ class CFM_685: class CFM_806: """Wrathion""" play = Draw(CONTROLLER).then( - Find(Draw.CARD + DRAGON) | ( - Find(LazyValueSelector(Draw.CARD)) & ExtraBattlecry(SELF, None) + Find(Draw.CARD + DRAGON) & ( + Find(LazyValueSelector(Draw.CARD)) & ( + ExtraBattlecry(SELF, None) + ) ) ) diff --git a/fireplace/cards/ungoro/neutral_rare.py b/fireplace/cards/ungoro/neutral_rare.py index ed54849ba..4dc0fcd8c 100644 --- a/fireplace/cards/ungoro/neutral_rare.py +++ b/fireplace/cards/ungoro/neutral_rare.py @@ -24,7 +24,7 @@ class UNG_072: class UNG_075: """Vicious Fledgling""" - events = Attack(SELF).after(Adapt(SELF)) + events = Attack(SELF, ALL_HEROES).after(Adapt(SELF)) class UNG_079: diff --git a/fireplace/cards/ungoro/priest.py b/fireplace/cards/ungoro/priest.py index 55e879270..36bac352d 100644 --- a/fireplace/cards/ungoro/priest.py +++ b/fireplace/cards/ungoro/priest.py @@ -83,7 +83,6 @@ class UNG_940: class UNG_940t8: - requirements = {PlayReq.REQ_HERO_TARGET: 0, PlayReq.REQ_TARGET_IF_AVAILABLE: 0} play = Buff(FRIENDLY_HERO, "UNG_940t8e") diff --git a/fireplace/dsl/copy.py b/fireplace/dsl/copy.py index e87e5c3ce..e0bdcea6a 100644 --- a/fireplace/dsl/copy.py +++ b/fireplace/dsl/copy.py @@ -49,12 +49,6 @@ def copy(self, source, entity): ret = super().copy(source, entity) if self.id: ret = source.controller.card(self.id, source) - if entity.type == CardType.MINION: - for k in entity.silenceable_attributes: - v = getattr(entity, k) - setattr(ret, k, v) - ret.silenced = entity.silenced - ret.damage = entity.damage for buff in entity.buffs: # Recreate the buff stack new_buff = source.controller.card(buff.id) @@ -67,6 +61,12 @@ def copy(self, source, entity): if buff in source.game.active_aura_buffs: new_buff.tick = buff.tick source.game.active_aura_buffs.append(new_buff) + if entity.type == CardType.MINION: + for k in entity.silenceable_attributes: + v = getattr(entity, k) + setattr(ret, k, v) + ret.silenced = entity.silenced + ret.damage = entity.damage return ret diff --git a/tests/test_gangs.py b/tests/test_gangs.py index 350b99536..ce34c9b45 100644 --- a/tests/test_gangs.py +++ b/tests/test_gangs.py @@ -367,9 +367,8 @@ def test_madam_goya(): def test_wrathion(): game = prepare_empty_game() game.player1.give(WISP).put_on_top() - game.player1.give("NEW1_023").put_on_top() for _ in range(4): - game.player1.give(WISP).put_on_top() + game.player1.give("NEW1_023").put_on_top() assert len(game.player1.hand) == 0 game.player1.give("CFM_806").play() assert len(game.player1.hand) == 5 @@ -378,6 +377,6 @@ def test_wrathion(): def test_wrathion_empty(): game = prepare_empty_game() game.player1.cant_fatigue = False - game.player1.give(WISP).put_on_top() + game.player1.give("NEW1_023").put_on_top() game.player1.give("CFM_806").play() assert game.player1.hero.health == 30 - 1 diff --git a/tests/test_icecrown.py b/tests/test_icecrown.py index ff6a8f8f8..4f8da85c4 100644 --- a/tests/test_icecrown.py +++ b/tests/test_icecrown.py @@ -205,6 +205,15 @@ def test_hero_armor(): assert game.player1.hero.armor == 7 +def test_hero_health(): + game = prepare_game() + game.player1.give("UNG_940t8").play() + game.player1.give(MOONFIRE).play(target=game.player1.hero) + assert game.player1.hero.health == 39 + game.player1.give("ICC_481").play() + assert game.player1.hero.health == 39 + + def test_death_grip(): game = prepare_game() grip = game.player1.give("ICC_314t4")