From d8b4257d66e583fe02f48d8d491995f9aa9294f3 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Sat, 8 Oct 2022 21:03:20 +0100 Subject: [PATCH] [40K] Implement Nurgle's Rot (#9632) --- Mage.Sets/src/mage/cards/n/NurglesRot.java | 49 +++++++++++++++++++++ Mage.Sets/src/mage/sets/Warhammer40000.java | 1 + 2 files changed, 50 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NurglesRot.java diff --git a/Mage.Sets/src/mage/cards/n/NurglesRot.java b/Mage.Sets/src/mage/cards/n/NurglesRot.java new file mode 100644 index 0000000000..fd74c63385 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NurglesRot.java @@ -0,0 +1,49 @@ +package mage.cards.n; + +import mage.abilities.Ability; +import mage.abilities.common.DiesAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.PlaguebearerOfNurgleToken; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class NurglesRot extends CardImpl { + + public NurglesRot(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.subtype.add(SubType.AURA); + + // Enchant creature an opponent controls + TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + this.addAbility(new EnchantAbility(auraTarget)); + + // When enchanted creature dies, return Nurgle's Rot to its owner's hand and you create a 1/3 black Demon creature token named Plaguebearer of Nurgle. + Ability ability = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted creature"); + ability.addEffect(new CreateTokenEffect(new PlaguebearerOfNurgleToken()).concatBy("and")); + this.addAbility(ability); + } + + private NurglesRot(final NurglesRot card) { + super(card); + } + + @Override + public NurglesRot copy() { + return new NurglesRot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index 75b2ec1fd8..a3ec1cbf21 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -171,6 +171,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("New Horizons", 218, Rarity.COMMON, mage.cards.n.NewHorizons.class)); cards.add(new SetCardInfo("Night Scythe", 162, Rarity.UNCOMMON, mage.cards.n.NightScythe.class)); cards.add(new SetCardInfo("Noise Marine", 82, Rarity.UNCOMMON, mage.cards.n.NoiseMarine.class)); + cards.add(new SetCardInfo("Nurgle's Rot", 45, Rarity.UNCOMMON, mage.cards.n.NurglesRot.class)); cards.add(new SetCardInfo("Old One Eye", 96, Rarity.RARE, mage.cards.o.OldOneEye.class)); cards.add(new SetCardInfo("Opal Palace", 286, Rarity.COMMON, mage.cards.o.OpalPalace.class)); cards.add(new SetCardInfo("Overgrowth", 219, Rarity.COMMON, mage.cards.o.Overgrowth.class));