It is currently 27 Jun 2019, 00:39
   
Text Size

Trying to code Day's Undoing for DOTP 2014

Moderators: Xander9009, CCGHQ Admins

Trying to code Day's Undoing for DOTP 2014

Postby fallenangle » 25 Jul 2015, 16:25

I've been trying to approximate Day's Undoing for DOTP 2014, but it isn't working as expected. I have one of Xander's Favor of the Gods cards in play when I cast it, so that may be the problem; but the Triggered Abilities I put in that are supposed to render cards unplayable and to exile things on the stack don't seem to be working. Here is the code I have now. Is it possible to approximate this card in DOTP 2014? If so, how should I change my code to go about doing this? Any and all feedback would be greatly appreciated.

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="DAYS_UNDOING_CW_398652" />
  <CARDNAME text="DAYS_UNDOING" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Day’s Undoing]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Anéantissement du jour]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Jornada revocada]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Vereiteltes Tagewerk]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Annullare il Giorno]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[一日のやり直し]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[하루 전으로]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Закат Дня]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Desfazer do Dia]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="398652" />
  <ARTID value="CW398652" />
  <ARTIST name="Jonas De Ro" />
  <CASTING_COST cost="{2}{U}" />
  <TYPE metaname="Sorcery" />
  <EXPANSION value="ORI" />
  <RARITY metaname="M" />

  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it’s your turn, end the turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chaque joueur mélange sa main et son cimetière avec sa bibliothèque et pioche ensuite sept cartes. Si c’est votre tour, terminez le tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cada jugador baraja su mano y su cementerio en su biblioteca, luego roba siete cartas. Si es tu turno, finaliza el turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Jeder Spieler mischt die Karten auf seiner Hand und in seinem Friedhof in seine Bibliothek und zieht dann sieben Karten. Falls es dein Zug ist, beende den Zug.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogni giocatore rimescola la propria mano e il proprio cimitero nel proprio grimorio, poi pesca sette carte. Se è il tuo turno, termina il turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各プレイヤーはそれぞれ、自分の手札と墓地を自分のライブラリーに加えて切り直し、その後カードを7枚引く。あなたのターンであるなら、ターンを終了する。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 플레이어는 자신의 손과 무덤을 서고에 섞어 넣은 후 카드 일곱 장을 뽑는다. 당신 턴이라면 턴을 끝낸다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый игрок втасовывает свои руку и кладбище в свою библиотеку, затем берет семь карт. Если идет ваш ход, закончите ход.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Cada jogador embaralha a própria mão e cemitério no próprio grimório e depois compra sete cards. Se for o seu turno, termine o turno.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
         local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
               if player ~= nil then
                  player:MoveLocalZone( ZONE_HAND, ZONE_LIBRARY )
                  player:MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
               if player ~= nil then
                  player:ShuffleLibrary()
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
               if player ~= nil then
                  player:DrawCards( 7 )
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      </SPELL_ABILITY>
      
      <TRIGGERED_ABILITY replacement_effect="1" priority="99">
      <TRIGGER value="SPELL_RESOLVED" simple_qualifier="self">
      if TriggerObject():GetPlayer() == EffectController() and TriggerObject():GetPlayer():MyTurn() == true then
      return true
      end
      return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
      local filter = ClearFilter()
      filter:SetZone(ZONE_STACK)
      filter:SetStackObjectType(STACK_OBJECT_CARD)
      filter:SetStackObjectType(STACK_OBJECT_ABILITY)
      if Object() ~= nil then
      Object():Exile()
      end
      </RESOLUTION_TIME_ACTION>
      <FILTER filter_id="6">
        local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
               if player ~= nil then
        local filter = ClearFilter()
        filter:Add( FE_OWNER, OP_IS, player )
      filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
        filter:SetZone( ZONE_ANYWHERE )
      end
         end
            end
        </FILTER>
      <CONTINUOUS_ACTION layer="6" filter_id="6">
    local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
        if FilteredCard() ~= nil and player ~= nil then
           local characteristics = FilteredCard():GetCurrentCharacteristics()
           characteristics:Bool_Set( CHARACTERISTIC_CANT_BE_PLAYED, 1 )
           characteristics:Bool_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1)
        end
         end
            end
    </CONTINUOUS_ACTION>
      <CONTINUOUS_ACTION layer="6">
    local number = MTG():GetNumberOfPlayers()
         if number ~= nil then
            for i=0,(number-1) do
               local player = MTG():GetNthPlayer(i)
               if player ~= nil then
             player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_CAST_SPELLS, 1)
             player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES, 1)
            end
            end
               end
        </CONTINUOUS_ACTION>
      <DURATION simple_duration="UntilEOT" />
      </TRIGGERED_ABILITY>
      
      <TRIGGERED_ABILITY replacement_effect="1" priority="99">
      <CLEANUP fire_once="1" />
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
         return MTG():GetPhase() == PHASE_COMBAT and TriggerPlayer() == EffectController() and TriggerPlayer():MyTurn() == true
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         if TriggerPlayer() ~= nil then
            MTG():SkipPhase()
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   
   <TRIGGERED_ABILITY replacement_effect="1" priority="99">
   <CLEANUP simple_cleanup="EndOfTurn" />
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
    return TriggerPlayer() == EffectController() and TriggerPlayer():MyTurn() == true and ( MTG():GetPhase() == PHASE_MAIN_1 or MTG():GetPhase() == PHASE_MAIN_2 )
    </TRIGGER>
      <RESOLUTION_TIME_ACTION>
    MTG():SkipPhase()
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   
   <TRIGGERED_ABILITY replacement_effect="1" priority="99">
   <CLEANUP simple_cleanup="EndOfTurn" />
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
    return TriggerPlayer() == EffectController() and TriggerPlayer():MyTurn() == true and ( MTG():GetStep() == STEP_END_OF_TURN )
   </TRIGGER>
   <RESOLUTION_TIME_ACTION>
    MTG():SkipStep()
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   
      <AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
   <AUTHOR><![CDATA[fallenangle]]></AUTHOR>
   <EDITORS><![CDATA[fallenangle]]></EDITORS>
   <DATE><![CDATA[24-07-15]]></DATE>
</CARD_V2>
fallenangle
 
Posts: 275
Joined: 20 Jul 2013, 02:31
Has thanked: 72 times
Been thanked: 24 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby Xander9009 » 25 Jul 2015, 17:57

As long as no abilities from the Favor of the Gods are active at the time (none of them are ongoing), then that card shouldn't be the problem.

For the stack, I think the problem might be that you call filter:SetStackObjectType(STACK_OBJECT_CARD) and then filter:SetStackObjectType(STACK_OBJECT_ABILITY). It's trying to find objects that are both. Try splitting that up into two separate filters that are independently exiled.

Since the entire triggered ability appears to not be working, though, I'd try putting in a MTG():MessageAllPlayers("Some message") in the trigger, the first RTA, or both. See if it is in fact firing at all. If not, try commenting out the entire ability except the trigger and see if it fires then.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2880
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 116 times
Been thanked: 435 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby fallenangle » 25 Jul 2015, 23:10

Well, I've revised the code so that it uses a LinkedDC instead of one long Triggered_Ability. Unfortunately, it still doesn't work. Can anyone suggest where I've gone wrong and how I can fix it?

Here's the code I have now:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
    <CARD_V2 ExportVersion="1">
      <FILENAME text="DAYS_UNDOING_CW_398652" />
      <CARDNAME text="DAYS_UNDOING" />
      <TITLE>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Day’s Undoing]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Anéantissement du jour]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Jornada revocada]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Vereiteltes Tagewerk]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Annullare il Giorno]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[一日のやり直し]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[하루 전으로]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Закат Дня]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Desfazer do Dia]]></LOCALISED_TEXT>
      </TITLE>
      <MULTIVERSEID value="398652" />
      <ARTID value="CW398652" />
      <ARTIST name="Jonas De Ro" />
      <CASTING_COST cost="{2}{U}" />
      <TYPE metaname="Sorcery" />
      <EXPANSION value="ORI" />
      <RARITY metaname="M" />

      <SPELL_ABILITY linked_ability_group="1">
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it’s your turn, end the turn.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chaque joueur mélange sa main et son cimetière avec sa bibliothèque et pioche ensuite sept cartes. Si c’est votre tour, terminez le tour.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cada jugador baraja su mano y su cementerio en su biblioteca, luego roba siete cartas. Si es tu turno, finaliza el turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Jeder Spieler mischt die Karten auf seiner Hand und in seinem Friedhof in seine Bibliothek und zieht dann sieben Karten. Falls es dein Zug ist, beende den Zug.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogni giocatore rimescola la propria mano e il proprio cimitero nel proprio grimorio, poi pesca sette carte. Se è il tuo turno, termina il turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各プレイヤーはそれぞれ、自分の手札と墓地を自分のライブラリーに加えて切り直し、その後カードを7枚引く。あなたのターンであるなら、ターンを終了する。]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 플레이어는 자신의 손과 무덤을 서고에 섞어 넣은 후 카드 일곱 장을 뽑는다. 당신 턴이라면 턴을 끝낸다.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый игрок втасовывает свои руку и кладбище в свою библиотеку, затем берет семь карт. Если идет ваш ход, закончите ход.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Cada jogador embaralha a própria mão e cemitério no próprio grimório e depois compra sete cards. Se for o seu turno, termine o turno.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:MoveLocalZone( ZONE_HAND, ZONE_LIBRARY )
                      player:MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:ShuffleLibrary()
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:DrawCards( 7 )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        if EffectSource():GetPlayer():MyTurn() == true then
        LinkedDC():Set_Int(0, 1)
        end
        </RESOLUTION_TIME_ACTION>
          </SPELL_ABILITY>
         
          <TRIGGERED_ABILITY linked_ability_group="1">
        <TRIGGER value="SPELL_RESOLVED" simple_qualifier="self">
        if LinkedDC():Get_Int(0) == 1 then
        return true
        end
        return false
        </TRIGGER>
        <RESOLUTION_TIME_ACTION>
        local filter = ClearFilter()
        filter:SetZone(ZONE_STACK)
        local card = MTG():GetStackObjectCard()
        if card ~= nil then
        card:Exile()
        end
        </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        EffectSource():Exile()
        </RESOLUTION_TIME_ACTION>
        </TRIGGERED_ABILITY>
       
        <STATIC_ABILITY linked_ability_group="1">
        <FILTER filter_id="6">
       for i = 0, (MTG():GetNumberOfPlayers()-1) do
      local player = MTG():GetNthPlayer(i)
       if player ~= nil then
            local filter = ClearFilter()
            filter:Add( FE_OWNER, OP_IS, player )
          filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
            filter:SetZone( ZONE_ANYWHERE )
          end
             end
            </FILTER>
          <CONTINUOUS_ACTION layer="8" filter_id="6">
          for i = 0, (MTG():GetNumberOfPlayers()-1) do
      local player = MTG():GetNthPlayer(i)
       if player ~= nil then
            if FilteredCard() ~= nil and LinkedDC():Get_Int(0) == 1 then
               local characteristics = FilteredCard():GetCurrentCharacteristics()
               characteristics:Bool_Set( CHARACTERISTIC_CANT_BE_PLAYED, 1 )
               characteristics:Bool_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1)
            end
             end
                end
        </CONTINUOUS_ACTION>
          <CONTINUOUS_ACTION layer="8">
           for i = 0, (MTG():GetNumberOfPlayers()-1) do
      local player = MTG():GetNthPlayer(i)
       if player ~= nil and LinkedDC():Get_Int(0) == 1 then
                 player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_CAST_SPELLS, 1)
                 player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES, 1)
                end
                   end
            </CONTINUOUS_ACTION>
          <DURATION simple_duration="UntilEOT" />
        </STATIC_ABILITY>
         
          <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
          <CLEANUP fire_once="1" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
             return MTG():GetPhase() == PHASE_COMBAT and LinkedDC():Get_Int(0) == 1
          </TRIGGER>
          <RESOLUTION_TIME_ACTION>
             if TriggerPlayer() ~= nil then
                MTG():SkipPhase()
             end
          </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
       return LinkedDC():Get_Int(0) == 1 and ( MTG():GetPhase() == PHASE_MAIN_1 or MTG():GetPhase() == PHASE_MAIN_2 )
        </TRIGGER>
          <RESOLUTION_TIME_ACTION>
        MTG():SkipPhase()
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
        return LinkedDC():Get_Int(0) == 1 and ( MTG():GetStep() == STEP_END_OF_TURN )
       </TRIGGER>
       <RESOLUTION_TIME_ACTION>
        MTG():SkipStep()
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
      
      <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_CLEANUP
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         LinkedDC():Set_Int(0, 0)
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
       
          <AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
       <AUTHOR><![CDATA[fallenangle]]></AUTHOR>
       <EDITORS><![CDATA[fallenangle]]></EDITORS>
       <DATE><![CDATA[24-07-15]]></DATE>
    </CARD_V2>
fallenangle
 
Posts: 275
Joined: 20 Jul 2013, 02:31
Has thanked: 72 times
Been thanked: 24 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby RiiakShiNal » 26 Jul 2015, 00:18

Xander9009 wrote:For the stack, I think the problem might be that you call filter:SetStackObjectType(STACK_OBJECT_CARD) and then filter:SetStackObjectType(STACK_OBJECT_ABILITY). It's trying to find objects that are both. Try splitting that up into two separate filters that are independently exiled.
Or you could put them both into an "Or" sub-filter which would allow to just query once and get both.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2115
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 468 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby Xander9009 » 26 Jul 2015, 00:30

RiiakShiNal wrote:
Xander9009 wrote:For the stack, I think the problem might be that you call filter:SetStackObjectType(STACK_OBJECT_CARD) and then filter:SetStackObjectType(STACK_OBJECT_ABILITY). It's trying to find objects that are both. Try splitting that up into two separate filters that are independently exiled.
Or you could put them both into an "Or" sub-filter which would allow to just query once and get both.
Wasn't sure if that would work with this kind of filter condition.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2880
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 116 times
Been thanked: 435 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby RiiakShiNal » 26 Jul 2015, 01:04

It may or may not, but we will never know unless we try. Worst case we have nested sub-filters such that the top sub-filter is an "Or" sub-filter with 2 child sub-filters and each child uses the appropriate SetStackObjectType call.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2115
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 468 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby fallenangle » 01 Aug 2015, 21:11

