- A temporary hacky fix to make it possible to disable the damage prevention replacement effects when a card loses the relevant keyword (e.g. Glittering Lion).

- Most likely won't work in certain corner cases, so it's in until a rewrite is done to properly support this.
This commit is contained in:
Agetian
2017-06-29 16:24:12 +00:00
parent 64ed0c1d93
commit ea28c67ffd
2 changed files with 10 additions and 1 deletions

View File

@@ -3513,7 +3513,7 @@ public class CardFactoryUtil {
if (isCombat) {
rep += "| IsCombat$ True";
}
rep += "| Secondary$ True | Description$ " + keyword;
rep += "| Secondary$ True | TiedToKeyword$ " + keyword + " | Description$ " + keyword;
if (from) {
String fromRep = rep + " | ValidSource$ Card.Self";

View File

@@ -110,6 +110,15 @@ public class ReplacementHandler {
// getting hit by mass removal should still produce tokens).
Zone cardZone = "True".equals(replacementEffect.getMapParams().get("CheckSelfLKIZone")) ? game.getChangeZoneLKIInfo(crd).getLastKnownZone() : game.getZoneOf(crd);
// Replacement effects that are tied to keywords (e.g. damage prevention effects - if the keyword is removed, the replacement
// effect should be inactive)
if (replacementEffect.hasParam("TiedToKeyword")) {
String kw = replacementEffect.getParam("TiedToKeyword");
if (!crd.hasKeyword(kw)) {
continue;
}
}
if (!replacementEffect.hasRun()
&& (layer == null || replacementEffect.getLayer() == layer)
&& replacementEffect.requirementsCheck(game)