From 201ef725850eea6db9b568a13c7bf4b52e02a54d Mon Sep 17 00:00:00 2001 From: tool4ever Date: Thu, 23 Feb 2023 04:36:33 +0100 Subject: [PATCH] ValidAfterStack for MayPlay (#2527) Co-authored-by: tool4EvEr --- forge-game/src/main/java/forge/game/GameActionUtil.java | 5 +++++ .../src/main/java/forge/game/spellability/SpellAbility.java | 1 - forge-gui/res/cardsfolder/l/lurrus_of_the_dream_den.txt | 2 +- forge-gui/res/cardsfolder/s/serra_paragon.txt | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameActionUtil.java b/forge-game/src/main/java/forge/game/GameActionUtil.java index 92712f53785..22f305ce48b 100644 --- a/forge-game/src/main/java/forge/game/GameActionUtil.java +++ b/forge-game/src/main/java/forge/game/GameActionUtil.java @@ -134,6 +134,11 @@ public final class GameActionUtil { } else { newSA = sa.copy(activator); } + + if (o.getAbility().hasParam("ValidAfterStack")) { + newSA.getMapParams().put("ValidAfterStack", o.getAbility().getParam("ValidAfterStack")); + } + final SpellAbilityRestriction sar = newSA.getRestrictions(); if (o.isWithFlash()) { sar.setInstantSpeed(true); diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java index 10332f5429f..9697bbfd836 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java @@ -2507,7 +2507,6 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit if (!matchesValidParam("ValidAfterStack", this)) { return false; } - // TODO add checks for Lurrus return true; } } diff --git a/forge-gui/res/cardsfolder/l/lurrus_of_the_dream_den.txt b/forge-gui/res/cardsfolder/l/lurrus_of_the_dream_den.txt index 3d6f84637b6..819916c9676 100644 --- a/forge-gui/res/cardsfolder/l/lurrus_of_the_dream_den.txt +++ b/forge-gui/res/cardsfolder/l/lurrus_of_the_dream_den.txt @@ -4,5 +4,5 @@ Types:Legendary Creature Cat Nightmare PT:3/2 K:Companion:Permanent.cmcLE2,Instant,Sorcery:Each permanent card in your starting deck has mana value 2 or less. K:Lifelink -S:Mode$ Continuous | EffectZone$ Battlefield | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | Affected$ Permanent.nonLand+YouOwn+cmcLE2 | AffectedZone$ Graveyard | Description$ During each of your turns, you may cast one permanent spell with mana value 2 or less from your graveyard. +S:Mode$ Continuous | EffectZone$ Battlefield | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | Affected$ Permanent.nonLand+YouOwn+cmcLE2 | ValidAfterStack$ Spell.cmcLE2 | AffectedZone$ Graveyard | Description$ During each of your turns, you may cast one permanent spell with mana value 2 or less from your graveyard. Oracle:Companion — Each permanent card in your starting deck has mana value 2 or less. (If this card is your chosen companion, you may put it into your hand from outside the game for {3} any time you could cast a sorcery.)\nLifelink\nDuring each of your turns, you may cast one permanent spell with mana value 2 or less from your graveyard. diff --git a/forge-gui/res/cardsfolder/s/serra_paragon.txt b/forge-gui/res/cardsfolder/s/serra_paragon.txt index b6db4b744cb..ee5d9b7f7b4 100644 --- a/forge-gui/res/cardsfolder/s/serra_paragon.txt +++ b/forge-gui/res/cardsfolder/s/serra_paragon.txt @@ -3,7 +3,7 @@ ManaCost:2 W W Types:Creature Angel PT:3/4 K:Flying -S:Mode$ Continuous | Affected$ Permanent.YouOwn+cmcLE3,Land.YouOwn| Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ Once during each of your turns, you may play a land from your graveyard or cast a permanent spell with mana value 3 or less from your graveyard. If you do, it gains "When this permanent is put into a graveyard from the battlefield, exile it and you gain 2 life." +S:Mode$ Continuous | Affected$ Permanent.YouOwn+cmcLE3,Land.YouOwn | ValidAfterStack$ Spell.cmcLE3 | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ Once during each of your turns, you may play a land from your graveyard or cast a permanent spell with mana value 3 or less from your graveyard. If you do, it gains "When this permanent is put into a graveyard from the battlefield, exile it and you gain 2 life." T:Mode$ SpellCast | ValidCard$ Card | ValidSA$ Spell.MayPlaySource | Execute$ DBAnimate | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ Once during each of your turns, you may play a land from your graveyard or cast a permanent spell with mana value 3 or less from your graveyard. If you do, it gains "When this permanent is put into a graveyard from the battlefield, exile it and you gain 2 life." T:Mode$ LandPlayed | ValidCard$ Land | ValidSA$ SpellAbility.MayPlaySource | TriggerZones$ Battlefield | Execute$ DBAnimate | Secondary$ True | TriggerDescription$ Once during each of your turns, you may play a land from your graveyard or cast a permanent spell with mana value 3 or less from your graveyard. If you do, it gains "When this permanent is put into a graveyard from the battlefield, exile it and you gain 2 life." SVar:DBAnimate:DB$ Animate | Defined$ TriggeredCard | Duration$ Permanent | Triggers$ TrigDieExile