It is currently 03 Sep 2025, 01:24
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby Xander9009 » 30 Oct 2014, 14:21

fallenangle wrote:Thanks for all the help, Xander. Now it does everything except add the luck counter. Can anyone help me fix this. Here's my current Gemstone Caverns code.
Best guess, replace "<TRIGGERED_ABILITY>" with "<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">" for the ability block that adds the counter. If active_zone="ZONE_TRANSITION" isn't included, then it defaults to ZONE_BATTLEFIELD IIRC (and of course it can't fire a transition trigger if it's already done transitioning). Not sure why it needs the replacement_effect="1", but that's exactly how it appears for Joraga Warcaller.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby fallenangle » 30 Oct 2014, 18:29

Thanks again, Xander! That did the trick. Now the only problem is how to get the card to add {1} to the mana pool if it has no luck counters, and one mana of any color to the mana pool if it does. Does anyone have a good way to code this that he or she could show me?

Again, for reference, here's the code I have now:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="GEMSTONE_CAVERNS_122094" />
  <CARDNAME text="GEMSTONE_CAVERNS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cavernes aux gemmes]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cavernas de gemas]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Edelsteinhöhlen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Caverne di Gemme]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Самоцветные Пещеры]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Carvernas de Pedras Preciosas]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="122094" />
  <ARTID value="122094" />
  <ARTIST name="Martina Pilcerova" />
  <CASTING_COST cost="" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Land" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
<TRIGGERED_ABILITY active_zone="ZONE_HAND">
 <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si les Cavernes aux gemmes sont dans votre main de départ et que vous ne jouez pas en premier, vous pouvez commencer la partie avec les Cavernes aux gemmes en jeu avec, sur elles, un marqueur « chance ». Si vous faites ainsi, retirez de la partie une carte de votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si las Cavernas de gemas están en tu mano inicial y no juegas primero, puedes comenzar el juego con las Cavernas de gemas en juego con un contador de suerte sobre ellas. Si lo haces, remueve del juego una carta de tu mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls die Edelsteinhöhlen auf deiner Anfangshand sind und du nicht als Erster an der Reihe bist, kannst du sie vor Spielbeginn mit einer Glücksmarke ins Spiel bringen. Falls du das tust, entferne eine Karte aus deiner Hand ganz aus dem Spiel.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se le Caverne di Gemme sono nella tua mano iniziale e non stai giocando per primo, puoi iniziare la partita mettendo nel campo di battaglia le Caverne di Gemme con un segnalino fortuna su di esse. Se lo fai, esilia una carta dalla tua mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟があなたのゲーム開始時の手札にあり、かつあなたが先攻でない場合、あなたはそれが運勢カウンターを1個置いて場に出ている状態でゲームを開始してもよい。 そうした場合、あなたの手札にあるカードを1枚ゲームから取り除く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если Самоцветные Пещеры пришли к вам в начальную руку и вы не ходите первым, вы можете начать игру с Самоцветными Пещерами в игре с одним жетоном удачи на них. Если вы это сделали, уберите одну карту в вашей руке из игры.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se Carvernas de Pedras Preciosas estiver em sua mão de abertura e você não for o primeiro a jogar, você pode começar o jogo com Carvernas de Pedras Preciosas em jogo com um marcador de sorte sobre ela. Se fizer isso, remova do jogo um card de sua mão.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP">
    return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
<RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():PutOntoBattlefield( EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
      <MAY />
      <AUTO_SKIP always="1" />
<RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:SetZone( ZONE_HAND, EffectController() )
    EffectController():ChooseItem( "CARD_QUERY_CHOOSE_CARD_TO_EXILE", EffectDC():Make_Targets(38) )
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(38):Get_CardPtr(0)
    if target ~= nil then
       EffectDC():Get_Targets(38):Protect_CardPtr(0)
       target:Exile()
    end
    </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

    <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
      <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_HAND">
        return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
      </TRIGGER>
      <COUNTER_REGISTRATION name="Luck" proliferate="11" />
      <RESOLUTION_TIME_ACTION>
        if EffectSource() ~= nil then
          EffectSource():AddCounters( MTG():GetCountersType("Luck"), 1)
        end
      </RESOLUTION_TIME_ACTION>
    </TRIGGERED_ABILITY>



<ACTIVATED_ABILITY forced_skip="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {1} to your mana pool.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}: Ajoutez {1} à votre réserve.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {1} a tu reserva de maná.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {1}.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {1} alla tua riserva di mana.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{1}を加える。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: {1}를 당신의 마나풀에 담는다.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: добавьте {1} в ваше хранилище маны.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {1} à sua reserva de mana.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加{1}到你的法术力池中。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}:加{1}到你的魔法力池中。]]></LOCALISED_TEXT>
<INTERVENING_IF ignore_resolution_check="1">
    if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
       return false
    else
       return true
    end
    </INTERVENING_IF>
      <COST type="TapSelf" />
      <PLAY_TIME_ACTION>
         RSN_MarkManaAbilityStart()
      </PLAY_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         RSN_Produce( "{1}", 1 )
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         RSN_EliminateExtraManaTokens()
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
      S_DisplayManaPool(EffectController())
      RSN_MarkManaAbilityEnd()
      </RESOLUTION_TIME_ACTION>
      <AI_AVAILABILITY window_step="upkeep" type="window" />
      <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
      <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY window_step="declare_blockers" type="window" />
      <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
      <AI_AVAILABILITY window_step="end_of_turn" type="window" />
      <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
      <AI_AVAILABILITY type="in_response" response_source="1" />
      <AI_AVAILABILITY type="in_response" response_target="1" />
   </ACTIVATED_ABILITY>
   <STATIC_ABILITY>
      <CONTINUOUS_ACTION layer="0">
         RSN_ClearCanProduceMana()
         RSN_MarkCanProduceMana( "{1}" )
      </CONTINUOUS_ACTION>
      <CONTINUOUS_ACTION layer="8">
         local oCard = EffectSource()
         if (RSN_CheckSwitchToFallback( oCard )) then
            local oCharacteristics = oCard:GetCurrentCharacteristics()
            oCharacteristics:GrantAbility( 9 )
         end
      </CONTINUOUS_ACTION>
   </STATIC_ABILITY>

<ACTIVATED_ABILITY forced_skip= "1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}: Ajoutez un mana de la couleur de votre choix à votre réserve.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega un maná de cualquier color a tu reserva de maná.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um ein Mana einer beliebigen Farbe.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi un mana di un qualsiasi colore alla tua riserva di mana.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに、好きな色1色のマナ1点を加える。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: 당신의 마나풀에 원하는 색의 마나 한 개를 담는다.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: добавьте одну ману любого цвета в ваше хранилище маны.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione um mana de qualquer cor à sua reserva de mana.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加一点任意颜色的法术力到你的法术力池中。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}:加一點任意顏色的魔法力到你的魔法力池中。]]></LOCALISED_TEXT>
<INTERVENING_IF ignore_resolution_check="1">
    if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
       return true
    else
       return false
    end
    </INTERVENING_IF>
      <COST type="TapSelf" />
      <PLAY_TIME_ACTION>
         RSN_MarkManaAbilityStart()
         local oPlayer = EffectController()
         local oCard = EffectSource()
         if (oPlayer ~= nil) then
            oPlayer:BeginNewMultipleChoice()
            oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W" )
            oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U" )
            oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B" )
            oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R" )
            oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G" )
            oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard )
         end
      </PLAY_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local nColour = EffectController():GetMultipleChoiceResult() + 1
         if (nColour == COLOUR_BLACK) then
            RSN_Produce( "{B}", 1 )
         elseif (nColour == COLOUR_BLUE) then
            RSN_Produce( "{U}", 1 )
         elseif (nColour == COLOUR_GREEN) then
            RSN_Produce( "{G}", 1 )
         elseif (nColour == COLOUR_RED) then
            RSN_Produce( "{R}", 1 )
         elseif (nColour == COLOUR_WHITE) then
            RSN_Produce( "{W}", 1 )
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         RSN_EliminateExtraManaTokens()
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
      S_DisplayManaPool(EffectController())
      RSN_MarkManaAbilityEnd()
      </RESOLUTION_TIME_ACTION>
      <AI_AVAILABILITY window_step="upkeep" type="window" />
      <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
      <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY window_step="declare_blockers" type="window" />
      <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
      <AI_AVAILABILITY window_step="end_of_turn" type="window" />
      <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
      <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
      <AI_AVAILABILITY type="in_response" response_source="1" />
      <AI_AVAILABILITY type="in_response" response_target="1" />
   </ACTIVATED_ABILITY>
   <STATIC_ABILITY>
      <CONTINUOUS_ACTION layer="0">
         RSN_ClearCanProduceMana()
         RSN_MarkCanProduceMana( "{B}{G}{R}{U}{W}" )
      </CONTINUOUS_ACTION>
      <CONTINUOUS_ACTION layer="8">
         local nDefaultColour = COLOUR_GREEN
         local oCard = EffectSource()
         if (RSN_CheckSwitchToFallback( oCard )) then
            local nColour = RSN_GetLastProducedColour()
            local oCharacteristics = oCard:GetCurrentCharacteristics()
            if (nColour ~= COLOUR_COLOURLESS) then
               oCharacteristics:GrantAbility( nColour )
            else
               oCharacteristics:GrantAbility( nDefaultColour )
            end
         end
      </CONTINUOUS_ACTION>
   </STATIC_ABILITY>
   <TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
      <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
      <RESOLUTION_TIME_ACTION>
         RSN_ClearProducedMana()
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <MANA_ABILITY resource_id="1">
      <COST type="TapSelf" />
      <PRODUCES amount="{W}" />
   </MANA_ABILITY>
   <MANA_ABILITY resource_id="2">
      <COST type="TapSelf" />
      <PRODUCES amount="{U}" />
   </MANA_ABILITY>
   <MANA_ABILITY resource_id="3">
      <COST type="TapSelf" />
      <PRODUCES amount="{B}" />
   </MANA_ABILITY>
   <MANA_ABILITY resource_id="4">
      <COST type="TapSelf" />
      <PRODUCES amount="{R}" />
   </MANA_ABILITY>
   <MANA_ABILITY resource_id="5">
      <COST type="TapSelf" />
      <PRODUCES amount="{G}" />
   </MANA_ABILITY>
   <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_B" />
   <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_G" />
   <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_R" />
   <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_U" />
   <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_W" />
<TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_C" />
</CARD_V2>
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 Xander9009 » 30 Oct 2014, 21:02

fallenangle wrote:Thanks again, Xander! That did the trick. Now the only problem is how to get the card to add {1} to the mana pool if it has no luck counters, and one mana of any color to the mana pool if it does. Does anyone have a good way to code this that he or she could show me?

Again, for reference, here's the code I have now:

Thanks again for all of your help with this!
I've combined the two into a single ability like they should be, and in each action before doing anything else, it checks if there's a luck counter. It also grants the colorless mana producing fallback ability which was missing. I tested it and it worked as expected in all but one way: I had 3 in my hand, one played automatically, I used it to exile one of the two remaining, and the last one then played, forcing me to exile yet another card. You should either make it ask every time or preventing it from playing if there's already one out. Simply putting <May /> apparently isn't enough.

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="GEMSTONE_CAVERNS_122094" />
  <CARDNAME text="GEMSTONE_CAVERNS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cavernes aux gemmes]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cavernas de gemas]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Edelsteinhöhlen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Caverne di Gemme]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Самоцветные Пещеры]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Carvernas de Pedras Preciosas]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="122094" />
  <ARTID value="122094" />
  <ARTIST name="Martina Pilcerova" />
  <CASTING_COST cost="" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Land" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <TRIGGERED_ABILITY active_zone="ZONE_HAND">
  <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si les Cavernes aux gemmes sont dans votre main de départ et que vous ne jouez pas en premier, vous pouvez commencer la partie avec les Cavernes aux gemmes en jeu avec, sur elles, un marqueur « chance ». Si vous faites ainsi, retirez de la partie une carte de votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si las Cavernas de gemas están en tu mano inicial y no juegas primero, puedes comenzar el juego con las Cavernas de gemas en juego con un contador de suerte sobre ellas. Si lo haces, remueve del juego una carta de tu mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls die Edelsteinhöhlen auf deiner Anfangshand sind und du nicht als Erster an der Reihe bist, kannst du sie vor Spielbeginn mit einer Glücksmarke ins Spiel bringen. Falls du das tust, entferne eine Karte aus deiner Hand ganz aus dem Spiel.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se le Caverne di Gemme sono nella tua mano iniziale e non stai giocando per primo, puoi iniziare la partita mettendo nel campo di battaglia le Caverne di Gemme con un segnalino fortuna su di esse. Se lo fai, esilia una carta dalla tua mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟があなたのゲーム開始時の手札にあり、かつあなたが先攻でない場合、あなたはそれが運勢カウンターを1個置いて場に出ている状態でゲームを開始してもよい。 そうした場合、あなたの手札にあるカードを1枚ゲームから取り除く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если Самоцветные Пещеры пришли к вам в начальную руку и вы не ходите первым, вы можете начать игру с Самоцветными Пещерами в игре с одним жетоном удачи на них. Если вы это сделали, уберите одну карту в вашей руке из игры.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se Carvernas de Pedras Preciosas estiver em sua mão de abertura e você não for o primeiro a jogar, você pode começar o jogo com Carvernas de Pedras Preciosas em jogo com um marcador de sorte sobre ela. Se fizer isso, remova do jogo um card de sua mão.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP">
      return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
        EffectSource():PutOntoBattlefield( EffectController() )
      end
    </RESOLUTION_TIME_ACTION>
    <MAY />
    <AUTO_SKIP always="1" />
    <RESOLUTION_TIME_ACTION>
      local filter = ClearFilter()
      filter:SetZone( ZONE_HAND, EffectController() )
      EffectController():ChooseItem( "CARD_QUERY_CHOOSE_CARD_TO_EXILE", EffectDC():Make_Targets(38) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(38):Get_CardPtr(0)
      if target ~= nil then
        EffectDC():Get_Targets(38):Protect_CardPtr(0)
        target:Exile()
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_HAND">
      return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <COUNTER_REGISTRATION name="Luck" proliferate="11" />
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
        EffectSource():AddCounters( MTG():GetCountersType("Luck"), 1)
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY forced_skip= "1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : Ajoutez {1} à votre réserve. Si les Cavernes aux gemmes ont un marqueur « chance » sur elles, ajoutez un mana de la couleur de votre choix à votre réserve à la place.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {1} a tu reserva de maná. Si las Cavernas de gemas tienen un contador de suerte sobre ellas, en vez de eso, agrega un maná de cualquier color a tu reserva de maná.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {1} alla tua riserva di mana. Se le Caverne di Gemme hanno su di esse un segnalino fortuna, aggiungi invece un mana di qualsiasi colore alla tua riserva di mana.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{1}を加える。 宝石の洞窟に運勢カウンターが置かれている場合、代わりにあなたのマナ・プールに好きな色1色のマナ1点を加える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Добавьте {1} в ваше хранилище маны. Если на Самоцветных Пещерах есть жетон удачи, добавьте вместо этого одну ману любого цвета в ваше хранилище маны.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {1} à sua reserva de mana. Se Carvernas de Pedras Preciosas tiver um marcador de sorte sobre ela, em vez disso, adicione um mana de qualquer cor à sua reserva de mana.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加{1}到你的法术力池中。 如果宝石洞穴上面有运气指示物,则改为加一点任意颜色的法术力到你的法术力池中。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <PLAY_TIME_ACTION>
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        RSN_MarkManaAbilityStart()
        local oPlayer = EffectController()
        local oCard = EffectSource()
        if (oPlayer ~= nil) then
          oPlayer:BeginNewMultipleChoice()
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G" )
          oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard )
        end
      end
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        local nColour = EffectController():GetMultipleChoiceResult() + 1
        if (nColour == COLOUR_BLACK) then
          RSN_Produce( "{B}", 1 )
        elseif (nColour == COLOUR_BLUE) then
          RSN_Produce( "{U}", 1 )
        elseif (nColour == COLOUR_GREEN) then
          RSN_Produce( "{G}", 1 )
        elseif (nColour == COLOUR_RED) then
          RSN_Produce( "{R}", 1 )
        elseif (nColour == COLOUR_WHITE) then
          RSN_Produce( "{W}", 1 )
        end
      else
        RSN_Produce( "{1}", 1 )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      RSN_EliminateExtraManaTokens()
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      S_DisplayManaPool(EffectController())
      RSN_MarkManaAbilityEnd()
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY window_step="upkeep" type="window" />
    <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_blockers" type="window" />
    <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY type="in_response" response_target="1" />
  </ACTIVATED_ABILITY>
  <STATIC_ABILITY>
    <CONTINUOUS_ACTION layer="0">
      RSN_ClearCanProduceMana()
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        RSN_MarkCanProduceMana( "{B}{G}{R}{U}{W}" )
      else
        RSN_MarkCanProduceMana( "{1}" )
      end
    </CONTINUOUS_ACTION>
    <CONTINUOUS_ACTION layer="8">
      local oCard = EffectSource()
      if (RSN_CheckSwitchToFallback( oCard )) then
        local oCharacteristics = oCard:GetCurrentCharacteristics()
        if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
          local nDefaultColour = COLOUR_GREEN
          local nColour = RSN_GetLastProducedColour()
          if (nColour ~= COLOUR_COLOURLESS) then
            oCharacteristics:GrantAbility( nColour )
          else
            oCharacteristics:GrantAbility( nDefaultColour )
          end
        else
          oCharacteristics:GrantAbility( 0 )
        end
      end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
    <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
    <RESOLUTION_TIME_ACTION>
      RSN_ClearProducedMana()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <MANA_ABILITY resource_id="0">
    <COST type="TapSelf" />
    <PRODUCES amount="{1}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="1">
    <COST type="TapSelf" />
    <PRODUCES amount="{W}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="2">
    <COST type="TapSelf" />
    <PRODUCES amount="{U}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="3">
    <COST type="TapSelf" />
    <PRODUCES amount="{B}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="4">
    <COST type="TapSelf" />
    <PRODUCES amount="{R}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="5">
    <COST type="TapSelf" />
    <PRODUCES amount="{G}" />
  </MANA_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_B" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_G" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_R" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_U" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_W" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_C" />
</CARD_V2>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby fallenangle » 30 Oct 2014, 21:42

I actually used an alternate fix using static abilities, continuous action, and granted abilities, so that it grants one or the other ability depending on whether the luck counter is there or not. Your solution is a lot more elegant, however. As for the issue you mentioned, I've run into the same problem coding Serum Powder, but I've never been forced to exile cards because of it. You just have to tell the game not to put the exiled Gemstone Caverns on the battlefield when prompted, and it shouldn't force you to play it, though you do have to answer the prompt once for each Caverns because the trigger fires from when the card was in your hand, even when you've exiled it. I'm not quite sure how to fix this issue; but it doesn't seem to be very major. Thanks again for all of your help and pointers in coding this crazy card!
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: Formal Request Thread

Postby Xander9009 » 31 Oct 2014, 00:29

fallenangle wrote:I actually used an alternate fix using static abilities, continuous action, and granted abilities, so that it grants one or the other ability depending on whether the luck counter is there or not. Your solution is a lot more elegant, however. As for the issue you mentioned, I've run into the same problem coding Serum Powder, but I've never been forced to exile cards because of it. You just have to tell the game not to put the exiled Gemstone Caverns on the battlefield when prompted, and it shouldn't force you to play it, though you do have to answer the prompt once for each Caverns because the trigger fires from when the card was in your hand, even when you've exiled it. I'm not quite sure how to fix this issue; but it doesn't seem to be very major. Thanks again for all of your help and pointers in coding this crazy card!
<MAY always_prompt="1"> will make it always ask instead of just automatically doing it even if the game setting "Always use optional abilities" is active (which mine is, and that's why I didn't get the prompts).

Setting the ability that adds the luck counter as a resource ability (with resource_id="0") and making a delayed trigger so it will only fire if the ability is actually used makes the card much closer to perfectly rule compliant.

Because I can't resist a riddle... | Open
There is technically one tiny problem with the ability. The player should choose which cards to be on the battlefield as the game starts, THEN cards should be chosen for exile. The only case I could think of where this would have any impact at all is if you start the game with 3 or 4 caverns and only 1 or 2 other cards, respectively (at least 2 more caverns than other cards). You SHOULD be able to play all caverns and exile all other cards with all but one cavern ending up in the graveyard and an empty hand. In reality, the way the ability is coded, you can't end up like that. When you play one, you must exile something. This means at some point, you'll be forced to exile your remaining cavern, meaning you can't end up with all of them in the graveyard. If someone can tell me when this will cause problems, feel free. As far as I'm concerned, this approximation is unlikely to EVER be noticed in actual gameplay.


Finally, an <INTERVENING_IF> can short-circuit the MAY clause. It won't ask if the intervening if returns false. So, checking if it's in your hand in an intervening if makes each individual card only prompt you if it's still in your hand, preventing you from being bothered by the unnecessary popups.

