It is currently 27 Apr 2024, 08:04
   
Text Size

Talk about new cards here

Moderator: CCGHQ Admins

Re: Talk about new cards here

Postby BloodReyvyn » 26 May 2013, 19:40

Ummmmm cool, except I am back to not being able to select a player... :oops:

Sorry, I hate to be a pest :oops: :oops:
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: Talk about new cards here

Postby thefiremind » 26 May 2013, 19:51

Apparently, this time I was the one who forgot the trigger condition on the "As Stuffy Doll enters the battlefield" trigger... :oops: I updated the attachment in the other topic, either download it again or add the trigger condition by yourself (same as Sewer Nemesis).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Talk about new cards here

Postby BloodReyvyn » 26 May 2013, 21:05

Heh, trying to code Magus of the Mirror, I hit a minor snag: Is there a parameter for activated abilities to restrict them to the player's upkeep?
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: Talk about new cards here

Postby thefiremind » 26 May 2013, 21:25

BloodReyvyn wrote:Heh, trying to code Magus of the Mirror, I hit a minor snag: Is there a parameter for activated abilities to restrict them to the player's upkeep?
Yes, it's upkeep="1" during_your_turn="1", but you must consider what I wrote here.

If you need a simple "dummy trigger" that gives you the time to activate the ability, you can use this:
Code: Select all
  <TRIGGERED_ABILITY priority="-1">
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP and Object():Tapped() == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    -- Time window for activated ability
    </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

Re: Talk about new cards here

Postby BloodReyvyn » 26 May 2013, 21:37

Oh... well meh, I can live without it. Or I suppose I could ask the person each upkeep if they want to activate it via a triggered ability.

Maybe DotP2014 will have less limitations.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: Talk about new cards here

Postby BloodReyvyn » 28 May 2013, 13:55

Hey hey, got another riddle for you guys. :P

I can't seem to spot my error with this code:

Mishra, Artificer Prodigy
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="MISHRA_ARTIFICER_PRODIGY_113539" />
  <CARDNAME text="MISHRA_ARTIFICER_PRODIGY" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Mishra, Artificer Prodigy]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mishra, prodige artificier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mishra, artífice prodigio]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mishra, Handwerker-Wunderkind]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mishra, Artefice Prodigio]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[工匠の神童、ミシュラ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Mishra, Artificer Prodigy]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мишра, Гениальный Механик]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mishra, Prodígio Artífice]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="113539" />
  <ARTID value="A113539" />
  <ARTIST name="Scott M. Fischer" />
  <CASTING_COST cost="{1}{U}{B}{R}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[A sojourn through time gave dark inspiration to one gifted young mind.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Voyager dans le temps donna une sombre inspiration à un jeune génie talentueux.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Un pequeño viaje por el tiempo dio una inspiración oscura a una joven mente dotada.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Eine Zeitreise sorgte dafür, dass ein begabtes junges Gehirn auf dunkle Gedanken kam.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Un soggiorno attraverso il tempo ha fornito un’oscura ispirazione a una giovane mente dotata.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[時間の中を漂うことで、才能ある若者の心に邪悪なひらめきが生まれた。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[A sojourn through time gave dark inspiration to one gifted young mind.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Непродолжительное пребывание во времени принесло темное вдохновение одному одаренному юному уму.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Uma residência provisória através do tempo deu uma inspiração sombria a uma jovem mente talentosa.]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
  <SUB_TYPE metaname="Artificer" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <POWER value="4" />
  <TOUGHNESS value="4" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast an artifact spell, you may search your graveyard, hand, and/or library for a card with the same name as that spell and put it onto the battlefield. If you search your library this way, shuffle it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous jouez un sort d’artefact, vous pouvez chercher dans votre cimetière, votre main et/ou votre bibliothèque une carte ayant le même nom que ce sort et la mettre en jeu. Si vous avez cherché dans votre bibliothèque de cette manière, mélangez-la.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que juegues un hechizo de artefacto, puedes buscar en tu cementerio, mano y/o biblioteca una carta con el mismo nombre que ese hechizo y ponerla en juego. Si buscas en tu biblioteca de esta manera, barájala.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Artefaktzauber spielst, kannst du deinen Friedhof, deine Hand und/oder deine Bibliothek nach einer Karte mit demselben Namen wie dieser Zauber durchsuchen und ins Spiel bringen. Falls du auf diese Weise deine Bibliothek durchsucht hast, mische sie.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia artefatto, puoi passare in rassegna il tuo cimitero, la tua mano e/o il tuo grimorio per una carta con lo stesso nome di quella magia e metterla sul campo di battaglia. Se passi in rassegna il tuo grimorio in questo modo, rimescolalo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがアーティファクト呪文をプレイするたび、あなたは自分の墓地や手札やライブラリーからその呪文と同じカード名のカードを1枚探し、それを場に出す。 あなたがこれにより自分のライブラリーからカードを探した場合、それを切り直す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever you cast an artifact spell, you may search your graveyard, hand, and/or library for a card with the same name as that spell and put it onto the battlefield. If you search your library this way, shuffle it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда вы играете артефактное заклинание, вы можете найти на вашем кладбище, в руке и/или библиотеке карту с таким же названием, что и разыгрываемое заклинание, и положить ее в игру. После поиска карты перетасуйте библиотеку.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você joga uma mágica de artefato, você pode procurar em seu cemitério, mão e/ou grimório por um card com o mesmo nome daquela mágica e colocá-lo em jogo. Se procurar em seu grimório desta maneira, embaralhe-o.]]></LOCALISED_TEXT>
    <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
      return TriggerObject():GetCardType():Test( CARD_TYPE_ARTIFACT ) ~= 0
      local played_artifact_name = TriggerObject():GetCardName()
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local filter = Object():GetFilter()
      local player = EffectController()
      player:MarkSearchedLibrary()
      filter:Clear()
      filter:NotTargetted()
      filter:AddCardName( played_artifact_name )
      filter:May()
      filter:SetZone( ZONE_LIBRARY )
      filter:SetZone( ZONE_HAND )
      filter:SetZone( ZONE_GRAVEYARD )
      filter:SetPlayer( player )
      local matching_artifacts = filter:Count()
      player:SetTargetCount( matching_artifacts )
      for i=0,( matching_artifacts - 1 ) do
        player:SetTargetPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_PUT_IN_PLAY" )
      end
      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>
      for i = 0,2 do
       local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
       local player = EffectController()
        if target ~= nil then
           target:PutIntoPlay( EffectController() )
       end
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      EffectController():ShuffleLibrary()
    </RESOLUTION_TIME_ACTION>
  </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" />
</CARD_V2>
I know the effect triggers when I play an artifact spell, it just apparently doesn't do anything.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: Talk about new cards here

Postby thefiremind » 28 May 2013, 14:43

There's more than 1 error here:
  • If you save something in an EffectDC register you can keep it through the whole ability, but a local variable exists only inside the block of code it's declared into, so there's no way your played_artifact_name can be carried through to the RESOLUTION_TIME_ACTION.
  • Besides what I wrote in the previous point, you declared the played_artifact_name variable after a "return": when a "return" is met, the function exits, and the lines after that will never be executed.
  • The calls to filter:SetZone override the previous ones (as all the filter functions whose name begins with "Set" rather than "Add") so you can't search through all the zones at once. You have 2 possible solutions for this: either you search every zone one by one asking a query for each one, or you collect in a chest all the pointers to the copies of the artifact that you have in those zones and present a single query that lets you choose from that chest. The latter would be easier but a bit approximated because the graveyard is a zone that anyone can see and if you decide to search your graveyard, you are forced to pick the artifact from there if there's one.
  • This is a conceptual error: the card lets you pick up just one artifact, not one for each zone. The proof is that it says "put it onto the battlefield", not "put those cards onto the battlefield".
That said, cards that search through multiple zones aren't easy at all. Luckily I already made Dark Supplicant which is almost the same, so I should be able to adapt it to your needs.

