Furthest I can get on
Dimir Charm is the following. I redid it partly from scratch by copying from
Izzet Charm and modifying. Its last ability which I modified from
Brainstorm still doesn't work properly. It's close, but not quite there.
- Dimir Charm | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="DIMIR_CHARM_17366473" />
<CARDNAME text="DIMIR_CHARM" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Dimir Charm]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="17366473" />
<ARTID value="A366473" />
<ARTIST name="Zoltan Boros" />
<CASTING_COST cost="{U}{B}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Dangerous to recognize. Deadly not to.”
—Lazav]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="DPI" />
<RARITY metaname="U" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Choose one — Counter target sorcery spell; or destroy target creature with power 2 or less; or look at the top three cards of target player's library, then put one back and the rest into that player's graveyard.]]></LOCALISED_TEXT>
<MODE_SELECT tag="MODE_CHOOSE_ONE">
<MODE tag="MODE_DIMIR_COUNTER" index="1" />
<MODE tag="MODE_DIMIR_DESTRUCTION" index="2" />
<MODE tag="MODE_DIMIR_CARD" index="3" />
</MODE_SELECT>
<TARGET tag="CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" definition="0" compartment="0" mode="1" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetZone( ZONE_STACK )
filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_CREATURE )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="1">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY" definition="1" compartment="1" mode="2" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_POWER, OP_LESS_THAN_OR_EQUAL_TO, 2 )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="2">
local target_creature = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target_creature ~= nil then
target_creature:Destroy()
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_PLAYER_TO_VESTIGE_ROT" definition="2" compartment="2" mode="3" count="1" />
<TARGET_DEFINITION id="2">
local filter = ClearFilter()
filter:SetFilterType(FILTER_TYPE_PLAYERS)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="3">
local answerDC = EffectDC():Make_Targets(3)
local queryDC = EffectDC():Make_Chest(1)
local player = EffectController()
local targetPlayer = EffectDC():Get_Targets(2):Get_PlayerPtr(0)
for i=0,(2) do
local card = targetPlayer:Library_GetNth(i)
if card ~= nil then
queryDC:Set_CardPtr(i, card)
else
break
end
end
if answerDC ~= nil and queryDC ~= nil then
player:ChooseItemFromDC( "CARD_QUERY_CHOOSE_A_CARD_TOP_OF_LIBRARY", queryDC, answerDC)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION mode="3">
local target = EffectDC():Get_Targets(3):Get_CardPtr(0)
if target ~= nil then
target:PutOnTopOfLibrary()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION mode="3">
local queryDC = EffectDC():Get_Chest(1)
local num_cards = queryDC:Count()
for i=0,num_cards-1 do
local card = queryDC:Get_CardPtr(i)
if card ~= nil then
card:PutInGraveyard()
end
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
<AI_SIMPLIFIED_TARGETING compartment="1" hint="HINT_ENEMY_ONLY" />
<AI_SIMPLIFIED_TARGETING compartment="2" hint="HINT_ENEMY_ONLY" />
</SPELL_ABILITY>
<AI_AVAILABILITY type="in_response" response_source="1" />
<AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="declare_blockers" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" type="window" />
<AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
<AI_AVAILABILITY type="in_response" response_source="1" />
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
<AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
</CARD_V2>
I didn't correct
Dizzy Spell because I didn't notice it. It's a bit a mess

Please don't be offended if I tell you a bunch of stuff you already know. I don't know what you know and what you don't, so I'll just explain my reasons for everything, and if it helps, great; if you already knew that, no harm.
I see two things that might make it not work. The first reason I think it's not working is because the <TARGET tag...> has definition="1" but the target block has id 0. Changing the target tag to have definition 0 so it matches the target block. (While you're there, you might change the compartment to 0 as well. But that doesn't really matter, it just looks cleaner.)
So
- Code: Select all
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_LOSE_3_0" definition="1" compartment="1" count="1" />
becomes
- Code: Select all
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_LOSE_3_0" definition="0" compartment="0" count="1" />
The second reason is that resolution blocks are used for events, things like draw a card, kill a creature, do some damage. Things that persist like "until end of turn, do this" need continuous blocks. Furthermore, they need a layer telling them what they're modifying. In this case, they're modifying power and toughness (by adding and subtracting, not by making it equal something ['gets +1/+1 until end of turn' vs 'becomes 1/1 until end of turn') so look ok the layers page on the wiki to see which layer it should be. In this case, it's 7C. So the
- Code: Select all
<RESOLUTION_ACTION>
should be replaced with
- Code: Select all
<CONTINUOUS_ACTION layer="7C">
Don't forget to change the closing tag, also.
Next up, the target block has an 'end' at the end. There's no 'if' or 'for' or anything like that, so there doesn't need to be an 'end'. That same block also has the variable 'first_card', but 'first_card' is never used. So you could just delete that entire line. Like the compartment, it doesn't matter, but it doesn't need to be there.
- Code: Select all
<TARGET_DEFINITION id="0">
local first_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
end
</TARGET_DEFINITION>
becomes
- Code: Select all
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
Finally, in the resolution block (the one we changed to continuous), you make 'target1' and then ask about 'target2', but 'target2' doesn't exist, because you named it 'target1'. Replace both with simply "target" and do the same in the next line for the characteristics.
- Code: Select all
<RESOLUTION_ACTION>
local target1 = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target2 ~= nil then
local characteristics = target2:GetCurrentCharacteristics()
characteristics:Power_Add( -3 )
characteristics:Toughness_Add( -0 )
end
</RESOLUTION_ACTION>
becomes
- Code: Select all
<RESOLUTION_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( -3 )
characteristics:Toughness_Add( -0 )
end
</RESOLUTION_ACTION>
Combining those gives us this. I don't know it'll will make the card work, but here's the result.
- Dizzy Spell | Open
- Code: Select all
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_LOSE_3_0" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="7C">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( -3 )
characteristics:Toughness_Add( -0 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
</SPELL_ABILITY>