From 0294564ef451a54dcd294abb0c48f8578b6f9815 Mon Sep 17 00:00:00 2001 From: tool4ever Date: Tue, 27 Jun 2023 16:03:52 +0200 Subject: [PATCH] Fix wrong decider when copying trigger (#3347) Co-authored-by: TRT <> --- .../java/forge/game/ability/SpellAbilityEffect.java | 2 +- .../src/main/java/forge/game/card/CardFactory.java | 2 +- forge-gui/res/cardsfolder/a/aetherplasm.txt | 7 ++----- forge-gui/res/cardsfolder/b/brimaz_king_of_oreskos.txt | 2 +- forge-gui/res/cardsfolder/s/share_the_spoils.txt | 10 +++------- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index 03b5da87f07..96ecb57f0b6 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -621,7 +621,7 @@ public abstract class SpellAbilityEffect { protected static boolean addToCombat(Card c, Player controller, SpellAbility sa, String attackingParam, String blockingParam) { final Card host = sa.getHostCard(); final Game game = controller.getGame(); - if (!game.getPhaseHandler().inCombat()) { + if (!c.isCreature() || !game.getPhaseHandler().inCombat()) { return false; } boolean combatChanged = false; diff --git a/forge-game/src/main/java/forge/game/card/CardFactory.java b/forge-game/src/main/java/forge/game/card/CardFactory.java index c2d706600e7..5d45f6ecfa4 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactory.java +++ b/forge-game/src/main/java/forge/game/card/CardFactory.java @@ -668,7 +668,7 @@ public class CardFactory { return null; } - return new WrappedAbility(sa.getTrigger(), sa.getWrappedAbility().copy(newHost, controller, false), sa.isOptionalTrigger() ? controller : null); + return new WrappedAbility(sa.getTrigger(), sa.getWrappedAbility().copy(newHost, controller, false), sa.getDecider()); } public static CardCloneStates getCloneStates(final Card in, final Card out, final CardTraitBase sa) { diff --git a/forge-gui/res/cardsfolder/a/aetherplasm.txt b/forge-gui/res/cardsfolder/a/aetherplasm.txt index 1ba42581379..0fe56688b20 100644 --- a/forge-gui/res/cardsfolder/a/aetherplasm.txt +++ b/forge-gui/res/cardsfolder/a/aetherplasm.txt @@ -2,11 +2,8 @@ Name:Aetherplasm ManaCost:2 U U Types:Creature Illusion PT:1/1 -T:Mode$ AttackerBlocked | ValidCard$ Creature | ValidBlocker$ Card.Self | OptionalDecider$ You | Execute$ TrigBounce | TriggerDescription$ Whenever CARDNAME blocks a creature, you may return CARDNAME to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature. -SVar:TrigBounce:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | Defined$ Self | RememberChanged$ True | SubAbility$ DBChangeZone -SVar:DBChangeZone:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature | Blocking$ TriggeredAttacker | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:X:Remembered$Amount +T:Mode$ AttackerBlocked | ValidCard$ Creature | ValidBlocker$ Card.Self | Execute$ TrigBounce | TriggerDescription$ Whenever CARDNAME blocks a creature, you may return CARDNAME to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature. +SVar:TrigBounce:AB$ ChangeZone | Cost$ Return<1/CARDNAME> | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature | Blocking$ TriggeredAttacker AI:RemoveDeck:All SVar:HasBlockEffect:TRUE Oracle:Whenever Aetherplasm blocks a creature, you may return Aetherplasm to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature. diff --git a/forge-gui/res/cardsfolder/b/brimaz_king_of_oreskos.txt b/forge-gui/res/cardsfolder/b/brimaz_king_of_oreskos.txt index 234e74bddda..a851908df63 100644 --- a/forge-gui/res/cardsfolder/b/brimaz_king_of_oreskos.txt +++ b/forge-gui/res/cardsfolder/b/brimaz_king_of_oreskos.txt @@ -5,7 +5,7 @@ PT:3/4 K:Vigilance T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigTokenAttacking | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME attacks, create a 1/1 white Cat Soldier creature token with vigilance that's attacking. SVar:TrigTokenAttacking:DB$ Token | TokenAmount$ 1 | TokenScript$ w_1_1_cat_soldier_vigilance | TokenOwner$ You | TokenAttacking$ True -T:Mode$ AttackerBlocked | ValidCard$ Creature | ValidBlocker$ Card.Self | Execute$ TrigTokenBlocking | TriggerDescription$ Whenever CARDNAME blocks a creature, create a 1/1 white Cat Soldier creature token with vigilance that's blocking that creature. +T:Mode$ AttackerBlocked | ValidCard$ Creature | ValidBlocker$ Card.Self | Execute$ TrigTokenBlocking | TriggerDescription$ Whenever NICKNAME blocks a creature, create a 1/1 white Cat Soldier creature token with vigilance that's blocking that creature. SVar:TrigTokenBlocking:DB$ Token | TokenAmount$ 1 | TokenScript$ w_1_1_cat_soldier_vigilance | TokenOwner$ You | TokenBlocking$ TriggeredAttacker SVar:HasAttackEffect:TRUE SVar:HasBlockEffect:TRUE diff --git a/forge-gui/res/cardsfolder/s/share_the_spoils.txt b/forge-gui/res/cardsfolder/s/share_the_spoils.txt index ce4a88bd5a8..9afb8587872 100644 --- a/forge-gui/res/cardsfolder/s/share_the_spoils.txt +++ b/forge-gui/res/cardsfolder/s/share_the_spoils.txt @@ -1,15 +1,11 @@ Name:Share the Spoils ManaCost:1 R Types:Enchantment -T:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZones$ Battlefield | Execute$ TrigForget | Static$ True -SVar:TrigForget:DB$ Pump | ForgetObjects$ TriggeredCard -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield or an opponent loses the game, exile the top card of each player's library. T:Mode$ LosesGame | ValidPlayer$ Player.Opponent | TriggerZones$ Battlefield | Execute$ TrigExile | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or an opponent loses the game, exile the top card of each player's library. -SVar:TrigExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ Player | DestinationZone$ Exile | RememberChanged$ True -S:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | MayPlayLimit$ 1 | MayPlayIgnoreColor$ True | MayPlayPlayer$ ActivePlayer | EffectZone$ Battlefield | AffectedZone$ Exile | Description$ During each player's turn, that player may play a land or cast a spell from among cards exiled with CARDNAME, and they may spend mana as though it were mana of any color to cast that spell. When they do, exile the top card of their library. +SVar:TrigExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ Player | DestinationZone$ Exile +S:Mode$ Continuous | Affected$ Card.ExiledWithSource | MayPlay$ True | MayPlayLimit$ 1 | MayPlayIgnoreColor$ True | MayPlayPlayer$ ActivePlayer | EffectZone$ Battlefield | AffectedZone$ Exile | Description$ During each player's turn, that player may play a land or cast a spell from among cards exiled with CARDNAME, and they may spend mana as though it were mana of any color to cast that spell. When they do, exile the top card of their library. T:Mode$ SpellCast | ValidCard$ Card | ValidSA$ Spell.MayPlaySource | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library. T:Mode$ LandPlayed | ValidCard$ Land | ValidSA$ SpellAbility.MayPlaySource | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library. -SVar:TrigExileTop:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ TriggeredCardController | DestinationZone$ Exile | RememberChanged$ True +SVar:TrigExileTop:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ TriggeredCardController | DestinationZone$ Exile Oracle:When Share the Spoils enters the battlefield or an opponent loses the game, exile the top card of each player's library.\nDuring each player's turn, that player may play a land or cast a spell from among cards exiled with Share the Spoils, and they may spend mana as though it were mana of any color to cast that spell. When they do, exile the top card of their library.