It is currently 12 Nov 2025, 00:32
   
Text Size

Aether Tradewinds problem.

Moderator: CCGHQ Admins

Aether Tradewinds problem.

Postby alexandreonly » 28 Sep 2012, 20:13

When i include this card, the deck don't show up. I can't find the problem:

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="AETHER_TRADEWINDS_201568" />
  <CARDNAME text="AETHER_TRADEWINDS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Æther Tradewinds]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="201568" />
  <ARTID value="201568" />
  <ARTIST name="Kieran Yanner" />
  <CASTING_COST cost="{2}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“The wind smells of misfortune. Check your knots.”
—Anitan, Ondu cleric]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Instant" />
  <EXPANSION value="DPG" />
  <RARITY metaname="C" />
  <SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Return target permanent you control and target permanent you don’t control to their owners’ hands.]]></LOCALISED_TEXT>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_CARDS )
   filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DEFINITION id="1">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_CARDS )
   filter:SetPlayer( EffectController() )
   filter:AddExtra( FILTER_EXTRA_FLIP_PLAYER )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY, EffectController() )
    </TARGET_DEFINITION>
   <TARGET_DETERMINATION>
    return AtLeastNTargetsFromDefinition(0, 2)
    </TARGET_DETERMINATION>
   <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PERMANENT_YOU_CONTROL", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 1, "CARD_QUERY_CHOOSE_PERMANENT_YOU_DONT_CONTROL", EffectDC():Make_Targets(1) )
    </PLAY_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
    if EffectDC() ~= nil and EffectDC():Get_Targets(0) ~= nil then
       local target_a = EffectDC():Get_Targets(0):Get_CardPtr(0)
       local target_b = EffectDC():Get_Targets(1):Get_CardPtr(0)
       if target_a ~= nil then
          target_a:PutInHand()
       end
       if target_b ~= nil then
          target_b:PutInHand()
       end
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
</CARD_V2>
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times

Re: Aether Tradewinds problem.

Postby alexandreonly » 28 Sep 2012, 20:27

Also, someone already have coded Linessa, Zephyr Mage?
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times

Re: Aether Tradewinds problem.

Postby thefiremind » 28 Sep 2012, 21:35

The only thing I can think of is checking if the XML has been saved in UTF-8 encoding: with those special characters, ANSI encoding would be unreadable by the game.

Linessa seems easy to me, just a bit long to write. For the Grandeur ability you just need to use filter:AddCardName( Object():GetCardName() ) for the card to discard: better than writing the explicit card name because you can reuse the code for the other Grandeur creatures without changing anything on the cost part.
< 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: 722 times

Re: Aether Tradewinds problem.

Postby alexandreonly » 29 Sep 2012, 00:42

thefiremind wrote:The only thing I can think of is checking if the XML has been saved in UTF-8 encoding: with those special characters, ANSI encoding would be unreadable by the game.

Linessa seems easy to me, just a bit long to write. For the Grandeur ability you just need to use filter:AddCardName( Object():GetCardName() ) for the card to discard: better than writing the explicit card name because you can reuse the code for the other Grandeur creatures without changing anything on the cost part.
Aether Tradewinds is working now. I did some formating, with notepad++. For Linessa, i don't know how to code the first ability because the cost will be variable accordint to the converted mana cost of the target.
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times

Re: Aether Tradewinds problem.

Postby BlindWillow » 29 Sep 2012, 02:53

As I had already coded two cards that I figured would make coding Linessa fairly easy (Korlash, Heir to Blackblade and Geth, Lord of the Vault), I went ahead and created her for you. AI should be able to use her fairly well too. Artwork included.
Attachments
linessa.zip
(121.15 KiB) Downloaded 193 times
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Aether Tradewinds problem.

Postby alexandreonly » 29 Sep 2012, 05:12

BlindWillow wrote:As I had already coded two cards that I figured would make coding Linessa fairly easy (Korlash, Heir to Blackblade and Geth, Lord of the Vault), I went ahead and created her for you. AI should be able to use her fairly well too. Artwork included.
Thanks
alexandreonly
 
Posts: 145
Joined: 04 Jul 2011, 17:27
Has thanked: 0 time
Been thanked: 8 times

Re: Aether Tradewinds problem.

Postby thefiremind » 29 Sep 2012, 09:45

alexandreonly wrote:For Linessa, i don't know how to code the first ability because the cost will be variable accordint to the converted mana cost of the target.
You are right, I didn't think about it... it's basically the same problem I had with Geth, Lord of the Vault in DotP2012. My technique was to check the available mana, limit the converted mana cost of the possible target through that information, and then tap {X} with TapLand after the target has been chosen.
< 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: 722 times

Re: Aether Tradewinds problem.

Postby BlindWillow » 29 Sep 2012, 15:34

Don't forget that you can use separate target definitions for target determination and target choosing. I use one that checks the maximum amount a player can afford along with SetConvertedCostMax() for target determination and then one that uses SetConvertedCostValue( GetEffectX() ) for target choosing.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Aether Tradewinds problem.

Postby thefiremind » 29 Sep 2012, 18:03

BlindWillow wrote:Don't forget that you can use separate target definitions for target determination and target choosing. I use one that checks the maximum amount a player can afford along with SetConvertedCostMax() for target determination and then one that uses SetConvertedCostValue( GetEffectX() ) for target choosing.
Example: if there are only 2 targets, one with cmc=1 and the other with cmc=3, your method would allow to choose X=0 or X=2, but there would be no legal targets for those values, and I don't know what would happen... probably nothing at all, anyway I wanted to avoid giving the AI something infinitely repeatable, that's why I made him a little more complicated.
< 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: 722 times

Re: Aether Tradewinds problem.

Postby BlindWillow » 29 Sep 2012, 18:47

thefiremind wrote:Example: if there are only 2 targets, one with cmc=1 and the other with cmc=3, your method would allow to choose X=0 or X=2, but there would be no legal targets for those values, and I don't know what would happen... probably nothing at all, anyway I wanted to avoid giving the AI something infinitely repeatable, that's why I made him a little more complicated.
In my testing the AI never entered into an infinite loop. And if you choose a value for X for which there is no valid target, indeed nothing happens. For Geth, that means no cards milled too. So, I'm satisfied with my method, but it is obviously a matter of personal preference how strict one wishes to adhere to the rules.

Edit: You do have me wondering now if there isn't some sort of loop going on when the AI is considering the ability, as Geth is by far the card that the AI has to think the most about in my DLC. I'll come up with versions of both Geth and Linessa that use the TapLand method later tonight and do some more testing.

Edit2: Scratch that. The problem wasn't even in my original Geth code. I was redoing my Geth code as I worked on Linessa and ended up forgetting to SetHint() in the first target determination (in both Linessa and Geth).
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Aether Tradewinds problem.

Postby BlindWillow » 30 Sep 2012, 00:41

Here's the corrected code for Linessa (also corrected the misplaced text prompt that I kept from Prodigal Pyromancer, who just happened to be the random card I used as an "activated ability template").

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="LINESSA_ZEPHYR_MAGE_999136198" />
  <CARDNAME text="LINESSA_ZEPHYR_MAGE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Linessa, Zephyr Mage]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Linessa, Maga dello Zefiro]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Linessa die Westwindzauberin]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Linessa, mage du zéphyr]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Linessa, maga céfira]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[西風の魔道士リネッサ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Linessa, Zephyr Mage]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Линесса, Повелительница Западного Ветра]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Linessa, Maga Zéfira]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="999136198" />
  <ARTID value="999136198" />
  <ARTIST name="Jim Murray" />
  <CASTING_COST cost="{3}{U}" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" order_de-DE="0" order_es-ES="1" order_fr-FR="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_pt-BR="0" order_ru-RU="0" />
  <SUB_TYPE metaname="Wizard" order_de-DE="1" order_es-ES="0" order_fr-FR="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_pt-BR="1" order_ru-RU="1" />
  <EXPANSION value="DPG" />
  <RARITY metaname="R" />
  <POWER value="3" />
  <TOUGHNESS value="3" />
  <ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{X}{U}{U}, {T}: Return target creature with converted mana cost X to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{X}{U}{U}, {T}: Fai tornare una creatura bersaglio con costo di mana convertito pari a X in mano al suo proprietario.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{X}{U}{U}, {T}: Bringe eine Kreatur deiner Wahl mit umgewandelten Manakosten von X auf die Hand ihres Besitzers zurück.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{X}{U}{U}, {T} : Renvoyez la créature ciblée ayant un coût converti de mana de X dans la main de son propriétaire.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{X}{U}{U}, {T}: Return target creature with converted mana cost X to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{X}{U}{U}, {T}:点数で見たマナ・コストがXのクリーチャー1体を対象とし、それをオーナーの手札に戻す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{X}{U}{U}, {T}: Return target creature with converted mana cost X to its owner’s hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{X}{U}{U}, {T}: Верните целевое существо с конвертированной мана-стоимостью X в руку его владельца.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{X}{U}{U}, {T}: Devolva a criatura alvo com custo de mana convertido igual a X para a mão de seu dono.]]></LOCALISED_TEXT>
    <COST type="Mana" cost="{X}{U}{U}" />
    <COST type="TapSelf" />
    <TARGET_DEFINITION id="0">
    local max_afford = 0
    for i=1,15 do
   if EffectController():CanAfford("{"..i.."}{U}{U}") == 1 then
      max_afford = i
   end
    end
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetConvertedCostMax( max_afford )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_NEUTRAL, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DEFINITION id="1">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetConvertedCostValue( GetEffectX() )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_NEUTRAL, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 1, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC = EffectDC():Get_Targets(0)
    if targetDC ~= nil then
   local target_card = targetDC:Get_CardPtr(0)
   if target_card ~= nil then
      target_card:PutInHand()
   end
    end
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY type="in_response" />
    <AI_AVAILABILITY step="begin_combat" turn="their_turn" />
    <AI_AVAILABILITY step="main_1" turn="my_turn" />
    <AI_AVAILABILITY step="declare_attackers" turn="their_turn" />
    <AI_AVAILABILITY step="declare_blockers" />
    <AI_AVAILABILITY step="end_of_turn" />
  </ACTIVATED_ABILITY>
  <ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|Grandeur| — Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner’s hand, then repeats this process for an artifact, an enchantment, and a land.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[|Magnificenza| — Scarta un’altra carta chiamata Linessa, Maga dello Zefiro: Un giocatore bersaglio fa tornare una creatura che controlla in mano al suo proprietario, poi ripete questo procedimento per un artefatto, un incantesimo e una terra.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[|Erhabenheit| — Wirf eine andere Karte namens Linessa die Westwindzauberin aus deiner Hand ab: Ein Spieler deiner Wahl bringt eine Kreatur, die er kontrolliert, auf die Hand ihres Besitzers zurück und wiederholt dann diesen Vorgang mit einem Artefakt, einer Verzauberung und einem Land.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[|Majesté| — Défaussez-vous d’une autre carte appelée Linessa, mage du zéphyr : Le joueur ciblé renvoie une créature qu’il contrôle dans la main de son propriétaire, puis il répète ce processus pour un artefact, un enchantement et un terrain.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[|Grandeza| — Descartar otra carta llamada Linessa, maga céfira: El jugador objetivo regresa una criatura que controla a la mano de su propietario, luego repite este proceso para un artefacto, un encantamiento y una tierra.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[壮大 ― 他の「西風の魔道士リネッサ」という名前のカードを1枚捨てる:プレイヤー1人を対象とする。そのプレイヤーは自分がコントロールするクリーチャーをすべてオーナーの手札に戻し、その後この手順をアーティファクトとエンチャントと土地について繰り返す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[|Grandeur| — Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner’s hand, then repeats this process for an artifact, an enchantment, and a land.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[|Сила духа| — Сбросьте другую карту с именем Линесса, Повелительница Западного Ветра: Целевой игрок возвращает находящееся под его контролем одно существо в руку его владельца, затем повторяет этот процесс для артефакта, чар и земли.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[|Grandeza| — Descarte outro card chamado Linessa, Maga Zéfira: O jogador alvo devolve uma criatura controlada por ele para a mão de seu dono, depois repete esse processo para um artefato, encantamento e terreno.]]></LOCALISED_TEXT>
    <COST type="Discard">
      <TARGET_DEFINITION id="6">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:NotTargetted()
      filter:SetZone( ZONE_HAND )
      filter:SetPlayer( EffectController() )
      filter:AddCardName( "LINESSA_ZEPHYR_MAGE" )
      </TARGET_DEFINITION>
      <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(6)
      </TARGET_DETERMINATION>
      <PLAYTIME>
      EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(0) )
      </PLAYTIME></COST>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    filter:SetHint( HINT_ENEMY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER", EffectDC():Make_Targets(1) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetController( player )
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:NotTargetted()
    filter:SetHint( HINT_ENEMY, player )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND", EffectDC():Make_Targets(2) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC2 = EffectDC():Get_Targets(2)
    if targetDC2 ~= nil then
   target_card2 = targetDC2:Get_CardPtr(0)
   if target_card2 ~= nil then
      target_card2:PutInHand()
   end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetController( player )
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_ARTIFACT )
    filter:NotTargetted()
    filter:SetHint( HINT_ENEMY, player )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_ARTIFACT_TO_PUT_INTO_HAND", EffectDC():Make_Targets(3) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC3 = EffectDC():Get_Targets(3)
    if targetDC3 ~= nil then
   target_card3 = targetDC3:Get_CardPtr(0)
   if target_card3 ~= nil then
      target_card3:PutInHand()
   end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetController( player )
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:NotTargetted()
    filter:SetHint( HINT_ENEMY, player )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_PUT_INTO_HAND", EffectDC():Make_Targets(4) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC4 = EffectDC():Get_Targets(4)
    if targetDC4 ~= nil then
   target_card4 = targetDC2:Get_CardPtr(0)
   if target_card4 ~= nil then
      target_card4:PutInHand()
   end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetController( player )
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_LAND )
    filter:NotTargetted()
    filter:SetHint( HINT_ENEMY, player )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_LAND_TO_PUT_INTO_HAND", EffectDC():Make_Targets(5) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC5 = EffectDC():Get_Targets(5)
    if targetDC5 ~= nil then
   target_card5 = targetDC5:Get_CardPtr(0)
   if target_card5 ~= nil then
      target_card5:PutInHand()
   end
    end
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY step="end_of_turn" />
    <AI_PLAY_SCORE>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_HAND )
    filter:AddCardName( "LINESSA_ZEPHYR_MAGE" )
    filter:SetPlayer( EffectController() )
    filter:NotTargetted()
    if filter:CountStopAt(1) == 1 then
   return 1000
    else
   return 0
    end
    </AI_PLAY_SCORE>
  </ACTIVATED_ABILITY>
  <SFX text="COMBAT_STORM_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_STORM_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
  <AI_BASE_SCORE score="500" zone="ZONE_IN_PLAY" />
</CARD_V2>
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Aether Tradewinds problem.

Postby BlindWillow » 30 Sep 2012, 00:45

If you prefer to go the TapLands route, here's thefiremind's 2012 code for Geth's ability:

Code: Select all
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{X}{B}: Put target artifact or creature card with converted mana cost X from an opponent’s graveyard onto the battlefield under your control tapped. Then that player puts the top X cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{X}{B}: Metti sul campo di battaglia sotto il tuo controllo TAPpata una carta creatura o artefatto bersaglio con costo di mana convertito pari a X dal cimitero di un avversario. Poi quel giocatore mette nel suo cimitero le prime X carte del suo grimorio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{X}{B}: Bringe eine Artefakt- oder Kreaturenkarte deiner Wahl mit umgewandelten Manakosten von X aus dem Friedhof eines Gegners unter deiner Kontrolle getappt ins Spiel. Dann legt dieser Spieler die obersten X Karten seiner Bibliothek auf seinen Friedhof.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{X}{B} : Mettez une carte d’artefact ou de créature ciblée avec un coût converti de mana de X sur le champ de bataille depuis le cimetière d’un adversaire, sous votre contrôle, engagée. Ce joueur met ensuite les X cartes du dessus de sa bibliothèque dans son cimetière.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{X}{B}: Pon en el campo de batalla girada bajo tu control la carta de artefacto o criatura objetivo con coste de maná convertido de X del cementerio de un oponente. Luego ese jugador pone las primeras X cartas de su biblioteca en su cementerio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{X}{B}:いずれかの対戦相手の墓地にある点数で見たマナ・コストがXの、アーティファクト・カード1枚かクリーチャー・カード1枚を対象とし、それをあなたのコントロール下でタップ状態で戦場に出す。 その後、そのプレイヤーは、自分のライブラリーの一番上からX枚のカードを自分の墓地に置く。]]></LOCALISED_TEXT>
    <COST type="mana" cost="{0}" />
    <TARGET_DETERMINATION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_ARTIFACT )
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_GRAVEYARD )
    local num_players = MTG():GetNumberOfPlayers()
    for p=0,num_players-1 do
      local player = MTG():GetNthPlayer(p)
      if player:GetTeam() ~= Object():GetPlayer():GetTeam() then
        filter:SetPlayer( player )
      end
    end
    if filter:CountStopAt( 1 ) == 1 then
      local maxcost = 16
      local maxafford = 0
      for i=1,maxcost do
        if Object():GetPlayer():CanAfford("{"..i.."}{B}", nil) == 1 then
          maxafford = i
        end
      end
      filter:SetConvertedCostMax( maxafford )
      if filter:CountStopAt( 1 ) == 1 then
        return TARGET_DETERMINATION_ALL
      end
    end
    return TARGET_DETERMINATION_NONE
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_ARTIFACT )
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_GRAVEYARD )
    local num_players = MTG():GetNumberOfPlayers()
    for p=0,num_players-1 do
      local player = MTG():GetNthPlayer(p)
      if player:GetTeam() ~= Object():GetPlayer():GetTeam() then
        filter:SetPlayer( player )
      end
    end
    if filter:CountStopAt( 1 ) == 1 then
      local maxcost = 16
      local maxafford = 0
      for i=1,maxcost do
        if Object():GetPlayer():CanAfford("{"..i.."}{B}", nil) == 1 then
          maxafford = i
        end
      end
      filter:SetConvertedCostMax( maxafford )
      if filter:CountStopAt( 1 ) == 1 then
        ChooseTarget( "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_BATTLEFIELD" )
      end
    end
    </PLAY_TIME_ACTION>
    <PLAY_TIME_ACTION>
    local target_card = Object():GetTargetCard()
    if target_card ~= nil then
      local cmc = target_card:GetConvertedManaCost()
      Object():GetPlayer():TapLand("{"..cmc.."}{B}")
      local store = Storage( Object() )
      store.set( 0, target_card )
    end
    </PLAY_TIME_ACTION>
    <AI_BASE_SCORE score="1200" zone="in_play" />
  </ACTIVATED_ABILITY>
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Aether Tradewinds problem.

Postby thefiremind » 30 Sep 2012, 08:50

BlindWillow wrote:If you prefer to go the TapLands route, here's thefiremind's 2012 code for Geth's ability:
In case you need an explanation about the for cycle with "maxafford", that checks the maximum amount of colorless mana that I can pay together with {B}. DotP2012 didn't have the function for retrieving the total available mana, and it wouldn't have been useful anyway because of the mandatory black mana.
I'm pretty proud of that card because it seemed impossible to me at first glance. :D
< 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: 722 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 4 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 9824 on 10 Nov 2025, 04:33

Users browsing this forum: No registered users and 4 guests

Login Form