changed ninjutsu ability cost to mana string

This commit is contained in:
Evan Kranzler 2021-12-27 21:43:45 -05:00
parent a6fcaab698
commit e8bc3d01ad
19 changed files with 36 additions and 38 deletions

View file

@ -30,7 +30,7 @@ public final class AzraSmokeshaper extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Ninjutsu {1}{B} // Ninjutsu {1}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{B}"))); this.addAbility(new NinjutsuAbility("{1}{B}"));
// When Azra Smokeshaper enters the battlefield, target creature you control gains indestructible until end of turn. // When Azra Smokeshaper enters the battlefield, target creature you control gains indestructible until end of turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect( Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(

View file

@ -29,7 +29,7 @@ public final class FallenShinobi extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Ninjutsu {2}{U}{B} // Ninjutsu {2}{U}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{2}{U}{B}"))); this.addAbility(new NinjutsuAbility("{2}{U}{B}"));
// Whenever Fallen Shinobi deals combat damage to a player, that player exiles the top two cards of their library. Until end of turn, you may play those cards without paying their mana cost. // Whenever Fallen Shinobi deals combat damage to a player, that player exiles the top two cards of their library. Until end of turn, you may play those cards without paying their mana cost.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -46,7 +46,7 @@ public final class HigureTheStillWind extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Ninjutsu {2}{U}{U} ({2}{U}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {2}{U}{U} ({2}{U}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{2}{U}{U}"))); this.addAbility(new NinjutsuAbility("{2}{U}{U}"));
// Whenever Higure, the Still Wind deals combat damage to a player, you may search your library for a Ninja card, reveal it, and put it into your hand. If you do, shuffle your library. // Whenever Higure, the Still Wind deals combat damage to a player, you may search your library for a Ninja card, reveal it, and put it into your hand. If you do, shuffle your library.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, false), true)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, false), true));

View file

@ -32,7 +32,7 @@ public final class IngeniousInfiltrator extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Ninjutsu {U}{B} // Ninjutsu {U}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{U}{B}"))); this.addAbility(new NinjutsuAbility("{U}{B}"));
// Whenever a Ninja you control deals combat damage to a player, draw a card. // Whenever a Ninja you control deals combat damage to a player, draw a card.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility( this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(

View file

@ -38,7 +38,7 @@ public final class InkEyesServantOfOni extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Ninjutsu {3}{B}{B} ({3}{B}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {3}{B}{B} ({3}{B}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{3}{B}{B}"))); this.addAbility(new NinjutsuAbility("{3}{B}{B}"));
// Whenever Ink-Eyes, Servant of Oni deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control. // Whenever Ink-Eyes, Servant of Oni deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control.
this.addAbility(new InkEyesServantOfOniTriggeredAbility()); this.addAbility(new InkEyesServantOfOniTriggeredAbility());

View file

@ -26,7 +26,7 @@ public final class MistSyndicateNaga extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Ninjutsu {2}{U} // Ninjutsu {2}{U}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{2}{U}"))); this.addAbility(new NinjutsuAbility("{2}{U}"));
// Whenever Mist-Syndicate Naga deals combat damage to a player, create a token that's a copy of Mist-Syndicate Naga. // Whenever Mist-Syndicate Naga deals combat damage to a player, create a token that's a copy of Mist-Syndicate Naga.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -36,7 +36,7 @@ public final class MistbladeShinobi extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{U}"))); this.addAbility(new NinjutsuAbility("{U}"));
// Whenever Mistblade Shinobi deals combat damage to a player, you may return target creature that player controls to its owner's hand. // Whenever Mistblade Shinobi deals combat damage to a player, you may return target creature that player controls to its owner's hand.
this.addAbility(new MistbladeShinobiTriggeredAbility()); this.addAbility(new MistbladeShinobiTriggeredAbility());

View file

@ -27,7 +27,7 @@ public final class MoonbladeShinobi extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Ninjutsu {2}{U} // Ninjutsu {2}{U}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{2}{U}"))); this.addAbility(new NinjutsuAbility("{2}{U}"));
// Whenever Moonblade Shinobi deals combat damage to a player, create a 1/1 blue Illusion creature token with flying. // Whenever Moonblade Shinobi deals combat damage to a player, create a 1/1 blue Illusion creature token with flying.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -27,7 +27,7 @@ public final class NinjaOfTheDeepHours extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); this.addAbility(new NinjutsuAbility("{1}{U}"));
// Whenever Ninja of the Deep Hours deals combat damage to a player, you may draw a card. // Whenever Ninja of the Deep Hours deals combat damage to a player, you may draw a card.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), true, false)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), true, false));

View file

@ -24,7 +24,7 @@ public final class NinjaOfTheNewMoon extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Ninjutsu {3}{B} // Ninjutsu {3}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{3}{B}"))); this.addAbility(new NinjutsuAbility("{3}{B}"));
} }
private NinjaOfTheNewMoon(final NinjaOfTheNewMoon card) { private NinjaOfTheNewMoon(final NinjaOfTheNewMoon card) {

View file

@ -27,7 +27,7 @@ public final class OkibaGangShinobi extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Ninjutsu {3}{B} ({3}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {3}{B} ({3}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{3}{B}"))); this.addAbility(new NinjutsuAbility("{3}{B}"));
// Whenever Okiba-Gang Shinobi deals combat damage to a player, that player discards two cards. // Whenever Okiba-Gang Shinobi deals combat damage to a player, that player discards two cards.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(2), false, true)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(2), false, true));

View file

@ -30,7 +30,7 @@ public final class SakashimasStudent extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// Ninjutsu {1}{U} // Ninjutsu {1}{U}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); this.addAbility(new NinjutsuAbility("{1}{U}"));
// You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types.
Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new AddSubtypeCopyApplier(SubType.NINJA)); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new AddSubtypeCopyApplier(SubType.NINJA));

View file

@ -4,7 +4,6 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
@ -116,7 +115,7 @@ class SatoruUmezawaEffect extends ContinuousEffectImpl {
return false; return false;
} }
for (Card card : player.getHand().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { for (Card card : player.getHand().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) {
game.getState().addOtherAbility(card, new NinjutsuAbility(new ManaCostsImpl<>("{2}{U}{B}"))); game.getState().addOtherAbility(card, new NinjutsuAbility("{2}{U}{B}"));
} }
return true; return true;
} }