Code: Select all
    <TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
    if TriggerObject():GetCardType():Test( CARD_TYPE_ARTIFACT ) ~= 0 then
       EffectDC():LKIShield_CardPtr( COMPARTMENT_ID_PARAM_TRIGGER_OBJECT )
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    -- let's see where it is...
    local artifact_count = 0
    local filter = Object():GetFilter()
    filter:Clear()
    filter:NotTargetted()
    filter:AddCardName( TriggerObject():GetCardName() )
    filter:SetPlayer( EffectController() )
    for i=ZONE_LIBRARY,ZONE_HAND do
       filter:SetZone( i )
       local found = filter:CountStopAt(1)
       EffectDC():Set_Int(i, found)
       artifact_count = artifact_count + found
    end
    EffectDC():Set_Int(7, artifact_count)
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local zone = ZONE_HAND
    if EffectDC():Get_Int(7) == 0 or EffectDC():Get_Int(zone) == 0 then
       return
    end
    local filter = Object():GetFilter()
    filter:Clear()
    filter:NotTargetted()
    filter:AddCardName( TriggerObject():GetCardName() )
    filter:SetZone( zone )
    filter:SetPlayer( EffectController() )
    filter:May()
    EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
       local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
       if target ~= nil then
          target:PutIntoPlay( EffectController() )
          EffectDC():Set_Int(8, 1)
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local zone = ZONE_GRAVEYARD
    if EffectDC():Get_Int(7) == 0 or EffectDC():Get_Int(zone) == 0 or EffectDC():Get_Int(8) == 1 then
       return
    end
    local filter = Object():GetFilter()
    filter:Clear()
    filter:NotTargetted()
    filter:AddCardName( TriggerObject():GetCardName() )
    filter:SetZone( zone )
    filter:SetPlayer( EffectController() )
    EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(1) ~= nil then
       local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
       if target ~= nil then
          target:PutIntoPlay( EffectController() )
          EffectDC():Set_Int(8, 1)
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local zone = ZONE_LIBRARY
    if EffectDC():Get_Int(7) == 0 or EffectDC():Get_Int(zone) == 0 or EffectDC():Get_Int(8) == 1 then
       return
    end
    EffectController():MarkSearchedLibrary()
    EffectDC():Set_Int(9, 1)
    local filter = Object():GetFilter()
    filter:Clear()
    filter:NotTargetted()
    filter:AddCardName( TriggerObject():GetCardName() )
    filter:SetZone( zone )
    filter:SetPlayer( EffectController() )
    filter:May()
    EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(2) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(2) ~= nil then
       local target = EffectDC():Get_Targets(2):Get_CardPtr(0)
       if target ~= nil then
          target:PutIntoPlay( EffectController() )
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Int(9) == 1 then
       EffectController():ShuffleLibrary()
    end
    </RESOLUTION_TIME_ACTION>
I don't know if you ever tried my Dark Supplicant, anyway it works like this: first it searches your hand, then your graveyard, finally your library (searching the library means shuffling it afterwards and getting something that you could get later anyway so I think it's OK to leave it as last chance). As soon as you select a card, the search stops.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Talk about new cards here

Postby BloodReyvyn » 28 May 2013, 15:51

Awesome, that works great now. :D Thank you again.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: Talk about new cards here

Postby DCarnage » 16 Aug 2013, 10:44

I'm a total noob and just joined the site although I have visited many times over the years. I have made a few decks using kevlahnota, BloodReyvyn, and thefiremind's wads and RiiakShiNal's deck builder. You guys are amazing and your decks are fun, thank you for the hard work.

There are a few cards that I need for a few decks and decided to "try" and make them myself.