This is tested and I didn't have any problems with it. Only prompts if it's still in your hand, always asks to use the ability if possible, only adds the counter if the ability it used, properly handles colorless vs rainbow mana,
Gemstone Caverns | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="GEMSTONE_CAVERNS_122094" />
  <CARDNAME text="GEMSTONE_CAVERNS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cavernes aux gemmes]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cavernas de gemas]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Edelsteinhöhlen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Caverne di Gemme]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gemstone Caverns]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Самоцветные Пещеры]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Carvernas de Pedras Preciosas]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="122094" />
  <ARTID value="122094" />
  <ARTIST name="Martina Pilcerova" />
  <CASTING_COST cost="" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Land" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <TRIGGERED_ABILITY active_zone="ZONE_HAND">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si les Cavernes aux gemmes sont dans votre main de départ et que vous ne jouez pas en premier, vous pouvez commencer la partie avec les Cavernes aux gemmes en jeu avec, sur elles, un marqueur « chance ». Si vous faites ainsi, retirez de la partie une carte de votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si las Cavernas de gemas están en tu mano inicial y no juegas primero, puedes comenzar el juego con las Cavernas de gemas en juego con un contador de suerte sobre ellas. Si lo haces, remueve del juego una carta de tu mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls die Edelsteinhöhlen auf deiner Anfangshand sind und du nicht als Erster an der Reihe bist, kannst du sie vor Spielbeginn mit einer Glücksmarke ins Spiel bringen. Falls du das tust, entferne eine Karte aus deiner Hand ganz aus dem Spiel.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se le Caverne di Gemme sono nella tua mano iniziale e non stai giocando per primo, puoi iniziare la partita mettendo nel campo di battaglia le Caverne di Gemme con un segnalino fortuna su di esse. Se lo fai, esilia una carta dalla tua mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[宝石の洞窟があなたのゲーム開始時の手札にあり、かつあなたが先攻でない場合、あなたはそれが運勢カウンターを1個置いて場に出ている状態でゲームを開始してもよい。 そうした場合、あなたの手札にあるカードを1枚ゲームから取り除く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If Gemstone Caverns is in your opening hand and you’re not playing first, you may begin the game with Gemstone Caverns on the battlefield with a luck counter on it. If you do, exile a card from your hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если Самоцветные Пещеры пришли к вам в начальную руку и вы не ходите первым, вы можете начать игру с Самоцветными Пещерами в игре с одним жетоном удачи на них. Если вы это сделали, уберите одну карту в вашей руке из игры.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se Carvernas de Pedras Preciosas estiver em sua mão de abertura e você não for o primeiro a jogar, você pode começar o jogo com Carvernas de Pedras Preciosas em jogo com um marcador de sorte sobre ela. Se fizer isso, remova do jogo um card de sua mão.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP">
      return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <INTERVENING_IF>
      return EffectSource() ~= nil and EffectSource():GetZone() == ZONE_HAND
    </INTERVENING_IF>
    <RESOLUTION_TIME_ACTION>
      EffectSource():PutOntoBattlefield( EffectController() )
      local DelayDC = EffectDC():Make_Chest(0)
      MTG():CreateDelayedTrigger(0, DelayDC)
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local filter = ClearFilter()
      filter:SetZone( ZONE_HAND, EffectController() )
      EffectController():ChooseItem( "CARD_QUERY_CHOOSE_CARD_TO_EXILE", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target ~= nil then
        target:Exile()
      end
    </RESOLUTION_TIME_ACTION>
    <MAY always_prompt="1">
         -- AI behaviour
         return EffectSource() ~= nil and EffectSource():GetZone() == ZONE_HAND
      </MAY>
    <AUTO_SKIP always="1" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION" resource_id="0" >
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_HAND">
      return EffectController():MyTurn() == false and MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <COUNTER_REGISTRATION name="Luck" proliferate="11" />
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
        EffectSource():AddCounters( MTG():GetCountersType("Luck"), 1)
      end
    </RESOLUTION_TIME_ACTION>
    <CLEANUP fire_once="1" />
  </TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY forced_skip= "1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : Ajoutez {1} à votre réserve. Si les Cavernes aux gemmes ont un marqueur « chance » sur elles, ajoutez un mana de la couleur de votre choix à votre réserve à la place.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {1} a tu reserva de maná. Si las Cavernas de gemas tienen un contador de suerte sobre ellas, en vez de eso, agrega un maná de cualquier color a tu reserva de maná.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {1}. Wenn Gemstone Caverns hat ein Glück-Marke liegt, anstatt um ein Mana einer beliebigen Farbe deinen Manavorrat.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {1} alla tua riserva di mana. Se le Caverne di Gemme hanno su di esse un segnalino fortuna, aggiungi invece un mana di qualsiasi colore alla tua riserva di mana.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{1}を加える。 宝石の洞窟に運勢カウンターが置かれている場合、代わりにあなたのマナ・プールに好きな色1色のマナ1点を加える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Добавьте {1} в ваше хранилище маны. Если на Самоцветных Пещерах есть жетон удачи, добавьте вместо этого одну ману любого цвета в ваше хранилище маны.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {1} à sua reserva de mana. Se Carvernas de Pedras Preciosas tiver um marcador de sorte sobre ela, em vez disso, adicione um mana de qualquer cor à sua reserva de mana.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T}:加{1}到你的法术力池中。 如果宝石洞穴上面有运气指示物,则改为加一点任意颜色的法术力到你的法术力池中。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T}: Add {1} to your mana pool. If Gemstone Caverns has a luck counter on it, instead add one mana of any color to your mana pool.]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <PLAY_TIME_ACTION>
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        RSN_MarkManaAbilityStart()
        local oPlayer = EffectController()
        local oCard = EffectSource()
        if (oPlayer ~= nil) then
          oPlayer:BeginNewMultipleChoice()
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_W" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_U" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_B" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_R" )
          oPlayer:AddMultipleChoiceAnswer( "RSN_MODE_PRODUCE_G" )
          oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard )
        end
      end
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        local nColour = EffectController():GetMultipleChoiceResult() + 1
        if (nColour == COLOUR_BLACK) then
          RSN_Produce( "{B}", 1 )
        elseif (nColour == COLOUR_BLUE) then
          RSN_Produce( "{U}", 1 )
        elseif (nColour == COLOUR_GREEN) then
          RSN_Produce( "{G}", 1 )
        elseif (nColour == COLOUR_RED) then
          RSN_Produce( "{R}", 1 )
        elseif (nColour == COLOUR_WHITE) then
          RSN_Produce( "{W}", 1 )
        end
      else
        RSN_Produce( "{1}", 1 )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      RSN_EliminateExtraManaTokens()
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      S_DisplayManaPool(EffectController())
      RSN_MarkManaAbilityEnd()
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY window_step="upkeep" type="window" />
    <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_blockers" type="window" />
    <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY type="in_response" response_target="1" />
  </ACTIVATED_ABILITY>
  <STATIC_ABILITY>
    <CONTINUOUS_ACTION layer="0">
      RSN_ClearCanProduceMana()
      if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
        RSN_MarkCanProduceMana( "{B}{G}{R}{U}{W}" )
      else
        RSN_MarkCanProduceMana( "{1}" )
      end
    </CONTINUOUS_ACTION>
    <CONTINUOUS_ACTION layer="8">
      local oCard = EffectSource()
      if (RSN_CheckSwitchToFallback( oCard )) then
        local oCharacteristics = oCard:GetCurrentCharacteristics()
        if EffectSource() ~= nil and EffectSource():CountCounters(MTG():GetCountersType("Luck")) &gt;= 1 then
          local nDefaultColour = COLOUR_GREEN
          local nColour = RSN_GetLastProducedColour()
          if (nColour ~= COLOUR_COLOURLESS) then
            oCharacteristics:GrantAbility( nColour )
          else
            oCharacteristics:GrantAbility( nDefaultColour )
          end
        else
          oCharacteristics:GrantAbility( 0 )
        end
      end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
    <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
    <RESOLUTION_TIME_ACTION>
      RSN_ClearProducedMana()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <MANA_ABILITY resource_id="0">
    <COST type="TapSelf" />
    <PRODUCES amount="{1}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="1">
    <COST type="TapSelf" />
    <PRODUCES amount="{W}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="2">
    <COST type="TapSelf" />
    <PRODUCES amount="{U}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="3">
    <COST type="TapSelf" />
    <PRODUCES amount="{B}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="4">
    <COST type="TapSelf" />
    <PRODUCES amount="{R}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="5">
    <COST type="TapSelf" />
    <PRODUCES amount="{G}" />
  </MANA_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_B" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_G" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_R" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_U" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_W" />
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_C" />
</CARD_V2>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Oct 2014, 15:52

I need an help to debug the following card, i would know if there are some interactions that make it not work properly.
The card is :
Generator Servant
Generator Servant - Neo Ver 1.0 | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="NEO_M15_143_GENERATOR_SERVANT_915383254" />
  <CARDNAME text="GENERATOR_SERVANT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Generator Servant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Servant du générateur]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sirviente generador]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Generatordiener]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Servo Generatore]]></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[Servo Gerador]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[电机仆役]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[電機僕役]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="915383254" />
  <ARTID value="915383254" />
  <ARTIST name="Mathias Kollros" />
  <CASTING_COST cost="{1}{R}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Elemental" />
  <EXPANSION value="M15" />
  <RARITY metaname="C" />
  <POWER value="2" />
  <TOUGHNESS value="1" />
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}, Sacrifice Generator Servant: Add {2} to your mana pool. If that mana is spent on a creature spell, it gains haste until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}, sacrifiez le Servant du générateur : Ajoutez {2} à votre réserve. Si ce mana est dépensé pour un sort de créature, cette créature acquiert la célérité.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}, sacrificar el Sirviente generador: Agrega {2} a tu reserva de maná. Si ese maná se usa en un hechizo de criatura, esa criatura gana la habilidad de prisa hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}, opfere den Generatordiener: Erhöhe deinen Manavorrat um {2}. Falls dieses Mana für einen Kreaturenzauber verwendet wird, erhält diese Kreatur Eile bis zum Ende des Zuges.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}, Sacrifica il Servo Generatore: Aggiungi {2} alla tua riserva di mana. Se quel mana viene speso per una magia creatura, quella creatura ha rapidità fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}, 発生器の召使いを生け贄に捧げる:あなたのマナ・プールに{2}を加える。このマナがクリーチャー・呪文のために使用されたなら、そのクリーチャーはターン終了時まで速攻を得る。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}, 발전기 하수인을 희생한다: {2}를 당신의 마나풀에 담는다. 그 마나가 생물 주문에 지불된다면, 그 생물은 턴종료까지 신속을 얻는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}, пожертвуйте Слугу-Генератор: добавьте {2} в ваше хранилище маны. Если та мана тратится на заклинание существа, то существо получает Ускорение до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}, Sacrifique Servo Gerador: Adicione {2} à sua reserva de mana. Se esse mana for gasto em uma mágica de criatura, ela ganha ímpeto até o final do turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T},牺牲电机仆役:加{2}到你的法术力池中。如果该法术力用以支付生物咒语,则该生物获得敏捷异能直到回合结束。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T},犧牲電機僕役:加{2}到你的魔法力池中。如果該魔法力用以支付生物咒語,則該生物獲得敏捷異能直到回合結束。]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <COST type="SacrificeSelf" />
    <RESOLUTION_TIME_ACTION>
    local delayDC = EffectDC():Make_Chest(1)
         local oChest = delayDC:Make_Chest(0)
         EffectDC():Set_Int(10, MTG():GetStep())
         RSN_ProduceForPlayerNoTrigger( "{1}", 2, EffectController() )
         local oTokens = RSN_GetProducedTokenChest()
         if oTokens ~= nil then
       for i = 0, (2-1) do
                if oTokens:Get_CardPtr( i ) ~= nil then
               oChest:Set_CardPtr( i, oTokens:Get_CardPtr( i ) )
                end
       end
         end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
           RSN_EliminateExtraManaTokens()
    </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
   S_DisplayManaPool(EffectController())
   </RESOLUTION_TIME_ACTION>
   <CONTINUOUS_ACTION layer="6">
    local i = 0
    local delayDC = EffectDC():Get_Chest(1)
    if delayDC ~= nil then
       local token_chest = delayDC:Get_Chest(0)
       if token_chest ~= nil then
         local token = token_chest:Get_NthCardPtr(i)
          if token ~= nil then
             token:GetCurrentCharacteristics():GrantAbility(1)
             token:GetCurrentCharacteristics():GrantAbility(2)
             token:GetCurrentCharacteristics():GrantAbility(3)
          end
         while (token ~= nil) do
          i = i + 1
          token = token_chest:Get_NthCardPtr(i)
                if token ~= nil then
                   token:GetCurrentCharacteristics():GrantAbility(1)
                   token:GetCurrentCharacteristics():GrantAbility(2)
                   token:GetCurrentCharacteristics():GrantAbility(3)
                end
          end
       end
    end
    </CONTINUOUS_ACTION>
     <DURATION>
       local ActualStep = EffectDC():Get_Int(10)
       return MTG():GetStep() &gt; ActualStep
     </DURATION>
   <AI_AVAILABILITY type="in_response" response_source="1" />
   <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_blockers" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" type="window" />
   <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
  </ACTIVATED_ABILITY>

 <TRIGGERED_ABILITY resource_id="1" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol" pre_trigger="1" >
   if TriggerObject() ~= nil then
      LinkedDC():Set_CardPtr(5, TriggerObject())       
      LinkedDC():Protect_CardPtr(5)   
   end
   return false
  </TRIGGER>
  </TRIGGERED_ABILITY>

 <TRIGGERED_ABILITY resource_id="2" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="ABILITY_PLAYED" simple_qualifier="objectyoucontrol" pre_trigger="1" >
   if TriggerObject() ~= nil and TriggerObject() ~= EffectSource() then
      LinkedDC():Clear()       
   end
   return false
  </TRIGGER>
  </TRIGGERED_ABILITY>

 <TRIGGERED_ABILITY resource_id="3" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="BECAME_TAPPED" simple_qualifier="self" pre_trigger="1">
    if LinkedDC():Get_CardPtr(5) ~= nil then
       local card = LinkedDC():Get_CardPtr(5)
       if card:GetCardType():Test(CARD_TYPE_CREATURE) then
          EffectDC():Set_CardPtr(3, card)
          EffectDC():Protect_CardPtr(3)
          return true
       end
    end
    return false
  </TRIGGER>
   <CONTINUOUS_ACTION layer="6">
    local target = EffectDC():Get_CardPtr(3)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_HASTE, 1 )
    end
    </CONTINUOUS_ACTION>
   <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
 <AI_BASE_SCORE score="450" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
Generator Servant.rar
Generator Servant - Neo Ver 1.0
(106.6 KiB) Downloaded 466 times
I would also know if someone has an idea how to fix Ob Nixilis, Unshackled here you can find the topic i opened :
Ob Nixilis, Unshackled need to be fixed
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby Xander9009 » 31 Oct 2014, 16:44

