diff --git a/Mage.Sets/src/mage/cards/n/NettlingNuisance.java b/Mage.Sets/src/mage/cards/n/NettlingNuisance.java new file mode 100644 index 00000000000..c3361ccd3bc --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NettlingNuisance.java @@ -0,0 +1,94 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.token.NettlingNuisancePirateToken; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; +import mage.abilities.Ability; +import mage.abilities.common.DealCombatDamageControlledTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.combat.GoadTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SetTargetPointer; + +/** + * + * @author Xanderhall + */ +public final class NettlingNuisance extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.FAERIE, "Faeries"); + + public NettlingNuisance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.FAERIE); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever one or more Faeries you control deal combat damage to a player, that player creates a 4/2 red Pirate creature token with "This creature can't block." The token is goaded for the rest of the game. + this.addAbility(new DealCombatDamageControlledTriggeredAbility(Zone.BATTLEFIELD, new NettlingNuisanceEffect(), filter, SetTargetPointer.PLAYER, false)); + } + + private NettlingNuisance(final NettlingNuisance card) { + super(card); + } + + @Override + public NettlingNuisance copy() { + return new NettlingNuisance(this); + } +} + +class NettlingNuisanceEffect extends OneShotEffect { + + NettlingNuisanceEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "that player creates a 4/2 red Pirate creature token with \"This creature can't block.\" The token is goaded for the rest of the game. " + + "(It attacks each combat if able and attacks a player other than you if able.)"; + } + + private NettlingNuisanceEffect(final NettlingNuisanceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + + if (player == null) { + return false; + } + + Token token = new NettlingNuisancePirateToken(); + token.putOntoBattlefield(1, game, source); + token.getLastAddedTokenIds().forEach(id -> game.addEffect( + new GoadTargetEffect().setDuration(Duration.EndOfGame).setTargetPointer(new FixedTarget(id, game)), + source + )); + + return true; + } + + @Override + public NettlingNuisanceEffect copy() { + return new NettlingNuisanceEffect(this); + } + +} + diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java b/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java index f9ae86ffbff..8b40bd61a55 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java @@ -89,6 +89,7 @@ public final class WildsOfEldraineCommander extends ExpansionSet { cards.add(new SetCardInfo("Midnight Clock", 99, Rarity.RARE, mage.cards.m.MidnightClock.class)); cards.add(new SetCardInfo("Mind Stone", 148, Rarity.COMMON, mage.cards.m.MindStone.class)); cards.add(new SetCardInfo("Myriad Landscape", 164, Rarity.UNCOMMON, mage.cards.m.MyriadLandscape.class)); + cards.add(new SetCardInfo("Nettling Nuisance", 15, Rarity.RARE, mage.cards.n.NettlingNuisance.class)); cards.add(new SetCardInfo("Nightmare Unmaking", 114, Rarity.RARE, mage.cards.n.NightmareUnmaking.class)); cards.add(new SetCardInfo("Nightveil Sprite", 100, Rarity.UNCOMMON, mage.cards.n.NightveilSprite.class)); cards.add(new SetCardInfo("Nymris, Oona's Trickster", 141, Rarity.RARE, mage.cards.n.NymrisOonasTrickster.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/NettlingNuisancePirateToken.java b/Mage/src/main/java/mage/game/permanent/token/NettlingNuisancePirateToken.java new file mode 100644 index 00000000000..35d72ca7603 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/NettlingNuisancePirateToken.java @@ -0,0 +1,33 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBlockSourceEffect; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; + +/** + * @author Xanderhall + */ +public final class NettlingNuisancePirateToken extends TokenImpl { + + public NettlingNuisancePirateToken() { + super("Pirate Token", "4/2 red Pirate creature token with \"This creature can't block.\""); + cardType.add(CardType.CREATURE); + subtype.add(SubType.PIRATE); + color.setRed(true); + power = new MageInt(4); + toughness = new MageInt(2); + + this.addAbility(new SimpleStaticAbility(new CantBlockSourceEffect(Duration.EndOfGame))); + } + + protected NettlingNuisancePirateToken(final NettlingNuisancePirateToken token) { + super(token); + } + + public NettlingNuisancePirateToken copy() { + return new NettlingNuisancePirateToken(this); + } +}