mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- 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:
@@ -3513,7 +3513,7 @@ public class CardFactoryUtil {
|
|||||||
if (isCombat) {
|
if (isCombat) {
|
||||||
rep += "| IsCombat$ True";
|
rep += "| IsCombat$ True";
|
||||||
}
|
}
|
||||||
rep += "| Secondary$ True | Description$ " + keyword;
|
rep += "| Secondary$ True | TiedToKeyword$ " + keyword + " | Description$ " + keyword;
|
||||||
|
|
||||||
if (from) {
|
if (from) {
|
||||||
String fromRep = rep + " | ValidSource$ Card.Self";
|
String fromRep = rep + " | ValidSource$ Card.Self";
|
||||||
|
|||||||
@@ -110,6 +110,15 @@ public class ReplacementHandler {
|
|||||||
// getting hit by mass removal should still produce tokens).
|
// getting hit by mass removal should still produce tokens).
|
||||||
Zone cardZone = "True".equals(replacementEffect.getMapParams().get("CheckSelfLKIZone")) ? game.getChangeZoneLKIInfo(crd).getLastKnownZone() : game.getZoneOf(crd);
|
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()
|
if (!replacementEffect.hasRun()
|
||||||
&& (layer == null || replacementEffect.getLayer() == layer)
|
&& (layer == null || replacementEffect.getLayer() == layer)
|
||||||
&& replacementEffect.requirementsCheck(game)
|
&& replacementEffect.requirementsCheck(game)
|
||||||
|
|||||||
Reference in New Issue
Block a user