Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Coding Squirrellink (Earl of Squirrel)
Moderator: CCGHQ Admins
Coding Squirrellink (Earl of Squirrel)
by 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)
by 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
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests