From 0d9aa357f5f6b71940d2b74b1e7bf32feb899df2 Mon Sep 17 00:00:00 2001 From: justin <42110866+justinjohnson14@users.noreply.github.com> Date: Thu, 28 Mar 2024 19:54:34 -0700 Subject: [PATCH] [PIP] Implement T-45 Power Armor (#12003) --- Mage.Sets/src/mage/cards/t/T45PowerArmor.java | 108 ++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 109 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/T45PowerArmor.java diff --git a/Mage.Sets/src/mage/cards/t/T45PowerArmor.java b/Mage.Sets/src/mage/cards/t/T45PowerArmor.java new file mode 100644 index 00000000000..9142de4dd61 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/T45PowerArmor.java @@ -0,0 +1,108 @@ +package mage.cards.t; + +import java.util.*; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.PayEnergyCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; +import mage.abilities.keyword.EquipAbility; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author justinjohnson14 + */ +public final class T45PowerArmor extends CardImpl { + public T45PowerArmor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + this.subtype.add(SubType.EQUIPMENT); + + // When T-45 Power Armor enters the battlefield, you get {E}{E}. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2), false)); + // Equipped creature gets +3/+3 and doesn't untap during its controller's untap step. + Ability ability = (new SimpleStaticAbility(new BoostEquippedEffect(3,3))); + ability.addEffect(new DontUntapInControllersUntapStepEnchantedEffect().setText("and doesn't untap during its controller's untap step")); + this.addAbility(ability); + // At the beginning of your upkeep, you may pay {E}. If you do, untap equipped creature, then put your choice of a menace, trample or lifelink counter on it. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new DoIfCostPaid( + new T45PowerArmorEffect(), + new PayEnergyCost(1) + ), + TargetController.YOU, + false + )); + + // Equip {3} + this.addAbility(new EquipAbility(3)); + } + + private T45PowerArmor(final T45PowerArmor card) { + super(card); + } + + @Override + public T45PowerArmor copy() { + return new T45PowerArmor(this); + } +} + +class T45PowerArmorEffect extends OneShotEffect { + + private static final Set choices = new LinkedHashSet<>(Arrays.asList("Menace", "Trample", "Lifelink")); + + T45PowerArmorEffect() { + super(Outcome.BoostCreature); + staticText = "untap equipped creature, then put your choice of a menace, trample, or lifelink counter on it"; + } + + protected T45PowerArmorEffect(mage.cards.t.T45PowerArmorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent creature = game.getPermanent(source.getSourcePermanentIfItStillExists(game).getAttachedTo()); + if (player == null || creature == null) { + return false; + } + + creature.untap(game); + + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose menace, trample, or lifelink"); + choice.setChoices(choices); + player.choose(outcome, choice, game); + String chosen = choice.getChoice(); + if (chosen != null) { + creature.addCounters(CounterType.findByName( + chosen.toLowerCase(Locale.ENGLISH) + ).createInstance(), source.getControllerId(), source, game); + } + + return true; + } + + @Override + public T45PowerArmorEffect copy() { + return new T45PowerArmorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 2febb8c52c1..58a0479f774 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -249,6 +249,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Swamp", 321, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Swiftfoot Boots", 242, Rarity.UNCOMMON, mage.cards.s.SwiftfootBoots.class)); cards.add(new SetCardInfo("Swords to Plowshares", 173, Rarity.UNCOMMON, mage.cards.s.SwordsToPlowshares.class)); + cards.add(new SetCardInfo("T-45 Power Armor", 145, Rarity.RARE, mage.cards.t.T45PowerArmor.class)); cards.add(new SetCardInfo("Tainted Field", 298, Rarity.UNCOMMON, mage.cards.t.TaintedField.class)); cards.add(new SetCardInfo("Tainted Isle", 299, Rarity.UNCOMMON, mage.cards.t.TaintedIsle.class)); cards.add(new SetCardInfo("Tainted Peak", 300, Rarity.UNCOMMON, mage.cards.t.TaintedPeak.class));