mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- A better place for replacement effect CARDNAME conversion.
This commit is contained in:
@@ -64,11 +64,6 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
mapParams.putAll(map);
|
||||
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
|
||||
public String toString() {
|
||||
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 {
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user