Cryptic Command
I just thought I would post what I came up with for Cryptic Command to see if anyone has any comments on possible problems with it or ways to improve it. It works well enough for me. It's a little cumbersome to "choose" linearly, but it gets the job done, and I think follows the rules, since there is never going to be a time when you can't cast it for lack of targets, as the final two options are not targeted.
Here's the code:
Here's the code:
- Code: Select all
<SPELL_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose two — Counter target spell; or return target permanent to its owner’s hand; or tap all creatures your opponents control; or draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli due — Neutralizza una magia bersaglio; oppure fai tornare un permanente bersaglio in mano al suo proprietario; oppure TAPpa tutte le creature controllate dai tuoi avversari; oppure pesca una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme zwei — Neutralisiere einen Zauberspruch deiner Wahl; oder bringe eine bleibende Karte deiner Wahl auf die Hand ihres Besitzers zurück; oder tappe alle Kreaturen, die deine Gegner kontrollieren; oder ziehe eine Karte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez deux — Contrecarrez le sort ciblé ; ou renvoyez le permanent ciblé dans la main de son propriétaire ; ou engagez toutes les créatures que vos adversaires contrôlent ; ou piochez une carte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige dos: Contrarresta el hechizo objetivo; o regresa el permanente objetivo a la mano de su propietario; o gira todas las criaturas que controlan tus oponentes; o roba una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[以下の4つから2つを選ぶ。「呪文1つを対象とし、それを打ち消す。」「パーマネント1つを対象とし、それをオーナーの手札に戻す。」「あなたの対戦相手がコントロールするすべてのクリーチャーをタップする。」「カードを1枚引く。」]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose two — Counter target spell; or return target permanent to its owner’s hand; or tap all creatures your opponents control; or draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите два — Отмените целевое заклинание; или верните целевой перманент в руку его владельца; или поверните все существа под контролем вашего оппонента; или возьмите карту.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha dois — Anule a mágica alvo; ou devolva a permanente alvo para a mão de seu dono; ou vire todas as criaturas que seus oponentes controlam; ou compre um card.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION ignore_filter="1">
EffectDC():Float_Set(0, 0)
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
filter:SetCardInstance( Object() )
filter:AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
if filter:CountStopAt(1) ~= 0 then
filter:Clear()
filter:May()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
EffectController():ChooseTarget( NO_VALIDATION, "1138_QUERY_CRYPTIC_COUNTER", EffectDC():Make_Targets(0) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local targetDC = EffectDC():Get_Targets(0)
if targetDC ~= nil then
local target = targetDC:Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
EffectDC():Float_Inc(0)
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_IN_PLAY )
if filter:CountStopAt(1) ~= 0 then
filter:Clear()
filter:May()
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
EffectController():ChooseTarget( NO_VALIDATION, "1138_QUERY_CRYPTIC_RETURN", EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local targetDC = EffectDC():Get_Targets(1)
if targetDC ~= nil then
local target = targetDC:Get_CardPtr(0)
if target ~= nil then
target:PutInHand()
EffectDC():Float_Inc(0)
end
end
</RESOLUTION_TIME_ACTION>
<FILTER>
return (FilteredCard() ~= nil and
FilteredCard():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and
FilteredCard():GetZone() == ZONE_IN_PLAY and
FilteredCard():GetController():GetTeam() ~= EffectController():GetTeam())
</FILTER>
<RESOLUTION_TIME_ACTION ignore_filter="1">
if EffectDC():Float_Get(0) == 1 then
EffectController():BeginNewMultipleChoice()
EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
EffectController():AskMultipleChoiceQuestion( "1138_QUERY_CRYPTIC_TAP")
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectDC():Float_Get(0) == 0 then
if FilteredCard() ~= nil then
FilteredCard():Tap()
end
elseif EffectDC():Float_Get(0) == 1 then
local decision = Object():GetMultipleChoiceResult()
if decision == 0 then
if FilteredCard() ~= nil then
FilteredCard():Tap()
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
if EffectDC():Float_Get(0) == 0 then
EffectController():DrawCard()
elseif Object():GetMultipleChoiceResult() == 1 then
EffectController():DrawCard()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>