It is currently 16 Apr 2024, 22:13
   
Text Size

Getting Chandra, Roaring Flame's ultimate to work

Moderator: CCGHQ Admins

Getting Chandra, Roaring Flame's ultimate to work

Postby fallenangle » 20 Jul 2015, 16:17

I've been working on the new Origins creature/walkers for DOTP 2014, and I've gotten stuck on Chandra, Roaring Flame's ultimate. I can deal 6 damage to each opponent easily enough, but I can't get the emblem (read, "delayed trigger doing unpreventable damage") that it is supposed to create to deal damage to 3 damage to each player damaged by the ultimate during that player's subsequent upkeeps. If any one of the coding gods out there could be so kind as to suggest code for the whole ability that I might try, I would be very grateful.

Thanks in advance for all of your help.

Edit: Here's the code for the ability I have now (my apologies for not posting this earlier):

Code: Select all
<ACTIVATED_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-7): Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you]]></LOCALISED_TEXT>
<AVAILABILITY>
         return PLW_MyPlayerDC( EffectController() ):Get_Int(PLW_TEFERI_ARCHMAGE_EMBLEM) == 1 or EffectController():IsSorceryTime() == true
      </AVAILABILITY>
<COST type="RemoveCountersSelf" amount="7" counter_type="Loyalty" />
<SFX text="GLOBAL_LAVA_PLAY" />
<RESOLUTION_TIME_ACTION>
         local num_players = MTG():GetNumberOfPlayers()
            for i=0,(num_players-1) do
            local player = MTG():GetNthPlayer(i)
            if player:GetTeam() ~= EffectController():GetTeam() then
            local delayDC = EffectDC():Make_Chest(2)
            delayDC:Set_PlayerPtr( 0, player )
            MTG():CreateDelayedTrigger(2, delayDC)
         end
            end
            </RESOLUTION_TIME_ACTION>
            <RESOLUTION_TIME_ACTION>
         local num_players = MTG():GetNumberOfPlayers()
            for i=0,(num_players-1) do
            local player = MTG():GetNthPlayer(i)
            if player:GetTeam() ~= EffectController():GetTeam() then
            EffectSourceLKI():DealDamageTo( 6, player )
            end
               end
      </RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>

<TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
      <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER">
        if (SecondaryPlayer() ~= nil) and
          (SecondaryPlayer() == EffectDC():Get_PlayerPtr(0)) and
          (Damage():GetSource() == EffectSourceLKI()) and
          (Damage():GetAmount() &gt; 0) then
          return true
        end
        return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
        local delayDC = EffectDC():Make_Chest(1)
        delayDC:Set_PlayerPtr( 0, SecondaryPlayer() )
        MTG():CreateDelayedTrigger(3, delayDC)
      </RESOLUTION_TIME_ACTION>
      <CLEANUP fire_once="1" />
      <CLEANUP simple_cleanup="EndOfTurn" />
   </TRIGGERED_ABILITY>

    <TRIGGERED_ABILITY resource_id="3">
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP">
        if ( TriggerPlayer() == EffectDC():Get_PlayerPtr(0)) and
          ( TriggerPlayer():MyTurn() ~= 0 ) then
          return MTG():GetStep() == STEP_UPKEEP
        end
        return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
        EffectSourceLKI():DealUnpreventableDamageTo( 3, TriggerPlayer() )
      </RESOLUTION_TIME_ACTION>
      <CLEANUP>
        return TriggerPlayer() == nil
      </CLEANUP>
    </TRIGGERED_ABILITY>
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Getting Chandra, Roaring Flame's ultimate to work

Postby RiiakShiNal » 20 Jul 2015, 22:37

There is a problem in the delayed trigger with resource_id="3". For the CLEANUP, TriggerPlayer() will always equal nil when the trigger is not active so it should check EffectDC():Get_PlayerPtr(0) == nil instead.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Getting Chandra, Roaring Flame's ultimate to work

Postby fallenangle » 21 Jul 2015, 01:16

That was the problem. It works perfectly now. Thanks a million, Riiak!
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 16 guests


Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 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 16 guests

Login Form