Page 8 of 8

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 17 Mar 2011, 15:33
by slapshot5
When does the code for option (a) get called? When the triggered ability resolves, or when it's put on the stack?

I've got that code right below the comment "//All tests passed, execute ability." in TriggerHandler.runSingleTrigger().

Right now, I:
1. select a spell
2. tap a land for mana that triggers this
3. the trigger goes on the stack
4. Click Cancel for paying the rest of the mana
--notice land is untapped, and no mana added to your pool

--expected = land stays tapped, and its mana is added to your mana pool

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 17 Mar 2011, 17:39
by slapshot5
Ok, I see. It's called when the trigger goes on the stack, but my stuff still isn't working correctly. Will dig further.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 17 Mar 2011, 19:28
by slapshot5
Error on my end. Move along. Nothing to see here.

-slapshot5

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 08 May 2011, 19:31
by friarsol
Do Triggers have a quick utility function to check whether or not they are mandatory/optional? I was going to add some code into Spell_Permanent so we could get rid of etbLoseLife (and improve AIs handling of other ETB effects). But need to have something like that before I can. Would I just check for OptionalDecider?

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 08 May 2011, 19:44
by Hellfish
The system itself just checks for OptionalDecider, yeah, so there's no isMandatory()-like on Trigger objects. Maybe there should be, for clarity?

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 08 May 2011, 20:24
by friarsol
Hellfish wrote:The system itself just checks for OptionalDecider, yeah, so there's no isMandatory()-like on Trigger objects. Maybe there should be, for clarity?
Maybe. I'll just grab it from the Params, and if we want to create small helper functions for the most commonly used stuff as the AF system does, we can do that at a later point.