It is currently 18 Apr 2024, 14:08
   
Text Size

Coding Squirrellink (Earl of Squirrel)

Moderator: CCGHQ Admins

Coding Squirrellink (Earl of Squirrel)

Postby WillPowers86 » 19 Dec 2018, 02:32

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" />
WillPowers86
 
Posts: 1
Joined: 19 Dec 2018, 02:28
Has thanked: 0 time
Been thanked: 0 time

Re: Coding Squirrellink (Earl of Squirrel)

Postby Xander9009 » 03 May 2019, 03:05

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.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 19 guests


Who is online

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

Login Form