Strange thing related to ignore_filter

Try this implementation of Thundercloud Shaman:
But here's the thing: if you remove ignore_filter="1" from the first action, everything works as expected.
Does anyone have a good explanation for this? I thought about 2:
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
<FILENAME text="THUNDERCLOUD_SHAMAN_139738" />
<CARDNAME text="THUNDERCLOUD_SHAMAN" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Thundercloud Shaman]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Shamane de nuée d’orage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Chamán del nubarrón]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Donnerwolken-Schamane]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sciamano del Temporale]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[雷雲のシャーマン]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Thundercloud Shaman]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Шаман Грозового Облака]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Xamã Cúmulo-Nimbo]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="139738" />
<ARTID value="A139738" />
<ARTIST name="Greg Staples" />
<CASTING_COST cost="{3}{R}{R}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[He cares not for the disasters his storm brings as long as his path ahead is clear.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Il se moque des conséquences de son orage tant qu’il déblaie les obstacles sur son chemin.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[No le importan los desastres que pueda acarrear su tormenta mientras su camino esté despejado.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Es ist ihm egal, was für Katastrophen sein Sturm mit sich bringt, solange dadurch sein Weg frei ist.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Non si preoccupa dei disastri causati dalla sua tempesta purché la strada che ha davanti sia sgombra.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[彼の目の前に道が開けるかぎり、彼は自分がもたらす嵐の被害など気にしはしない。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[He cares not for the disasters his storm brings as long as his path ahead is clear.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Его не беспокоят разрушения, которые приносит его буря, главное, чтобы дорога вперед была расчищена.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Ele não se importa com os desastres que suas tempestades causam desde que seu caminho fique limpo.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Giant" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
<SUB_TYPE metaname="Shaman" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
<EXPANSION value="LRW" />
<RARITY metaname="U" />
<POWER value="4" />
<TOUGHNESS value="4" />
<TRIGGERED_ABILITY LKI_shield_effect_source="1" dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Thundercloud Shaman enters the battlefield, it deals damage equal to the number of Giants you control to each non-Giant creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Shamane de nuée d’orage arrive en jeu, il inflige un nombre de blessures égal au nombre de géants que vous contrôlez à chaque créature non-géant.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Chamán del nubarrón entre en juego, hace una cantidad de daño igual al número de Gigantes que controlas a cada criatura que no sea Gigante.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Donnerwolken-Schamane ins Spiel kommt, fügt er allen Nichtriesen-Kreaturen so viele Schadenspunkte zu, wie du Riesen kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando lo Sciamano del Temporale entra nel campo di battaglia, infligge un ammontare di danni pari al numero di Giganti che controlli ad ogni creatura non Gigante.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[雷雲のシャーマンが場に出たとき、それは巨人でない各クリーチャーに、それぞれあなたがコントロールする巨人の総数に等しい点数のダメージを与える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Thundercloud Shaman enters the battlefield, it deals damage equal to the number of Giants you control to each non-Giant creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Шаман Грозового Облака входит в игру, он наносит каждому не являющемуся Гигантом существу повреждения, равные количеству Гигантов под вашим контролем.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Xamã Cúmulo-Nimbo entra em jogo, ele causa dano igual ao número de Gigantes que você controla a cada criatura que não seja Gigante.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION ignore_filter="1">
-- How many Giants do you control?
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_IN_PLAY )
filter:AddSubType( CREATURE_TYPE_GIANT )
filter:SetController( EffectController() )
EffectDC():Set_Int( 0, filter:Count() )
-- Test
MTG():MessageAllPlayers( "Test register 0 in 1st action: "..EffectDC():Get_Int(0) )
</RESOLUTION_TIME_ACTION>
<FILTER>
-- Filter non-Giant creatures
local fc = FilteredCard()
return fc ~= nil and
fc:GetZone() == ZONE_IN_PLAY and
fc:GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and
fc:GetSubType():Test( CREATURE_TYPE_GIANT ) == 0
</FILTER>
<RESOLUTION_TIME_ACTION>
-- Deal the damage
if FilteredCard() ~= nil then
local source = EffectSource()
if source == nil then
source = Object()
end
local damage = EffectDC():Get_Int(0)
FilteredCard():DealDamage(damage, source)
-- Test
MTG():MessageAllPlayers( "Test register 0 in 2nd action: "..damage )
end
</RESOLUTION_TIME_ACTION>
<SFX text="GLOBAL_CHAIN_PLAY" />
</TRIGGERED_ABILITY>
<SFX text="COMBAT_LIGHTNING_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_LIGHTNING_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
<AI_BASE_SCORE score="450" zone="ZONE_HAND" />
</CARD_V2>
But here's the thing: if you remove ignore_filter="1" from the first action, everything works as expected.
Does anyone have a good explanation for this? I thought about 2:
- Registers in actions with ignore_filter="1" are separated from registers in actions without it.
- Actions with ignore_filter="1" are actually executed for last, no matter what (this doesn't seem possible, since the messages are fired in the correct order and I think there are some official cards that wouldn't work if this was true).