Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Help with a card
Moderator: CCGHQ Admins
Help with a card
by Thran75 » 26 Feb 2013, 21:52
I don't understand why this card doesn't work can someone can give me an hand?
<CARD_V2>
<FILENAME text="AURA_FRACTURE_24560" />
<CARDNAME text="AURA_FRACTURE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Frattura dell'aura]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="24560" />
<ARTID value="24560" />
<ARTIST name="Rebecca Guay" />
<CASTING_COST cost="{2}{W}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds. »]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“‘Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.“]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA["I maghi ristici di Jamuraa trattano la magia come il loro giardino estirpando le magie indesiderate come fossero erbacce fastidiose."]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[”Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds”]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Enchantment" />
<EXPANSION value="DPG" />
<RARITY metaname="C" />
<ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una Terra : Distruggi un incantesimo bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME></COST>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_DESTROY", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
if target ~= nil then
target:Destroy()
end
</RESOLUTION_TIME_ACTION>
Thank to every kind soul willing to help me.
<CARD_V2>
<FILENAME text="AURA_FRACTURE_24560" />
<CARDNAME text="AURA_FRACTURE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Frattura dell'aura]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="24560" />
<ARTID value="24560" />
<ARTIST name="Rebecca Guay" />
<CASTING_COST cost="{2}{W}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds. »]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“‘Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.“]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA["I maghi ristici di Jamuraa trattano la magia come il loro giardino estirpando le magie indesiderate come fossero erbacce fastidiose."]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[”Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds”]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Enchantment" />
<EXPANSION value="DPG" />
<RARITY metaname="C" />
<ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una Terra : Distruggi un incantesimo bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME></COST>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_DESTROY", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
if target ~= nil then
target:Destroy()
end
</RESOLUTION_TIME_ACTION>
Thank to every kind soul willing to help me.
Re: Help with a card
by RiiakShiNal » 26 Feb 2013, 22:10
It helps if you use the [ code ] [ /code ] tags (without the extra spaces) as it makes reading the card easier.
As for what is wrong with the card I don't see the closing tags for the ability or for the card, also for picking the enchantment to destroy you may want to use chest 1 instead of 0 because you used chest 0 for sacrificing the land essentially making that part like this:
As for what is wrong with the card I don't see the closing tags for the ability or for the card, also for picking the enchantment to destroy you may want to use chest 1 instead of 0 because you used chest 0 for sacrificing the land essentially making that part like this:
- Code: Select all
<ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una Terra : Distruggi un incantesimo bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME>
</COST>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_DESTROY", EffectDC():Make_Targets(1) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local target = EffectDC():Get_Targets(1):Get_NthCardPtr(0)
if target ~= nil then
target:Destroy()
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
</CARD_V2>
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2183
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Help with a card
by Thran75 » 26 Feb 2013, 22:30
ops i missed last part of the card on the post... but yes you had right about the other part. Now it work perfectly. Thank you a lot.
Re: Help with a card
by thefiremind » 26 Feb 2013, 22:44
To say it in other words, never reuse the same EffectDC register inside the same ability, not even for storing different kinds of data.
You call EffectDC():Make_Targets(0), then register 0 is "wasted". No more EffectDC():Make_Targets(0), EffectDC():Set_Int(0, ...), or whatever.
(Actually, the FreeCompartment function is used in some cards to be sure that ObjectDC registers are clean before using them, so it would probably be able to make a register usable again, but nobody does that for EffectDC, so just use different register numbers and forget about this last thing. )
You call EffectDC():Make_Targets(0), then register 0 is "wasted". No more EffectDC():Make_Targets(0), EffectDC():Set_Int(0, ...), or whatever.
(Actually, the FreeCompartment function is used in some cards to be sure that ObjectDC registers are clean before using them, so it would probably be able to make a register usable again, but nobody does that for EffectDC, so just use different register numbers and forget about this last thing. )
< 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: Help with a card
by Thran75 » 27 Feb 2013, 19:24
Thank again! By the way i am trying to find out how affect only non basic lands with spells and abilities do you know where i could look?
Re: Help with a card
by thefiremind » 27 Feb 2013, 19:44
"Basic" is a supertype, so if you want to filter nonbasic for targetting you'll write
- Code: Select all
local filter = Object():GetFilter()
-- ...other filtering for zone, card type, etc.
filter:AddSupertype( SUPERTYPE_BASIC )
filter:AddExtra( FILTER_EXTRA_FLIP_SUPER_TYPES )
- Code: Select all
FilteredCard():GetSupertype():Test( SUPERTYPE_BASIC ) == 0
< 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
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests