From d3ba8224f4b759dc600979a143498e6f17fc6be8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Feb 2022 17:21:53 -0500 Subject: [PATCH] [NEO] Implemented Kami's Flare --- Mage.Sets/src/mage/cards/k/KamisFlare.java | 92 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 93 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KamisFlare.java diff --git a/Mage.Sets/src/mage/cards/k/KamisFlare.java b/Mage.Sets/src/mage/cards/k/KamisFlare.java new file mode 100644 index 0000000000..1de874a78a --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KamisFlare.java @@ -0,0 +1,92 @@ +package mage.cards.k; + +import mage.abilities.Ability; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.ModifiedPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlaneswalker; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KamisFlare extends CardImpl { + + public KamisFlare(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Kami's Flare deals 3 damage to target creature or planeswalker. Kami's Flare also deals 2 damage to that permanent's controller if you control a modified creature. + this.getSpellAbility().addEffect(new KamisFlareEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); + this.getSpellAbility().addHint(KamisFlareEffect.getHint()); + } + + private KamisFlare(final KamisFlare card) { + super(card); + } + + @Override + public KamisFlare copy() { + return new KamisFlare(this); + } +} + +class KamisFlareEffect extends OneShotEffect { + private static final FilterPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(ModifiedPredicate.instance); + } + + private static final Hint hint = new ConditionHint( + new PermanentsOnTheBattlefieldCondition(filter), "You control a modified creature" + ); + + KamisFlareEffect() { + super(Outcome.Benefit); + staticText = "{this} deals 3 damage to target creature or planeswalker. " + + "{this} also deals 2 damage to that permanent's controller if you control a modified creature"; + } + + private KamisFlareEffect(final KamisFlareEffect effect) { + super(effect); + } + + @Override + public KamisFlareEffect copy() { + return new KamisFlareEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + permanent.damage(3, source, game); + if (!game.getBattlefield().contains(filter, source, game, 1)) { + return true; + } + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.damage(2, source, game); + } + return true; + } + + public static Hint getHint() { + return hint; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 1e12da65a1..3f78a1d9c2 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -137,6 +137,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Kaito Shizuki", 226, Rarity.MYTHIC, mage.cards.k.KaitoShizuki.class)); cards.add(new SetCardInfo("Kaito's Pursuit", 103, Rarity.COMMON, mage.cards.k.KaitosPursuit.class)); cards.add(new SetCardInfo("Kami of Terrible Secrets", 105, Rarity.COMMON, mage.cards.k.KamiOfTerribleSecrets.class)); + cards.add(new SetCardInfo("Kami's Flare", 150, Rarity.COMMON, mage.cards.k.KamisFlare.class)); cards.add(new SetCardInfo("Kappa Tech-Wrecker", 198, Rarity.UNCOMMON, mage.cards.k.KappaTechWrecker.class)); cards.add(new SetCardInfo("Kindled Fury", 151, Rarity.COMMON, mage.cards.k.KindledFury.class)); cards.add(new SetCardInfo("Kirin-Touched Orochi", 212, Rarity.RARE, mage.cards.k.KirinTouchedOrochi.class));