Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Why does this ability trigger twice?
Moderator: CCGHQ Admins
Why does this ability trigger twice?
by DarkusChi » 06 Jun 2011, 20:25
Hi, anyone know why the triggered ability triggers twice upon 1st activation:
- Code: Select all
<ACTIVATED_ABILITY tag="xxx" forced_skip="1" layer="0">
<COST type="Mana" cost="{1}" />
<EFFECT>
Object():Register_Set( 0, 12 )
Object():Register_Set( 1 , 2 )
</EFFECT>
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY auto_skip="1" layer="7c" >
<TRIGGER value="ABILITY_RESOLVED">
return SelfTriggered() and Object():Register_Get( 1 ) == 2
</TRIGGER>
<EFFECT>
Object():Register_Set( 1, 0 )
AddPowerAndToughnessToSelf( Object():Register_Get( 0 ), 0 )
</EFFECT>
<DURATION>
return UntilEndOfTurn()
</DURATION>
</TRIGGERED_ABILITY>
- DarkusChi
- Posts: 15
- Joined: 10 May 2011, 23:42
- Has thanked: 0 time
- Been thanked: 0 time
Re: Why does this ability trigger twice?
by Shatterhouse » 07 Jun 2011, 00:05
It must be a timing issue with the game sending out an ABILITY_RESOLVED trigger. I wouldn't expect it to happen between abilities, but this one is setting a register to try to control its own trigger, and that probably screws it up.
Try moving Object():Register_Set( 1, 0 ) into a PRE_EFFECT block.
Or this could be a job for the pre_trigger="1" flag.
Try moving Object():Register_Set( 1, 0 ) into a PRE_EFFECT block.
Or this could be a job for the pre_trigger="1" flag.
- Shatterhouse
- Posts: 72
- Joined: 20 Apr 2011, 00:07
- Has thanked: 0 time
- Been thanked: 2 times
Re: Why does this ability trigger twice?
by DarkusChi » 07 Jun 2011, 01:35
Thanks Shatterhouse, moving the Object():Register_Set( 1, 0 ) to a pre effect block did the trick
- DarkusChi
- Posts: 15
- Joined: 10 May 2011, 23:42
- Has thanked: 0 time
- Been thanked: 0 time
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests