mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Attempting to fix a bug with the replacement handler not converting CARDNAME.
This commit is contained in:
@@ -25,6 +25,7 @@ import forge.game.card.Card;
|
|||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.spellability.AbilitySub;
|
import forge.game.spellability.AbilitySub;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
|
import forge.util.TextUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -62,6 +63,12 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
|||||||
originalMapParams.putAll(map);
|
originalMapParams.putAll(map);
|
||||||
mapParams.putAll(map);
|
mapParams.putAll(map);
|
||||||
this.setHostCard(host);
|
this.setHostCard(host);
|
||||||
|
|
||||||
|
if (host != null && mapParams.get("Description").contains("CARDNAME")) {
|
||||||
|
String desc = TextUtil.fastReplace(mapParams.get("Description"), "CARDNAME", host.toString());
|
||||||
|
originalMapParams.put("Description", desc);
|
||||||
|
mapParams.put("Description", desc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,6 +198,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
String desc = this.getMapParams().get("Description");
|
||||||
if (this.getMapParams().containsKey("Description") && !this.isSuppressed()) {
|
if (this.getMapParams().containsKey("Description") && !this.isSuppressed()) {
|
||||||
return AbilityUtils.applyDescriptionTextChangeEffects(this.getMapParams().get("Description"), this);
|
return AbilityUtils.applyDescriptionTextChangeEffects(this.getMapParams().get("Description"), this);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user