First up is Land Grant
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="LAND_GRANT_19633" />
  <CARDNAME text="LAND_GRANT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Land Grant]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Land Grant]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="19633" />
  <ARTID value="19633" />
  <ARTIST name="D. Alexander Gregory" />
  <CASTING_COST cost="{1}{G}" />
  <TYPE metaname="Sorcery" />
  <EXPANSION value="MM" />
  <RARITY metaname="C" />
  <UTILITY_ABILITY qualifier="Alternate">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant's mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If you have no land cards in hand, you may reveal your hand rather than pay Land Grant’s mana cost.]]></LOCALISED_TEXT>
  <COST type=""/>
    <COST_DEFINITION id="0">
   
    </COST_DEFINITION>
    <ABILITY_TEXT tag="CARD_QUERY_LAND_GRANT_ALTERNATE" />
  </UTILITY_ABILITY>
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Search your library for a Forest card, reveal that card, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    local effectController = EffectController()
    local subfilter = filter:AddSubFilter_Or()
       subfilter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_FOREST )
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
    filter:SetZone( ZONE_LIBRARY, effectController )
    effectController:ChooseItem( "CARD_QUERY_CHOOSE_A_LAND_TO_PUT_INTO_YOUR_HAND", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:Reveal()
    end 
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:PutInHand()
    end 
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    EffectController():ShuffleLibrary()
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <AI_BASE_SCORE score="300" zone="ZONE_HAND" />
</CARD_V2>
I have figured everything out except for how to code alternative costs. I'm not very familiar with DoTP's scripting or functions. Some pointers would be great or better yet, take the code and put it in one of your wads. :D

I'm hoping to make Channel, Lifegift and Tinder Wall once I get the scripting down. Lifegift looks like it would be a piece of cake.
Last edited by DCarnage on 16 Aug 2013, 18:44, edited 1 time in total.
DCarnage
 
Posts: 1
Joined: 16 Aug 2013, 10:27
Has thanked: 1 time
Been thanked: 0 time

Re: Talk about new cards here

Postby thefiremind » 16 Aug 2013, 12:58

When your cost doesn't require something that exists a "standard" cost for (like sacrifice, exile, return to hand, tap, untap, etc.) the only possible way is to use the "generic" cost. Since the "generic" cost always requires to set a prerequisite, it seems to me the best place to put the check for having no land cards in hand.
Code: Select all
    <COST type="generic">
      <PREREQUISITE>
      local filter = ClearFilter()
      filter:SetZone( ZONE_HAND, EffectController() )
      filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
      return filter:CountStopAt(1) == 0
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      EffectController():RevealHand()
      </RESOLUTION_TIME_ACTION>
    </COST>
DCarnage wrote:Lifegift looks like it would be a piece of cake.
It sure is: copy the ability from Grazing Gladehart, remove simple_qualifier="objectyoucontrol" (you don't care about whose land it is), and make it gain 1 life rather than 2.

The other 2 cards will require RiiakShiNal's mana functions, so it's better to get help from him.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Talk about new cards here

Postby gorem2k » 16 Aug 2013, 15:14

about generic cost, I have myself a question for you.

How do you ask for a value BEFORE choosing a target, when both are connected for cost?

this is what I have for Chandra Nalaar:

| Open
Code: Select all
...
    <COST type="generic">
      <PREREQUISITE>
      return EffectSource():CountCounters( MTG():GetCountersType("Loyalty") ) &gt; 0
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
         local max_amount = EffectSource():CountCounters( MTG():GetCountersType("Loyalty") )
         local controller = EffectController()
         controller:BeginNewNumericalChoice()
         controller:AddNumericalChoiceAnswer(max_amount)
         controller:AskNumericalChoiceQuestion("CARD_QUERY_CHOOSE_REMOVECOUNTER")
      end
      </RESOLUTION_TIME_ACTION>
    </COST>
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_DEAL_X_DAMAGE" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
...
I've tried using random dependency="1" in <TARGET> and conditional="1" in <RESOLUTION_TIME_ACTION> and this had no effect. I don't really want to create a delayed trigger for choosing a target.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Talk about new cards here

Postby thefiremind » 16 Aug 2013, 16:03

I'm not sure if I understood the problem... the fact that you are choosing the target first is perfectly normal: the costs are paid after choosing the target. Does the numerical choice not pop up when used inside a cost? If that's so, use some PLAY_TIME_ACTION blocks rather than the COST block.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Talk about new cards here

Postby gorem2k » 16 Aug 2013, 17:10

thefiremind wrote:I'm not sure if I understood the problem... the fact that you are choosing the target first is perfectly normal: the costs are paid after choosing the target. Does the numerical choice not pop up when used inside a cost? If that's so, use some PLAY_TIME_ACTION blocks rather than the COST block.
PLAY_TIME gave same result. I thought what was inside cost had to be done before resolution but it's not the case.

My only complain is we can only cancel the activation before paying -X . as soon as target is chose , we can't go back...

EDIT:oops, you said PLAY_TIME_ACTION instead of COST ? I thought you meant instead of RESOLUTION_TIME_ACTION??!?! wait...

EDIT2: removed COST and only kept PLAY_TIME_ACTION, same result. also adding a QUERY_FLAG_MAY to AskNumericalChoiceQuestion("CARD_QUERY_CHOOSE_REMOVECOUNTER") won't do anything except show a little strange "1" character.. :roll:
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Talk about new cards here

Postby thefiremind » 16 Aug 2013, 17:57

gorem2k wrote:My only complain is we can only cancel the activation before paying -X . as soon as target is chose , we can't go back...
There's nothing you can do about that. If you go as far as choosing the target, you should be convinced enough that you really want to use the 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

Re: Talk about new cards here

Postby gorem2k » 16 Aug 2013, 18:01

thefiremind wrote:
gorem2k wrote:My only complain is we can only cancel the activation before paying -X . as soon as target is chose , we can't go back...
There's nothing you can do about that. If you go as far as choosing the target, you should be convinced enough that you really want to use the ability...
OK. didn't know that what is before " : " (ie the cost) was decided after...
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 31 guests


Who is online

In total there are 31 users online :: 0 registered, 0 hidden and 31 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 31 guests

Login Form