NeoAnderson wrote:I need an help to debug the following card, i would know if there are some interactions that make it not work properly.
The card is :
Generator Servant
Generator Servant - Neo Ver 1.0 | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="NEO_M15_143_GENERATOR_SERVANT_915383254" />
  <CARDNAME text="GENERATOR_SERVANT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Generator Servant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Servant du générateur]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sirviente generador]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Generatordiener]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Servo Generatore]]></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[Servo Gerador]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[电机仆役]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[電機僕役]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="915383254" />
  <ARTID value="915383254" />
  <ARTIST name="Mathias Kollros" />
  <CASTING_COST cost="{1}{R}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Elemental" />
  <EXPANSION value="M15" />
  <RARITY metaname="C" />
  <POWER value="2" />
  <TOUGHNESS value="1" />
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}, Sacrifice Generator Servant: Add {2} to your mana pool. If that mana is spent on a creature spell, it gains haste until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}, sacrifiez le Servant du générateur : Ajoutez {2} à votre réserve. Si ce mana est dépensé pour un sort de créature, cette créature acquiert la célérité.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}, sacrificar el Sirviente generador: Agrega {2} a tu reserva de maná. Si ese maná se usa en un hechizo de criatura, esa criatura gana la habilidad de prisa hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}, opfere den Generatordiener: Erhöhe deinen Manavorrat um {2}. Falls dieses Mana für einen Kreaturenzauber verwendet wird, erhält diese Kreatur Eile bis zum Ende des Zuges.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}, Sacrifica il Servo Generatore: Aggiungi {2} alla tua riserva di mana. Se quel mana viene speso per una magia creatura, quella creatura ha rapidità fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}, 発生器の召使いを生け贄に捧げる:あなたのマナ・プールに{2}を加える。このマナがクリーチャー・呪文のために使用されたなら、そのクリーチャーはターン終了時まで速攻を得る。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}, 발전기 하수인을 희생한다: {2}를 당신의 마나풀에 담는다. 그 마나가 생물 주문에 지불된다면, 그 생물은 턴종료까지 신속을 얻는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}, пожертвуйте Слугу-Генератор: добавьте {2} в ваше хранилище маны. Если та мана тратится на заклинание существа, то существо получает Ускорение до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}, Sacrifique Servo Gerador: Adicione {2} à sua reserva de mana. Se esse mana for gasto em uma mágica de criatura, ela ganha ímpeto até o final do turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{T},牺牲电机仆役:加{2}到你的法术力池中。如果该法术力用以支付生物咒语,则该生物获得敏捷异能直到回合结束。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{T},犧牲電機僕役:加{2}到你的魔法力池中。如果該魔法力用以支付生物咒語,則該生物獲得敏捷異能直到回合結束。]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <COST type="SacrificeSelf" />
    <RESOLUTION_TIME_ACTION>
    local delayDC = EffectDC():Make_Chest(1)
         local oChest = delayDC:Make_Chest(0)
         EffectDC():Set_Int(10, MTG():GetStep())
         RSN_ProduceForPlayerNoTrigger( "{1}", 2, EffectController() )
         local oTokens = RSN_GetProducedTokenChest()
         if oTokens ~= nil then
       for i = 0, (2-1) do
                if oTokens:Get_CardPtr( i ) ~= nil then
               oChest:Set_CardPtr( i, oTokens:Get_CardPtr( i ) )
                end
       end
         end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
           RSN_EliminateExtraManaTokens()
    </RESOLUTION_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
   S_DisplayManaPool(EffectController())
   </RESOLUTION_TIME_ACTION>
   <CONTINUOUS_ACTION layer="6">
    local i = 0
    local delayDC = EffectDC():Get_Chest(1)
    if delayDC ~= nil then
       local token_chest = delayDC:Get_Chest(0)
       if token_chest ~= nil then
         local token = token_chest:Get_NthCardPtr(i)
          if token ~= nil then
             token:GetCurrentCharacteristics():GrantAbility(1)
             token:GetCurrentCharacteristics():GrantAbility(2)
             token:GetCurrentCharacteristics():GrantAbility(3)
          end
         while (token ~= nil) do
          i = i + 1
          token = token_chest:Get_NthCardPtr(i)
                if token ~= nil then
                   token:GetCurrentCharacteristics():GrantAbility(1)
                   token:GetCurrentCharacteristics():GrantAbility(2)
                   token:GetCurrentCharacteristics():GrantAbility(3)
                end
          end
       end
    end
    </CONTINUOUS_ACTION>
     <DURATION>
       local ActualStep = EffectDC():Get_Int(10)
       return MTG():GetStep() &gt; ActualStep
     </DURATION>
   <AI_AVAILABILITY type="in_response" response_source="1" />
   <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
   <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
   <AI_AVAILABILITY window_step="declare_blockers" type="window" />
   <AI_AVAILABILITY window_step="end_of_turn" type="window" />
   <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
  </ACTIVATED_ABILITY>

 <TRIGGERED_ABILITY resource_id="1" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol" pre_trigger="1" >
   if TriggerObject() ~= nil then
      LinkedDC():Set_CardPtr(5, TriggerObject())       
      LinkedDC():Protect_CardPtr(5)   
   end
   return false
  </TRIGGER>
  </TRIGGERED_ABILITY>

 <TRIGGERED_ABILITY resource_id="2" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="ABILITY_PLAYED" simple_qualifier="objectyoucontrol" pre_trigger="1" >
   if TriggerObject() ~= nil and TriggerObject() ~= EffectSource() then
      LinkedDC():Clear()       
   end
   return false
  </TRIGGER>
  </TRIGGERED_ABILITY>

 <TRIGGERED_ABILITY resource_id="3" linked_ability_group="1" replacement_effect="1">
  <TRIGGER value="BECAME_TAPPED" simple_qualifier="self" pre_trigger="1">
    if LinkedDC():Get_CardPtr(5) ~= nil then
       local card = LinkedDC():Get_CardPtr(5)
       if card:GetCardType():Test(CARD_TYPE_CREATURE) then
          EffectDC():Set_CardPtr(3, card)
          EffectDC():Protect_CardPtr(3)
          return true
       end
    end
    return false
  </TRIGGER>
   <CONTINUOUS_ACTION layer="6">
    local target = EffectDC():Get_CardPtr(3)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_HASTE, 1 )
    end
    </CONTINUOUS_ACTION>
   <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
 <AI_BASE_SCORE score="450" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
I would also know if someone has an idea how to fix Ob Nixilis, Unshackled here you can find the topic i opened :
Ob Nixilis, Unshackled need to be fixed
I've got the tab open for Ob Nixilis, Unshackled, but I haven't had time to look at it yet much yet. As far as I can tell, there's no way to restrict it the way you need to without recoding all cards that allow you to search a library so they can inform you what was searched.
Actually, I suppose you wouldn't need to recode all cards that search libraries. You'd only need to recode cards that let you search other's libraries. A much smaller number (35 to be exact). Have those cards grant Ob Nixilis a delayed triggered ability for searching libraries just before they search someone else's, and then reset it once the ability has fired. Well, something to that effect, at least, since the way I just said it almost definitely wouldn't work, but you're a fantastic coder, so you can probably figure it out from there if you want to make it rule compliant. It would be like TFM's scry function, more or less (in that, in order for Ob Nixilis to work, all instances of relevant library searches must be coded properly with this version of the function). The good news is that you should be able to put the necessary code to avoid Ob's ability firing into a single function and just paste that ability into each card that searches another player's library.

FYI: of the 35 total cards that search another player's library, only 4 have been coded (well, only 4 are in the CW). Bribery, Jace, Architect of Thought, Mimeofacture, and Slaughter Games.

As for Generator Servant, I can only think of two potential issues.

1: I don't know if cards that make things produce more mana when they would normally produce mana do so by increasing the amount produced or by adding it on separately as far as the rules are concerned. If it's by increasing the amount, then I don't think we can really account for this except by recoding all cards which make things produce extra mana. I think the mana is supposed to be separate, and thus should not be restricted to creature spells and should not grant haste, but I don't know for sure.

2: As I mentioned before to Riiak, since we can't control which mana tokens are used to cast which spells, if you were to have out a Generator Servant and an Academy Ruins, then casting an Alpha Myr and an Arcbound Worker would not necessarily grant them both haste. You would usually be able to simple cast the Arcbound Worker first before tapping the Academy Ruins, but there are possible situations (albeit probably very rare) in which the Alpha Myr would need to be cast first. In that case, Generator Servant and Academy Ruins both must be tapped to have one haste-granting mana and one normal mana to cast Alpha Myr, but you can't decide which combination of mana gets used. And if it uses the wrong combination, then your Arcbound Worker doesn't get haste like it should. This will be rare and not a big issue even when it happens, so as long as the card is working, I see no reason to worry about it. I couldn't manage to get the theoretical solution I mentioned before working, so unless someone does, this is the best we can get, and as for as I'm concerned, it's close enough. (Note: I haven't actually looked for bugs or anything. Hopefully that's not what you were hoping for.)

I do have a question merely out of curiosity, though. Here:
| Open
Code: Select all
<CONTINUOUS_ACTION layer="6">
  local i = 0
  local delayDC = EffectDC():Get_Chest(1)
  if delayDC ~= nil then
    local token_chest = delayDC:Get_Chest(0)
    if token_chest ~= nil then
      local token = token_chest:Get_NthCardPtr(i)
      if token ~= nil then
        token:GetCurrentCharacteristics():GrantAbility(1)
        token:GetCurrentCharacteristics():GrantAbility(2)
        token:GetCurrentCharacteristics():GrantAbility(3)
      end
      while (token ~= nil) do
        i = i + 1
        token = token_chest:Get_NthCardPtr(i)
        if token ~= nil then
          token:GetCurrentCharacteristics():GrantAbility(1)
          token:GetCurrentCharacteristics():GrantAbility(2)
          token:GetCurrentCharacteristics():GrantAbility(3)
        end
      end
    end
  end
</CONTINUOUS_ACTION>
how come you don't just combine those into this:
Code: Select all
<CONTINUOUS_ACTION layer="6">
  local i = 0
  local delayDC = EffectDC():Get_Chest(1)
  if delayDC ~= nil then
    local token_chest = delayDC:Get_Chest(0)
    if token_chest ~= nil then
      local token = token_chest:Get_NthCardPtr(i)
      while (token ~= nil) do
        token = token_chest:Get_NthCardPtr(i)
        if token ~= nil then
          token:GetCurrentCharacteristics():GrantAbility(1)
          token:GetCurrentCharacteristics():GrantAbility(2)
          token:GetCurrentCharacteristics():GrantAbility(3)
        end
        i = i + 1
      end
    end
  end
</CONTINUOUS_ACTION>
I mean, obviously there's nothing wrong with how it is; I'm just wondering why the redundancy?

EDIT: For the 35 total cards, I just counted the cards hereand skipped the few that didn't fit. The search might have missed a couple.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Oct 2014, 17:20

Xander9009 wrote:Actually, I suppose you wouldn't need to recode all cards that search libraries. You'd only need to recode cards that let you search other's libraries. A much smaller number (35 to be exact). Have those cards grant Ob Nixilis a delayed triggered ability for searching libraries just before they search someone else's, and then reset it once the ability has fired. Well, something to that effect, at least, since the way I just said it almost definitely wouldn't work, but you're a fantastic coder, so you can probably figure it out from there if you want to make it rule compliant. It would be like TFM's scry function, more or less (in that, in order for Ob Nixilis to work, all instances of relevant library searches must be coded properly with this version of the function). The good news is that you should be able to put the necessary code to avoid Ob's ability firing into a single function and just paste that ability into each card that searches another player's library.
FYI: of the 35 total cards that search another player's library, only 4 have been coded (well, only 4 are in the CW). Bribery, Jace, Architect of Thought, Mimeofacture, and Slaughter Games.
EDIT: For the 35 total cards, I just counted the cards hereand skipped the few that didn't fit. The search might have missed a couple.
I also tought to make a function to check the spells who allows to search opponent's library, but the main problem is that we have to fight with cards that allows to search "a target player's library" in this case will most complicated to undestand exactly which library was searched (Example :Cranial Extraction).
Xander9009 wrote:As for Generator Servant, I can only think of two potential issues.
1: I don't know if cards that make things produce more mana when they would normally produce mana do so by increasing the amount produced or by adding it on separately as far as the rules are concerned. If it's by increasing the amount, then I don't think we can really account for this except by recoding all cards which make things produce extra mana. I think the mana is supposed to be separate, and thus should not be restricted to creature spells and should not grant haste, but I don't know for sure.

2: As I mentioned before to Riiak, since we can't control which mana tokens are used to cast which spells, if you were to have out a Generator Servant and an Academy Ruins, then casting an Alpha Myr and an Arcbound Worker would not necessarily grant them both haste. You would usually be able to simple cast the Arcbound Worker first before tapping the Academy Ruins, but there are possible situations (albeit probably very rare) in which the Alpha Myr would need to be cast first. In that case, Generator Servant and Academy Ruins both must be tapped to have one haste-granting mana and one normal mana to cast Alpha Myr, but you can't decide which combination of mana gets used. And if it uses the wrong combination, then your Arcbound Worker doesn't get haste like it should. This will be rare and not a big issue even when it happens, so as long as the card is working, I see no reason to worry about it. I couldn't manage to get the theoretical solution I mentioned before working, so unless someone does, this is the best we can get, and as for as I'm concerned, it's close enough. (Note: I haven't actually looked for bugs or anything. Hopefully that's not what you were hoping for.)

I do have a question merely out of curiosity, though. Here:
| Open
Code: Select all
<CONTINUOUS_ACTION layer="6">
  local i = 0
  local delayDC = EffectDC():Get_Chest(1)
  if delayDC ~= nil then
    local token_chest = delayDC:Get_Chest(0)
    if token_chest ~= nil then
      local token = token_chest:Get_NthCardPtr(i)
      if token ~= nil then
        token:GetCurrentCharacteristics():GrantAbility(1)
        token:GetCurrentCharacteristics():GrantAbility(2)
        token:GetCurrentCharacteristics():GrantAbility(3)
      end
      while (token ~= nil) do
        i = i + 1
        token = token_chest:Get_NthCardPtr(i)
        if token ~= nil then
          token:GetCurrentCharacteristics():GrantAbility(1)
          token:GetCurrentCharacteristics():GrantAbility(2)
          token:GetCurrentCharacteristics():GrantAbility(3)
        end
      end
    end
  end
</CONTINUOUS_ACTION>
how come you don't just combine those into this:
Code: Select all
<CONTINUOUS_ACTION layer="6">
  local i = 0
  local delayDC = EffectDC():Get_Chest(1)
  if delayDC ~= nil then
    local token_chest = delayDC:Get_Chest(0)
    if token_chest ~= nil then
      local token = token_chest:Get_NthCardPtr(i)
      while (token ~= nil) do
        token = token_chest:Get_NthCardPtr(i)
        if token ~= nil then
          token:GetCurrentCharacteristics():GrantAbility(1)
          token:GetCurrentCharacteristics():GrantAbility(2)
          token:GetCurrentCharacteristics():GrantAbility(3)
        end
        i = i + 1
      end
    end
  end
</CONTINUOUS_ACTION>
I mean, obviously there's nothing wrong with how it is; I'm just wondering why the redundancy?
1. About the extra producing mana honestly i am also not sure if it should grant haste.
2. Theorically we could choose the mana combination to use just pressing "Ctrl" but the tokens are not visible so we cannot understand what is selected. Anyway i think we could live with an approxiamation, and as all other approximations has some limits, but i think there are really few cirmustances were this limitation is visible!
3. About the code you're right it is a bit redundant i just reused an old code i had, anyway both version would work.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby Xander9009 » 31 Oct 2014, 19:26

NeoAnderson wrote:I also thought to make a function to check the spells who allows to search opponent's library, but the main problem is that we have to fight with cards that allows to search "a target player's library" in this case will most complicated to understand exactly which library was searched (Example :Cranial Extraction).
Only way I can think of is utilizing the fact that every library-searching card also shuffles the library. You could potentially exploit the "SPELL_OR_ABILITY_CAUSED_SHUFFLE" trigger. See who shuffles as the spell resolves.

NeoAnderson wrote:1. About the extra producing mana honestly i am also not sure if it should grant haste.
Hopefully not, because I'm pretty sure we can't make it work (not without, once again, recoding all cards that grant extra mana and dang it it's just not worth it! haha).
NeoAnderson wrote:2. Theoretically we could choose the mana combination to use just pressing "Ctrl" but the tokens are not visible so we cannot understand what is selected. Anyway i think we could live with an approximation, and as all other approximations has some limits, but i think there are really few circumstances where this limitation is visible!
It might be worth trying to see exactly what method is used for determining the initially chosen mana and exactly how it changes when ctrl is pressed. If so, we could figure out how many times to press it. The result isn't really worth the effort, but as a curiosity it might be interesting.
NeoAnderson wrote:3. About the code you're right it is a bit redundant i just reused an old code i had, anyway both version would work.
I see. I can totally understand that seeing as a good 75% of all the coding I've ever done has been copy/paste haha (and I'm pretty sure that's true for most of us, so...).
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Oct 2014, 20:08

Xander9009 wrote:Only way I can think of is utilizing the fact that every library-searching card also shuffles the library. You could potentially exploit the "SPELL_OR_ABILITY_CAUSED_SHUFFLE" trigger. See who shuffles as the spell resolves.
I thought to use this trigger too, but i am not sure that all search force to shuffle the library.

Xander9009 wrote:Hopefully not, because I'm pretty sure we can't make it work (not without, once again, recoding all cards that grant extra mana and dang it it's just not worth it! haha).
I think it depends which card will produces the extra mana.

Xander9009 wrote:It might be worth trying to see exactly what method is used for determining the initially chosen mana and exactly how it changes when ctrl is pressed. If so, we could figure out how many times to press it. The result isn't really worth the effort, but as a curiosity it might be interesting.
Ok I let you play with this tests. :D

Xander9009 wrote:I see. I can totally understand that seeing as a good 75% of all the coding I've ever done has been copy/paste haha (and I'm pretty sure that's true for most of us, so...).
The amounts of cards coded left few time to revise a working code. So to gain time is more easy to copy and paste.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby Xander9009 » 31 Oct 2014, 20:20

NeoAnderson wrote:
Xander9009 wrote:Only way I can think of is utilizing the fact that every library-searching card also shuffles the library. You could potentially exploit the "SPELL_OR_ABILITY_CAUSED_SHUFFLE" trigger. See who shuffles as the spell resolves.
I thought to use this trigger too, but i am not sure that all search force to shuffle the library.
Doomsday is the only card which allows a player to search a library without shuffling. However, it's a single card which you could easily make a exception for. However, it searches your own library, so it doesn't even need the exception made.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Oct 2014, 20:41

Xander9009 wrote:
NeoAnderson wrote:
Xander9009 wrote:Only way I can think of is utilizing the fact that every library-searching card also shuffles the library. You could potentially exploit the "SPELL_OR_ABILITY_CAUSED_SHUFFLE" trigger. See who shuffles as the spell resolves.
I thought to use this trigger too, but i am not sure that all search force to shuffle the library.
Doomsday is the only card which allows a player to search a library without shuffling. However, it's a single card which you could easily make a exception for. However, it searches your own library, so it doesn't even need the exception made.
I have a doubt and i haven't tested. Cards that says : "Look at the top X cards of your library" does activate the search condition? Also Scry ability..

UPDATE: I just tested and it will not trigger with abilities that says : Look at top X cards of you library..and also with Scry.
So at least this seems to be ok.
Last edited by NeoAnderson on 01 Nov 2014, 00:41, edited 1 time in total.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby RiiakShiNal » 01 Nov 2014, 00:07

NeoAnderson wrote:1. About the extra producing mana honestly i am also not sure if it should grant haste.
2. Theorically we could choose the mana combination to use just pressing "Ctrl" but the tokens are not visible so we cannot understand what is selected. Anyway i think we could live with an approxiamation, and as all other approximations has some limits, but i think there are really few cirmustances were this limitation is visible!
3. About the code you're right it is a bit redundant i just reused an old code i had, anyway both version would work.
  1. No, cards that cause extra production of mana do not copy mana properties so there is no need to worry about extra mana being produced due to those effects. Additionally Generator Servant only mentions {2} mana and only if that mana is used to cast a creature spell should it give haste so you wouldn't need to worry about extra mana anyway.
  2. Theoretically we should be able to, except that in practice we can't select a different combination of mana of the same colour, but with different properties. DotP doesn't allow it, Colourless manais used first if the spell takes colourless mana (same type so DotP forces it's use instead of allowing to use coloured mana).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby NeoAnderson » 01 Nov 2014, 00:10

RiiakShiNal wrote:
  1. No, cards that cause extra production of mana do not copy mana properties so there is no need to worry about extra mana being produced due to those effects. Additionally Generator Servant only mentions {2} mana and only if that mana is used to cast a creature spell should it give haste so you wouldn't need to worry about extra mana anyway.
  2. Theoretically we should be able to, except that in practice we can't select a different combination of mana of the same colour, but with different properties. DotP doesn't allow it, Colourless manais used first if the spell takes colourless mana (same type so DotP forces it's use instead of allowing to use coloured mana).
Thanks for your pointing Riiak, so i think it could be a good approximation, the situations where we are limited by the game engine are really few! Would be great to receive also your opinion about the other card and "Search Library" issue.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby Xander9009 » 01 Nov 2014, 01:33

RiiakShiNal wrote:No, cards that cause extra production of mana do not copy mana properties so there is no need to worry about extra mana being produced due to those effects.
The issue I was thinking of was whether or not Mana Reflection should allow Generator Servant to grant up to 4 creatures haste. It won't, but I'm just not sure if that's correct or not.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 6 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 6 guests

Login Form