View file

@ -33,7 +33,7 @@ public final class SilentBladeOni extends CardImpl {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Ninjutsu {4}{U}{B} // Ninjutsu {4}{U}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{4}{U}{B}"))); this.addAbility(new NinjutsuAbility("{4}{U}{B}"));
// Whenever Silent-Blade Oni deals combat damage to a player, look at that player's hand. // Whenever Silent-Blade Oni deals combat damage to a player, look at that player's hand.
// You may cast a nonland card in it without paying that card's mana cost. // You may cast a nonland card in it without paying that card's mana cost.

View file

@ -43,7 +43,7 @@ public final class Skullsnatcher extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Ninjutsu {B} ({B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {B} ({B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{B"))); this.addAbility(new NinjutsuAbility("{B}"));
// Whenever Skullsnatcher deals combat damage to a player, exile up to two target cards from that player's graveyard. // Whenever Skullsnatcher deals combat damage to a player, exile up to two target cards from that player's graveyard.
Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD); Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD);

View file

@ -38,7 +38,7 @@ public final class ThroatSlitter extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Ninjutsu {2}{B} ({2}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {2}{B} ({2}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{2}{B}"))); this.addAbility(new NinjutsuAbility("{2}{B}"));
// Whenever Throat Slitter deals combat damage to a player, destroy target nonblack creature that player controls. // Whenever Throat Slitter deals combat damage to a player, destroy target nonblack creature that player controls.
this.addAbility(new ThroatSlitterTriggeredAbility()); this.addAbility(new ThroatSlitterTriggeredAbility());

View file

@ -43,7 +43,7 @@ public final class WalkerOfSecretWays extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) // Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); this.addAbility(new NinjutsuAbility("{1}{U}"));
// Whenever Walker of Secret Ways deals combat damage to a player, look at that player's hand. // Whenever Walker of Secret Ways deals combat damage to a player, look at that player's hand.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new WalkerOfSecretWaysEffect(), false, true)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new WalkerOfSecretWaysEffect(), false, true));

View file

@ -4,7 +4,7 @@ import mage.abilities.Ability;
import mage.abilities.ActivatedAbilityImpl; import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl; import mage.abilities.costs.CostImpl;
import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
@ -18,7 +18,6 @@ import mage.game.Game;
import mage.game.command.CommandObject; import mage.game.command.CommandObject;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import mage.util.CardUtil; import mage.util.CardUtil;
@ -46,28 +45,22 @@ import java.util.UUID;
public class NinjutsuAbility extends ActivatedAbilityImpl { public class NinjutsuAbility extends ActivatedAbilityImpl {
private final boolean commander; private final boolean commander;
private static final FilterControlledCreaturePermanent filter =
new FilterControlledCreaturePermanent("unblocked attacker you control");
static {
filter.add(UnblockedPredicate.instance);
}
/** /**
* @param manaCost ninjutsu mana cost * @param manaString ninjutsu mana cost
*/ */
public NinjutsuAbility(ManaCost manaCost) { public NinjutsuAbility(String manaString) {
this(manaCost, false); this(new ManaCostsImpl<>(manaString), false);
} }
public NinjutsuAbility(ManaCost manaCost, boolean commander) { public NinjutsuAbility(Cost cost, boolean commander) {
super(commander ? Zone.ALL : Zone.HAND, new NinjutsuEffect(), manaCost); super(commander ? Zone.ALL : Zone.HAND, new NinjutsuEffect(), cost);
this.addCost(new RevealNinjutsuCardCost(commander)); this.addCost(new RevealNinjutsuCardCost(commander));
this.addCost(new ReturnAttackerToHandTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); this.addCost(new ReturnAttackerToHandTargetCost());
this.commander = commander; this.commander = commander;
} }
public NinjutsuAbility(NinjutsuAbility ability) { private NinjutsuAbility(final NinjutsuAbility ability) {
super(ability); super(ability);
this.commander = ability.commander; this.commander = ability.commander;
} }
@ -135,11 +128,17 @@ class NinjutsuEffect extends OneShotEffect {
class ReturnAttackerToHandTargetCost extends CostImpl { class ReturnAttackerToHandTargetCost extends CostImpl {
private UUID defendingPlayerId; private static final FilterControlledCreaturePermanent filter =
new FilterControlledCreaturePermanent("unblocked attacker you control");
public ReturnAttackerToHandTargetCost(TargetControlledPermanent target) { static {
this.addTarget(target); filter.add(UnblockedPredicate.instance);
this.defendingPlayerId = null; }
private UUID defendingPlayerId = null;
public ReturnAttackerToHandTargetCost() {
this.addTarget(new TargetControlledPermanent(filter));
this.text = "Return an unblocked attacker you control to hand"; this.text = "Return an unblocked attacker you control to hand";
} }

View file

@ -76,7 +76,7 @@ Morph|card, cost|
Mutate|card, manaString| Mutate|card, manaString|
Myriad|new| Myriad|new|
Nightbound|new| Nightbound|new|
Ninjutsu|cost| Ninjutsu|manaString|
Outlast|cost| Outlast|cost|
Partner|instance| Partner|instance|
Persist|new| Persist|new|