From e537df37ab8310a689594eb2b75fc9726c5cc955 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Nov 2022 09:03:27 -0500 Subject: [PATCH] [BRC] Implement Machine God's Effigy --- .../src/mage/cards/m/MachineGodsEffigy.java | 62 +++++++++++++++++++ .../mage/sets/TheBrothersWarCommander.java | 1 + 2 files changed, 63 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MachineGodsEffigy.java diff --git a/Mage.Sets/src/mage/cards/m/MachineGodsEffigy.java b/Mage.Sets/src/mage/cards/m/MachineGodsEffigy.java new file mode 100644 index 00000000000..5afa80f9d75 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MachineGodsEffigy.java @@ -0,0 +1,62 @@ +package mage.cards.m; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.common.CopyPermanentEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.util.functions.CopyApplier; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MachineGodsEffigy extends CardImpl { + + public MachineGodsEffigy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // You may have Machine God's Effigy enter the battlefield as a copy of any creature on the battlefield, except it's an artifact and it has "{T}: Add {U}." + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new EntersBattlefieldEffect( + new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new MachineGodsEffigyApplier()) + .setText("You may have {this} enter the battlefield as a copy of any creature " + + "on the battlefield, except it's an artifact and it has \"{T}: Add {U}.\""), + "", true + ) + )); + + // {T}: Add {U}. + this.addAbility(new BlueManaAbility()); + } + + private MachineGodsEffigy(final MachineGodsEffigy card) { + super(card); + } + + @Override + public MachineGodsEffigy copy() { + return new MachineGodsEffigy(this); + } +} + +class MachineGodsEffigyApplier extends CopyApplier { + + @Override + public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) { + blueprint.retainAllArtifactSubTypes(null); + blueprint.removeAllCardTypes(game); + blueprint.addCardType(CardType.ARTIFACT); + blueprint.getAbilities().add(new BlueManaAbility()); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java index 52097e03bc4..cba0150562c 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java @@ -89,6 +89,7 @@ public final class TheBrothersWarCommander extends ExpansionSet { cards.add(new SetCardInfo("Liquimetal Torque", 145, Rarity.UNCOMMON, mage.cards.l.LiquimetalTorque.class)); cards.add(new SetCardInfo("Lithoform Engine", 146, Rarity.MYTHIC, mage.cards.l.LithoformEngine.class)); cards.add(new SetCardInfo("Losheel, Clockwork Scholar", 73, Rarity.RARE, mage.cards.l.LosheelClockworkScholar.class)); + cards.add(new SetCardInfo("Machine God's Effigy", 16, Rarity.RARE, mage.cards.m.MachineGodsEffigy.class)); cards.add(new SetCardInfo("March of Progress", 8, Rarity.RARE, mage.cards.m.MarchOfProgress.class)); cards.add(new SetCardInfo("Marionette Master", 109, Rarity.RARE, mage.cards.m.MarionetteMaster.class)); cards.add(new SetCardInfo("Master Transmuter", 87, Rarity.RARE, mage.cards.m.MasterTransmuter.class));