From 5581405ad9830cfd88058119aced67e0b2779cf3 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sun, 20 Dec 2020 07:51:54 -0600 Subject: [PATCH 1/2] [KHM] Implemented Cleaving Reaper --- .../src/mage/cards/c/CleavingReaper.java | 84 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CleavingReaper.java diff --git a/Mage.Sets/src/mage/cards/c/CleavingReaper.java b/Mage.Sets/src/mage/cards/c/CleavingReaper.java new file mode 100644 index 00000000000..8ff425892d1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CleavingReaper.java @@ -0,0 +1,84 @@ +package mage.cards.c; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; + +/** + * + * @author weirddan455 + */ +public final class CleavingReaper extends CardImpl { + + public CleavingReaper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add(SubType.ANGEL); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Pay 3 life: Return Cleaving Reaper from your graveyard to your hand. + // Activate this ability only if you had an Angel or Berserker enter the battlefield under your control this turn. + Ability ability = new ActivateIfConditionActivatedAbility( + Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new PayLifeCost(3), CleavingReaperCondition.instance + ); + this.addAbility(ability, new PermanentsEnteredBattlefieldWatcher()); + } + + private CleavingReaper(final CleavingReaper card) { + super(card); + } + + @Override + public CleavingReaper copy() { + return new CleavingReaper(this); + } +} + +enum CleavingReaperCondition implements Condition { + + instance; + + @Override + public boolean apply(Game game, Ability source) { + PermanentsEnteredBattlefieldWatcher watcher = game.getState().getWatcher(PermanentsEnteredBattlefieldWatcher.class); + if (watcher != null) { + List permanents = watcher.getThisTurnEnteringPermanents(source.getControllerId()); + if (permanents != null) { + for (Permanent permanent : permanents) { + if (permanent.hasSubtype(SubType.ANGEL, game) || permanent.hasSubtype(SubType.BERSERKER, game)) { + return true; + } + } + } + } + return false; + } + + @Override + public String toString() { + return "if you had an Angel or Berserker enter the battlefield under your control this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 14e08de5bca..ffc36270ea9 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -34,6 +34,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Bearded Axe", 388, Rarity.UNCOMMON, mage.cards.b.BeardedAxe.class)); cards.add(new SetCardInfo("Blightstep Pathway", 252, Rarity.RARE, mage.cards.b.BlightstepPathway.class)); cards.add(new SetCardInfo("Canopy Tactician", 378, Rarity.RARE, mage.cards.c.CanopyTactician.class)); + cards.add(new SetCardInfo("Cleaving Reaper", 376, Rarity.RARE, mage.cards.c.CleavingReaper.class)); cards.add(new SetCardInfo("Darkbore Pathway", 254, Rarity.RARE, mage.cards.d.DarkborePathway.class)); cards.add(new SetCardInfo("Elven Ambush", 391, Rarity.UNCOMMON, mage.cards.e.ElvenAmbush.class)); cards.add(new SetCardInfo("Giant's Grasp", 384, Rarity.UNCOMMON, mage.cards.g.GiantsGrasp.class)); From 06a551fbd5323d27e1cfee34f2dc5dae2d073489 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sun, 20 Dec 2020 08:43:54 -0600 Subject: [PATCH 2/2] [KHM] Add ConditionHint to Cleaving Reaper --- Mage.Sets/src/mage/cards/c/CleavingReaper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mage.Sets/src/mage/cards/c/CleavingReaper.java b/Mage.Sets/src/mage/cards/c/CleavingReaper.java index 8ff425892d1..402b054abef 100644 --- a/Mage.Sets/src/mage/cards/c/CleavingReaper.java +++ b/Mage.Sets/src/mage/cards/c/CleavingReaper.java @@ -8,6 +8,8 @@ import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.condition.Condition; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; import mage.constants.SubType; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; @@ -25,6 +27,8 @@ import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; */ public final class CleavingReaper extends CardImpl { + private static final Hint hint = new ConditionHint(CleavingReaperCondition.instance, "Can return from graveyard"); + public CleavingReaper(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); @@ -44,6 +48,7 @@ public final class CleavingReaper extends CardImpl { Ability ability = new ActivateIfConditionActivatedAbility( Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new PayLifeCost(3), CleavingReaperCondition.instance ); + ability.addHint(hint); this.addAbility(ability, new PermanentsEnteredBattlefieldWatcher()); }