Here is my latest, revised attempt. It still doesn't work. More specifically, nothing after the SPELL_ABILITY tag works. Can anyone pinpoint the problem?

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
    <CARD_V2 ExportVersion="1">
      <FILENAME text="DAYS_UNDOING_CW_398652" />
      <CARDNAME text="DAYS_UNDOING" />
      <TITLE>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Day’s Undoing]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Anéantissement du jour]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Jornada revocada]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Vereiteltes Tagewerk]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Annullare il Giorno]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[一日のやり直し]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[하루 전으로]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Закат Дня]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Desfazer do Dia]]></LOCALISED_TEXT>
      </TITLE>
      <MULTIVERSEID value="398652" />
      <ARTID value="CW398652" />
      <ARTIST name="Jonas De Ro" />
      <CASTING_COST cost="{2}{U}" />
      <TYPE metaname="Sorcery" />
      <EXPANSION value="ORI" />
      <RARITY metaname="M" />

      <SPELL_ABILITY linked_ability_group="1">
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it’s your turn, end the turn.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chaque joueur mélange sa main et son cimetière avec sa bibliothèque et pioche ensuite sept cartes. Si c’est votre tour, terminez le tour.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cada jugador baraja su mano y su cementerio en su biblioteca, luego roba siete cartas. Si es tu turno, finaliza el turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Jeder Spieler mischt die Karten auf seiner Hand und in seinem Friedhof in seine Bibliothek und zieht dann sieben Karten. Falls es dein Zug ist, beende den Zug.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogni giocatore rimescola la propria mano e il proprio cimitero nel proprio grimorio, poi pesca sette carte. Se è il tuo turno, termina il turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各プレイヤーはそれぞれ、自分の手札と墓地を自分のライブラリーに加えて切り直し、その後カードを7枚引く。あなたのターンであるなら、ターンを終了する。]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 플레이어는 자신의 손과 무덤을 서고에 섞어 넣은 후 카드 일곱 장을 뽑는다. 당신 턴이라면 턴을 끝낸다.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый игрок втасовывает свои руку и кладбище в свою библиотеку, затем берет семь карт. Если идет ваш ход, закончите ход.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Cada jogador embaralha a própria mão e cemitério no próprio grimório e depois compra sete cards. Se for o seu turno, termine o turno.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:MoveLocalZone( ZONE_HAND, ZONE_LIBRARY )
                      player:MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:ShuffleLibrary()
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:DrawCards( 7 )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        if EffectController():MyTurn() == true then
        LinkedDC():Set_Int(0, 1)
        end
        </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        EffectSource():Exile()
        </RESOLUTION_TIME_ACTION>
          </SPELL_ABILITY>
         
          <STATIC_ABILITY linked_ability_group="1">
        <CONTINUOUS_ACTION layer="6">
        local filter = ClearFilter()
        filter:SetZone(ZONE_ANYWHERE)
       local subfilter = filter:AddSubFilter_Or()
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PHENOMENON )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANE )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SCHEME )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
               local filter_count = filter:EvaluateObjects()
               for i=0,filter_count-1 do
                  local permanent = filter:GetNthEvaluatedObject(i)
                  if permanent ~= nil and LinkedDC():Get_Int(0) == 1 then
                     local characteristics = permanent:GetCurrentCharacteristics()
                     characteristics:LoseAllAbilities()
                  end
               end
      </CONTINUOUS_ACTION>
                <DURATION simple_duration="UntilEOT" />
        </STATIC_ABILITY>
       
        <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
        <CLEANUP simple_cleanup="EndOfTurn" />
      <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_STACK" pre_trigger="1">
if LinkedDC():Get_Int(0) == 1 then
      MTG():OverrideEvent()
            TriggerObject():Exile()
            return true
         end
         return false
      </TRIGGER>
   </TRIGGERED_ABILITY>
       
        <STATIC_ABILITY linked_ability_group="1">
        <FILTER filter_id="0">
      local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
       if player ~= nil then
            local filter = ClearFilter()
            filter:Add( FE_OWNER, OP_IS, player )
          filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
            filter:SetZone( ZONE_ANYWHERE )
          end
             end
            end
            </FILTER>
          <CONTINUOUS_ACTION layer="8" filter_id="0">
        local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
      local player = MTG():GetNthPlayer(i)
       if player ~= nil then
            if FilteredCard() ~= nil and LinkedDC():Get_Int(0) == 1 then
               local characteristics = FilteredCard():GetCurrentCharacteristics()
               characteristics:Bool_Set( CHARACTERISTIC_CANT_BE_PLAYED, 1 )
               characteristics:Bool_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1)
            end
               end
                end
               end
        </CONTINUOUS_ACTION>
          <CONTINUOUS_ACTION layer="8">
          local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
       if player ~= nil and LinkedDC():Get_Int(0) == 1 then
                 player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_CAST_SPELLS, 1)
                 player:GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES, 1)
                end
                   end
                  end
            </CONTINUOUS_ACTION>
          <DURATION simple_duration="UntilEOT" />
        </STATIC_ABILITY>
         
          <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
          <CLEANUP fire_once="1" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
             return MTG():GetPhase() == PHASE_COMBAT and TriggerPlayer() == EffectController() and LinkedDC():Get_Int(0) == 1
          </TRIGGER>
          <RESOLUTION_TIME_ACTION>
             if TriggerPlayer() ~= nil then
                MTG():SkipPhase()
             end
          </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
       return LinkedDC():Get_Int(0) == 1 and TriggerPlayer() == EffectController() and ( MTG():GetPhase() == PHASE_MAIN_1 or MTG():GetPhase() == PHASE_MAIN_2 )
        </TRIGGER>
          <RESOLUTION_TIME_ACTION>
        if TriggerPlayer() ~= nil then
                MTG():SkipPhase()
             end
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" priority="99">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
        return LinkedDC():Get_Int(0) == 1 and TriggerPlayer() == EffectController() and ( MTG():GetStep() == STEP_END_OF_TURN )
       </TRIGGER>
       <RESOLUTION_TIME_ACTION>
      if TriggerPlayer() ~= nil then
        MTG():SkipStep()
      end
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
      
      <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_CLEANUP
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         LinkedDC():Set_Int(0, 0)
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
       
          <AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
       <AUTHOR><![CDATA[fallenangle]]></AUTHOR>
       <EDITORS><![CDATA[fallenangle]]></EDITORS>
       <DATE><![CDATA[24-07-15]]></DATE>
    </CARD_V2>
