mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +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);
|
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 "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user