It is currently 15 Nov 2025, 07:48
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby braquio » 26 Aug 2014, 02:34

thefiremind wrote:
braquio wrote:Only one thing, i dont know why but my sealed decks are cleared each time i restart the game, this is normal?
I think this was one of the bad consequences of editing the sealed pool.
No, like i said, i had this problem before i start any change in sealed pool.
May be i have something wrong in my profile.
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
User avatar
braquio
 
Posts: 143
Joined: 16 Feb 2014, 19:21
Has thanked: 15 times
Been thanked: 9 times

Re: Formal Request Thread

Postby thefiremind » 26 Aug 2014, 09:28

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>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby fallenangle » 26 Aug 2014, 19:28

Well, Firemind, SweetLu, you two are the greatest! Now I've got it working and it functions exactly as it should. The only thing is that if you want to leave it tapped, you have to decline once during your untap, upkeep, and draw phases, for a total of three times. I suspect that this is an engine limitation, and it's only a minor annoyance, so I'm not going to complain any more, although I would be interested to know if there really is a way to limit the query to only asking you the first time. I'm going to post the code here in case anyone wants to use the card. Thanks again for all of your patience and your amazing help!

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
        <CARD_V2 ExportVersion="1">
          <FILENAME text="TIME_VAULT_383130" />
          <CARDNAME text="TIME_VAULT" />
          <TITLE>
            <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
          </TITLE>
          <MULTIVERSEID value="383130" />
          <ARTID value="383130" />
          <ARTIST name="Mark Tedin" />
          <CASTING_COST cost="{2}" />
          <TYPE metaname="Artifact" />
          <EXPANSION value="VMA" />
          <RARITY metaname="M" />
          <TRIGGERED_ABILITY replacement_effect="3" active_zone="ZONE_TRANSITION">
            <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Volta Temporale entra nel campo di battaglia TAPpata.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
          <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1" />
              <RESOLUTION_TIME_ACTION>
            if TriggerObject() ~= nil then
               TriggerObject():Tap()
            end
            </RESOLUTION_TIME_ACTION>
           </TRIGGERED_ABILITY>
          <STATIC_ABILITY>
            <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Volta Temporale non STAPpa durante il tuo STAP.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
        <CONTINUOUS_ACTION layer="8">
            if EffectSource() ~= nil then
               EffectSource():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_DOESNT_UNTAP, 1 )
            end
            </CONTINUOUS_ACTION>
           </STATIC_ABILITY>
          <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>
            <LOCALISED_TEXT LanguageCode="fr-FR"><![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>
            <LOCALISED_TEXT LanguageCode="es-ES"><![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>
            <LOCALISED_TEXT LanguageCode="de-DE"><![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>
            <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se stai per iniziare il tuo turno mentre la Volta Temporale è TAPpata, invece puoi saltare quel turno. Se lo fai, STAPpa la Volta Temporale.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="jp-JA"><![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>
            <LOCALISED_TEXT LanguageCode="ko-KR"><![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>
            <LOCALISED_TEXT LanguageCode="ru-RU"><![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>
            <LOCALISED_TEXT LanguageCode="pt-BR"><![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>
           <TRIGGERED_ABILITY resource_id="1" replacement_effect="1" priority="20">
              <CLEANUP fire_once="1" />
              <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1">
            return MTG():GetPhase() == PHASE_BEGINNING
            </TRIGGER>
              <RESOLUTION_TIME_ACTION>
            EffectDC():Set_Int( 0, MTG():GetTurnNumber() )
            </RESOLUTION_TIME_ACTION>
              <RESOLUTION_TIME_ACTION>
            local delayDC = EffectDC():Make_Chest(2)
            MTG():CreateDelayedTrigger(2, delayDC)
            </RESOLUTION_TIME_ACTION>
              <RESOLUTION_TIME_ACTION>
            MTG():SkipPhase()
            </RESOLUTION_TIME_ACTION>
              <CONTINUOUS_ACTION layer="8">
            EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
            </CONTINUOUS_ACTION>
              <DURATION>
            return EffectController() == nil or MTG():GetTurnNumber() &gt; EffectDC():Get_Int(0)
            </DURATION>
           </TRIGGERED_ABILITY>
           <TRIGGERED_ABILITY resource_id="2" replacement_effect="1" priority="20">
              <CLEANUP simple_cleanup="EndOfTurn" />
              <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1" />
              <RESOLUTION_TIME_ACTION>
            MTG():SkipStep()
            </RESOLUTION_TIME_ACTION>
           </TRIGGERED_ABILITY>
          <ACTIVATED_ABILITY forced_skip="4">
            <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Gioca un altro turno dopo questo.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
        <COST type="TapSelf" />
        <RESOLUTION_TIME_ACTION>
            EffectController():GetTeam():TakeExtraTurn()
            </RESOLUTION_TIME_ACTION>
          </ACTIVATED_ABILITY>
        </CARD_V2>
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby thefiremind » 26 Aug 2014, 19:42

fallenangle wrote:The only thing is that if you want to leave it tapped, you have to decline once during your untap, upkeep, and draw phases, for a total of three times.
It happens because the trigger fires for each step where MTG():GetPhase() == PHASE_BEGINNING, despite the CLEANUP condition set to fire once. I remember having similar problems when I tried to code Paradox Haze (I failed to do so).

You could try with
Code: Select all
    <TRIGGER value="BEGINNING_OF_PLAYERS_TURN" simple_qualifier="controller" pre_trigger="1">
    return EffectSource() ~= nil and EffectSource():IsTapped()
    </TRIGGER>
but I'm not sure if it works.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby fallenangle » 26 Aug 2014, 22:53

Thanks for the idea, Firemind. Unfortunately, it doesn't work; but I'm more than happy with the way it works now, even if I have to click multiple times to keep the vault tapped. Thanks again for all of your help with this!
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby NeoAnderson » 26 Aug 2014, 23:19

thefiremind wrote:
fallenangle wrote:The only thing is that if you want to leave it tapped, you have to decline once during your untap, upkeep, and draw phases, for a total of three times.
It happens because the trigger fires for each step where MTG():GetPhase() == PHASE_BEGINNING, despite the CLEANUP condition set to fire once. I remember having similar problems when I tried to code Paradox Haze (I failed to do so).

You could try with
Code: Select all
    <TRIGGER value="BEGINNING_OF_PLAYERS_TURN" simple_qualifier="controller" pre_trigger="1">
    return EffectSource() ~= nil and EffectSource():IsTapped()
    </TRIGGER>
but I'm not sure if it works.
You could use a fake activated ability with cost 0, to set a lock. When it is locked it skip the question when is unlocked it asks.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby RiiakShiNal » 27 Aug 2014, 00:38

You could just set a LinkedDC() register the first time in a turn (for example setting it to the turn number) when the question is asked and if that LinkedDC() is set (check to see if it equals the current turn number) then don't ask again, just skip this activation.
RiiakShiNal
Programmer
 
Posts: 2189
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby sweetLu » 27 Aug 2014, 00:40

You could try changing MTG():GetPhase() == PHASE_BEGINNING to MTG():GetStep() == STEP_UNTAP. Good point TFM I wasn't thinking. Thank you.


Or you could count how many times it triggered in a turn and only ask the question if it hasn't triggered yet. For instance make the trigger:
Code: Select all
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1">
   <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1">
   if MTG():GetPhase() == PHASE_BEGINNING and EffectSource() ~= nil and EffectSource():IsTapped() and LinkedDC():Get_Int(10) == 0 then
      LinkedDC():Set_Int(10, 1)
      return true
   end
   return false
   </TRIGGER>
   -- All your other RTAs and such
</TRIGGERED_ABILITY>
And then add this to clear LinkedDC():Get_Int(10):

Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
    <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
   return MTG():GetStep() == STEP_CLEANUP
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
   LinkedDC():Set_Int(10, 0)
    </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
I used something similar when I attempted Paradox Haze. I could get the correct number of upkeeps but in my version you were required to click continue for each additional upkeep (like having to click continue to go from Main Phase I to Combat Phase).
Last edited by sweetLu on 27 Aug 2014, 10:52, edited 1 time in total.
sweetLu
 
Posts: 181
Joined: 16 Jul 2014, 01:24
Has thanked: 21 times
Been thanked: 22 times

Re: Formal Request Thread

Postby thefiremind » 27 Aug 2014, 08:23

sweetLu wrote:You could try changing MTG():GetPhase() == PHASE_BEGINNING to MTG():GetStep() == STEP_UNTAP.
That is not recommended, otherwise the card wouldn't be compatible with cards that make players skip their untap phases.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby fallenangle » 27 Aug 2014, 19:41

I tried doing what SweetLu recommended, but now the Vault skips my turn whether I tell it to untap or not, although it does only query me once. Do you have any idea why that might be? Thanks again for all of your wonderful suggestions and help!

This is what I have now for the code:

Code: Select all
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="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>
                <LOCALISED_TEXT LanguageCode="fr-FR"><![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>
                <LOCALISED_TEXT LanguageCode="es-ES"><![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>
                <LOCALISED_TEXT LanguageCode="de-DE"><![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>
                <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se stai per iniziare il tuo turno mentre la Volta Temporale è TAPpata, invece puoi saltare quel turno. Se lo fai, STAPpa la Volta Temporale.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="jp-JA"><![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>
                <LOCALISED_TEXT LanguageCode="ko-KR"><![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>
                <LOCALISED_TEXT LanguageCode="ru-RU"><![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>
                <LOCALISED_TEXT LanguageCode="pt-BR"><![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">
   if MTG():GetPhase() == PHASE_BEGINNING and EffectSource() ~= nil and EffectSource():IsTapped() and LinkedDC():Get_Int(10) == 0 then
      LinkedDC():Set_Int(10, 1)
      return true
   end
   return false
   </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>
               <TRIGGERED_ABILITY resource_id="1" replacement_effect="1" priority="20">
                  <CLEANUP fire_once="1" />
                  <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1">
                return MTG():GetPhase() == PHASE_BEGINNING
                </TRIGGER>
                  <RESOLUTION_TIME_ACTION>
                EffectDC():Set_Int( 0, MTG():GetTurnNumber() )
                </RESOLUTION_TIME_ACTION>
                  <RESOLUTION_TIME_ACTION>
                local delayDC = EffectDC():Make_Chest(2)
                MTG():CreateDelayedTrigger(2, delayDC)
                </RESOLUTION_TIME_ACTION>
                  <RESOLUTION_TIME_ACTION>
                MTG():SkipPhase()
                </RESOLUTION_TIME_ACTION>
                  <CONTINUOUS_ACTION layer="8">
                EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
                </CONTINUOUS_ACTION>
                  <DURATION>
                return EffectController() == nil or MTG():GetTurnNumber() &gt; EffectDC():Get_Int(0)
                </DURATION>
               </TRIGGERED_ABILITY>
               <TRIGGERED_ABILITY resource_id="2" replacement_effect="1" priority="20">
                  <CLEANUP simple_cleanup="EndOfTurn" />
                  <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1" />
                  <RESOLUTION_TIME_ACTION>
                MTG():SkipStep()
                </RESOLUTION_TIME_ACTION>
               </TRIGGERED_ABILITY>
    <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
        <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
       return MTG():GetStep() == STEP_CLEANUP
        </TRIGGER>
        <RESOLUTION_TIME_ACTION>
       LinkedDC():Set_Int(10, 0)
        </RESOLUTION_TIME_ACTION>
    </TRIGGERED_ABILITY>
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby thefiremind » 27 Aug 2014, 21:44

fallenangle wrote:I tried doing what SweetLu recommended, but now the Vault skips my turn whether I tell it to untap or not, although it does only query me once.
Now that you make me notice... I'm surprised that it was working well before: it has no condition for the delayed trigger to happen, so you decide to untap or not, but the turn is skipped no matter what.

This:
Code: Select all
        <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>
should be changed into this:
Code: Select all
        <RESOLUTION_TIME_ACTION>
        if EffectSource() ~= nil then
           local result = EffectController():GetMultipleChoiceResult()
           if result == 0 then
               EffectSource():Untap()
               MTG():CreateDelayedTrigger(1, nil)
           end
        end
        </RESOLUTION_TIME_ACTION>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby fallenangle » 28 Aug 2014, 02:36

Thanks for the suggestion, Firemind! That was just what I needed, and it now works perfectly! Thanks again, everyone, for all of your patience and help with this!

Here's the working code, for those who want it:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
            <CARD_V2 ExportVersion="1">
              <FILENAME text="TIME_VAULT_383130" />
              <CARDNAME text="TIME_VAULT" />
              <TITLE>
                <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault]]></LOCALISED_TEXT>
              </TITLE>
              <MULTIVERSEID value="383130" />
              <ARTID value="383130" />
              <ARTIST name="Mark Tedin" />
              <CASTING_COST cost="{2}" />
              <TYPE metaname="Artifact" />
              <EXPANSION value="VMA" />
              <RARITY metaname="M" />
              <TRIGGERED_ABILITY replacement_effect="3" active_zone="ZONE_TRANSITION">
                <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Volta Temporale entra nel campo di battaglia TAPpata.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault enters the battlefield tapped.]]></LOCALISED_TEXT>
              <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1" />
                  <RESOLUTION_TIME_ACTION>
                if TriggerObject() ~= nil then
                   TriggerObject():Tap()
                end
                </RESOLUTION_TIME_ACTION>
               </TRIGGERED_ABILITY>
              <STATIC_ABILITY>
                <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Volta Temporale non STAPpa durante il tuo STAP.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Time Vault doesn’t untap during your untap step.]]></LOCALISED_TEXT>
            <CONTINUOUS_ACTION layer="8">
                if EffectSource() ~= nil then
                   EffectSource():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_DOESNT_UNTAP, 1 )
                end
                </CONTINUOUS_ACTION>
               </STATIC_ABILITY>
                      <TRIGGERED_ABILITY replacement_query="1" linked_ability_group="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>
                    <LOCALISED_TEXT LanguageCode="fr-FR"><![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>
                    <LOCALISED_TEXT LanguageCode="es-ES"><![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>
                    <LOCALISED_TEXT LanguageCode="de-DE"><![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>
                    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se stai per iniziare il tuo turno mentre la Volta Temporale è TAPpata, invece puoi saltare quel turno. Se lo fai, STAPpa la Volta Temporale.]]></LOCALISED_TEXT>
                    <LOCALISED_TEXT LanguageCode="jp-JA"><![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>
                    <LOCALISED_TEXT LanguageCode="ko-KR"><![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>
                    <LOCALISED_TEXT LanguageCode="ru-RU"><![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>
                    <LOCALISED_TEXT LanguageCode="pt-BR"><![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">
       if MTG():GetPhase() == PHASE_BEGINNING and EffectSource() ~= nil and EffectSource():IsTapped() and LinkedDC():Get_Int(10) == 0 then
          LinkedDC():Set_Int(10, 1)
          return true
       end
       return false
       </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()
                   MTG():CreateDelayedTrigger(1, nil)
               end
            end
            </RESOLUTION_TIME_ACTION>
          </TRIGGERED_ABILITY>
                   <TRIGGERED_ABILITY resource_id="1" replacement_effect="1" priority="20">
                      <CLEANUP fire_once="1" />
                      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1">
                    return MTG():GetPhase() == PHASE_BEGINNING
                    </TRIGGER>
                      <RESOLUTION_TIME_ACTION>
                    EffectDC():Set_Int( 0, MTG():GetTurnNumber() )
                    </RESOLUTION_TIME_ACTION>
                      <RESOLUTION_TIME_ACTION>
                    local delayDC = EffectDC():Make_Chest(2)
                    MTG():CreateDelayedTrigger(2, delayDC)
                    </RESOLUTION_TIME_ACTION>
                      <RESOLUTION_TIME_ACTION>
                    MTG():SkipPhase()
                    </RESOLUTION_TIME_ACTION>
                      <CONTINUOUS_ACTION layer="8">
                    EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
                    </CONTINUOUS_ACTION>
                      <DURATION>
                    return EffectController() == nil or MTG():GetTurnNumber() &gt; EffectDC():Get_Int(0)
                    </DURATION>
                   </TRIGGERED_ABILITY>
                   <TRIGGERED_ABILITY resource_id="2" replacement_effect="1" priority="20">
                      <CLEANUP simple_cleanup="EndOfTurn" />
                      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller" pre_trigger="1" />
                      <RESOLUTION_TIME_ACTION>
                    MTG():SkipStep()
                    </RESOLUTION_TIME_ACTION>
                   </TRIGGERED_ABILITY>
        <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
            <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
           return MTG():GetStep() == STEP_CLEANUP
            </TRIGGER>
            <RESOLUTION_TIME_ACTION>
           LinkedDC():Set_Int(10, 0)
            </RESOLUTION_TIME_ACTION>
        </TRIGGERED_ABILITY>
              <ACTIVATED_ABILITY forced_skip="4">
                <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Gioca un altro turno dopo questo.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
                <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Take an extra turn after this one.]]></LOCALISED_TEXT>
            <COST type="TapSelf" />
            <RESOLUTION_TIME_ACTION>
                EffectController():GetTeam():TakeExtraTurn()
                </RESOLUTION_TIME_ACTION>
              </ACTIVATED_ABILITY>
            </CARD_V2>
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby fallenangle » 28 Aug 2014, 18:44

Now I'm working on Doomsday. I had it working yesterday except for the life loss part because I moved the five chosen cards to the graveyard after first moving the graveyard to the library, then moved the graveyard back to the library once I had exiled it. That worked, except it occurred to me that this would not be effective if a card like Rest in Peace were in play, so I figure that I need to exile the cards first, then return them to the library after removing the library from the game. The problem is that I don't know how to do this. Do I need a delayed trigger? I've looked to Search the City for guidance, but so far the cards just get put on top of the library in exile. Can anyone give me some advice about how to solve this problem? Thanks in advance for all of your help, patience, and advice.

Here's the code that I'm using, for reference:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="DOOMSDAY_15397" />
   <CARDNAME text="DOOMSDAY" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Doomsday]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Doomsday]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="15397" />
   <ARTID value="15397" />
   <ARTIST name="Adrian Smith" />
   <CASTING_COST cost="{B}{B}{B}" />
   <TYPE metaname="Sorcery" />
   <EXPANSION value="6E" />
   <RARITY metaname="R" />
   <SPELL_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Passa in rassegna il tuo grimorio e il tuo cimitero per cinque carte e esilia le rimanenti. Metti le carte scelte in cima al tuo grimorio in un qualsiasi ordine. Perdi metà dei tuoi punti vita, arrotondati per eccesso.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up.]]></LOCALISED_TEXT>
      <RESOLUTION_TIME_ACTION>
      local player = EffectController()
      if player ~= nil then
   player:MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
      end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
local count = 5
local filter = ClearFilter()
    local effectController = EffectController()
    filter:SetZone( ZONE_LIBRARY, effectController )
    effectController:SetItemCount( count )
    for i = 0, (count-1) do
       effectController:SetItemPrompt(i, "CARD_QUERY_CHOOSE_A_CARD_TO_PUT_ONTO_YOUR_LIBRARY" )
    end       
    effectController:ChooseItems( EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local targetDC = EffectDC():Get_Targets(0)
    if targetDC ~= nil then
      local number = targetDC:Count()
      for i = 0, (number-1) do
        local target = targetDC:Get_CardPtr(i)
         target:PutOnTopOfLibrary()
      end
    end
    </RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local chest = LinkedDC():Make_Chest(3)
    local source = EffectSource()
    for i = 0, (5-1) do
       local card = EffectController():Library_GetTop()
       if card~= nil then
         card:Exile()
chest:Int_Inc(5)
          chest:Set_CardPtr(i, card)
         end
end
</RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
 local player = EffectController()
      if player ~= nil then
       player:MoveLocalZone( ZONE_LIBRARY, ZONE_EXILE )
    end
    </RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
    local chest = LinkedDC():Get_Chest(3)
    if chest ~= nil then
      if chest:Get_Int(5) &gt; 0 then
        for i = 0, (5-1) do
           local card = chest:Get_CardPtr(i)
           if card ~= ni then
 card:PutOnTopOfLibrary()
             break
           end
        end
       end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    local controller = EffectController()
    filter:SetZone(ZONE_LIBRARY, controller)
    local max_cards = filter:CountStopAt(5) --{{-- change this number for a different amount of cards
    if max_cards &gt; 0 then
       filter:SetPortion(max_cards)
       controller:SetItemCount(max_cards)
       for i=0,max_cards-1 do
          controller:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_LIBRARY")
       end
       controller:ChooseItems( EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local targetDC = EffectDC():Get_Targets(1)
    if targetDC ~= nil then
       local max_cards = targetDC:Count()
       for i=0,max_cards-1 do
          targetDC:Get_CardPtr(i):PutOnTopOfLibrary()
       end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local value = math.ceil(EffectController():GetLifeTotal() / 2)
    EffectController():LoseLife(value)
    </RESOLUTION_TIME_ACTION>
   </SPELL_ABILITY>
   <AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
</CARD_V2>
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby thefiremind » 28 Aug 2014, 21:39

fallenangle wrote:I figure that I need to exile the cards first, then return them to the library after removing the library from the game.
The card says "search for 5 cards and exile the rest", so I would do exactly as it says. I see 2 ways to do it:
  1. Collect all cards from library and graveyard into a single data chest, then let the player choose from it. Loop through the same data chest and exile the cards that weren't chosen.
  2. Make a query that lets you select 5 cards from your library, then another query that lets you select from your graveyard a number of cards equal to 5 minus the ones you already chosen from your library. Loop through library and graveyard and exile the cards that weren't chosen.
The last step is to collect the chosen cards into another data chest so that they can be rearranged on top of the library, and lose half life.

If you are in trouble I can try and write some code, let me know which of the 2 ways you prefer.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby fallenangle » 28 Aug 2014, 22:03

I would prefer to do option one, since that seems easier, but I'm not quite sure how to go about it. If you really wouldn't mind writing some code with annotations to show me how to do it, I would be very much obliged to you for all of your help.

Thank you again for all of the patience and kindness you've shown me as I've been struggling to code cards!
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 9824 on 10 Nov 2025, 04:33

Users browsing this forum: No registered users and 8 guests

Login Form