It is currently 12 Nov 2025, 00:33
   
Text Size

Tuktuk Scrapper problem. Somebody help?

Moderator: CCGHQ Admins

Tuktuk Scrapper problem. Somebody help?

Postby alexandreonly » 17 Oct 2012, 20:57

It destroy the target artifact, ok, but it do not damage the artifact's controller. Here is the code:

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="TUKTUK_SCRAPPER_201579" />
  <CARDNAME text="TUKTUK_SCRAPPER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Tuktuk Scrapper]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="201579" />
  <ARTID value="201579" />
  <ARTIST name="Matt Cavotta" />
  <CASTING_COST cost="{3}{R}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Goblin" order_de-DE="0" order_es-ES="2" order_fr-FR="0" order_it-IT="2" order_jp-JA="0" order_ko-KR="0" order_pt-BR="0" order_ru-RU="0" />
  <SUB_TYPE metaname="Artificer" order_de-DE="1" order_es-ES="1" order_fr-FR="1" order_it-IT="1" order_jp-JA="1" order_ko-KR="1" order_pt-BR="1" order_ru-RU="1" />
  <SUB_TYPE metaname="Ally" order_de-DE="2" order_es-ES="0" order_fr-FR="2" order_it-IT="0" order_jp-JA="2" order_ko-KR="2" order_pt-BR="2" order_ru-RU="2" />
  <EXPANSION value="DPG" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="2" />
  <TRIGGERED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Tuktuk Scrapper or another Ally enters the battlefield under your control, you may destroy target artifact. If that artifact is put into a graveyard this way, Tuktuk Scrapper deals damage to that artifact’s controller equal to the number of Allies you control.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_IN_PLAY">
        return (TriggerObject():GetSubType():Test( CREATURE_TYPE_ALLY ) ~= 0 and TriggerObject():GetPlayer() == EffectController())
    </TRIGGER>
   <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_ARTIFACT )
   filter:May()
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ARTIFACT_TO_DESTROY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
   local player = target:GetPlayer()
    if target ~= nil then
        local delayDC = EffectDC():Make_Chest(1)
        delayDC:Set_ProtectedCardPtr(0, target)
      delayDC:Set_PlayerPtr(0, player)
        MTG():CreateDelayedTrigger(1, delayDC)      
    end
    </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:Destroy()
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_BLUNT_PLAY" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1" filter_zone="ZONE_GRAVEYARD">
    <CLEANUP fire_once="1" />
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_IN_PLAY">
    return TriggerObject() == EffectDC():Get_ProtectedCardPtr(0)
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddSubType( CREATURE_TYPE_ALLY )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetPlayer( EffectController() )
    filter:NotTargetted()
    total = (filter:Count())
   local source = EffectSource()
    if source == nil then
      source = Object()
    end
   local target = EffectDC():Get_PlayerPtr(0)
   if ( target ~= nil ) then   
       target:DealDamage(total, source)   
    end
    </RESOLUTION_TIME_ACTION>
   <SFX text="TARGET_PIERCE_PLAY" />
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_CHOP_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_CHOP_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times

Re: Tuktuk Scrapper problem. Somebody help?

Postby RiiakShiNal » 18 Oct 2012, 01:47

You are overwriting the card pointer with the player pointer. The card pointer and player pointers need to be in separate indexes.
For example:
Code: Select all
        delayDC:Set_ProtectedCardPtr(0, target)
        delayDC:Set_PlayerPtr(1, player)
RiiakShiNal
Programmer
 
Posts: 2189
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Tuktuk Scrapper problem. Somebody help?

Postby alexandreonly » 18 Oct 2012, 02:01

RiiakShiNal wrote:You are overwriting the card pointer with the player pointer. The card pointer and player pointers need to be in separate indexes.
For example:
Code: Select all
        delayDC:Set_ProtectedCardPtr(0, target)
        delayDC:Set_PlayerPtr(1, player)
It's working now. Thanks.
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 4 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 9824 on 10 Nov 2025, 04:33

Users browsing this forum: No registered users and 4 guests

Login Form