Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
BECAME_TAPPED_FOR_MANA don't works wih land ?
Moderator: CCGHQ Admins
BECAME_TAPPED_FOR_MANA don't works wih land ?
by Persee » 02 Dec 2012, 12:40
Hi, all
I tried to code Wild Growth and I used this trigger but it don't fire when the land is used.
It works with the trigger BECAME_TAPPED
Thx for help.
I tried to code Wild Growth and I used this trigger but it don't fire when the land is used.
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
<FILENAME text="WILD_GROWTH_12340193" />
<CARDNAME text="WILD_GROWTH" />
<ARTID value="WILD_GROWTH" />
<ARTIST name="Mike Raabe" />
<TYPE metaname="Enchantment" />
<SUB_TYPE metaname="Aura" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" order_ko-KR="0" order_pt-BR="0" order_ru-RU="0" />
<CASTING_COST cost="{G}" />
<MULTIVERSEID value="26647" />
<EXPANSION value="DPE" />
<RARITY metaname="C" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Wild Growth]]></LOCALISED_TEXT>
</TITLE>
<STATIC_ABILITY attach_filter="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Enchant land]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
local attach_filter = Object():AttachmentFilter_Get()
attach_filter:Clear()
attach_filter:AddCardType( CARD_TYPE_LAND )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces).]]></LOCALISED_TEXT>
<TRIGGER value="BECAME_TAPPED_FOR_MANA">
return TriggerObject() == Object():GetParent()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local land = TriggerObject()
if land ~= nil then
ProduceMana( "G", 1 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<SPELL_ABILITY attach_filter="1" filter_zone="ZONE_IN_PLAY">
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ALLIED_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_LAND_TO_ENCHANT", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target_card ~= nil then
Object():Enchant( target_card )
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
It works with the trigger BECAME_TAPPED
Thx for help.
Re: BECAME_TAPPED_FOR_MANA don't works wih land ?
by thefiremind » 02 Dec 2012, 13:27
Strange... as far as I know, BECAME_TAPPED_FOR_MANA works only with lands. But I tested it only with basic lands. Maybe it works only with basic lands? Which land did you try to enchant?
I noticed that you are missing the TOKEN_REGISTRATION for the mana token, but if you say that it works with BECAME_TAPPED, then that's not the problem.
By the way, if you want to make BECAME_TAPPED_FOR_MANA work with lands that produce mana tokens, you can fire the trigger manually in addition to producing the token, as the original cards do for cycling. After all, Wild Growth loses a lot of functionality if the additional mana isn't ready to pay the same thing you were tapping the land for.
I noticed that you are missing the TOKEN_REGISTRATION for the mana token, but if you say that it works with BECAME_TAPPED, then that's not the problem.
By the way, if you want to make BECAME_TAPPED_FOR_MANA work with lands that produce mana tokens, you can fire the trigger manually in addition to producing the token, as the original cards do for cycling. After all, Wild Growth loses a lot of functionality if the additional mana isn't ready to pay the same thing you were tapping the land for.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: BECAME_TAPPED_FOR_MANA don't works wih land ?
by Persee » 02 Dec 2012, 14:19
I just tried wtih a basic land.
I add the TOKEN_REGISTRATION but it still doesn't work as I expected.
How do I manually fire the trigger ?
I add the TOKEN_REGISTRATION but it still doesn't work as I expected.
How do I manually fire the trigger ?
Re: BECAME_TAPPED_FOR_MANA don't works wih land ?
by thefiremind » 02 Dec 2012, 19:29
Cards with cycling have:
- Code: Select all
<PLAY_TIME_ACTION>
MTG():FireTrigger( TRIGGER_CYCLED, Object() )
</PLAY_TIME_ACTION>
- Code: Select all
<PLAY_TIME_ACTION>
MTG():FireTrigger( TRIGGER_BECAME_TAPPED_FOR_MANA, Object() )
</PLAY_TIME_ACTION>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: BECAME_TAPPED_FOR_MANA don't works wih land ?
by Persee » 03 Dec 2012, 17:35
Thx for help.
I'll use this code.
Basic Land don't have any MANA_ABILITY
edit : it's works ! Basic land that use mana token can be activated or the AI use them as usual. Of course, the ability doesn't trigger in this case.
I'll use this code.
Basic Land don't have any MANA_ABILITY
edit : it's works ! Basic land that use mana token can be activated or the AI use them as usual. Of course, the ability doesn't trigger in this case.
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests