From 1e08c42c24cbd1be4868a01dc119b8fe7f818528 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Mon, 8 Apr 2024 01:50:45 +0200 Subject: [PATCH] [PIP] Implements Nightkin Ambusher --- .../src/mage/cards/n/NightkinAmbusher.java | 69 +++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NightkinAmbusher.java diff --git a/Mage.Sets/src/mage/cards/n/NightkinAmbusher.java b/Mage.Sets/src/mage/cards/n/NightkinAmbusher.java new file mode 100644 index 00000000000..af6f559e950 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NightkinAmbusher.java @@ -0,0 +1,69 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class NightkinAmbusher extends CardImpl { + + public NightkinAmbusher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + + this.subtype.add(SubType.MUTANT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // When Nightkin Ambusher enters the battlefield, target player gets four rad counters. + Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.RAD.createInstance(4))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + // Nightkin Ambusher can't be blocked as long as defending player has a rad counter. + this.addAbility(new SimpleStaticAbility(new ConditionalRestrictionEffect( + new CantBeBlockedSourceEffect(), NightkinAmbusherCondition.instance + ).setText("{this} can't be blocked as long as defending player has a rad counter"))); + } + + private NightkinAmbusher(final NightkinAmbusher card) { + super(card); + } + + @Override + public NightkinAmbusher copy() { + return new NightkinAmbusher(this); + } +} + +enum NightkinAmbusherCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Player defendingPlayer = game.getPlayer(game.getCombat().getDefendingPlayerId(source.getSourceId(), game)); + return defendingPlayer != null && defendingPlayer.getCounters().getCount(CounterType.RAD) >= 1; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 46468a7eeb6..d49b583af91 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -205,6 +205,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Nick Valentine, Private Eye", 378, Rarity.RARE, mage.cards.n.NickValentinePrivateEye.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Nick Valentine, Private Eye", 563, Rarity.RARE, mage.cards.n.NickValentinePrivateEye.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Nick Valentine, Private Eye", 906, Rarity.RARE, mage.cards.n.NickValentinePrivateEye.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Nightkin Ambusher", 112, Rarity.UNCOMMON, mage.cards.n.NightkinAmbusher.class)); cards.add(new SetCardInfo("Nomad Outpost", 277, Rarity.UNCOMMON, mage.cards.n.NomadOutpost.class)); cards.add(new SetCardInfo("Nuka-Cola Vending Machine", 137, Rarity.UNCOMMON, mage.cards.n.NukaColaVendingMachine.class)); cards.add(new SetCardInfo("One with the Machine", 179, Rarity.RARE, mage.cards.o.OneWithTheMachine.class));