From 41b39e74c352f38ba8186cfa22aa91bacc9c9ff6 Mon Sep 17 00:00:00 2001 From: Chris H Date: Sat, 15 Nov 2025 15:09:57 -0500 Subject: [PATCH] Airbend spells --- .../game/ability/effects/AirbendEffect.java | 18 +++++++++++++----- ...ng_swift_savior_aand_and_la_oceans_fury.txt | 6 +++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/AirbendEffect.java b/forge-game/src/main/java/forge/game/ability/effects/AirbendEffect.java index bfb9f8b85d9..1ff39ed6bb1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AirbendEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AirbendEffect.java @@ -11,6 +11,7 @@ import forge.game.card.Card; import forge.game.card.CardZoneTable; import forge.game.player.Player; import forge.game.spellability.SpellAbility; +import forge.game.spellability.SpellAbilityStackInstance; import forge.game.trigger.TriggerType; import forge.game.zone.ZoneType; import forge.util.Lang; @@ -55,21 +56,27 @@ public class AirbendEffect extends SpellAbilityEffect { if (gameCard == null || !c.equalsWithGameTimestamp(gameCard) || gameCard.isPhasedOut()) { continue; } - - if (!gameCard.canExiledBy(sa, true)) { - continue; - } handleExiledWith(gameCard, sa); Map moveParams = AbilityKey.newMap(); AbilityKey.addCardZoneTableParams(moveParams, triggerList); - Card movedCard = game.getAction().exile(gameCard, sa, moveParams); + SpellAbilityStackInstance si = null; + if (gameCard.isInZone(ZoneType.Stack)) { + SpellAbility stackSA = game.getStack().getSpellMatchingHost(gameCard); + si = game.getStack().getInstanceMatchingSpellAbilityID(stackSA); + } + Card movedCard = game.getAction().exile(gameCard, sa, moveParams); if (movedCard == null || !movedCard.isInZone(ZoneType.Exile)) { continue; } + if (si != null) { + // GameAction.changeZone should really take care of cleaning up SASI when a card from the stack is removed. + game.getStack().remove(si); + } + // Effect to cast for 2 from exile Card eff = createEffect(sa, movedCard.getOwner(), "Airbend" + movedCard, hostCard.getImageKey()); eff.addRemembered(movedCard); @@ -84,6 +91,7 @@ public class AirbendEffect extends SpellAbilityEffect { game.getAction().moveToCommand(eff, sa); } + triggerList.triggerChangesZoneAll(game, sa); handleExiledWith(triggerList.allCards(), sa); diff --git a/forge-gui/res/cardsfolder/upcoming/aang_swift_savior_aand_and_la_oceans_fury.txt b/forge-gui/res/cardsfolder/upcoming/aang_swift_savior_aand_and_la_oceans_fury.txt index 51652012f58..b719541402a 100644 --- a/forge-gui/res/cardsfolder/upcoming/aang_swift_savior_aand_and_la_oceans_fury.txt +++ b/forge-gui/res/cardsfolder/upcoming/aang_swift_savior_aand_and_la_oceans_fury.txt @@ -5,8 +5,8 @@ PT:2/3 K:Flash K:Flying T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigAirbend | TriggerDescription$ When NICKNAME enters, airbend up to one other target creature or spell. (Exile it. While it's exiled, its owner may cast it for {2} rather than its mana cost.) -SVar:TrigAirbend:DB$ Airbend | ValidTgts$ Creature.Other,Card.inZoneStack | TgtPrompt$ Select another target creature or spell -A:AB$ SetState | Cost$ Waterbend<8> |Defined$ Self | Mode$ Transform | SpellDescription$ Transform NICKNAME. +SVar:TrigAirbend:DB$ Airbend | ValidTgts$ Creature.Other,Card.inZoneStack | TgtPrompt$ Select up to another target creature or spell | TgtZone$ Battlefield,Stack | TargetMin$ 0 +A:AB$ SetState | Cost$ Waterbend<8> | Defined$ Self | Mode$ Transform | SpellDescription$ Transform NICKNAME. AlternateMode:DoubleFaced Oracle:Flash\nFlying\nWhen Aang enters, airbend up to one other target creature or spell. (Exile it. While it's exiled, its owner may cast it for {2} rather than its mana cost.)\nWaterbend {8}: Transform Aang. @@ -20,4 +20,4 @@ K:Reach K:Trample T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPutCounterAll | TriggerDescription$ Whenever NICKNAME attack, put a +1/+1 counter on each tapped creature you control. SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.YouCtrl+tapped | CounterType$ P1P1 | CounterNum$ 1 -Oracle:Reach, trample\nWhenever Aang and La attack, put a +1/+1 counter on each tapped creature you control. +Oracle:Reach, trample\nWhenever Aang and La attack, put a +1/+1 counter on each tapped creature you control. \ No newline at end of file