From b91cef5dd67adaaf6bc2e291e55232cecb325a9a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 13 Sep 2022 07:53:25 -0400 Subject: [PATCH] [40K] Implemented Noise Marine --- Mage.Sets/src/mage/cards/n/NoiseMarine.java | 77 +++++++++++++++++++++ Mage.Sets/src/mage/sets/Warhammer40000.java | 1 + 2 files changed, 78 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NoiseMarine.java diff --git a/Mage.Sets/src/mage/cards/n/NoiseMarine.java b/Mage.Sets/src/mage/cards/n/NoiseMarine.java new file mode 100644 index 0000000000..497c2414f4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NoiseMarine.java @@ -0,0 +1,77 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.CascadeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; +import mage.target.common.TargetAnyTarget; +import mage.watchers.common.CastSpellLastTurnWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NoiseMarine extends CardImpl { + + public NoiseMarine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.ASTARTES); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Cascade + this.addAbility(new CascadeAbility()); + + // Sonic Blaster -- When Noise Marine enters the battlefield, it deals damage equal to the number of spells you've cast this turn to any target. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DamageTargetEffect(NoiseMarineValue.instance, "it") + ); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability.withFlavorWord("Sonic Blaster")); + } + + private NoiseMarine(final NoiseMarine card) { + super(card); + } + + @Override + public NoiseMarine copy() { + return new NoiseMarine(this); + } +} + +enum NoiseMarineValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); + return watcher == null ? 0 : watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId()); + } + + @Override + public NoiseMarineValue copy() { + return instance; + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return "spells you've cast this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index 805ec63ada..02c3fb4a88 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -29,6 +29,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("Hardened Scales", 215, Rarity.RARE, mage.cards.h.HardenedScales.class)); cards.add(new SetCardInfo("Imotekh the Stormlord", 5, Rarity.MYTHIC, mage.cards.i.ImotekhTheStormlord.class)); cards.add(new SetCardInfo("Inquisitor Greyfax", 3, Rarity.MYTHIC, mage.cards.i.InquisitorGreyfax.class)); + cards.add(new SetCardInfo("Noise Marine", 82, Rarity.UNCOMMON, mage.cards.n.NoiseMarine.class)); cards.add(new SetCardInfo("Sol Ring", 249, Rarity.UNCOMMON, mage.cards.s.SolRing.class)); cards.add(new SetCardInfo("Szarekh, the Silent King", 1, Rarity.MYTHIC, mage.cards.s.SzarekhTheSilentKing.class)); }