- A better place for replacement effect CARDNAME conversion.

This commit is contained in:
Agetian
2017-12-08 10:35:54 +00:00
parent 2a62001048
commit 0c397a414e

View File

@@ -64,11 +64,6 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
mapParams.putAll(map); mapParams.putAll(map);
this.setHostCard(host); this.setHostCard(host);
if (host != null && mapParams.containsKey("Description") && mapParams.get("Description").contains("CARDNAME")) {
String desc = TextUtil.fastReplace(mapParams.get("Description"), "CARDNAME", host.toString());
originalMapParams.put("Description", desc);
mapParams.put("Description", desc);
}
} }
/** /**
@@ -199,7 +194,11 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
@Override @Override
public String toString() { public String toString() {
if (this.getMapParams().containsKey("Description") && !this.isSuppressed()) { if (this.getMapParams().containsKey("Description") && !this.isSuppressed()) {
return AbilityUtils.applyDescriptionTextChangeEffects(this.getMapParams().get("Description"), this); String desc = this.getMapParams().get("Description");
if (desc.contains("CARDNAME")) {
desc = TextUtil.fastReplace(this.getMapParams().get("Description"), "CARDNAME", getHostCard().toString());
}
return AbilityUtils.applyDescriptionTextChangeEffects(desc, this);
} else { } else {
return ""; return "";
} }