more NICKNAME support

This commit is contained in:
Northmoc
2020-10-01 20:14:06 -04:00
parent 95c4095c3c
commit 24eb24d20d
4 changed files with 10 additions and 3 deletions

View File

@@ -150,7 +150,11 @@ public abstract class SpellAbilityEffect {
if ("}".equals(t)) { isPlainText = true; continue; } if ("}".equals(t)) { isPlainText = true; continue; }
if (isPlainText) { if (isPlainText) {
if(t.startsWith("NICKNAME")) {
sb.append(TextUtil.fastReplace(t,"NICKNAME", sa.getHostCard().getName().split(",")[0]));
} else {
sb.append(TextUtil.fastReplace(t, "CARDNAME", sa.getHostCard().getName())); sb.append(TextUtil.fastReplace(t, "CARDNAME", sa.getHostCard().getName()));
}
} else { } else {
final List<? extends GameObject> objs; final List<? extends GameObject> objs;
if (t.startsWith("p:")) { if (t.startsWith("p:")) {

View File

@@ -2075,8 +2075,9 @@ public class Card extends GameEntity implements Comparable<Card> {
} }
final Card host = stAb.getHostCard(); final Card host = stAb.getHostCard();
if (isValid(stAb.getParam("ValidAttacker").split(","), host.getController(), host, null)) { if (isValid(stAb.getParam("ValidAttacker").split(","), host.getController(), host, null)) {
String desc = stAb.toString(); String currentName = (host.getName());
desc = TextUtil.fastReplace(desc, "CARDNAME", host.getName()); String desc1 = TextUtil.fastReplace(stAb.toString(), "CARDNAME", currentName);
String desc = TextUtil.fastReplace(desc1,"NICKNAME", currentName.split(",")[0]);
if (host.getEffectSource() != null) { if (host.getEffectSource() != null) {
desc = TextUtil.fastReplace(desc, "EFFECTSOURCE", host.getEffectSource().getName()); desc = TextUtil.fastReplace(desc, "EFFECTSOURCE", host.getEffectSource().getName());
} }

View File

@@ -699,6 +699,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
String desc = node.getDescription(); String desc = node.getDescription();
if (node.getHostCard() != null) { if (node.getHostCard() != null) {
desc = TextUtil.fastReplace(desc, "CARDNAME", node.getHostCard().getName()); desc = TextUtil.fastReplace(desc, "CARDNAME", node.getHostCard().getName());
desc = TextUtil.fastReplace(desc,"NICKNAME",node.getHostCard().getName().split(",")[0]);
if (node.getOriginalHost() != null) { if (node.getOriginalHost() != null) {
desc = TextUtil.fastReplace(desc, "ORIGINALHOST", node.getOriginalHost().getName()); desc = TextUtil.fastReplace(desc, "ORIGINALHOST", node.getOriginalHost().getName());
} }

View File

@@ -216,6 +216,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
if (hasParam("Description") && !this.isSuppressed()) { if (hasParam("Description") && !this.isSuppressed()) {
String desc = getParam("Description"); String desc = getParam("Description");
desc = TextUtil.fastReplace(desc, "CARDNAME", this.hostCard.getName()); desc = TextUtil.fastReplace(desc, "CARDNAME", this.hostCard.getName());
desc = TextUtil.fastReplace(desc, "NICKNAME", this.hostCard.getName().split(",")[0]);
return desc; return desc;
} else { } else {