From 64265bc2dd231f93eb36933708000a78395b321c Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:24:13 +0200 Subject: [PATCH] implement [MH3] Ajani Fells the Godsire --- .../mage/cards/a/AjaniFellsTheGodsire.java | 107 ++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons3.java | 1 + 2 files changed, 108 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AjaniFellsTheGodsire.java diff --git a/Mage.Sets/src/mage/cards/a/AjaniFellsTheGodsire.java b/Mage.Sets/src/mage/cards/a/AjaniFellsTheGodsire.java new file mode 100644 index 00000000000..96391abd3e0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AjaniFellsTheGodsire.java @@ -0,0 +1,107 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.CatWarrior21Token; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class AjaniFellsTheGodsire extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls with power 3 or greater"); + + static { + filter.add(TargetController.OPPONENT.getControllerPredicate()); + filter.add(new PowerPredicate(ComparisonType.OR_GREATER, 3)); + } + + public AjaniFellsTheGodsire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}"); + + this.subtype.add(SubType.SAGA); + + // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I -- Exile target creature an opponent controls with power 3 or greater. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_I, + new ExileTargetEffect(), new TargetCreaturePermanent(filter) + ); + + // II -- Create a 2/1 white Cat Warrior creature token, then put a vigilance counter on a creature you control. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_II, + new CreateTokenEffect(new CatWarrior21Token()), + new AjaniFellsTheGodsireCounterEffect() + ); + + // III -- Target creature you control gains double strike until end of turn. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, SagaChapter.CHAPTER_III, + new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance()), + new TargetControlledCreaturePermanent() + ); + + this.addAbility(sagaAbility); + } + + private AjaniFellsTheGodsire(final AjaniFellsTheGodsire card) { + super(card); + } + + @Override + public AjaniFellsTheGodsire copy() { + return new AjaniFellsTheGodsire(this); + } +} + +class AjaniFellsTheGodsireCounterEffect extends OneShotEffect { + + AjaniFellsTheGodsireCounterEffect() { + super(Outcome.Benefit); + staticText = ", then put a vigilance counter on a creature you control"; + } + + private AjaniFellsTheGodsireCounterEffect(final AjaniFellsTheGodsireCounterEffect effect) { + super(effect); + } + + @Override + public AjaniFellsTheGodsireCounterEffect copy() { + return new AjaniFellsTheGodsireCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetPermanent target = new TargetControlledCreaturePermanent(); + target.withChooseHint("to give a vigilance counter").withNotTarget(true); + player.choose(outcome, target, source, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + return permanent != null && permanent.addCounters(CounterType.VIGILANCE.createInstance(), source, game); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ModernHorizons3.java b/Mage.Sets/src/mage/sets/ModernHorizons3.java index fd7f64fce3d..d26be7d62f4 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons3.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons3.java @@ -24,6 +24,7 @@ public final class ModernHorizons3 extends ExpansionSet { cards.add(new SetCardInfo("Accursed Marauder", 80, Rarity.COMMON, mage.cards.a.AccursedMarauder.class)); cards.add(new SetCardInfo("Aerie Auxiliary", 18, Rarity.COMMON, mage.cards.a.AerieAuxiliary.class)); cards.add(new SetCardInfo("Aether Spike", 50, Rarity.COMMON, mage.cards.a.AetherSpike.class)); + cards.add(new SetCardInfo("Ajani Fells the Godsire", 19, Rarity.UNCOMMON, mage.cards.a.AjaniFellsTheGodsire.class)); cards.add(new SetCardInfo("Ajani, Nacatl Avenger", 237, Rarity.MYTHIC, mage.cards.a.AjaniNacatlAvenger.class)); cards.add(new SetCardInfo("Ajani, Nacatl Pariah", 237, Rarity.MYTHIC, mage.cards.a.AjaniNacatlPariah.class)); cards.add(new SetCardInfo("Amphibian Downpour", 51, Rarity.RARE, mage.cards.a.AmphibianDownpour.class));