mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +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 ("}".equals(t)) { isPlainText = true; continue; }
|
||||||
|
|
||||||
if (isPlainText) {
|
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 {
|
} else {
|
||||||
final List<? extends GameObject> objs;
|
final List<? extends GameObject> objs;
|
||||||
if (t.startsWith("p:")) {
|
if (t.startsWith("p:")) {
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user