Page 1 of 1

checkTargetingEffects +SpellAbilityCast Triggers not working

PostPosted: 22 Jun 2011, 14:46
by Sloth
At the moment neither the old keywords using checkTargetingEffects ("When CARDNAME becomes the target of a spell or ability, ...") nor modern triggers with ValidTarget (Angelic Protector) are working at the moment.
Has something changed the targeting here?

Re: checkTargetingEffects not working

PostPosted: 22 Jun 2011, 17:30
by Sloth
After some more testing, I can say for sure that all "SpellAbilityCast" and "SpellCast" triggers won't trigger if they have a "TargetsValid" parameter.
My guess is that the target are not properly set when the triggers are called or the format the triggers are stored in has changed.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 22 Jun 2011, 17:38
by friarsol
I did change how targeting works with my Multi-targeting fixes, it's possible it's related to that.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 03:56
by friarsol
I see what the issue is. It looks like the Trigger is run after the SA is added to the stack, which is also after when the Target gets cleared from the SA (since the Target lives in the StackInstance now). I'll see if I can fix this with a one-liner, otherwise it'll have to wait till Friday for some real debugging when I have time.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 04:03
by friarsol
Ok, I was able to successfully test this working with a deck of Angelic Protector and Elvish Fury. If you could do some more robust testing Sloth it would be greatly appreciated.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 07:39
by Sloth
friarsol wrote:Ok, I was able to successfully test this working with a deck of Angelic Protector and Elvish Fury. If you could do some more robust testing Sloth it would be greatly appreciated.
I did some testing (Angelic Protector, Dormant Gomazoa and Mirozel) and everything worked fine. Thanks a lot Sol.

I will try to continue removing the remains of checkTargetingEffects (Cowardice and Horobi, Death's Wail), but it needs a new option for "Defined" in the abilities triggered by SpellAbilityCast: "TriggeredTarget".

Update: Converting these cards to trigger is more difficult than I thought. I'm afraid SpellAbilityCast can't really handle it, since a triggered ability has to go on the stack for each target of the spell. Maybe we need to create a new trigger "BecomesTarget". I'm not volunteering.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 08:36
by Hellfish
I'll look into it. *Superhero pose*

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 10:15
by Sloth
Hellfish wrote:I'll look into it. *Superhero pose*
Thanks Hellfish.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 14:18
by Hellfish
Okay, I got a working version of a BecomesTarget trigger that works with Cowardice + Arc Trail among others. Converted Cowardice to start. Check r9985.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 15:12
by Sloth
Hellfish wrote:Okay, I got a working version of a BecomesTarget trigger that works with Cowardice + Arc Trail among others. Converted Cowardice to start. Check r9985.
I just did a test with Cowardice + Arc Trail and only the first target was returned to hand. Same with Horobi, Death's Wail and Glarewielder.

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

PostPosted: 23 Jun 2011, 15:23
by Hellfish
That's... weird. It returned two steel walls fine for me.Gimme a sec.
EDIT:Yep, definitely worked here. I'm dubious to this other thought, but I'm gonna check if somehow using Setup Game State meddles with the result.

EDIT2:Nope,works fine with dummy decks too. :-s What were you targeting?