It is currently 11 May 2025, 10:21
   
Text Size

Why does this ability trigger twice?

Moderator: CCGHQ Admins

Why does this ability trigger twice?

Postby 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>
i.e if i have 3 untapped mana first activation will add 24 to power and not 12, 2nd activation will add 12, 3rd will add 12 and so on. next turn is the same 24,12,12.
DarkusChi
 
Posts: 15
Joined: 10 May 2011, 23:42
Has thanked: 0 time
Been thanked: 0 time

Re: Why does this ability trigger twice?

Postby 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.
Shatterhouse
 
Posts: 72
Joined: 20 Apr 2011, 00:07
Has thanked: 0 time
Been thanked: 2 times

Re: Why does this ability trigger twice?

Postby 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


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 6 guests


Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 6 guests

Login Form