From 7b6eb50a546f896eec55c242ab79d26501667639 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 8 May 2025 13:11:19 -0400 Subject: [PATCH] [WHO] Implement The Face of Boe --- Mage.Sets/src/mage/cards/t/TheFaceOfBoe.java | 99 ++++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 8 +- 2 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/TheFaceOfBoe.java diff --git a/Mage.Sets/src/mage/cards/t/TheFaceOfBoe.java b/Mage.Sets/src/mage/cards/t/TheFaceOfBoe.java new file mode 100644 index 00000000000..146d1c02195 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheFaceOfBoe.java @@ -0,0 +1,99 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.AbilityImpl; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheFaceOfBoe extends CardImpl { + + public TheFaceOfBoe(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ALIEN); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // {T}: You may cast a spell with suspend from your hand. If you do, pay its suspend cost rather than its mana cost. Activate only as a sorcery. + this.addAbility(new ActivateAsSorceryActivatedAbility(new TheFaceOfBoeEffect(), new TapSourceCost())); + } + + private TheFaceOfBoe(final TheFaceOfBoe card) { + super(card); + } + + @Override + public TheFaceOfBoe copy() { + return new TheFaceOfBoe(this); + } +} + +class TheFaceOfBoeEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("card with suspend"); + + static { + filter.add(new AbilityPredicate(SuspendAbility.class)); + } + + TheFaceOfBoeEffect() { + super(Outcome.Benefit); + staticText = "you may cast a spell with suspend from your hand. " + + "If you do, pay its suspend cost rather than its mana cost"; + } + + private TheFaceOfBoeEffect(final TheFaceOfBoeEffect effect) { + super(effect); + } + + @Override + public TheFaceOfBoeEffect copy() { + return new TheFaceOfBoeEffect(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, filter); + player.choose(outcome, player.getHand(), target, source, game); + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + return false; + } + ManaCostsImpl cost = new ManaCostsImpl<>(); + CardUtil.castStream(card.getAbilities(game), SuspendAbility.class) + .map(AbilityImpl::getManaCosts) + .forEach(cost::addAll); + CardUtil.castSingle(player, source, game, card, cost); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index 3f66c667127..eda59b0b363 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -909,10 +909,10 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("The Eleventh Doctor", 730, Rarity.RARE, mage.cards.t.TheEleventhDoctor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Eleventh Hour", 41, Rarity.RARE, mage.cards.t.TheEleventhHour.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Eleventh Hour", 646, Rarity.RARE, mage.cards.t.TheEleventhHour.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("The Face of Boe", 1003, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("The Face of Boe", 126, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("The Face of Boe", 412, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("The Face of Boe", 731, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Face of Boe", 1003, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Face of Boe", 126, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Face of Boe", 412, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Face of Boe", 731, Rarity.RARE, mage.cards.t.TheFaceOfBoe.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Fifth Doctor", "556z", Rarity.RARE, mage.cards.t.TheFifthDoctor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Fifth Doctor", 1004, Rarity.RARE, mage.cards.t.TheFifthDoctor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Fifth Doctor", 1147, Rarity.RARE, mage.cards.t.TheFifthDoctor.class, NON_FULL_USE_VARIOUS));