From 47bd2c9646095d80ba6da4a8c8ecc33cc740cd3f Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 12 May 2025 10:47:46 -0400 Subject: [PATCH] [FIN] Implement Summoner's Grimoire --- .../src/mage/cards/s/SummonersGrimoire.java | 96 +++++++++++++++++++ Mage.Sets/src/mage/sets/FinalFantasy.java | 1 + 2 files changed, 97 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SummonersGrimoire.java diff --git a/Mage.Sets/src/mage/cards/s/SummonersGrimoire.java b/Mage.Sets/src/mage/cards/s/SummonersGrimoire.java new file mode 100644 index 00000000000..7f5265668e0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SummonersGrimoire.java @@ -0,0 +1,96 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.AddCardSubtypeAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.JobSelectAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SummonersGrimoire extends CardImpl { + + public SummonersGrimoire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}{G}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Job select + this.addAbility(new JobSelectAbility()); + + // Equipped creature is a Shaman in addition to its other types and has "Whenever this creature attacks, you may put a creature card from your hand onto the battlefield. If that card is an enchantment card, it enters tapped and attacking." + Ability ability = new SimpleStaticAbility(new AddCardSubtypeAttachedEffect( + SubType.SHAMAN, AttachmentType.EQUIPMENT + ).setText("equipped creature is a Shaman in addition to its other types")); + ability.addEffect(new GainAbilityAttachedEffect( + new AttacksTriggeredAbility(new SummonersGrimoireEffect()), AttachmentType.EQUIPMENT + ).setText("and has \"Whenever this creature attacks, you may put a creature card from your hand " + + "onto the battlefield. If that card is an enchantment card, it enters tapped and attacking.\"")); + this.addAbility(ability); + + // Abraxas -- Equip {3} + this.addAbility(new EquipAbility(3).withFlavorWord("Abraxas")); + } + + private SummonersGrimoire(final SummonersGrimoire card) { + super(card); + } + + @Override + public SummonersGrimoire copy() { + return new SummonersGrimoire(this); + } +} + +class SummonersGrimoireEffect extends OneShotEffect { + + SummonersGrimoireEffect() { + super(Outcome.Benefit); + staticText = "you may put a creature card from your hand onto the battlefield. " + + "If that card is an enchantment card, it enters tapped and attacking"; + } + + private SummonersGrimoireEffect(final SummonersGrimoireEffect effect) { + super(effect); + } + + @Override + public SummonersGrimoireEffect copy() { + return new SummonersGrimoireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCard target = new TargetCardInHand(0, 1, StaticFilters.FILTER_CARD_CREATURE); + player.choose(outcome, player.getHand(), target, source, game); + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + return false; + } + boolean flag = card.isEnchantment(game); + player.moveCards(card, Zone.BATTLEFIELD, source, game, flag, false, false, null); + if (flag) { + game.getCombat().addAttackingCreature(card.getId(), game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/FinalFantasy.java b/Mage.Sets/src/mage/sets/FinalFantasy.java index 86faa30dd45..8014a55ae42 100644 --- a/Mage.Sets/src/mage/sets/FinalFantasy.java +++ b/Mage.Sets/src/mage/sets/FinalFantasy.java @@ -165,6 +165,7 @@ public final class FinalFantasy extends ExpansionSet { cards.add(new SetCardInfo("Summon: Primal Odin", 365, Rarity.RARE, mage.cards.s.SummonPrimalOdin.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Summon: Shiva", 362, Rarity.UNCOMMON, mage.cards.s.SummonShiva.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Summon: Shiva", 78, Rarity.UNCOMMON, mage.cards.s.SummonShiva.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Summoner's Grimoire", 205, Rarity.RARE, mage.cards.s.SummonersGrimoire.class)); cards.add(new SetCardInfo("Swamp", 300, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Swamp", 301, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Swamp", 302, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));