From 165a347092a511563348e7e0fa97ed801ae88d72 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 12 Sep 2021 17:46:43 -0400 Subject: [PATCH] [MID] Implemented Moonrager's Slash --- .../src/mage/cards/m/MoonragersSlash.java | 42 +++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + .../condition/common/NightCondition.java | 23 ++++++++++ .../mage/abilities/hint/common/NightHint.java | 27 ++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MoonragersSlash.java create mode 100644 Mage/src/main/java/mage/abilities/condition/common/NightCondition.java create mode 100644 Mage/src/main/java/mage/abilities/hint/common/NightHint.java diff --git a/Mage.Sets/src/mage/cards/m/MoonragersSlash.java b/Mage.Sets/src/mage/cards/m/MoonragersSlash.java new file mode 100644 index 0000000000..68b745297e --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MoonragersSlash.java @@ -0,0 +1,42 @@ +package mage.cards.m; + +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.NightCondition; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect; +import mage.abilities.hint.common.NightHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.target.common.TargetAnyTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MoonragersSlash extends CardImpl { + + public MoonragersSlash(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); + + // This spell costs {2} less to cast if it's night. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SpellCostReductionSourceEffect(2, NightCondition.instance) + ).addHint(NightHint.instance)); + + // Moonrager's Slash deals 3 damage to any target. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + } + + private MoonragersSlash(final MoonragersSlash card) { + super(card); + } + + @Override + public MoonragersSlash copy() { + return new MoonragersSlash(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 4a64c5f9a5..9572d5223e 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -197,6 +197,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Memory Deluge", 62, Rarity.RARE, mage.cards.m.MemoryDeluge.class)); cards.add(new SetCardInfo("Might of the Old Ways", 189, Rarity.COMMON, mage.cards.m.MightOfTheOldWays.class)); cards.add(new SetCardInfo("Moonrage Brute", 7, Rarity.RARE, mage.cards.m.MoonrageBrute.class)); + cards.add(new SetCardInfo("Moonrager's Slash", 148, Rarity.COMMON, mage.cards.m.MoonragersSlash.class)); cards.add(new SetCardInfo("Moonsilver Key", 255, Rarity.UNCOMMON, mage.cards.m.MoonsilverKey.class)); cards.add(new SetCardInfo("Moonveil Regent", 149, Rarity.MYTHIC, mage.cards.m.MoonveilRegent.class)); cards.add(new SetCardInfo("Morbid Opportunist", 113, Rarity.UNCOMMON, mage.cards.m.MorbidOpportunist.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/NightCondition.java b/Mage/src/main/java/mage/abilities/condition/common/NightCondition.java new file mode 100644 index 0000000000..29e5c709d6 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/NightCondition.java @@ -0,0 +1,23 @@ +package mage.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.game.Game; + +/** + * @author TheElk801 + * TODO: Implement this + */ +public enum NightCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public String toString() { + return "it's night"; + } +} diff --git a/Mage/src/main/java/mage/abilities/hint/common/NightHint.java b/Mage/src/main/java/mage/abilities/hint/common/NightHint.java new file mode 100644 index 0000000000..afc7f2631d --- /dev/null +++ b/Mage/src/main/java/mage/abilities/hint/common/NightHint.java @@ -0,0 +1,27 @@ +package mage.abilities.hint.common; + +import mage.abilities.Ability; +import mage.abilities.condition.common.NightCondition; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.game.Game; + +/** + * @author TheElk801 + */ +public enum NightHint implements Hint { + instance; + private static final Hint hint = new ConditionHint( + NightCondition.instance, "It's currently night" + ); + + @Override + public String getText(Game game, Ability ability) { + return hint.getText(game, ability); + } + + @Override + public Hint copy() { + return this; + } +}