From 9099f48593c9df89c1881df5b57b5dcbd426d19f Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Thu, 2 May 2024 11:09:49 +0200 Subject: [PATCH] implement [PIP] Mutational Advantage --- .../src/mage/cards/m/MutationalAdvantage.java | 58 +++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 59 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MutationalAdvantage.java diff --git a/Mage.Sets/src/mage/cards/m/MutationalAdvantage.java b/Mage.Sets/src/mage/cards/m/MutationalAdvantage.java new file mode 100644 index 00000000000..a5d719e20a4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MutationalAdvantage.java @@ -0,0 +1,58 @@ +package mage.cards.m; + +import mage.abilities.effects.common.PreventAllDamageToAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.counter.ProliferateEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.CounterAnyPredicate; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class MutationalAdvantage extends CardImpl { + + private static final FilterPermanent filter = + new FilterControlledPermanent("permanents you control with counters on them"); + + static { + filter.add(CounterAnyPredicate.instance); + } + + public MutationalAdvantage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}{U}"); + + // Permanents you control with counters on them gain hexproof and indestructible until end of turn. Prevent all damage that would be dealt to those permanents this turn. Proliferate. + this.getSpellAbility().addEffect( + new GainAbilityControlledEffect( + HexproofAbility.getInstance(), Duration.EndOfTurn, filter + ).setText("Permanents you control with counters on them gain hexproof") + ); + this.getSpellAbility().addEffect( + new GainAbilityControlledEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn, filter + ).setText("and indestructible until end of turn") + ); + this.getSpellAbility().addEffect( + new PreventAllDamageToAllEffect(Duration.EndOfTurn, filter) + ); + this.getSpellAbility().addEffect(new ProliferateEffect()); + } + + private MutationalAdvantage(final MutationalAdvantage card) { + super(card); + } + + @Override + public MutationalAdvantage copy() { + return new MutationalAdvantage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 5474ed1c1cc..27f1bfcdb35 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -208,6 +208,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Mossfire Valley", 273, Rarity.RARE, mage.cards.m.MossfireValley.class)); cards.add(new SetCardInfo("Mountain", 323, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mr. House, President and CEO", 7, Rarity.MYTHIC, mage.cards.m.MrHousePresidentAndCEO.class)); + cards.add(new SetCardInfo("Mutational Advantage", 111, Rarity.RARE, mage.cards.m.MutationalAdvantage.class)); cards.add(new SetCardInfo("Myriad Landscape", 274, Rarity.UNCOMMON, mage.cards.m.MyriadLandscape.class)); cards.add(new SetCardInfo("Mystic Forge", 236, Rarity.RARE, mage.cards.m.MysticForge.class)); cards.add(new SetCardInfo("Mystic Monastery", 275, Rarity.UNCOMMON, mage.cards.m.MysticMonastery.class));