Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
DOTP 2012 : Cryptic Command
Moderator: CCGHQ Admins
DOTP 2012 : Cryptic Command
by Persee » 11 Feb 2012, 16:35
Hello,
I try to code this card but I have problems with some couple of effect.
For exemple, when I want to counter a spell and return a permanent to his ower's hand, the counterspell don't work but it works when I want to draw a card...
I try to code this card but I have problems with some couple of effect.
For exemple, when I want to counter a spell and return a permanent to his ower's hand, the counterspell don't work but it works when I want to draw a card...
- Code: Select all
<?xml version='1.0'?>
<CARD_V2 custom="true">
<FILENAME text="CRYPTIC_COMMAND_12340106" />
<CARDNAME text="CRYPTIC_COMMAND" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Cryptic Command]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="12340106" />
<ARTID value="123585" />
<FRAMECOLOUR name="U" />
<COLOUR value="Z" />
<ARTIST name="Wayne England" />
<CASTING_COST cost="{1}{U}{U}{U}" />
<TYPE metaname="Instant" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
<EXPANSION value="DPE" />
<RARITY metaname="R" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Remove a charge counter from Umezawa's Jitte: Choose one - Equipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Remove a charge counter from Umezawa's Jitte: Choose one - Equipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life.]]></LOCALISED_TEXT>
<PLAY_TIME_ACTION>
local filter = Object():GetFilter()
local player = Object():GetPlayer()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
local target = filter:Count()
MTG():ObjectDataChest():Int_Set( 5 , target )
if target > 0 then
Object():GetPlayer():BeginNewMultipleChoice()
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CARD_QUERY_OPTION_CRYPTIC_COMMAND_A" )
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 5 ) > 0 then
if Object():GetMultipleChoiceResult() == 0 then
MTG():ObjectDataChest():Int_Set( 0 , 1 )
MTG():ObjectDataChest():Int_Inc( 4 )
end
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION target_choosing="1">
if MTG():ObjectDataChest():Int_Get( 0 ) ~= 0 then
local filter = Object():GetFilter()
local player = Object():GetPlayer()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
player:ChooseTargetDC( "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", MTG():EffectDataChest():Make_Targets( 1 ))
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
Object():GetPlayer():BeginNewMultipleChoice()
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CARD_QUERY_OPTION_CRYPTIC_COMMAND_B" )
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
if Object():GetMultipleChoiceResult() == 0 then
MTG():ObjectDataChest():Int_Set( 1 , 1 )
MTG():ObjectDataChest():Int_Inc( 4 )
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION target_choosing="1">
if MTG():ObjectDataChest():Int_Get( 1 ) ~= 0 then
local filter = Object():GetFilter()
local player = Object():GetPlayer()
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ARTIFACT )
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:AddCardType( CARD_TYPE_LAND )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddCardType( CARD_TYPE_PLANESWALKER )
filter:SetNeutral()
filter:SetZone( ZONE_IN_PLAY )
player:ChooseTargetDC( "CARD_QUERY_CHOOSE_PERMANENT_TO_PUT_INTO_HAND", MTG():EffectDataChest():Make_Targets( 2 ))
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 4 ) == 1 then
Object():GetPlayer():BeginNewMultipleChoice()
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
Object():GetPlayer():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CARD_QUERY_OPTION_CRYPTIC_COMMAND_C" )
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
if Object():GetMultipleChoiceResult() == 0 and MTG():ObjectDataChest():Int_Get( 4 ) < 2 then
MTG():ObjectDataChest():Int_Set( 2 , 1 )
MTG():ObjectDataChest():Int_Inc( 4 )
end
</PLAY_TIME_ACTION>
<PLAY_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 4 ) < 2 then
Object():GetPlayer():GainLife(1)
MTG():ObjectDataChest():Int_Set( 3 , 1 )
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 0 ) ~= 0 then
local target_chest = MTG():EffectDataChest():Get_Targets( 1 )
if target_chest ~= nil then
local target_card = target_chest:Get_CardPtr( 0 )
if target_card ~= nil then
target_card:CounterSpell()
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 1 ) ~= 0 then
local target_chest2 = MTG():EffectDataChest():Get_Targets( 2 )
if target_chest2 ~= nil then
local target_card2 = target_chest2:Get_CardPtr( 0 )
if target_card2 ~= nil then
target_card2:ReturnToOwnersHand()
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 3 ) ~= 0 then
Object():GetPlayer():DrawCard()
end
</RESOLUTION_TIME_ACTION>
<FILTER>
return (FilteredCard() ~= nil and FilteredCard():GetZone() == ZONE_IN_PLAY and FilteredCard():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and FilteredCard():GetController():GetTeam() ~= Object():GetController():GetTeam())
</FILTER>
<RESOLUTION_TIME_ACTION>
if MTG():ObjectDataChest():Int_Get( 2 ) ~= 0 then
FilteredCard():Tap()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
Re: DOTP 2012 : Cryptic Command
by nabeshin » 17 Feb 2012, 15:52
Having seen the such!!! I couldn't be kept and have commented on it... It - Magnificent result of persistent work of the great thinker!
I hope having united our efforts we will force to work correctly this irritating card!
I hope having united our efforts we will force to work correctly this irritating card!
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests


