It is currently 16 Apr 2024, 04:21
   
Text Size

A planeswalkers mod

User-made mods in DLC (Downloadable Content) form.
Get MTG cards here for your DotP that aren't available anywhere else!

Moderator: CCGHQ Admins

Re: A planeswalkers mod

Postby BloodReyvyn » 09 Jun 2013, 11:11

Actually yes originally, it said something along the lines of "[COMPOUND_TYPE_METANAME_ENCHANTMENT_PLANESWALKER]" where it should have said the type.

There is one other issue going on. I have the first two abilities working flawlessly so far, but you can still trigger each of them once per turn, rather than just one of them per turn.
Last edited by BloodReyvyn on 09 Jun 2013, 11:18, edited 1 time in total.
"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: A planeswalkers mod

Postby thefiremind » 09 Jun 2013, 11:13

BloodReyvyn wrote:Actually yes originally, it said something along the lines of "[COMPOUND_TYPE_METANAME_ENCHANTMENT_PLANESWALKER]" where it should have said the type.
This is actually good because you could define that string to be localised as just "Planeswalker" and hide the fact that it's also an enchantment. 8)
< 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: A planeswalkers mod

Postby BloodReyvyn » 09 Jun 2013, 11:23

Ooh that would be awesome... Still trying to figure out that last ability, it's a beastly one only because the way I described how it would act might make creatures with shroud or hexproof being stuck in the unselected group. That could lead to you being forced to leave something you might not want to in the "unselected stack."

I can't think of another way to do it without removing them from the battlefield, then putting them back, which would introduce worse headaches in the long run.
"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: A planeswalkers mod

Postby BloodReyvyn » 09 Jun 2013, 11:45

Actually got everything more or less working thus far, with the exceptions of;

1. The abilities can still each be activated once per turn rather than just one ability period per turn.

2. The AI will opt to use the Redirection Counters when the PW is in play, but the damage is not "redirected" at all. Damage goes right to the player with no counters removed.

EDIT: Also, I re-tried the dual type again and it says exactly "[COMPOUND_TYPE_ENCHANTMENT_PLANESWALKER]", not sure if the lack of the word METANAME matters at all.
"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: A planeswalkers mod

Postby Rickycoe123 » 09 Jun 2013, 13:54

So, im guessing you guys have had the planes walker viewable in the deck, but not being able to activate the abilities?
Rickycoe123
 
Posts: 138
Joined: 14 Mar 2013, 22:44
Has thanked: 1 time
Been thanked: 15 times

Re: A planeswalkers mod

Postby thefiremind » 09 Jun 2013, 14:05

BloodReyvyn wrote:1. The abilities can still each be activated once per turn rather than just one ability period per turn.
This is because
Code: Select all
local characteristics = Object()
should be
Code: Select all
local characteristics = Object():GetCurrentCharacteristics()
BloodReyvyn wrote:2. The AI will opt to use the Redirection Counters when the PW is in play, but the damage is not "redirected" at all. Damage goes right to the player with no counters removed.
I don't like the "counters" route for this... I'd like to think about something cleaner.
BloodReyvyn wrote:EDIT: Also, I re-tried the dual type again and it says exactly "[COMPOUND_TYPE_ENCHANTMENT_PLANESWALKER]", not sure if the lack of the word METANAME matters at all.
Well, whatever the string is, declare it in a TEXT_PERMANENT XML so that it's localised as "Planeswalker" (at least in English, the other translations are a minor issue for now). Do it exactly the same way as you give names to the decks.
< 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: A planeswalkers mod

Postby BloodReyvyn » 10 Jun 2013, 00:00

Alright, It no longer says all that jazz and looks like just a Planeswalker. SWEET!

Originally, I was going to remove all redirection counters at the end of combat, but I suppose I could just give the creature a hidden ability that "redirects" damage in a similar manner.

I have 2 concerns with this approach since I been thinking about it:

1. With the current set-up I would have to prevent the damage to the player and remove counters equal to the damage prevented... however, some cards have damage that can't be prevented, ie- Malignus.

2. I could give the creature a hidden ability rather than a counter until EOT, but would I be able to actually deal damage to this card directly and make an ability that just removes the counters as it's dealt damage?

If I could, I could in turn do the same thing whenever a player casts a spell or activates an ability that would deal damage to the planeswalker's controller; Ask the spell or ability's controller if they prefer to redirect the damage to the planeswalker instead.

After the above (the bulk of PW issues I believe) is sorted, I need to either find a way to make the PW unable to be targeted by spells and abilities that specifically target enchantments. Do you think it would be better to try and filter the card out somehow (not quite sure if you even can) or give the planeswalker shroud until the spell or ability resolves?

EDIT: After that last edit, however, she is now going directly to the graveyard when she's cast. Current code (Not sure I need to keep updating, but it keeps the topic fresh I suppose):

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="LILIANA_OF_THE_VEIL_235597" />
  <CARDNAME text="LILIANA_OF_THE_VEIL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Liliana du voile]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Liliana mit Schleier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ヴェールのリリアナ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Лилиана с Завесой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Liliana do Véu]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="235597" />
  <ARTID value="A235597" />
  <ARTIST name="Steve Argyle" />
  <CASTING_COST cost="{1}{B}{B}" />
  -- must find a way to make cards that target enchantments to ignore this card as a target or give this card shroud when effects that target enchantments are activated.
  <TYPE metaname="Enchantment" />
  <TYPE metaname="Planeswalker" />
  <SUB_TYPE metaname="Liliana" />
  <EXPANSION value="ISD" />
  <RARITY metaname="M" />

  -- Makes it come into play with 3 loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" from_zone="ZONE_ANY" />
    <RESOLUTION_TIME_ACTION>
      Object():AddCounters( MTG():GetCountersType("LOYALTY_COUNTER"), 3 )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make each player discard a card and add one loyalty counter.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(+1): Chaque joueur se défausse d’une carte. ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(+1): Cada jugador descarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(+1): Jeder Spieler wirft eine Karte aus seiner Hand ab.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(+1)]</span><span style=“position:relative; font-style:normal”>: Ogni giocatore scarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(+1):各プレイヤーはカードを1枚捨てる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(+1): каждый игрок сбрасывает карту.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(+1): Cada jogador descarta um card.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="1" />
    -- Simple Rix-Maddi discard effect from thefiremind's mod.
    <RESOLUTION_TIME_ACTION repeating="1">
      local n = MTG():GetActionRepCount()
      local num_players = MTG():GetNumberOfPlayers()
      local playerindex = n
      local player = MTG():GetNthPlayer(playerindex)
      local filter = Object():GetFilter()
      if player ~= nil and n &lt; num_players then
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( player )
       filter:SetZone( ZONE_HAND )
       filter:SetHint( HINT_ENEMY, player )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(n) )
       return true   
      else
       for i=0,num_players-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
       return false
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Makes a target player sac a creature at the cost of 2 loyalty counters.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-2): Le joueur ciblé sacrifie une créature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-2): El jugador objetivo sacrifica una criatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-2): Ein Spieler deiner Wahl opfert eine Kreatur.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-2)]</span><span style=“position:relative; font-style:normal”>: Un giocatore bersaglio sacrifica una creatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-2):プレイヤー1人を対象とする。そのプレイヤーはクリーチャーを1体生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-2): целевой игрок приносит в жертву существо.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-2): O jogador alvo sacrifica uma criatura.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="-2" />
    -- Simple Diabolic Edict code from thefiremind's mod
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_TO_SACRIFICE_CREATURE", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( 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_SACRIFICE", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target ~= nil then
       local player = target:GetPlayer()
        target:Sacrifice(player) 
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Not Implemented yet, will ask the effect controller to choose any number of permanents a player controls.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-6): Séparez tous les permanents que le joueur ciblé contrôle en deux tas. Ce joueur sacrifie tous les permanents dans le tas de son choix.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-6): Separa todos los permanentes que controla el jugador objetivo en dos montones. Ese jugador sacrifica todos los permanentes en un montón de su elección.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-6): Teile alle bleibenden Karten, die ein Spieler deiner Wahl kontrolliert, auf zwei Stapel auf. Dieser Spieler opfert alle bleibenden Karten in einem der Stapel, den er bestimmt.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-6)]</span><span style=“position:relative; font-style:normal”>: Separa in due pile tutti i permanenti controllati da un giocatore bersaglio. Quel giocatore sacrifica tutti i permanenti nella pila a sua scelta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-6): プレイヤー1人を対象とし、そのプレイヤーがコントロールするすべてのパーマネントを2つの束に分ける。 そのプレイヤーは束を1つ選び、その束にあるすべてのパーマネントを生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-6): разделите все перманенты под контролем целевого игрока на две стопки. Тот игрок приносит в жертву все перманенты в стопке по его выбору.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-6): Separe todas as permanentes que o jogador alvo controla em dois montes. Aquele jogador sacrifica todas as permanentes no monte à escolha dele.]]></LOCALISED_TEXT>
    -- Going to have to fudge ability by selecting any number of permanents target player controls, then asking them to sac the selected or unselected cards, such as "Sacrifice the selected permanents? (If not, unselected permenents will be sacrificed instead)."
    <COST type="countersself" name="LOYALTY_COUNTER" number="-6" />
  </ACTIVATED_ABILITY>

  -- Sacrifice this permanent when it no longer has any loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="STATE_BASED_EFFECTS">
      return Object():CountCounters( MTG():GetCountersType("LOYALTY_COUNTER") ) == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      Object():PutInGraveyard()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make it only be able to use one ability per turn.
  <TRIGGERED_ABILITY internal="1" auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ACTIVATED_ABILITY_PLAYED" simple_qualifier="self" />
    <CONTINUOUS_ACTION layer="6">
       local characteristics = Object():GetCurrentCharacteristics()
       if characteristics ~= nil then
         characteristics:Characteristic_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1 )     
       end
    </CONTINUOUS_ACTION>
    <DURATION>
      return ( MTG():GetStep() == STEP_UNTAP ) and ( EffectController():MyTurn() ~= 0 )
    </DURATION>     
  </TRIGGERED_ABILITY>

  -- Ask the attacking player if they want to attack this planeswalker instead and put a redirection counter on that creature.
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ATTACKING">
      local defending = TriggerObject():GetPlayerAttacked()
      return defending ~= nil and defending:GetTeam() == EffectController():GetTeam()
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local player = TriggerObject():ObjectController()
      if player:IsAI() == 0 then
       player:BeginNewMultipleChoice()
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
       player:AskMultipleChoiceQuestion( "CARD_QUERY_ATTACK_THIS_PLANESWALKER_INSTEAD" )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if TriggerObject():GetMultipleChoiceResult() == 0 then
        TriggerObject():AddCounters( MTG():GetCountersType("LILIANA_REDIRECTION_COUNTER"), 1 )
      end
    </RESOLUTION_TIME_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>

  -- Redirect damage from the player to the planeswalker, or rather remove counters equal to the damage that would have been dealt by each creature with a Liliana-specific redirection counter on it.
  <TRIGGERED_ABILITY  internal="1" pre_trigger="1" auto_skip="1" priority="-10" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="PLAYER_TOOK_DAMAGE">
      return TriggerPlayer() == EffectController()
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      if (Damage():GetReceivingPlayer() == EffectController()) and (Damage():EffectSource():SetHasCounterType("LILIANA_REDIRECTION_COUNTER") == 1) then
         Object():RemoveCounters( MTG():GetCounters("LOYALTY_COUNTER"), Damage() )
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Pointless but helpful visual depiction of the base Loyalty of the Planeswalker.
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
  </STATIC_ABILITY>

</CARD_V2>
"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: A planeswalkers mod

Postby BloodReyvyn » 10 Jun 2013, 05:48

Well, I rewrote a few things, but with her going to the grave the moment she hits the battlefield it's all theoretical at this point. I have no idea what is making her go to the grave, since I tried commenting out almost everything that actually does anything at all... and it still happens.

Current code:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="LILIANA_OF_THE_VEIL_235597" />
  <CARDNAME text="LILIANA_OF_THE_VEIL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Liliana du voile]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Liliana mit Schleier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ヴェールのリリアナ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Лилиана с Завесой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Liliana do Véu]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="235597" />
  <ARTID value="A235597" />
  <ARTIST name="Steve Argyle" />
  <CASTING_COST cost="{1}{B}{B}" />
  -- must find a way to make cards that target enchantments to ignore this card as a target or give this card shroud when effects that target enchantments are activated.
  <TYPE metaname="Enchantment" />
  <TYPE metaname="Planeswalker" />
  <SUB_TYPE metaname="Liliana" />
  <EXPANSION value="ISD" />
  <RARITY metaname="M" />

  -- Makes it come into play with 3 loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" priority="-10" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" from_zone="ZONE_ANY" />
    <RESOLUTION_TIME_ACTION>
      Object():AddCounters( MTG():GetCountersType("LOYALTY_COUNTER"), 3 )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make each player discard a card and add one loyalty counter.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(+1): Chaque joueur se défausse d’une carte. ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(+1): Cada jugador descarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(+1): Jeder Spieler wirft eine Karte aus seiner Hand ab.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(+1)]</span><span style=“position:relative; font-style:normal”>: Ogni giocatore scarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(+1):各プレイヤーはカードを1枚捨てる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(+1): каждый игрок сбрасывает карту.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(+1): Cada jogador descarta um card.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="1" />
    -- Each player chooses and discards a card.
    <RESOLUTION_TIME_ACTION repeating="1">
      local n = MTG():GetActionRepCount()
      local num_players = MTG():GetNumberOfPlayers()
      local playerindex = n
      local player = MTG():GetNthPlayer(playerindex)
      local filter = Object():GetFilter()
      if player ~= nil and n &lt; num_players then
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( player )
       filter:SetZone( ZONE_HAND )
       filter:SetHint( HINT_ENEMY, player )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(n) )
       return true   
      else
       for i=0,num_players-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
       return false
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Makes a target player sac a creature at the cost of 2 loyalty counters.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-2): Le joueur ciblé sacrifie une créature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-2): El jugador objetivo sacrifica una criatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-2): Ein Spieler deiner Wahl opfert eine Kreatur.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-2)]</span><span style=“position:relative; font-style:normal”>: Un giocatore bersaglio sacrifica una creatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-2):プレイヤー1人を対象とする。そのプレイヤーはクリーチャーを1体生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-2): целевой игрок приносит в жертву существо.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-2): O jogador alvo sacrifica uma criatura.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="-2" />
    -- Simple Diabolic Edict code from thefiremind's mod
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_TO_SACRIFICE_CREATURE", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( 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_SACRIFICE", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target ~= nil then
       local player = target:GetPlayer()
        target:Sacrifice(player) 
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Will ask the effect controller to choose any number of permanents a player controls.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-6): Séparez tous les permanents que le joueur ciblé contrôle en deux tas. Ce joueur sacrifie tous les permanents dans le tas de son choix.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-6): Separa todos los permanentes que controla el jugador objetivo en dos montones. Ese jugador sacrifica todos los permanentes en un montón de su elección.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-6): Teile alle bleibenden Karten, die ein Spieler deiner Wahl kontrolliert, auf zwei Stapel auf. Dieser Spieler opfert alle bleibenden Karten in einem der Stapel, den er bestimmt.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-6)]</span><span style=“position:relative; font-style:normal”>: Separa in due pile tutti i permanenti controllati da un giocatore bersaglio. Quel giocatore sacrifica tutti i permanenti nella pila a sua scelta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-6): プレイヤー1人を対象とし、そのプレイヤーがコントロールするすべてのパーマネントを2つの束に分ける。 そのプレイヤーは束を1つ選び、その束にあるすべてのパーマネントを生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-6): разделите все перманенты под контролем целевого игрока на две стопки. Тот игрок приносит в жертву все перманенты в стопке по его выбору.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-6): Separe todas as permanentes que o jogador alvo controla em dois montes. Aquele jogador sacrifica todas as permanentes no monte à escolha dele.]]></LOCALISED_TEXT>
    -- Going to have to fudge ability by selecting any number of permanents target player controls, then asking them to sac the selected or unselected cards, such as "Sacrifice the selected permanents? (If not, unselected permenents will be sacrificed instead)."
    <COST type="countersself" name="LOYALTY_COUNTER" number="-6" />
  </ACTIVATED_ABILITY>

  -- Sacrifice this permanent when it no longer has any loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="STATE_BASED_EFFECTS">
      return Object():CountCounters( MTG():GetCountersType("LOYALTY_COUNTER") ) == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      Object():PutInGraveyard()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make it only be able to use one ability per turn.
  <TRIGGERED_ABILITY internal="1" auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ACTIVATED_ABILITY_PLAYED" simple_qualifier="self" />
    <CONTINUOUS_ACTION layer="6">
       local characteristics = Object():GetCurrentCharacteristics()
       if characteristics ~= nil then
         characteristics:Characteristic_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1 )     
       end
    </CONTINUOUS_ACTION>
    <DURATION>
      return ( MTG():GetStep() == STEP_UNTAP ) and ( EffectController():MyTurn() ~= 0 )
    </DURATION>     
  </TRIGGERED_ABILITY>

  -- Ask the attacking player if they want to attack this planeswalker instead. If they do, grant an ability to the creature that redirects that creature's combat damage to the planeswalker this turn.
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ATTACKING">
      local defending = TriggerObject():GetPlayerAttacked()
      return defending ~= nil and defending:GetTeam() == EffectController():GetTeam()
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local player = TriggerObject():ObjectController()
      if player:IsAI() == 0 then
       player:BeginNewMultipleChoice()
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
       player:AskMultipleChoiceQuestion( "CARD_QUERY_ATTACK_THIS_PLANESWALKER_INSTEAD" )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if TriggerObject():GetMultipleChoiceResult() == 0 then
        TriggerObject():GetCurrentCharacteristics():GrantAbility(1)
      end
    </RESOLUTION_TIME_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>

  -- Redirect damage from the player to the planeswalker and remove counters equal to the damage that would have been dealt by each source.
  <TRIGGERED_ABILITY  internal="1" pre_trigger="1" auto_skip="1" priority="-10" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="PLAYER_TOOK_DAMAGE">
      return ( TriggerPlayer() == EffectController() ) and ( TriggerObject():GetCurrentCharacteristics():HasAbility(1) == 1 )
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local planeswalker = Object()
      if Damage():GetReceivingPlayer() == EffectController() then
       if planeswalker ~= nil then
         Damage():SetReceivingObject(planeswalker)
          Object():RemoveCounters( MTG():GetCountersType("LOYALTY_COUNTER"), Damage() )
       end
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- If there are two planeswalkers with the same SUBTYPE, both of them are sacrificed.
  <TRIGGERED_ABILITY auto_skip="1" internal="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_IN_PLAY" from_zone="ZONE_ANY" />
    <RESOLUTION_TIME_ACTION>
      local total = 0
      local filter = Object():GetFilter()
      filter:Clear()
      filter:NotTargetted()
      filter:AddCardSubtype( "LILIANA" )
      filter:SetZone(ZONE_IN_PLAY)
      total = filter:Count()
      if total &gt; 1 then
        Object():PutInGraveyard()
      end
      return false
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- The ability granted to creatures if they choose to deal their damage to the planeswalker instead.
  <STATIC_ABILITY resource_id="1" immunity="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
  </STATIC_ABILITY>

  -- Pointless for us but helpful for players; visual depiction of the base Loyalty of the Planeswalker.
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
  </STATIC_ABILITY>

