It is currently 16 Apr 2024, 12:08
   
Text Size

Talk about new cards here

Moderator: CCGHQ Admins

Re: Talk about new cards here

Postby Blue Ghost » 24 Aug 2014, 05:22

I've been trying to program Jeleva, Nephalia's Scourge. I got her ETB ability to work, but her attack trigger currently doesn't do anything. Can someone help pretty please?

Jeleva, Nephalia's Scourge | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="C_JELEVA_NEPHALIAS_SCOURGE_738028" />
  <CARDNAME text="JELEVA_NEPHALIAS_SCOURGE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Jeleva, Nephalia's Scourge]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="738028" />
  <ARTID value="738028" />
  <ARTIST name="Todd Lockwood" />
  <CASTING_COST cost="{1}{U}{B}{R}" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Vampire" />
  <SUB_TYPE metaname="Wizard" />
  <EXPANSION value="C13" />
  <RARITY metaname="M" />
  <POWER value="1" />
  <TOUGHNESS value="3" />
   <STATIC_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></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[Voar]]></LOCALISED_TEXT>
      <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
   </STATIC_ABILITY>
 <SPELL_ABILITY linked_ability_group="1">
    <PLAY_TIME_ACTION>
    -- Save the amount of mana available just before casting this card
    LinkedDC():Set_Int( 0, EffectController():GetTotalMana() )
    </PLAY_TIME_ACTION>
  </SPELL_ABILITY>
  <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1" active_zone="ZONE_ANY">    <TRIGGER value="SPELL_PLAYED" simple_qualifier="self">
    -- The previously saved amount minus the current amount of available mana gives the mana spent to cast this card
    LinkedDC():Set_Int( 1, LinkedDC():Get_Int(0) - EffectController():GetTotalMana() )
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY linked_ability_group="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Jeleva, Nephalia's Scourge enters the battlefield, each player exiles the top X cards of his or her library, where X is the amount of mana spent to cast Jeleva.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD">
    -- Save the value in a safe register
    EffectDC():Set_Int( 0, LinkedDC():Get_Int(1) )
    return true
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    EffectController():DisplayMessage( EffectDC():Get_Int(0) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local cards = EffectDC():Get_Int(0)
    for i=0, MTG():GetNumberOfPlayers()-1 do
       local player = MTG():GetNthPlayer(i)
       if player ~= nil then
          for i=0, cards-1 do
          local top = player:Library_GetTop()
             if top ~= nil then
                   if (top:GetCardType():Test(CARD_TYPE_SORCERY) or top:GetCardType():Test(CARD_TYPE_INSTANT)) then
                        local index = LinkedDC():Get_Int(0)
                        local linkedDC = LinkedDC():Get_Chest(1)
                        if linkedDC == nil then
                          linkedDC = LinkedDC():Make_Chest(1)
                        end
                        linkedDC:Set_CardPtr(index, top)
                        linkedDC:Protect_CardPtr(index)
                        LinkedDC():Int_Inc(0)
                    end
                    top:Exile()
               end
            end
          end
     end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local linkedDC = LinkedDC():Get_Chest(1)
    if EffectSource() ~= nil and linkedDC ~= nil then
       local count = LinkedDC():Get_Int(0)
       for i=0,count-1 do
          local card = linkedDC:Get_CardPtr(i)
          if card ~= nil then
             card:NailOnto( EffectSource() )
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
    <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Jeleva attacks, you may cast an instant or sorcery card exiled with it without paying its mana cost.]]></LOCALISED_TEXT>
    <TRIGGER value="ATTACKING" simple_qualifier="self" />
    <RESOLUTION_TIME_ACTION>
    local linkedDC = LinkedDC():Get_Chest(1)
    if linkedDC ~= nil then
   local queryDC = EffectDC():Make_Chest(2)
   queryDC:CopyFrom(linkedDC)
   local count = LinkedDC():Get_Int(0)
        for i = 0, count-1 do
      local card = queryDC:Get_CardPtr(i)
      if card == nil or EffectController():CanCastSpellForFree(card) == false then
         queryDC:QueryUnselect_CardPtr(i)
      end
   end
 
        EffectController():ChooseItemFromDC( "CARD_QUERY_CHOOSE_SPELL_TO_CAST", queryDC, EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
   local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
   if target ~= nil and EffectController():CanCastSpellForFree(target) then
      EffectController():CastSpellForFree(target)
   end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>



  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_PLASMA_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_PLASMA_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
  <AI_BASE_SCORE score="600" zone="ZONE_HAND" />
  <AI_BASE_SCORE score="150" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
Blue Ghost
 
Posts: 52
Joined: 07 Apr 2013, 20:41
Has thanked: 6 times
Been thanked: 0 time

Re: Talk about new cards here

Postby braquio » 24 Aug 2014, 11:50

Blue Ghost wrote:I've been trying to program Jeleva, Nephalia's Scourge. I got her ETB ability to work, but her attack trigger currently doesn't do anything. Can someone help pretty please?
The idea is to keep sorceries and instants you exile in a save list, isn't it?
Then this block of here is some confusing to me.

| Open
Code: Select all
<RESOLUTION_TIME_ACTION>
        local cards = EffectDC():Get_Int(0)
        for j=0, MTG():GetNumberOfPlayers()-1 do
           local player = MTG():GetNthPlayer(j)
           if player ~= nil then
              for i=0, cards-1 do
              local top = player:Library_GetTop()
                 if top ~= nil then
                       if (top:GetCardType():Test(CARD_TYPE_SORCERY) or top:GetCardType():Test(CARD_TYPE_INSTANT)) then
                            local index = LinkedDC():Get_Int(0)
                            local linkedDC = LinkedDC():Get_Chest(1)
                            if linkedDC == nil then
                              linkedDC = LinkedDC():Make_Chest(1)
                            end
                            linkedDC:Set_CardPtr(index, top)
                            linkedDC:Protect_CardPtr(index)
                            LinkedDC():Int_Inc(0)
                        end
                        top:Exile()
                   end
                end
              end
         end
        </RESOLUTION_TIME_ACTION>
Avoid using LinkedDC as name of another DC u want to use

Be careful when u use a for inside another for, use differents variables to counters i,j,k,l...

Initialize the index value outside of bucles to avoid initialize on each iteration.
And dont forget increment its value when you introduce a new card

Try something like this;

| Open
Code: Select all
<RESOLUTION_TIME_ACTION>
local cards = EffectDC():Get_Int(0)
local index = 0   
        if targetDC == nil then
      local targetDC = LinkedDC():Make_Chest(1)
   end      
   for j=0, MTG():GetNumberOfPlayers()-1 do
      local player = MTG():GetNthPlayer(j)
      if player ~= nil then
         for i=0, cards-1 do
            local top = player:Library_GetTop()
            if top ~= nil then
               if (top:GetCardType():Test(CARD_TYPE_SORCERY) or top:GetCardType():Test(CARD_TYPE_INSTANT)) then
                  
                  targetDC:Set_CardPtr(index, top)
                                      targetDC:Protect_CardPtr(index)
                  index = index + 1
               end
               top:Exile()
            end
         end
      end
   end
</RESOLUTION_TIME_ACTION>
Well i'm not sure about one thing.
Code: Select all
local targetDC = LinkedDC():Make_Chest(1)
I dont know if u can make a chest inside LinkedDC and use it in another ability but try it.
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
User avatar
braquio
 
Posts: 143
Joined: 16 Feb 2014, 19:21
Has thanked: 15 times
Been thanked: 9 times

Re: Talk about new cards here

Postby Blue Ghost » 26 Aug 2014, 03:03

All the cards are nailed onto Jeleva that are supposed to be, so I don't think that part of the code is the issue. I'm pretty sure it's something in the ability that triggers on attacking.
Blue Ghost
 
Posts: 52
Joined: 07 Apr 2013, 20:41
Has thanked: 6 times
Been thanked: 0 time

Re: Talk about new cards here

Postby cenarius » 10 Jul 2015, 08:53

Ok, last post was on 26 Aug 2014.

I just feel like asking.

I'm working on "Chains of Mephistopheles". My card works as intended, which is already good for someone who doesn't know hwat he's doing (i'm not a programmer, just know some sh... things), and i already tested it and it works... but not as intended.

My code:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CHAINS_OF_MEPHISTOPHELES_512159823" />
  <CARDNAME text="CHAINS_OF_MEPHISTOPHELES" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cadenas de Mefistófeles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Chains of Mephistopheles]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="512159823" />
  <ARTID value="512159823" />
  <ARTIST name="Heather Hudson" />
  <CASTING_COST cost="{1}{B}" />
  <TYPE metaname="Enchantment" />
  <EXPANSION value="MED" />
  <RARITY metaname="R" />
 
  <TRIGGERED_ABILITY>
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si un jugador fuera a robar una carta exepto la primera que roba en su fase de robar, en lugar de eso ese jugador descarta una carta de su mano. Si ese jugador descarta una carta de esta forma, roba una carta. Si ese jugador no descarta una carta, pone la primera carta de la parte superior de su biblioteca en su cementerio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se un giocatore sta per pescare una carta oltre la prima della sua normale acquisizione in ogni turno, invece quel giocatore scarta una carta. Se il giocatore scarta una carta in questo modo, egli pesca una carta. Se il giocatore non scarta una carta in questo modo, egli mette nel suo cimitero la prima carta del proprio grimorio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn’t discard a card this way, he or she puts the top card of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
   <TRIGGER value="DREW_CARD" pre_trigger="1">
   if TriggerPlayer()~= nil then
       local interrogation = MTG():ClearInterrogationQuery()
       interrogation:SetPlayer( TriggerPlayer() )
       local num_drawn_this_turn = interrogation:Count(INTERROGATE_CARDS_DRAWN, INTERROGATE_THIS_TURN, 1)
       if MTG():GetStep() ~= STEP_DRAW or num_drawn_this_turn == 1 then
          MTG():OverrideEvent()
          return true
       end
    end
    return false
    </TRIGGER>
   
   <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:SetZone( ZONE_HAND, TriggerPlayer())
    TriggerPlayer():SetItemCount( 1 )
   
   if (TriggerPlayer() ~= nil and TriggerPlayer():Hand_Count() ~= 0) then
      for i = 0,(1-1) do
         TriggerPlayer():SetItemPrompt (i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
      end
      TriggerPlayer():ChooseItems( EffectDC():Make_Targets(0) )   
   else
      TriggerPlayer():MillCards(1)
      return false
   end
   </RESOLUTION_TIME_ACTION>

   <RESOLUTION_TIME_ACTION>
    local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_card ~= nil and TriggerPlayer():Hand_Count() ~= 0 then
       target_card:Discard()
    end
    </RESOLUTION_TIME_ACTION>   

   <RESOLUTION_TIME_ACTION>
    if TriggerPlayer() ~= nil then
      TriggerPlayer():DrawCards(1)
      return false
    end
    </RESOLUTION_TIME_ACTION>   
   
   </TRIGGERED_ABILITY>
 
   <AUTHOR><![CDATA[cenarius]]></AUTHOR>
   <EDITORS><![CDATA[cenarius]]></EDITORS>
   <DATE><![CDATA[09-07-15]]></DATE>
</CARD_V2>
My questions here is, is there a way to define a variable outside the triggered event but also re-init that variable every time a player draws a card?

Because my card as it is does the following:
- Asks if the card a player wants to draw is the first one.
- If it isn't, then the nightmare begins.
- Asks if he has cards in his hand.
- If he has cards in his hand, he discards a card...
- ...Then draws a card... but before doing so, it triggers the first ability.
- Before drawing, the player discards a card.
- If there are no cards in hand, it mills one from the top of the library.
- All the process repeats over and over again.

It was fun though to see how the player discarded his hand and then started to mills cards like a desperado.

Any kind of help will be appreciated ;)
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby RiiakShiNal » 10 Jul 2015, 11:06

