Page 1 of 1

Mardu Heart-Piercer (Raid Ability)

PostPosted: 22 Aug 2014, 17:52
by Chakan
I wasn't quite sure where to start with the Raid ability for Mardu Heart-Piercer (it's a trigger if a creature you control attacked and you put a card with raid, it can do 2 damage to target creature or player.) There wasn't anything really that I could base this ability on, so I sort of used Angelic Arbiter and Sparkmage Apprentice as bases, but I know this isn't right. Can anybody point me in the right direction here? I'd appreciate the help. Here's what I got so far.

<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[|Raid| — When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY"/>
local num_starting_players= MTG():GetNumberOfStartingPlayers()
for i=0,(num_starting_players-1) do
local player = MTG():GetNthStartingPlayer( i )
if (player ~= nil and player:GetTeam() ~= EffectController():GetTeam()) then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( player )
if interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN ) then
<SFX text="TARGET_SPARKS_PLAY" />
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_2_DAMAGE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if ( target_creature ~= nil ) then
EffectSourceLKI():DealDamageTo( 2, target_creature )
elseif ( target_player ~= nil ) then
EffectSourceLKI():DealDamageTo( 2, target_player )
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>

Re: Mardu Heart-Piercer (Raid Ability)

PostPosted: 22 Aug 2014, 19:13
by sweetLu
I'm sorry, apparently I cannot read well. I didn't see you were already using interrogations

Re: Mardu Heart-Piercer (Raid Ability)

PostPosted: 22 Aug 2014, 20:33
by thefiremind
I think you are actually very close, but the problem is that you can't make code that says: if ... then <...>another block of code</...>, each block must contain code that works by itself. You are also never closing the "for", which is useless by the way, because you can already address yourself as EffectController().

Try this trigger condition:
Code: Select all
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( EffectController() )
return interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN )
</TRIGGER>
<SFX text="TARGET_SPARKS_PLAY" />
below this point it should be correct.

Re: Mardu Heart-Piercer (Raid Ability)

PostPosted: 22 Aug 2014, 21:09
by NeoAnderson
thefiremind wrote:I think you are actually very close, but the problem is that you can't make code that says: if ... then <...>another block of code</...>, each block must contain code that works by itself. You are also never closing the "for", which is useless by the way, because you can already address yourself as EffectController().

Try this trigger condition:
Code: Select all
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( EffectController() )
return interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN )
</TRIGGER>
<SFX text="TARGET_SPARKS_PLAY" />
below this point it should be correct.
It shoud work Fire but you have to remove a "/", otherwise the interrogation instructions will be not condidered.
Code: Select all
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" >
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( EffectController() )
return interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN )
</TRIGGER>
<SFX text="TARGET_SPARKS_PLAY" />

Re: Mardu Heart-Piercer (Raid Ability)

PostPosted: 22 Aug 2014, 22:30
by thefiremind
Right... #-o Fixed in the original post.

Re: Mardu Heart-Piercer (Raid Ability)

PostPosted: 23 Aug 2014, 01:07
by Chakan
Thanks everyone. I'm getting better with this stuff every day thanks to all of you.