mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
more NICKNAME support
This commit is contained in:
@@ -150,7 +150,11 @@ public abstract class SpellAbilityEffect {
|
||||
if ("}".equals(t)) { isPlainText = true; continue; }
|
||||
|
||||
if (isPlainText) {
|
||||
sb.append(TextUtil.fastReplace(t, "CARDNAME", sa.getHostCard().getName()));
|
||||
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()));
|
||||
}
|
||||
} else {
|
||||
final List<? extends GameObject> objs;
|
||||
if (t.startsWith("p:")) {
|
||||
|
||||
@@ -2075,8 +2075,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
final Card host = stAb.getHostCard();
|
||||
if (isValid(stAb.getParam("ValidAttacker").split(","), host.getController(), host, null)) {
|
||||
String desc = stAb.toString();
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", host.getName());
|
||||
String currentName = (host.getName());
|
||||
String desc1 = TextUtil.fastReplace(stAb.toString(), "CARDNAME", currentName);
|
||||
String desc = TextUtil.fastReplace(desc1,"NICKNAME", currentName.split(",")[0]);
|
||||
if (host.getEffectSource() != null) {
|
||||
desc = TextUtil.fastReplace(desc, "EFFECTSOURCE", host.getEffectSource().getName());
|
||||
}
|
||||
|
||||
@@ -699,6 +699,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
String desc = node.getDescription();
|
||||
if (node.getHostCard() != null) {
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", node.getHostCard().getName());
|
||||
desc = TextUtil.fastReplace(desc,"NICKNAME",node.getHostCard().getName().split(",")[0]);
|
||||
if (node.getOriginalHost() != null) {
|
||||
desc = TextUtil.fastReplace(desc, "ORIGINALHOST", node.getOriginalHost().getName());
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
if (hasParam("Description") && !this.isSuppressed()) {
|
||||
String desc = getParam("Description");
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", this.hostCard.getName());
|
||||
desc = TextUtil.fastReplace(desc, "NICKNAME", this.hostCard.getName().split(",")[0]);
|
||||
|
||||
return desc;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user