Define a variable, no. Use a data chest register, yes.

There are multiple options for data chest registers:
  • LinkedDC() - Requires each ability to have linked_ability_group="1" in the ability tag. Can't be accessed from another card instance.
  • player:PlayerDataChest() - Persistent storage for a single player.
  • MTG():DuelDataChest() - Persistent storage for the match.
  • RSN_ObjectDC() - Persistent storage for a card (makes use of DuelDataChest()). Can be accessed from other cards. Requires my ObjectDC functions.

It should be noted that you can already get whether the card being drawn is the first in the turn or not through interrogation.

You can check the number of cards in hand by calling player:Hand_Count().
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Talk about new cards here

Postby cenarius » 10 Jul 2015, 12:03

RiiakShiNal wrote:Define a variable, no. Use a data chest register, yes.

There are multiple options for data chest registers:
  • LinkedDC() - Requires each ability to have linked_ability_group="1" in the ability tag. Can't be accessed from another card instance.
  • player:PlayerDataChest() - Persistent storage for a single player.
  • MTG():DuelDataChest() - Persistent storage for the match.
  • RSN_ObjectDC() - Persistent storage for a card (makes use of DuelDataChest()). Can be accessed from other cards. Requires my ObjectDC functions.

It should be noted that you can already get whether the card being drawn is the first in the turn or not through interrogation.

You can check the number of cards in hand by calling player:Hand_Count().
Thank you for your reply ;)
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby cenarius » 14 Jul 2015, 21:36

Hi again.

I did all the "Burst" cards, Mind Burst, Æther Burst, Life Burst, Flame Burst and Muscle Burst, but i have a question about the last one. The card says clearly that the creature gets 3+(1*each copy of Muscle Burst in all graveyards) until end of turn. I got it working, but then i realized, what if a spell or ability removes a copy of Muscle Burst in any graveyard after resolving and granting the power-up? as the card says "until end of turn" that means the creature gets the power for each Muscle Burst in each graveyard until end of turn, it doesn't say something like "target creature gets +x/+x where x is the number of copies of this card at the moment you played it".

I hope someone can give me a hand in here please.
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby thefiremind » 14 Jul 2015, 22:05

cenarius wrote:as the card says "until end of turn" that means the creature gets the power for each Muscle Burst in each graveyard until end of turn, it doesn't say something like "target creature gets +x/+x where x is the number of copies of this card at the moment you played it"
Cards like Muscle Burst do the math the moment they resolve, then the value doesn't change even if what has been counted changes. Some people remember that Mutilate from DotP2013 was bugged in the first version and the -X/-X changed if the player played a Swamp after casting Mutilate, but that was wrong and had been fixed afterwards. Use a RESOLUTION_TIME_ACTION to save the value inside EffectDC, then read that saved value inside the CONTINUOUS_ACTION.
< 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 cenarius » 15 Jul 2015, 07:24

thefiremind wrote:
cenarius wrote:as the card says "until end of turn" that means the creature gets the power for each Muscle Burst in each graveyard until end of turn, it doesn't say something like "target creature gets +x/+x where x is the number of copies of this card at the moment you played it"
Cards like Muscle Burst do the math the moment they resolve, then the value doesn't change even if what has been counted changes. Some people remember that Mutilate from DotP2013 was bugged in the first version and the -X/-X changed if the player played a Swamp after casting Mutilate, but that was wrong and had been fixed afterwards. Use a RESOLUTION_TIME_ACTION to save the value inside EffectDC, then read that saved value inside the CONTINUOUS_ACTION.
Already did that, but still i had that doubt. So the "At the moment you casted this spell" is an implicit rule, isn't it? i thought so.

As always, thank you for your support ;)
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby RiiakShiNal » 15 Jul 2015, 11:07

cenarius wrote:Already did that, but still i had that doubt. So the "At the moment you casted this spell" is an implicit rule, isn't it? i thought so.

As always, thank you for your support ;)
Actually, it is "At the moment this spell resolves" and not "At the moment you cast this spell". There is a difference in that if the number changes between when the card is cast and when it resolves it will use the number at resolution time and not the number at play time.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Talk about new cards here

Postby cenarius » 16 Jul 2015, 11:24

Hi, it's me again :p

I'm working on "Probe". Here is my code:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="PROBE_512022990" />
  <CARDNAME text="PROBE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sonde]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sonde]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Probe]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Probe]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="512022990" />
  <ARTID value="512022990" />
  <ARTIST name="Eric Peterson" />
  <CASTING_COST cost="{2}{U}" />
  <TYPE metaname="Sorcery" />
  <EXPANSION value="IN" />
  <RARITY metaname="C" />
 
   <UTILITY_ABILITY qualifier="Kicker">
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Estímulo {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Potenziamento {1}{B}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[キッカー {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Kicker {1}{B}]]></LOCALISED_TEXT>
      <COST mana_cost="{1}{B}" type="Mana" />
      <ABILITY_TEXT tag="KICKER_QUERY_PROBE_KICKED" secondary_tag="KICKER_QUERY_PROBE_UNKICKED" />
   </UTILITY_ABILITY>
 
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Piochez trois cartes, puis défaussez-vous de deux cartes de votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ziehe drei Karten und wirf dann zwei Karten von Deiner Hand ab.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Pesca una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Draw three cards, then discard two cards.]]></LOCALISED_TEXT>
   <RESOLUTION_TIME_ACTION>
         EffectController():DrawCards( 3 )
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
      local filter = ClearFilter()
       filter:SetZone(ZONE_HAND, EffectController())
       EffectController():SetItemCount(2)
       for i=0,1 do
          EffectController():SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD")
       end
       EffectController():ChooseItems( EffectDC():Make_Targets(1) )
      </RESOLUTION_TIME_ACTION>
      
      <RESOLUTION_TIME_ACTION>
         for i = 0,1 do
            local targetDC = EffectDC():Get_Targets(i)
            if targetDC ~= nil  then
               local target_card = targetDC:Get_CardPtr(0)
               if target_card ~= nil  then
                  target_card:Discard()
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si vous avez payé le coût de kick, le joueur ciblé se défausse de deux cartes de sa main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn Du die Bonuskosten bezahlt hast, wirft ein Spieler Deiner Wahl zwei Karten von seiner Hand ab.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If Probe was kicked, target player discards two cards.]]></LOCALISED_TEXT>
   <TARGET tag="CARD_QUERY_CHOOSE_PLAYER_DISCARD_2" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    </TARGET_DEFINITION>
      
      <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    local target = EffectDC():Get_Targets(0): Get_PlayerPtr(0)
    if target ~= nil and EffectSourceLKI():WasKicked()then
       filter:SetZone( ZONE_HAND, target)
       target:SetItemCount( 2 )
       for i = 0,(2-1) do
          target:SetItemPrompt (i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD_2" )
       end
       target:ChooseItems( EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    if player ~= nil then
       for i = 0,(2-1) do
          local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
          if target_card ~= nil  then
             target_card:Discard()
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
   <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </SPELL_ABILITY>
</CARD_V2>
I saw the only card similar to this one which is "Orim’s Thunder", but when i play it it asks me to target a creature to deal damage and if the kicker cost wasn't payed it skips the damage part. Which is good because that means the card works, but is not "cute" to ask for a second target if you don't plan to pay the kicker cost, right?

Well, i copied the code (like i said, i'm not a programmer) and my Probe card does the same, when i cast it, it also ask me to choose a player to discard 2 cards, but then if no kicker cost was payed it skips the discard part. It works, but it isn't "cute".

My question is, of course, if there is a "cuter" way to do this kicker stuff when you can make 2 or several targets but only if the kicker cost was payed?

Thank you in advance.
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby thefiremind » 16 Jul 2015, 11:52

As far as I know, there's no way to do that because the value returned by WasKicked() is set only at resolution time. Besides, I think it's rule-compliant this way, because you should be able to kill a Gossamer Phantasm with an unkicked Orim's Thunder (you can target the creature, even if damage won't be dealt).

EDIT: And I think you also need all targets to cast these cards even if you don't pay the kicker cost (you can't play Orim's Thunder with no creatures and you can't play Probe if somehow all players have shroud or protection from blue). I'd like to get confirmation, though.
Last edited by thefiremind on 16 Jul 2015, 12:07, edited 3 times in total.
< 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 cenarius » 16 Jul 2015, 11:57

thefiremind wrote:As far as I know, there's no way to do that because the value returned by WasKicked() is set only at resolution time. Besides, I think it's rule-compliant this way, because you should be able to kill a Gossamer Phantasm with an unkicked Orim's Thunder (you can target the creature, even if damage won't be dealt).
Really? :o you can do that? make the target even without paying for the kicker cost?

Then that's some big detail i missed back on 2001 when i played MTG.

Edit: I was so surprised i forgot to say thank you for the quick reply ;)
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby thefiremind » 16 Jul 2015, 12:03

cenarius wrote:Really? :o you can do that? make the target even without paying for the kicker cost?
I would be more comfortable if I could find proof from a judge's answer or from Gatherer's rulings (there are none for Orim's Thunder, I'm really surprised about that!), but I think it works that way.
< 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 cenarius » 16 Jul 2015, 15:21

Awgh, my mistake, please remove this comment.
Last edited by cenarius on 16 Jul 2015, 15:27, edited 1 time in total.
cenarius
 
Posts: 87
Joined: 09 Jun 2015, 14:40
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 16 guests


Who is online

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

Login Form