</CARD_V2>
Pretty much can't do anything at all until she stays on the battlefield for longer than a fraction of a second (can't even see if she's coming into play with counters any more, but I assume so because it was fine before). :x

EDIT: Removed every single ability that would send her to the grave and she still goes directly to the grave...
"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: A planeswalkers mod

Postby BloodReyvyn » 10 Jun 2013, 07:51

Okay, I figured it out... sort of...

Giving her two different types works great for making the card say it's a planeswalker... However, either the game does not recognize the card type "Planeswalker" and simply treats it like an instant or sorcery (sending it to the grave after it's casted) or it does not recognize the card type [COMPOUND_TYPE_ENCHANTMENT_PLANESWALKER] to the same effect... Seems cards of an unknown type are simply sent to the grave. Is there a way to prevent that?

I deleted the line:

Code: Select all
  <TYPE metaname="Planeswalker" />
And now it works again, that's pretty much the only basis I have to go on at this point.
"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: A planeswalkers mod

Postby BloodReyvyn » 10 Jun 2013, 08:17

Well, I thought all was good, but now she gets sent to the graveyard randomly...

Whatever... Here's the code if anyone else wants a crack at it:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="LILIANA_OF_THE_VEIL_235597" />
  <CARDNAME text="LILIANA_OF_THE_VEIL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Liliana du voile]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Liliana mit Schleier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Liliana del Velo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ヴェールのリリアナ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Liliana of the Veil]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Лилиана с Завесой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Liliana do Véu]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="235597" />
  <ARTID value="A235597" />
  <ARTIST name="Steve Argyle" />
  <CASTING_COST cost="{1}{B}{B}" />
  -- must find a way to make cards that target enchantments to ignore this card as a target or give this card shroud when effects that target enchantments are activated.
  <TYPE metaname="Enchantment" />
  <SUPERTYPE metaname="Planeswalker" />
  <SUB_TYPE metaname="Liliana" />
  <EXPANSION value="ISD" />
  <RARITY metaname="M" />

  -- Makes it come into play with 3 loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" from_zone="ZONE_ANY" />
    <RESOLUTION_TIME_ACTION>
      Object():AddCounters( MTG():GetCountersType("LOYALTY_COUNTER"), 3 )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make each player discard a card and add one loyalty counter.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(+1): Chaque joueur se défausse d’une carte. ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(+1): Cada jugador descarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(+1): Jeder Spieler wirft eine Karte aus seiner Hand ab.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(+1)]</span><span style=“position:relative; font-style:normal”>: Ogni giocatore scarta una carta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(+1):各プレイヤーはカードを1枚捨てる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(+1): Each player discards a card.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(+1): каждый игрок сбрасывает карту.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(+1): Cada jogador descarta um card.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="1" />
    -- Each player chooses and discards a card.
    <RESOLUTION_TIME_ACTION repeating="1">
      local n = MTG():GetActionRepCount()
      local num_players = MTG():GetNumberOfPlayers()
      local playerindex = n
      local player = MTG():GetNthPlayer(playerindex)
      local filter = Object():GetFilter()
      if player ~= nil and n &lt; num_players then
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( player )
       filter:SetZone( ZONE_HAND )
       filter:SetHint( HINT_ENEMY, player )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(n) )
       return true   
      else
       for i=0,num_players-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
       return false
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Makes a target player sac a creature at the cost of 2 loyalty counters.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-2): Le joueur ciblé sacrifie une créature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-2): El jugador objetivo sacrifica una criatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-2): Ein Spieler deiner Wahl opfert eine Kreatur.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-2)]</span><span style=“position:relative; font-style:normal”>: Un giocatore bersaglio sacrifica una creatura.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-2):プレイヤー1人を対象とする。そのプレイヤーはクリーチャーを1体生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-2): Target player sacrifices a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-2): целевой игрок приносит в жертву существо.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-2): O jogador alvo sacrifica uma criatura.]]></LOCALISED_TEXT>
    <COST type="countersself" name="LOYALTY_COUNTER" number="-2" />
    -- Simple Diabolic Edict code from thefiremind's mod
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_TO_SACRIFICE_CREATURE", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( 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_SACRIFICE", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target ~= nil then
       local player = target:GetPlayer()
        target:Sacrifice(player) 
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Will ask the effect controller to choose any number of permanents a player controls.
  <ACTIVATED_ABILITY per_turn_limit="1" filter_zone="ZONE_IN_PLAY" sorcery_time="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[(-6): Séparez tous les permanents que le joueur ciblé contrôle en deux tas. Ce joueur sacrifie tous les permanents dans le tas de son choix.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[(-6): Separa todos los permanentes que controla el jugador objetivo en dos montones. Ese jugador sacrifica todos los permanentes en un montón de su elección.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[(-6): Teile alle bleibenden Karten, die ein Spieler deiner Wahl kontrolliert, auf zwei Stapel auf. Dieser Spieler opfert alle bleibenden Karten in einem der Stapel, den er bestimmt.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[</span><span style=“position:relative; font-style:italic”>[(-6)]</span><span style=“position:relative; font-style:normal”>: Separa in due pile tutti i permanenti controllati da un giocatore bersaglio. Quel giocatore sacrifica tutti i permanenti nella pila a sua scelta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(-6): プレイヤー1人を対象とし、そのプレイヤーがコントロールするすべてのパーマネントを2つの束に分ける。 そのプレイヤーは束を1つ選び、その束にあるすべてのパーマネントを生け贄に捧げる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[(-6): Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[(-6): разделите все перманенты под контролем целевого игрока на две стопки. Тот игрок приносит в жертву все перманенты в стопке по его выбору.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[(-6): Separe todas as permanentes que o jogador alvo controla em dois montes. Aquele jogador sacrifica todas as permanentes no monte à escolha dele.]]></LOCALISED_TEXT>
    -- Going to have to fudge ability by selecting any number of permanents target player controls, then asking them to sac the selected or unselected cards, such as "Sacrifice the selected permanents? (If not, unselected permenents will be sacrificed instead)."
    <COST type="countersself" name="LOYALTY_COUNTER" number="-6" />
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_TO_SACRIFICE_PERMANENTS", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
  </ACTIVATED_ABILITY>

  -- Sacrifice this permanent when it no longer has any loyalty counters on it.
  <TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="STATE_BASED_EFFECTS">
      return Object():CountCounters( MTG():GetCountersType("LOYALTY_COUNTER") ) == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      Object():PutInGraveyard()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- Make it only be able to use one ability per turn.
  <TRIGGERED_ABILITY internal="1" auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ACTIVATED_ABILITY_PLAYED" simple_qualifier="self" />
    <CONTINUOUS_ACTION layer="6">
       local characteristics = Object():GetCurrentCharacteristics()
       if characteristics ~= nil then
         characteristics:Characteristic_Set( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1 )     
       end
    </CONTINUOUS_ACTION>
    <DURATION>
      return ( MTG():GetStep() == STEP_UNTAP ) and ( EffectController():MyTurn() ~= 0 )
    </DURATION>     
  </TRIGGERED_ABILITY>

  -- Ask the attacking player if they want to attack this planeswalker instead. If they do, grant an ability to the creature that redirects that creature's combat damage to the planeswalker this turn.
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ATTACKING">
      local defending = TriggerObject():GetPlayerAttacked()
      return ( defending ~= nil ) and ( defending:GetTeam() == EffectController():GetTeam() )
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local player = TriggerObject():ObjectController()
      if player:IsAI() == 0 then
       player:BeginNewMultipleChoice()
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
       player:AskMultipleChoiceQuestion( "CARD_QUERY_ATTACK_THIS_PLANESWALKER_INSTEAD" )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if TriggerObject():GetMultipleChoiceResult() == 0 then
        TriggerObject():GetCurrentCharacteristics():GrantAbility(1)
      end
    </RESOLUTION_TIME_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </TRIGGERED_ABILITY>

  -- Redirect damage from the player to the planeswalker and remove counters equal to the damage that would have been dealt by each source.
  <TRIGGERED_ABILITY  internal="1" pre_trigger="1" auto_skip="1" priority="-10" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="PLAYER_TOOK_DAMAGE">
      return ( TriggerPlayer() == EffectController() ) and ( TriggerObject():GetCurrentCharacteristics():HasAbility(1) == 1 )
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local planeswalker = Object()
      if Damage():GetReceivingPlayer() == EffectController() then
       if planeswalker ~= nil then
         Damage():SetReceivingObject(planeswalker)
          --Object():RemoveCounters( MTG():GetCountersType("LOYALTY_COUNTER"), Damage() )
       end
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- If there are two planeswalkers with the same SUBTYPE, both of them are sacrificed. Unfortunately, the SubType filter doesn't work, so we have to look for every existing planeswalker name of that type...
  <TRIGGERED_ABILITY auto_skip="1" internal="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_IN_PLAY" from_zone="ZONE_ANY" />
    <RESOLUTION_TIME_ACTION>
      local total = 0
      local filter = Object():GetFilter()
      filter:Clear()
      filter:NotTargetted()
      filter:AddCardName( "LILIANA_OF_THE_VEIL" )
      filter:SetZone(ZONE_IN_PLAY)
      total = filter:Count()
      if total &gt; 1 then
        Object():PutInGraveyard()
      end
      return false
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  -- The ability granted to creatures if they choose to deal their damage to the planeswalker instead.
  <STATIC_ABILITY resource_id="1" immunity="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[This creatures is attacking Liliana of the Veil.]]></LOCALISED_TEXT>
  </STATIC_ABILITY>

  -- Pointless for us but helpful for players; visual depiction of the base Loyalty of the Planeswalker.
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[                                         Loyalty ( 3 )]]></LOCALISED_TEXT>
  </STATIC_ABILITY>

</CARD_V2>
Been spending the better part of 3 days off on this and it's starting to actually annoy me, so I am done for the moment. :( Probably take another look at it in a week or so, after I have a chance to work on a few other cards that won't be so annoying to make.
"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: A planeswalkers mod

Postby thefiremind » 10 Jun 2013, 23:06

There's no function called HasAbility... I understood what you wanted to do there (more or less), and a function like that would have been useful for other cards, but it doesn't exist. :wink:

Anyway, the fact that it goes straight to the graveyard if it has the Planeswalker type made it much less appealing to me... one forced approximation too much. :(
< 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: A planeswalkers mod

Postby BloodReyvyn » 11 Jun 2013, 09:20

Kind of my feeling on it when I reached that point... I was so elated when I got it to say just Planeswalker... then completely crushed when I found out that was the reason I couldn't keep it out.

Then I hit a few more issues and kind started thinking "is this really worth it for a game that's about to cycle out more or less?"

I would like to try again, but I am thinking Duels 2014 may have better ways to work around... and it's not that far off from release. After that, it's a matter of how long before it's cracked open so we can actually make mods (ie- Rick's DLL)
"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

Previous

Return to New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)

Who is online

Users browsing this forum: No registered users and 14 guests


Who is online

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

Login Form