It is currently 15 Aug 2025, 00:00
   
Text Size

Trigger discussion (was WheneverKeyword reference)

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Trigger discussion (was WheneverKeyword reference)

Postby slapshot5 » 17 Mar 2011, 15:33

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
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Trigger discussion (was WheneverKeyword reference)

Postby slapshot5 » 17 Mar 2011, 17:39

Ok, I see. It's called when the trigger goes on the stack, but my stuff still isn't working correctly. Will dig further.
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Trigger discussion (was WheneverKeyword reference)

Postby slapshot5 » 17 Mar 2011, 19:28

Error on my end. Move along. Nothing to see here.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Trigger discussion (was WheneverKeyword reference)

Postby friarsol » 08 May 2011, 19:31

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?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Trigger discussion (was WheneverKeyword reference)

Postby Hellfish » 08 May 2011, 19:44

The system itself just checks for OptionalDecider, yeah, so there's no isMandatory()-like on Trigger objects. Maybe there should be, for clarity?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Trigger discussion (was WheneverKeyword reference)

Postby friarsol » 08 May 2011, 20:24

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 34 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 34 users online :: 0 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 34 guests

Login Form