mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28: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.spellability.AbilitySub;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.TextUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -48,7 +49,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
public final boolean hasRun() {
|
||||
return this.hasRun;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new replacement effect.
|
||||
*
|
||||
@@ -62,8 +63,14 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
originalMapParams.putAll(map);
|
||||
mapParams.putAll(map);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the checks for run.
|
||||
*
|
||||
@@ -191,6 +198,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
String desc = this.getMapParams().get("Description");
|
||||
if (this.getMapParams().containsKey("Description") && !this.isSuppressed()) {
|
||||
return AbilityUtils.applyDescriptionTextChangeEffects(this.getMapParams().get("Description"), this);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user