It is currently 19 Apr 2024, 22:20
   
Text Size

Skipping a turn

Moderator: CCGHQ Admins

Skipping a turn

Postby thefiremind » 14 Sep 2013, 16:08

Inspired by a post by GrovyleXShinyCelebi, I tried to code a turn skip by skipping all phases of that turn. It almost worked... but it seems that the end phase cannot be skipped, no matter what. I even tried to add a specific delayed trigger for the end phase, but no way, the end phase was still there.
EDIT: Good news! You can't skip the end phase with SkipPhase, but you can skip each step of it with SkipStep!

Here's my Chronosavant code.
Code: Select all
  <ACTIVATED_ABILITY active_zone="ZONE_GRAVEYARD">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}{W}: Return Chronosavant from your graveyard to the battlefield tapped. You skip your next turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{1}{W} : Renvoyez en jeu, engagé, le Chronosavant depuis votre cimetière. Passez votre prochain tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{1}{W}: Regresa el Cronósofo de tu cementerio al juego girado. Sáltate tu siguiente turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{1}{W}: Bringe den Zeitkundigen aus deinem Friedhof getappt ins Spiel zurück. Übergehe deinen nächsten Zug.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{1}{W}: Rimetti sul campo di battaglia TAPpato il Cronosapiente dal tuo cimitero. Salta il tuo prossimo turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{1}{W}:あなたの墓地にあるクロノサヴァントをタップ状態で場に出す。 あなたの次のターンをとばす。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{1}{W}: Return Chronosavant from your graveyard to the battlefield tapped. You skip your next turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{1}{W}: Верните Хрономудреца из вашего кладбища в игру повернутым. Пропустите ваш следующий ход.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{1}{W}: Devolva Cronosábio de seu cemitério para o jogo virado. Pule seu próximo turno.]]></LOCALISED_TEXT>
    <COST mana_cost="{1}{W}" type="Mana" />
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():PutOntoBattlefieldTapped( EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    MTG():CreateDelayedTrigger(1, nil)
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1" replacement_effect="1">
    <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>
    MTG():CreateDelayedTrigger(2, nil)
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    MTG():SkipPhase()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
    <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>
A little explanation: since I cannot know when my next turn will come, I only create a delayed trigger for skipping my next beginning phase, then that trigger will create other delayed triggers for the remaining steps of the same turn. This should allow the code to work even when one of the phases is skipped because of another card... or maybe it screws up exactly those scenarios, I don't know. :lol: Feel free to test the strategy in other cards and report bugs on this topic.
< 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: 721 times

Re: Skipping a turn

Postby sumomole » 19 Oct 2013, 19:01

Can't skip discard step when hands more than 7.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Skipping a turn

Postby thefiremind » 19 Oct 2013, 19:19

sumomole wrote:Can't skip discard step when hands more than 7.
I guess that the cleanup step can't be skipped no matter what. Do you think we can find a way to give PLAYER_CHARACTERISTIC_NO_HAND_LIMIT during the cleanup step that should be skipped?
< 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: 721 times

Re: Skipping a turn

Postby sumomole » 19 Oct 2013, 20:05

thefiremind wrote:
sumomole wrote:Can't skip discard step when hands more than 7.
I guess that the cleanup step can't be skipped no matter what. Do you think we can find a way to give PLAYER_CHARACTERISTIC_NO_HAND_LIMIT during the cleanup step that should be skipped?
Good idea, it seems ok. :lol:
Code: Select all
  <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>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 29 guests


Who is online

In total there are 29 users online :: 0 registered, 0 hidden and 29 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 29 guests

Login Form