mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
CardFactoryUtil: add Commander Ninjutsu variant
This commit is contained in:
@@ -3963,19 +3963,41 @@ public class CardFactoryUtil {
|
||||
final String[] k = keyword.split(":");
|
||||
final String manacost = k[1];
|
||||
|
||||
String desc = "Ninjutsu";
|
||||
boolean commander = false;
|
||||
if (k.length > 2 && k[2].equals("Commander")) {
|
||||
desc = "Commander " + desc;
|
||||
commander = true;
|
||||
}
|
||||
|
||||
String effect = "AB$ ChangeZone | Cost$ " + manacost +
|
||||
" Return<1/Creature.attacking+unblocked/unblocked attacker> " +
|
||||
"| PrecostDesc$ Ninjutsu | CostDesc$ " + ManaCostParser.parse(manacost) +
|
||||
"| PrecostDesc$ " + desc + " | CostDesc$ " + ManaCostParser.parse(manacost) +
|
||||
"| ActivationZone$ Hand | Origin$ Hand | Ninjutsu$ True " +
|
||||
"| Destination$ Battlefield | Defined$ Self |" +
|
||||
" SpellDescription$ (" + inst.getReminderText() + ")";
|
||||
"| Destination$ Battlefield | Defined$ Self " +
|
||||
"| SpellDescription$ (" + inst.getReminderText() + ")";
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||
SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||
sa.setIntrinsic(intrinsic);
|
||||
|
||||
sa.setTemporary(!intrinsic);
|
||||
inst.addSpellAbility(sa);
|
||||
|
||||
// extra secondary effect for Commander Ninjutsu
|
||||
if (commander) {
|
||||
effect = "AB$ ChangeZone | Cost$ " + manacost +
|
||||
" Return<1/Creature.attacking+unblocked/unblocked attacker> " +
|
||||
"| PrecostDesc$ " + desc + " | CostDesc$ " + ManaCostParser.parse(manacost) +
|
||||
"| ActivationZone$ Command | Origin$ Command | Ninjutsu$ True " +
|
||||
"| Destination$ Battlefield | Defined$ Self | Secondary$ True " +
|
||||
"| SpellDescription$ (" + inst.getReminderText() + ")";
|
||||
|
||||
sa = AbilityFactory.getAbility(effect, card);
|
||||
sa.setIntrinsic(intrinsic);
|
||||
|
||||
sa.setTemporary(!intrinsic);
|
||||
inst.addSpellAbility(sa);
|
||||
}
|
||||
} else if (keyword.startsWith("Outlast")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String manacost = k[1];
|
||||
|
||||
@@ -98,7 +98,7 @@ public enum Keyword {
|
||||
MORPH(KeywordWithCost.class, false, "You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost."),
|
||||
MULTIKICKER(KeywordWithCost.class, false, "You may pay an additional %s any number of times as you cast this spell."),
|
||||
MYRIAD(SimpleKeyword.class, false, "Whenever this creature attacks, for each opponent other than defending player, you may create a token that's a copy of this creature that's tapped and attacking that player or a planeswalker they control. Exile the tokens at end of combat."),
|
||||
NINJUTSU(KeywordWithCost.class, false, "%s, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking."),
|
||||
NINJUTSU(Ninjutsu.class, false, "%s, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your %s tapped and attacking."),
|
||||
OUTLAST(KeywordWithCost.class, false, "%s, {T}: Put a +1/+1 counter on this creature. Outlast only as a sorcery."),
|
||||
OFFERING(KeywordWithType.class, false, "You may cast this card any time you could cast an instant by sacrificing a %1$s and paying the difference in mana costs between this and the sacrificed %1$s. Mana cost includes color."),
|
||||
PARTNER(Partner.class, true, "You can have two commanders if both have partner."),
|
||||
|
||||
31
forge-game/src/main/java/forge/game/keyword/Ninjutsu.java
Normal file
31
forge-game/src/main/java/forge/game/keyword/Ninjutsu.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package forge.game.keyword;
|
||||
|
||||
public class Ninjutsu extends KeywordWithCost {
|
||||
|
||||
protected boolean commander = false;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.game.keyword.KeywordWithCost#parse(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected void parse(String details) {
|
||||
if (details.contains(":")) {
|
||||
String k[] = details.split(":");
|
||||
details = k[0];
|
||||
if (k[1].equals("Commander")) {
|
||||
commander = true;
|
||||
}
|
||||
}
|
||||
super.parse(details);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.game.keyword.KeywordWithCost#formatReminderText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected String formatReminderText(String reminderText) {
|
||||
String zone = commander ? "hand or the command zone" : "hand";
|
||||
return String.format(reminderText, cost.toSimpleString(), zone);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Name:Yuriko, the Tiger's Shadow
|
||||
ManaCost:1 U B
|
||||
Types:Legendary Creature Human Ninja
|
||||
PT:1/3
|
||||
K:Ninjutsu:U B:Commander
|
||||
T:Mode$ DamageDone | ValidSource$ Ninja | ValidTarget$ Player | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigDig | TriggerDescription$ Whenever a Ninja you control deals combat damage to a player, reveal the top card of your library and put that card into your hand. Each opponent loses life equal to that card's converted mana cost.
|
||||
SVar:TrigDig:DB$Dig | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Hand | RememberChanged$ True | SubAbility$ DBLoseLife
|
||||
SVar:DBLoseLife:DB$LoseLife | LifeAmount$ X | Defined$ Player.Opponent | SubAbility$ DBCleanup | References$ X
|
||||
SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$CardManaCost
|
||||
DeckHints:Type$Ninja
|
||||
Oracle:Commander ninjutsu {U}{B} ({U}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand or the command zone tapped and attacking.)\nWhenever a Ninja you control deals combat damage to a player, reveal the top card of your library and put that card into your hand. Each opponent loses life equal to that card's converted mana cost.
|
||||
Reference in New Issue
Block a user