fallenangle
 
Posts: 275
Joined: 20 Jul 2013, 02:31
Has thanked: 72 times
Been thanked: 24 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby RiiakShiNal » 01 Aug 2015, 22:32

Well, there are at least 2 major problems:
  • Your triggered abilities have no active_zone set which means their active_zone is the battlefield, but their on a spell.
  • After the spell resolves it immediately changes zones and thus your triggers won't occur because they are now completely invalid.
Try using delayed triggers instead as that will help to solve both issues.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2115
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 468 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby fallenangle » 02 Aug 2015, 17:01

I tried creating delayed triggers, and so far everything works except that I can't prevent lands from being playable so that my main phase will end as soon as I cast the spell. Do you have any idea of how I could accomplish this?

This is the code I have now:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
    <CARD_V2 ExportVersion="1">
      <FILENAME text="DAYS_UNDOING_CW_398652" />
      <CARDNAME text="DAYS_UNDOING" />
      <TITLE>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Day’s Undoing]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Anéantissement du jour]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Jornada revocada]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Vereiteltes Tagewerk]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Annullare il Giorno]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[一日のやり直し]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[하루 전으로]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Закат Дня]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Desfazer do Dia]]></LOCALISED_TEXT>
      </TITLE>
      <MULTIVERSEID value="398652" />
      <ARTID value="CW398652" />
      <ARTIST name="Jonas De Ro" />
      <CASTING_COST cost="{2}{U}" />
      <TYPE metaname="Sorcery" />
      <EXPANSION value="ORI" />
      <RARITY metaname="M" />

      <SPELL_ABILITY>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it’s your turn, end the turn.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chaque joueur mélange sa main et son cimetière avec sa bibliothèque et pioche ensuite sept cartes. Si c’est votre tour, terminez le tour.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cada jugador baraja su mano y su cementerio en su biblioteca, luego roba siete cartas. Si es tu turno, finaliza el turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Jeder Spieler mischt die Karten auf seiner Hand und in seinem Friedhof in seine Bibliothek und zieht dann sieben Karten. Falls es dein Zug ist, beende den Zug.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogni giocatore rimescola la propria mano e il proprio cimitero nel proprio grimorio, poi pesca sette carte. Se è il tuo turno, termina il turno.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各プレイヤーはそれぞれ、自分の手札と墓地を自分のライブラリーに加えて切り直し、その後カードを7枚引く。あなたのターンであるなら、ターンを終了する。]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 플레이어는 자신의 손과 무덤을 서고에 섞어 넣은 후 카드 일곱 장을 뽑는다. 당신 턴이라면 턴을 끝낸다.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый игрок втасовывает свои руку и кладбище в свою библиотеку, затем берет семь карт. Если идет ваш ход, закончите ход.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Cada jogador embaralha a própria mão e cemitério no próprio grimório e depois compra sete cards. Se for o seu turno, termine o turno.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:MoveLocalZone( ZONE_HAND, ZONE_LIBRARY )
                      player:MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:ShuffleLibrary()
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
             local number = MTG():GetNumberOfPlayers()
             if number ~= nil then
                for i=0,(number-1) do
                   local player = MTG():GetNthPlayer(i)
                   if player ~= nil then
                      player:DrawCards( 7 )
                   end
                end
             end
          </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
      if EffectController():MyTurn() == true then
        MTG():CreateDelayedTrigger(1, nil)
        MTG():CreateDelayedTrigger(2, nil)
        MTG():CreateDelayedTrigger(3, nil)
        MTG():CreateDelayedTrigger(4, nil)
        MTG():CreateDelayedTrigger(5, nil)
        MTG():CreateDelayedTrigger(6, nil)
        MTG():CreateDelayedTrigger(7, nil)
        end
        </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        local filter = ClearFilter()
        filter:Add(FE_CARD_NAME, OP_IS, "FAVOR_OF_THE_GODS")
        filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
        if FilteredCard() ~= nil then
        FilteredCard():PutOnBottomOfLibrary()
        end
        </RESOLUTION_TIME_ACTION>
        <RESOLUTION_TIME_ACTION>
        EffectSource():Exile()
        </RESOLUTION_TIME_ACTION>
          </SPELL_ABILITY>
         
          <TRIGGERED_ABILITY resource_id="1" replacement_effect="1">
        <CLEANUP simple_cleanup="EndOfTurn" />
        <CONTINUOUS_ACTION layer="6">
        local filter = ClearFilter()
        filter:SetZone(ZONE_ANYWHERE)
       local subfilter = filter:AddSubFilter_Or()
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PHENOMENON )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANE )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SCHEME )
               subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
               local filter_count = filter:EvaluateObjects()
               for i=0,filter_count-1 do
                  local permanent = filter:GetNthEvaluatedObject(i)
                  if permanent ~= nil then
                     local characteristics = permanent:GetCurrentCharacteristics()
                     characteristics:LoseAllAbilities()
                  end
               end
      </CONTINUOUS_ACTION>
        </TRIGGERED_ABILITY>
       
        <TRIGGERED_ABILITY resource_id="2">
        <CLEANUP simple_cleanup="EndOfTurn" />
      <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_STACK" pre_trigger="1">
      MTG():OverrideEvent()
            TriggerObject():Exile()
            return true
      </TRIGGER>
   </TRIGGERED_ABILITY>
   
   <TRIGGERED_ABILITY resource_id="7" replacement_effect="1">
        <CLEANUP simple_cleanup="EndOfTurn" />
        <FILTER filter_id="0">
         local player = EffectController()
         local filter = ClearFilter()
         filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
         filter:Add( FE_OWNER, OP_IS, EffectController() )
         filter:SetZone( ZONE_ANYWHERE )
      </FILTER>
      <CONTINUOUS_ACTION layer="8" filter_id="0">
         if FilteredCard() ~= nil then
            local characteristics = FilteredCard():GetCurrentCharacteristics()
            characteristics:Bool_Set( CHARACTERISTIC_CANT_BE_PLAYED, 1 )
         end
      </CONTINUOUS_ACTION>
      </TRIGGERED_ABILITY>
       
         <TRIGGERED_ABILITY resource_id="6" replacement_effect="1">
         <CLEANUP simple_cleanup="EndOfTurn" />
         <TRIGGER value="CONSIDERED_FOR_CAST" pre_trigger="1">
         if TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_ARTIFACT) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_ENCHANTMENT) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_INSTANT) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_SCHEME) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_SORCERY) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_LAND) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_PHENOMENON) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_PLANE) == true or
         TriggerObject():GetCardType():Test(CARD_TYPE_PLANESWALKER) == true then
         MTG():OverrideEvent()
       return true
    end
    return false
    </TRIGGER>
        </TRIGGERED_ABILITY>
         
          <TRIGGERED_ABILITY replacement_effect="1" resource_id="3">
          <CLEANUP fire_once="1" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
             return MTG():GetPhase() == PHASE_COMBAT and TriggerPlayer() == EffectController()
          </TRIGGER>
          <RESOLUTION_TIME_ACTION>
             if TriggerPlayer() ~= nil then
                MTG():SkipPhase()
             end
          </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" resource_id="4">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
       return TriggerPlayer() == EffectController() and ( MTG():GetPhase() == PHASE_MAIN_1 or MTG():GetPhase() == PHASE_MAIN_2 )
        </TRIGGER>
          <RESOLUTION_TIME_ACTION>
        if TriggerPlayer() ~= nil then
                MTG():SkipPhase()
             end
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY replacement_effect="1" resource_id="5">
       <CLEANUP simple_cleanup="EndOfTurn" />
          <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" pre_trigger="1">
        return TriggerPlayer() == EffectController() and ( MTG():GetStep() == STEP_END_OF_TURN )
       </TRIGGER>
       <RESOLUTION_TIME_ACTION>
      if TriggerPlayer() ~= nil then
        MTG():SkipStep()
      end
        </RESOLUTION_TIME_ACTION>
       </TRIGGERED_ABILITY>
      
       
          <AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
       <AUTHOR><![CDATA[fallenangle]]></AUTHOR>
       <EDITORS><![CDATA[fallenangle]]></EDITORS>
       <DATE><![CDATA[24-07-15]]></DATE>
    </CARD_V2>
