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

Descendant path help

Moderator: CCGHQ Admins

Descendant path help

Postby Scion of Darkness » 28 Mar 2013, 04:13

Ive made a descendant path but can't find a code to put only not creatures on the bottom of the deck =P can someone give a hand please

Code: Select all
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return ( (MTG():GetStep() == STEP_UPKEEP) and (TriggerPlayer() == EffectController()) and (TriggerPlayer():MyTurn() ~= 0) and (TriggerPlayer():Library_GetNth(0) ~= nil))
    </TRIGGER>
     <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter() 
    local player = EffectController()   
    filter:Clear() 
    filter:NotTargetted() 
    filter:SetPlayer( player ) 
    filter:SetZone( ZONE_LIBRARY ) 
    filter:SetPortion( 1 ) 
    player:SetTargetCount( 1 ) 
    player:SetTargetPrompt( 0, "CARD_QUERY_PLAY" ) 
    player:ChooseTargetsWithFlags( NO_VALIDATION, EffectDC():Make_Targets(0), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )   
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local spell = EffectDC():Get_Targets(0):Get_CardPtr(0)   
    local player = EffectController()
    if ( spell ~= nil ) then   
      local effectSource = Object()
      local spellSubtypes = spell:GetSubType()
      
      local filter = Object():GetFilter() 
      filter:Clear()
      filter:SetZone( ZONE_IN_PLAY )
      filter:SetSubTypes( spellSubtypes )
      filter:SetController( player )
      filter:SetCardInstance( effectSource )
      filter:AddExtra( FILTER_EXTRA_ANY_SUB_TYPE )
      filter:NotTargetted()
      local mycount = filter:Count()
      if mycount &gt; 0 then
         if spell:CanBePlayed( player ) then
            spell:PlayFreeFromAnywhere( player )
         end
      end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
User avatar
Scion of Darkness
 
Posts: 235
Joined: 27 Aug 2012, 13:14
Has thanked: 17 times
Been thanked: 23 times

Re: Descendant path help

Postby Persee » 28 Mar 2013, 07:11

PutInLibrary(-1)
User avatar
Persee
 
Posts: 168
Joined: 02 Jun 2011, 08:33
Has thanked: 42 times
Been thanked: 24 times

Re: Descendant path help

Postby thefiremind » 28 Mar 2013, 10:03

In order to make the card more user-friendly I'd suggest to ask if you want to play the card only when you can really play it.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, reveal the top card of your library. If it’s a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre entretien, révélez la carte du dessus de votre bibliothèque. Si c’est une carte de créature qui partage un type de créature avec une créature que vous contrôlez, vous pouvez lancer cette carte sans payer son coût de mana. Sinon, mettez-la au-dessous de votre bibliothèque.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu mantenimiento, muestra la primera carta de tu biblioteca. Si es una carta de criatura que comparte un tipo de criatura con una criatura que controlas, puedes lanzar esa carta sin pagar su coste de maná. De lo contrario, pon esa carta en el fondo de tu biblioteca.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zeige zu Beginn deines Versorgungssegments die oberste Karte deiner Bibliothek offen vor. Falls es sich um eine Kreaturenkarte handelt, die mit einer Kreatur, die du kontrollierst, einen Kreaturentyp gemeinsam hat, kannst du diese Karte wirken, ohne ihre Manakosten zu bezahlen. Lege die Karte sonst unter deine Bibliothek.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, rivela la prima carta del tuo grimorio. Se è una carta creatura che condivide un tipo di creatura con una creatura che controlli, puoi lanciare quella carta senza pagare il suo costo di mana. Altrimenti, mettila in fondo al tuo grimorio.]]></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[No início de sua manutenção, revele o card do topo de seu grimório. Se for um card de criatura que compartilha um tipo de criatura com uma criatura que você controla, você poderá conjurar aquele card sem pagar seu custo de mana. Caso contrário, coloque aquele card no fundo de seu grimório.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    local card = player:Library_GetNth(0)
    if card ~= nil then
       local can_play = 0
       if card:GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 then
          local filter = Object():GetFilter()
          filter:Clear()
          filter:NotTargetted()
          filter:SetZone( ZONE_IN_PLAY )
          filter:SetSubTypes( card:GetSubType() )
          filter:SetController( player )
          filter:AddExtra( FILTER_EXTRA_ANY_SUB_TYPE )
          can_play = filter:CountStopAt(1)
       end
       EffectDC():Set_Int(1, can_play)
       if can_play == 1 then
          filter:Clear()
          filter:NotTargetted()
          filter:SetPlayer( player )
          filter:SetZone( ZONE_LIBRARY )
          filter:SetPortion( 1 )
          player:SetTargetCount( 1 )
          player:SetTargetPrompt( 0, "CARD_QUERY_PLAY" )
          player:ChooseTargetsWithFlags( NO_VALIDATION, EffectDC():Make_Targets(0), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )
       else
          card:GuidedReveal( ZONE_LIBRARY, ZONE_LIBRARY )
          card:PutInLibrary(-1)
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local card = player:Library_GetNth(0)
    if card ~= nil then
       if EffectDC():Get_Int(1) == 1 then
          local player = EffectController()
          local spell = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
          if spell ~= nil and spell:CanBePlayed(player) then
             spell:PlayFreeFromAnywhere(player)
          else
             card:GuidedReveal( ZONE_LIBRARY, ZONE_LIBRARY )
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 22 guests


Who is online

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

Users browsing this forum: No registered users and 22 guests

Login Form