Page 1 of 1

Coding Squirrellink (Earl of Squirrel)

PostPosted: 19 Dec 2018, 02:32
by WillPowers86
I thought I had it, but the Squirrellink ability doesn't seem to be working. The card shows that it's trying to do something when I assign it as an attacker, but no tokens are generated.

| Open
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever this creature deals damage, put that many 1/1 green Squirrel creature tokens onto the battlefield.]]></LOCALISED_TEXT>
<TRIGGER value="SOURCE_DEALS_DAMAGE" to_zone="ZONE_ANY" from_zone="ZONE_ANY" damage_type="combat">
if EffectSource() ~= nil then
return TriggerObject() == EffectSource():GetParent()
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local parent = EffectSource():GetParent()
if parent ~= nil then
local damage = Damage():GetAmount()
if damage ~= nil then
MTG():PutTokensOntoBattlefield( "TOKEN_SQUIRREL_C_1_1_G_CW_1", damage, EffectController() )
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="TOKEN_SQUIRREL_C_1_1_G_CW_1" />
<HELP title="MORE_INFO_BADGE_TITLE_4" body="MORE_INFO_BADGE_BODY_4" zone="ZONE_ANY" />

Re: Coding Squirrellink (Earl of Squirrel)

PostPosted: 03 May 2019, 03:05
by Xander9009
Better late than never? This is a creature, not an enchantment or equipment. It doesn't have a parent. Checking for parent is preventing the RTA from doing anything. Remove the first two lines of the RTA and the corresponding end.