fallenangle
 
Posts: 275
Joined: 20 Jul 2013, 02:31
Has thanked: 72 times
Been thanked: 24 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby RiiakShiNal » 03 Aug 2015, 11:05

You could always use a CONTINUOUS_ACTION with a FILTER for all cards in hands and give them the characteristic: CHARACTERISTIC_CANT_BE_PLAYED (that would prevent any cards from being played)
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2115
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 468 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby fallenangle » 03 Aug 2015, 21:44

Thanks for the suggestion, Riiak! It worked perfectly, and now the card works, too. Thanks again for all of your help with this!
fallenangle
 
Posts: 275
Joined: 20 Jul 2013, 02:31
Has thanked: 72 times
Been thanked: 24 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby Tejahn » 04 Aug 2015, 01:11

Can you post the code or supply the XML?
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby Xander9009 » 04 Aug 2015, 11:21

Tejahn wrote:Can you post the code or supply the XML?
He already sent it to me and it's in the CW. https://drive.google.com/file/d/0B-cZn2 ... lILTA/view
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2880
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 116 times
Been thanked: 435 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby Xander9009 » 21 Aug 2015, 17:44

So, the copy in the CW definitely has an issue. I didn't think about it until I saw it in action, and then I tested it to be sure.
Opponent has these in play.
Geist-Honored Monk (including the two tokens)
Angelic Overseer
Honor of the Pure

I deal 4 damage to the monk and the angel before playing Day's Undoing. Both die. Tested it without dealing damage just to be sure, and the monk still dies. Removing all abilities isn't a good way to go. I'm going to try granting
Code: Select all
CHARACTERISTIC_CANT_BE_PLAYED
CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES
to all cards and then granting
Code: Select all
PLAYER_CHARACTERISTIC_CANT_CAST_SPELLS
PLAYER_CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES
PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES
to all players just for good measure.

EDIT: I just wanted to say that this worked.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2880
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 116 times
Been thanked: 435 times

Re: Trying to code Day's Undoing for DOTP 2014

Postby RiiakShiNal » 22 Aug 2015, 17:25

Also make sure you grant CHARACTERISTIC_CANT_ATTACK to the creatures so that if someone uses Day's Undoing before combat, they can't attack. And CHARACTERISTIC_CANT_BE_PLAYED to cards in the graveyard (for lands that could be played from the graveyard due to some other effect) and in the library (in case the top card is visible and something else has allowed it to be played).
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2115
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 468 times

Next

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 2 guests

Login Form