From 0dd2451ac05da444aa87ec7504aabd77d1c8d4f8 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 30 Apr 2025 21:51:45 -0400 Subject: [PATCH] [ACR] Implement Altair Ibn-La'Ahad --- .../src/mage/cards/a/AltairIbnLaAhad.java | 144 ++++++++++++++++++ Mage.Sets/src/mage/sets/AssassinsCreed.java | 8 +- 2 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/a/AltairIbnLaAhad.java diff --git a/Mage.Sets/src/mage/cards/a/AltairIbnLaAhad.java b/Mage.Sets/src/mage/cards/a/AltairIbnLaAhad.java new file mode 100644 index 00000000000..cd64eedaa1b --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AltairIbnLaAhad.java @@ -0,0 +1,144 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentCard; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTargets; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * @author TheElk801 + */ +public final class AltairIbnLaAhad extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("Assassin creature card from your graveyard"); + + static { + filter.add(SubType.ASSASSIN.getPredicate()); + } + + public AltairIbnLaAhad(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Whenever Altair Ibn-La'Ahad attacks, exile up to one target Assassin creature card from your graveyard with a memory counter on it. Then for each creature card you own in exile with a memory counter on it, create a tapped and attacking token that's a copy of it. Exile those tokens at end of combat. + Ability ability = new AttacksTriggeredAbility(new AltairIbnLaAhadExileEffect()); + ability.addEffect(new AltairIbnLaAhadTokenEffect()); + ability.addTarget(new TargetCardInYourGraveyard(0, 1, filter)); + this.addAbility(ability); + } + + private AltairIbnLaAhad(final AltairIbnLaAhad card) { + super(card); + } + + @Override + public AltairIbnLaAhad copy() { + return new AltairIbnLaAhad(this); + } +} + +class AltairIbnLaAhadExileEffect extends OneShotEffect { + + AltairIbnLaAhadExileEffect() { + super(Outcome.Benefit); + staticText = "exile up to one target Assassin creature card from your graveyard with a memory counter on it"; + } + + private AltairIbnLaAhadExileEffect(final AltairIbnLaAhadExileEffect effect) { + super(effect); + } + + @Override + public AltairIbnLaAhadExileEffect copy() { + return new AltairIbnLaAhadExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (player == null || card == null) { + return false; + } + player.moveCards(card, Zone.EXILED, source, game); + card.addCounters(CounterType.MEMORY.createInstance(), source, game); + return true; + } +} + +class AltairIbnLaAhadTokenEffect extends OneShotEffect { + + AltairIbnLaAhadTokenEffect() { + super(Outcome.Benefit); + staticText = "Then for each creature card you own in exile with a memory counter on it, " + + "create a tapped and attacking token that's a copy of it. Exile those tokens at end of combat"; + } + + private AltairIbnLaAhadTokenEffect(final AltairIbnLaAhadTokenEffect effect) { + super(effect); + } + + @Override + public AltairIbnLaAhadTokenEffect copy() { + return new AltairIbnLaAhadTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Set cards = game + .getExile() + .getAllCards(game, source.getControllerId()) + .stream() + .filter(card -> card.getCounters(game).containsKey(CounterType.MEMORY)) + .filter(card -> card.isCreature(game)) + .collect(Collectors.toSet()); + if (cards.isEmpty()) { + return false; + } + Set permanents = new HashSet<>(); + for (Card card : cards) { + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + source.getControllerId(), null, + false, 1, true, true + ); + effect.setSavedPermanent(new PermanentCard(card, source.getControllerId(), game)); + effect.apply(game, source); + permanents.addAll(effect.getAddedPermanents()); + } + game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility( + new ExileTargetEffect("exile those tokens") + .setTargetPointer(new FixedTargets(permanents, game)) + ), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/AssassinsCreed.java b/Mage.Sets/src/mage/sets/AssassinsCreed.java index 76ce1d51546..0bc9a63c4e9 100644 --- a/Mage.Sets/src/mage/sets/AssassinsCreed.java +++ b/Mage.Sets/src/mage/sets/AssassinsCreed.java @@ -33,10 +33,10 @@ public final class AssassinsCreed extends ExpansionSet { cards.add(new SetCardInfo("Alexios, Deimos of Kosmos", 134, Rarity.UNCOMMON, mage.cards.a.AlexiosDeimosOfKosmos.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Alexios, Deimos of Kosmos", 214, Rarity.UNCOMMON, mage.cards.a.AlexiosDeimosOfKosmos.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Alexios, Deimos of Kosmos", 33, Rarity.UNCOMMON, mage.cards.a.AlexiosDeimosOfKosmos.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 137, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 225, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 268, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 45, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 137, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 225, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 268, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Altair Ibn-La'Ahad", 45, Rarity.MYTHIC, mage.cards.a.AltairIbnLaAhad.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Apple of Eden, Isu Relic", 122, Rarity.MYTHIC, mage.cards.a.AppleOfEdenIsuRelic.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Apple of Eden, Isu Relic", 254, Rarity.MYTHIC, mage.cards.a.AppleOfEdenIsuRelic.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Apple of Eden, Isu Relic", 70, Rarity.MYTHIC, mage.cards.a.AppleOfEdenIsuRelic.class, NON_FULL_USE_VARIOUS));