Fix wrong decider when copying trigger (#3347)

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2023-06-27 16:03:52 +02:00
committed by GitHub
parent 0bab2edbc9
commit 0294564ef4
5 changed files with 8 additions and 15 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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.

View File

@@ -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

View File

@@ -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.