From 0a474c955a023a9de85b0eb48ae06224b71da57d Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Mon, 29 Jul 2024 21:07:23 +0200 Subject: [PATCH] Fix Catastrophe allowing regeneration on land choice for creatures --- .../java/forge/game/ability/effects/DestroyAllEffect.java | 5 ++++- forge-gui/res/cardsfolder/c/catastrophe.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/DestroyAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DestroyAllEffect.java index 58dd62291c8..7e5795aadec 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DestroyAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DestroyAllEffect.java @@ -42,7 +42,7 @@ public class DestroyAllEffect extends SpellAbilityEffect { */ @Override public void resolve(SpellAbility sa) { - final boolean noRegen = sa.hasParam("NoRegen"); + boolean noRegen = sa.hasParam("NoRegen"); final Card card = sa.getHostCard(); final boolean isOptional = sa.hasParam("Optional"); final Game game = sa.getActivatingPlayer().getGame(); @@ -90,6 +90,9 @@ public class DestroyAllEffect extends SpellAbilityEffect { CardZoneTable zoneMovements = AbilityKey.addCardZoneTableParams(params, sa); for (Card c : list) { + if (sa.hasParam("NoRegenValid")) { + noRegen = c.isValid(sa.getParam("NoRegenValid"), sa.getActivatingPlayer(), card, sa); + } if (game.getAction().destroy(c, sa, !noRegen, params) && remDestroyed) { card.addRemembered(zoneMovements.getLastStateBattlefield().get(c)); } diff --git a/forge-gui/res/cardsfolder/c/catastrophe.txt b/forge-gui/res/cardsfolder/c/catastrophe.txt index a6cd1f8ddf9..63b36306cbb 100644 --- a/forge-gui/res/cardsfolder/c/catastrophe.txt +++ b/forge-gui/res/cardsfolder/c/catastrophe.txt @@ -2,6 +2,6 @@ Name:Catastrophe ManaCost:4 W W Types:Sorcery A:SP$ GenericChoice | Choices$ DBKillLand,DBKillCreatures | Defined$ You | AILogic$ BestOption | StackDescription$ SpellDescription | SpellDescription$ Destroy all lands or all creatures. Creatures destroyed this way can't be regenerated. -SVar:DBKillLand:DB$ DestroyAll | ValidCards$ Land | SpellDescription$ Destroy all lands. +SVar:DBKillLand:DB$ DestroyAll | ValidCards$ Land | NoRegenValid$ Creature | SpellDescription$ Destroy all lands. SVar:DBKillCreatures:DB$ DestroyAll | ValidCards$ Creature | NoRegen$ True | SpellDescription$ Destroy all creatures. They can't be regenerated. Oracle:Destroy all lands or all creatures. Creatures destroyed this way can't be regenerated.