messing with StackDescription building

This commit is contained in:
Northmoc
2023-02-09 22:50:35 -05:00
parent d99e43209a
commit 8fa12e7ceb
4 changed files with 31 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import forge.util.lang.LangEnglish;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Iterables;
@@ -80,14 +81,34 @@ public abstract class SpellAbilityEffect {
// Own description
String stackDesc = params.get("StackDescription");
if (stackDesc != null) {
String[] reps = null;
if (stackDesc.startsWith("REP")) {
reps = stackDesc.substring(4).split(" & ");
stackDesc = "SpellDescription";
}
// by typing "SpellDescription" they want to bypass the Effect's string builder
if ("SpellDescription".equalsIgnoreCase(stackDesc)) {
if (params.get("SpellDescription") != null) {
sb.append(CardTranslation.translateSingleDescriptionText(params.get("SpellDescription"), sa.getHostCard().getName()));
}
if (sa.getTargets() != null && !sa.getTargets().isEmpty()) {
sb.append(" (Targeting: ").append(sa.getTargets()).append(")");
}
if (params.get("SpellDescription") != null) {
String spellDesc = CardTranslation.translateSingleDescriptionText(params.get("SpellDescription"),
sa.getHostCard().getName());
if (Lang.getInstance() instanceof LangEnglish && reps != null) {
for (String s : reps) {
String[] rep = s.split("_",2);
spellDesc = spellDesc.replaceFirst(rep[0], rep[1]);
}
}
if (spellDesc.contains("(")) { //trim reminder text from StackDesc
spellDesc = spellDesc.substring(0, spellDesc.indexOf("(") - 1);
}
if (reps == null) {
sb.append(spellDesc);
} else {
tokenizeString(sa, sb, spellDesc);
}
}
if (sa.getTargets() != null && !sa.getTargets().isEmpty() && reps == null) {
sb.append(" (Targeting: ").append(Lang.joinHomogenous(sa.getTargets())).append(")");
}
} else if (!"None".equalsIgnoreCase(stackDesc)) { // by typing "none" they want to suppress output
tokenizeString(sa, sb, stackDesc);
}

View File

@@ -1,6 +1,6 @@
Name:Alchemist's Gift
ManaCost:B
Types:Instant
A:SP$ Pump | ValidTgts$ Creature | NumAtt$ +1 | NumDef$ +1 | KWChoice$ Deathtouch,Lifelink | StackDescription$ {c:Targeted} gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn. | SpellDescription$ Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn. (Any amount of damage a creature with deathtouch deals to a creature is enough to destroy it. Damage dealt by a creature with lifelink also causes its controller to gain that much life.)
A:SP$ Pump | ValidTgts$ Creature | NumAtt$ +1 | NumDef$ +1 | KWChoice$ Deathtouch,Lifelink | StackDescription$ REP Target creature_{c:Targeted} & your_{p:You}'s | SpellDescription$ Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn. (Any amount of damage a creature with deathtouch deals to a creature is enough to destroy it. Damage dealt by a creature with lifelink also causes its controller to gain that much life.)
DeckHas:Ability$LifeGain
Oracle:Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn. (Any amount of damage a creature with deathtouch deals to a creature is enough to destroy it. Damage dealt by a creature with lifelink also causes its controller to gain that much life.)

View File

@@ -1,7 +1,7 @@
Name:Fists of Flame
ManaCost:1 R
Types:Instant
A:SP$ Draw | Cost$ 1 R | NumCards$ 1 | SubAbility$ DBPump | SpellDescription$ Draw a card. Until end of turn, target creature gains trample and gets +1/+0 for each card you've drawn this turn.
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | KW$ Trample | NumAtt$ +X
A:SP$ Draw | NumCards$ 1 | SubAbility$ DBPump | SpellDescription$ Draw a card.
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | KW$ Trample | NumAtt$ +X | StackDescription$ REP target creature_{c:Targeted} | SpellDescription$ Until end of turn, target creature gains trample and gets +1/+0 for each card you've drawn this turn.
SVar:X:Count$YouDrewThisTurn
Oracle:Draw a card. Until end of turn, target creature gains trample and gets +1/+0 for each card you've drawn this turn.

View File

@@ -1,7 +1,7 @@
Name:Part Water
ManaCost:X X U
Types:Sorcery
A:SP$ Pump | Cost$ X X U | KW$ Islandwalk | TargetMin$ X | TargetMax$ X | ValidTgts$ Creature | TgtPrompt$ Select X target creatures | StackDescription$ X target creatures [{c:Targeted}] gain islandwalk until end of turn. | SpellDescription$ X target creatures gain islandwalk until end of turn. (They can't be blocked as long as defending player controls an Island.)
A:SP$ Pump | KW$ Islandwalk | TargetMin$ X | TargetMax$ X | ValidTgts$ Creature | TgtPrompt$ Select X target creatures | StackDescription$ SpellDescription | SpellDescription$ X target creatures gain islandwalk until end of turn. (They can't be blocked as long as defending player controls an Island.)
SVar:X:Count$xPaid
AI:RemoveDeck:Random
DeckHas:Keyword$IslandWalk