From 43cdf845d5cf905c587265d47dece84c57c577b4 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 12 Nov 2024 10:26:13 -0500 Subject: [PATCH] [J25] Implement Fumulus, the Infestation --- .../mage/cards/f/FumulusTheInfestation.java | 78 +++++++++++++++++++ .../src/mage/sets/FoundationsJumpstart.java | 1 + .../SacrificePermanentTriggeredAbility.java | 8 +- 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/f/FumulusTheInfestation.java diff --git a/Mage.Sets/src/mage/cards/f/FumulusTheInfestation.java b/Mage.Sets/src/mage/cards/f/FumulusTheInfestation.java new file mode 100644 index 00000000000..f3a37cb826c --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FumulusTheInfestation.java @@ -0,0 +1,78 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAllTriggeredAbility; +import mage.abilities.common.SacrificePermanentTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.game.permanent.token.XiraBlackInsectToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FumulusTheInfestation extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("an Insect, Leech, Slug, or Worm you control"); + + static { + filter.add(Predicates.or( + SubType.INSECT.getPredicate(), + SubType.LEECH.getPredicate(), + SubType.SLUG.getPredicate(), + SubType.WORM.getPredicate() + )); + filter.add(TargetController.YOU.getControllerPredicate()); + } + + public FumulusTheInfestation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.INSECT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Whenever a player sacrifices a nontoken creature, create a 1/1 black Insect creature token with flying. + this.addAbility(new SacrificePermanentTriggeredAbility( + new CreateTokenEffect(new XiraBlackInsectToken()), + StaticFilters.FILTER_CREATURE_NON_TOKEN, TargetController.ANY + )); + + // Whenever an Insect, Leech, Slug, or Worm you control attacks, defending player loses 1 life and you gain 1 life. + Ability ability = new AttacksAllTriggeredAbility( + new LoseLifeTargetEffect(1), false, + filter, SetTargetPointer.PLAYER, false + ); + ability.addEffect(new GainLifeEffect(1).concatBy("and")); + this.addAbility(ability); + } + + private FumulusTheInfestation(final FumulusTheInfestation card) { + super(card); + } + + @Override + public FumulusTheInfestation copy() { + return new FumulusTheInfestation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/FoundationsJumpstart.java b/Mage.Sets/src/mage/sets/FoundationsJumpstart.java index 62c2c65af72..3e6e9764420 100644 --- a/Mage.Sets/src/mage/sets/FoundationsJumpstart.java +++ b/Mage.Sets/src/mage/sets/FoundationsJumpstart.java @@ -278,6 +278,7 @@ public final class FoundationsJumpstart extends ExpansionSet { cards.add(new SetCardInfo("Foul Play", 442, Rarity.UNCOMMON, mage.cards.f.FoulPlay.class)); cards.add(new SetCardInfo("Fretwork Colony", 443, Rarity.UNCOMMON, mage.cards.f.FretworkColony.class)); cards.add(new SetCardInfo("Frost Trickster", 313, Rarity.COMMON, mage.cards.f.FrostTrickster.class)); + cards.add(new SetCardInfo("Fumulus, the Infestation", 42, Rarity.RARE, mage.cards.f.FumulusTheInfestation.class)); cards.add(new SetCardInfo("Fungal Plots", 658, Rarity.UNCOMMON, mage.cards.f.FungalPlots.class)); cards.add(new SetCardInfo("Furious Reprisal", 554, Rarity.UNCOMMON, mage.cards.f.FuriousReprisal.class)); cards.add(new SetCardInfo("Fusion Elemental", 745, Rarity.UNCOMMON, mage.cards.f.FusionElemental.class)); diff --git a/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java index cc6a23bef9d..4acbcf1f2bd 100644 --- a/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java @@ -28,7 +28,11 @@ public class SacrificePermanentTriggeredAbility extends TriggeredAbilityImpl { * zone = battlefield, setTargetPointer = NONE, optional = false */ public SacrificePermanentTriggeredAbility(Effect effect, FilterPermanent filter) { - this(Zone.BATTLEFIELD, effect, filter, TargetController.YOU, SetTargetPointer.NONE, false); + this(effect, filter, TargetController.YOU); + } + + public SacrificePermanentTriggeredAbility(Effect effect, FilterPermanent filter, TargetController sacrificingPlayer) { + this(Zone.BATTLEFIELD, effect, filter, sacrificingPlayer, SetTargetPointer.NONE, false); } public SacrificePermanentTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, @@ -115,7 +119,7 @@ public class SacrificePermanentTriggeredAbility extends TriggeredAbilityImpl { default: throw new IllegalArgumentException("Unsupported TargetController in SacrificePermanentTriggeredAbility: " + sacrificingPlayer); } - return getWhen() + targetControllerText + CardUtil.addArticle(filter.getMessage()) + ", "; + return getWhen() + targetControllerText + CardUtil.addArticle(filter.getMessage()) + ", "; } }