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);
// 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.
Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(

View file

@ -29,7 +29,7 @@ public final class FallenShinobi extends CardImpl {
this.toughness = new MageInt(4);
// 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.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -46,7 +46,7 @@ public final class HigureTheStillWind extends CardImpl {
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.)
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.
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);
// 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.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(

View file

@ -38,7 +38,7 @@ public final class InkEyesServantOfOni extends CardImpl {
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.)
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.
this.addAbility(new InkEyesServantOfOniTriggeredAbility());

View file

@ -26,7 +26,7 @@ public final class MistSyndicateNaga extends CardImpl {
this.toughness = new MageInt(1);
// 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.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -36,7 +36,7 @@ public final class MistbladeShinobi extends CardImpl {
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.)
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.
this.addAbility(new MistbladeShinobiTriggeredAbility());

View file

@ -27,7 +27,7 @@ public final class MoonbladeShinobi extends CardImpl {
this.toughness = new MageInt(2);
// 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.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(

View file

@ -27,7 +27,7 @@ public final class NinjaOfTheDeepHours extends CardImpl {
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.)
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.
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);
// Ninjutsu {3}{B}
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{3}{B}")));
this.addAbility(new NinjutsuAbility("{3}{B}"));
}
private NinjaOfTheNewMoon(final NinjaOfTheNewMoon card) {

View file

@ -27,7 +27,7 @@ public final class OkibaGangShinobi extends CardImpl {
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.)
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.
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);
// 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.
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.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
@ -116,7 +115,7 @@ class SatoruUmezawaEffect extends ContinuousEffectImpl {
return false;
}
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;
}

View file

@ -33,7 +33,7 @@ public final class SilentBladeOni extends CardImpl {
this.toughness = new MageInt(5);
// 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.
// 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);
// 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.
Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD);

View file

@ -38,7 +38,7 @@ public final class ThroatSlitter extends CardImpl {
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.)
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.
this.addAbility(new ThroatSlitterTriggeredAbility());

View file

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

View file

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