From d2ac4c3b3d6235679bdb2d1c0d49e09c251fd877 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Sat, 30 Jul 2022 02:04:30 +0100 Subject: [PATCH] [NCC] Implement Skyboon Evangelist (#9333) --- .../src/mage/cards/s/SkyboonEvangelist.java | 105 ++++++++++++++++++ .../src/mage/cards/s/SoulbladeCorrupter.java | 20 ++-- .../src/mage/sets/NewCapennaCommander.java | 2 + 3 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SkyboonEvangelist.java diff --git a/Mage.Sets/src/mage/cards/s/SkyboonEvangelist.java b/Mage.Sets/src/mage/cards/s/SkyboonEvangelist.java new file mode 100644 index 0000000000..d41ad5d85c --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkyboonEvangelist.java @@ -0,0 +1,105 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.AttacksAllTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.SupportAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SetTargetPointer; +import mage.constants.SubType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.CounterAnyPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +import java.util.Set; +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ + +public final class SkyboonEvangelist extends CardImpl { + + public SkyboonEvangelist(UUID ownerID, CardSetInfo setInfo) { + super(ownerID, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); + + this.subtype.add(SubType.BIRD); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // FLying + this.addAbility(FlyingAbility.getInstance()); + + // When Skyboon Evangelist enters the battlefield, support 6. + this.addAbility(new SupportAbility(this, 6)); + + // Whenever a creature with a counter on it attacks one of your opponents, that creature gains flying until end of turn. + this.addAbility(new SkyboonEvangelistTriggeredAbility()); + } + + private SkyboonEvangelist(final SkyboonEvangelist card) { + super(card); + } + + @Override + public SkyboonEvangelist copy() { + return new SkyboonEvangelist(this); + } +} + +class SkyboonEvangelistTriggeredAbility extends AttacksAllTriggeredAbility { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with a counter on it"); + + static { + filter.add(CounterAnyPredicate.instance); + } + + SkyboonEvangelistTriggeredAbility() { + super(new GainAbilityTargetEffect( + FlyingAbility.getInstance(), + Duration.EndOfTurn + ).setText("that creature gains flying until end of turn"), false, filter, SetTargetPointer.PERMANENT, false); + } + + SkyboonEvangelistTriggeredAbility(final SkyboonEvangelistTriggeredAbility effect) { + super(effect); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event,game)) { + Player defender = game.getPlayer(event.getTargetId()); + if (defender == null) { + return false; + } + Set opponents = game.getOpponents(this.getControllerId()); + if (opponents != null && opponents.contains(defender.getId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId(), game)); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a creature with a counter on it attacks one of your opponents, that creature gains flying until end of turn."; + } + + @Override + public SkyboonEvangelistTriggeredAbility copy() { + return new SkyboonEvangelistTriggeredAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/SoulbladeCorrupter.java b/Mage.Sets/src/mage/cards/s/SoulbladeCorrupter.java index ff625a7444..84e90b3e5e 100644 --- a/Mage.Sets/src/mage/cards/s/SoulbladeCorrupter.java +++ b/Mage.Sets/src/mage/cards/s/SoulbladeCorrupter.java @@ -1,9 +1,11 @@ package mage.cards.s; +import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksAllTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.PartnerWithAbility; @@ -16,7 +18,6 @@ import mage.constants.SubType; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -69,14 +70,17 @@ class SoulbladeCorrupterTriggeredAbility extends AttacksAllTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (super.checkTrigger(event, game)) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null && player.hasOpponent(getControllerId(), game)) { - getEffects().setTargetPointer(new FixedTarget(permanent, game)); - return true; + if (super.checkTrigger(event,game)) { + Player defender = game.getPlayer(event.getTargetId()); + if (defender == null) { + return false; + } + Set opponents = game.getOpponents(this.getControllerId()); + if (opponents != null && opponents.contains(defender.getId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId(), game)); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/NewCapennaCommander.java b/Mage.Sets/src/mage/sets/NewCapennaCommander.java index a7fd94bb2c..06d161d1d5 100644 --- a/Mage.Sets/src/mage/sets/NewCapennaCommander.java +++ b/Mage.Sets/src/mage/sets/NewCapennaCommander.java @@ -263,6 +263,8 @@ public final class NewCapennaCommander extends ExpansionSet { cards.add(new SetCardInfo("Shadowmage Infiltrator", 351, Rarity.UNCOMMON, mage.cards.s.ShadowmageInfiltrator.class)); cards.add(new SetCardInfo("Shamanic Revelation", 311, Rarity.RARE, mage.cards.s.ShamanicRevelation.class)); cards.add(new SetCardInfo("Silent-Blade Oni", 352, Rarity.RARE, mage.cards.s.SilentBladeOni.class)); + cards.add(new SetCardInfo("Skyboon Evangelist", 20, Rarity.RARE, mage.cards.s.SkyboonEvangelist.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Skyboon Evangelist", 121, Rarity.RARE, mage.cards.s.SkyboonEvangelist.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Skyclave Shade", 260, Rarity.RARE, mage.cards.s.SkyclaveShade.class)); cards.add(new SetCardInfo("Skycloud Expanse", 427, Rarity.RARE, mage.cards.s.SkycloudExpanse.class)); cards.add(new SetCardInfo("Skyship Plunderer", 232, Rarity.UNCOMMON, mage.cards.s.SkyshipPlunderer.class));