From fae1802ef6342c42865ca5144f12e0e1b06820bc Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 20 Sep 2019 20:07:55 -0400 Subject: [PATCH] Implemented Reaper of Night --- Mage.Sets/src/mage/cards/r/ReaperOfNight.java | 66 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 67 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/ReaperOfNight.java diff --git a/Mage.Sets/src/mage/cards/r/ReaperOfNight.java b/Mage.Sets/src/mage/cards/r/ReaperOfNight.java new file mode 100644 index 0000000000..6bdd66b0da --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/ReaperOfNight.java @@ -0,0 +1,66 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.AdventureCard; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ReaperOfNight extends AdventureCard { + + public ReaperOfNight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{5}{B}{B}", "Harvest Fear", "{3}{B}"); + + this.subtype.add(SubType.SPECTER); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Whenever Reaper of Night attacks, if defending player has two or fewer cards in hand, it gains flying until end of turn. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new AttacksTriggeredAbility(new GainAbilitySourceEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn + ), false), ReaperOfNightCondition.instance, "Whenever {this} attacks, " + + "if defending player has two or fewer cards in hand, it gains flying until end of turn." + )); + + // Harvest Fear + // Target opponent discards two cards. + this.getAdventureSpellAbility().addEffect(new DiscardTargetEffect(2)); + this.getAdventureSpellAbility().addTarget(new TargetOpponent()); + } + + private ReaperOfNight(final ReaperOfNight card) { + super(card); + } + + @Override + public ReaperOfNight copy() { + return new ReaperOfNight(this); + } +} + +enum ReaperOfNightCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getCombat().getDefendingPlayerId(source.getSourceId(), game)); + return player != null && player.getHand().size() <= 2; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index d68f45670f..439527f9a9 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -213,6 +213,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Rampart Smasher", 213, Rarity.UNCOMMON, mage.cards.r.RampartSmasher.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 101, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); cards.add(new SetCardInfo("Realm-Cloaked Giant", 26, Rarity.MYTHIC, mage.cards.r.RealmCloakedGiant.class)); + cards.add(new SetCardInfo("Reaper of Night", 102, Rarity.COMMON, mage.cards.r.ReaperOfNight.class)); cards.add(new SetCardInfo("Reave Soul", 103, Rarity.COMMON, mage.cards.r.ReaveSoul.class)); cards.add(new SetCardInfo("Redcap Melee", 135, Rarity.UNCOMMON, mage.cards.r.RedcapMelee.class)); cards.add(new SetCardInfo("Redcap Raiders", 136, Rarity.COMMON, mage.cards.r.RedcapRaiders.class));