fallenangle wrote:Edit: Tried this after some borrowings from
Mana Vault, and it gave me the query prior to my untap phase, during my upkeep, and during my draw phase. It never untapped when I selected "Yes," however.
First of all, not all attributes make sense with a number different than "1". In forced_skip="1", for instance, the "1" is to be intended as "true", that is "yes use forced skip", there are no different "levels" of forced skip and I don't know if using a different number actually works (it depends on whether the engine internally checks for being different from 0 or equal to 1). If you can't find a value that is not "1" for an attribute anywhere in the cards coded so far, then it falls into that category.
The MAY doesn't work in internal (= replacement_query or replacement_effect) triggers, so you can remove it.
If we want to be precise, this is not an "intervening if". On an internal trigger it doesn't make any difference because there's no time in between trigger and resolution where things may change, anyway an "intervening if" has its "if" clause between commas (it would be "At the beginning of your turn, if
Time Vault is tapped, you may..."). When it's not an "intervening if" you can put the condition inside TRIGGER only, and be happy with it.
You are missing an "end" in the RESOLUTION_TIME_ACTION that untaps, I think this is the main problem. Have you ever wondered why we indent the code? I mean, why do we write
- Code: Select all
if variable == 1 then
for i=0,1 do
SomeFunction(i)
end
end
rather than
- Code: Select all
if variable == 1 then
for i=0,1 do
SomeFunction(i)
end
end
Because it's easier to read, but it's also easier to recognize when you are missing an "end" (or a parenthesis in other languages). Basically, if you get to the end of your code and the last line isn't starting from the same column as where you started, then you are missing something. Get used to indentation and you'll avoid this kind of errors more easily.
AUTO_SKIP is useless in internal (= replacement_query or replacement_effect) triggers, they won't give any time to respond anyway, no matter whether they have AUTO_SKIP or not.
This is optional, but when you don't need to pass anything to a delayed trigger, you can avoid making a "delayDC" and pass nil instead.
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If you would begin your turn while Time Vault is tapped, you may skip that turn instead. If you do, untap Time Vault.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1">
return MTG():GetPhase() == PHASE_BEGINNING and EffectSource() ~= nil and EffectSource():IsTapped()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectController():BeginNewMultipleChoice()
EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
EffectController():AskMultipleChoiceQuestion( "CARD_QUERY_MC_UNTAP", EffectSource() )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
local result = EffectController():GetMultipleChoiceResult()
if result == 0 then
EffectSource():Untap()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():CreateDelayedTrigger(1, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>