It is currently 06 Sep 2025, 16:44
   
Text Size

Card Creation Request Thread

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: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 02:31

Can somebody tell me how to filter multicolored permanents?

I'm trying to do Renounce the Guilds

here's my progress so far:
| Open
Code: Select all
  <SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Each player sacrifices a multicolored permanent.]]></LOCALISED_TEXT>
    <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
       -- ask the query
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( player )
       filter:SetZone( ZONE_IN_PLAY )
       filter:SetHint( HINT_ENEMY, player )
        filter:SetMonoColoured( false )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_PERMANENT_TO_SACRIFICE", EffectDC():Make_Targets(n) )
       return true
       
    else
       local i=0
       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:Sacrifice( target_card:GetPlayer() )
            end
          end
       end
       return false
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
do I need to add a filter block? or replace SetMonoColoured( false ) for something else?

Thanks in advance
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby sumomole » 18 Jun 2013, 04:06

gorem2k wrote:Can somebody tell me how to filter multicolored permanents?

I'm trying to do Renounce the Guilds

do I need to add a filter block? or replace SetMonoColoured( false ) for something else?
No, "filter: SetMonoColoured (false)" just mean not necessary monocolor, it includes monocolor and multicolor.
If it's me, I will use PermanentColour(object) that in my functions, which is used to detect whether a card is multicolored.
And I must to say, when we code any card that sacrifices permanents, we should add 5 permanent types, since the mana token is also permanent, and AI can sacrifices it instead of other permanent.
Renounce the Guilds | Open
Code: Select all
    local filter = Object():GetFilter()
    MTG():ClearFilterMarkedObjectsInZone(ZONE_IN_PLAY)
    filter:Clear()
    filter:NotTargetted()
    filter:AddCardType( CARD_TYPE_ARTIFACT )
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddCardType( CARD_TYPE_LAND )
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:AddCardType( CARD_TYPE_PLANESWALKER )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetController( player )
    local total = filter:EvaluateObjects()
    if total &gt; 0 then
      for i=0,total-1 do
        local card = filter:GetNthEvaluatedObject(i)             
        if card ~= nil and PermanentColour(card) &gt; 1 then         
           card:MarkForFilter()
        end
      end          
    end
    filter:SetMarkedObjectsOnly()
    filter:SetHint( HINT_ENEMY, player )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_PERMANENT_TO_SACRIFICE", EffectDC():Make_Targets(n) )
NEMESiS wrote:Does anyone have Hindering Light, Survival Cache, Overrule or Vanish into Memory?
I have tried Dawn Charm but failed, so I can't code Hindering Light, and there are Survival Cache & Overrule & Vanish into Memory.
you can use the Rebound ability of DISTORTION_STRIKE_280255 or any ohter official card to code Survival Cache.
Survival Cache | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You gain 2 life. Then if you have more life than an opponent, draw a card.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
    EffectController():GainLife( 2 )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local life_min = EffectController():GetLifeTotal()
    for i=0,MTG():GetNumberOfPlayers()-1 do
       local player = MTG():GetNthPlayer( i )
       if player ~= nil and player:GetTeam() ~= EffectController():GetTeam() then
         if player:GetLifeTotal() &lt; life_min then
            life_min = player:GetLifeTotal()
         end
       end
    end
    if EffectController():GetLifeTotal() &gt; life_min then
       EffectController():DrawCard()
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_PLAYER_LIFE_PLAY" />
  </SPELL_ABILITY>
The Overrule used some string(referencing permanent text) that in my mod.
Overrule | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Counter target spell unless its controller pays {X}. You gain X life.]]></LOCALISED_TEXT>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_STACK )
    filter:SetStackObjectType( STACK_OBJECT_CARD )
    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_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_spell = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_spell ~= nil then
      local player = target_spell:GetPlayer()
      local mana = GetObjectX()
       if player ~= nil and player:CanAfford("{"..mana.."}") == 1 then
         player:SetCustomQueryInstructionValue( mana )
          player:BeginNewMultipleChoice()   
          player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PAY_"..mana )   
          player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_IS_COUNTERED" )   
          player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_RUNE_SNAG" )
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_spell = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_spell ~= nil then
      local player = target_spell:GetPlayer()
      local mana = GetObjectX()
      local decision = Object():GetMultipleChoiceResult()
      local characteristics = target_spell:GetCurrentCharacteristics()
      if player ~= nil then
        if player:CanAfford("{"..mana.."}") == 1 then
          if decision ~= 1 then
            player:TapLand("{"..mana.."}")
          else
             target_spell:CounterSpell()
          end     
        else
          target_spell:CounterSpell()
        end
      end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if (player ~= nil) then
       player:GainLife(GetObjectX())
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
Vanish into Memory.zip
(103.34 KiB) Downloaded 339 times


Kieran wrote:RiiakShiNal, thanks for providing the link to the deck the Crazyabdul requested. However, I'm missing two cards. These are the final cards I need to finish the deck:

Infinite Assault

Long-Term Plans
Spellshift

Infinite Combat

For the second deck I need the following cards:

Basal Thrull
Blood Pet
Oona's Prowler
Overeager Apprentice

Shriekmaw
Sins of the Past

If these can't be coded can some suggest some good replacements? Thanks in advance!

Also, can I request Darien, King of Kjeldor. Holy Justiciar, Kazandu Blademaster, Luminescent Rain, and especially Magus of the Disk / Magus of the Moat.
You can find Shriekmaw in my mod. Basal Thrull & Blood Pet & Overeager Apprentice need mana token. I can't code Sins of the Past.
Long-Term Plans | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library for a card, shuffle your library, then put that card third from the top.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    EffectController():MarkSearchedLibrary()
    filter:Clear()
    filter:May()
    filter:NotTargetted()
    filter:SetZone( ZONE_LIBRARY )
    filter:SetPlayer( EffectController() )
    EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_PUT_ONTO_LIBRARY", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    EffectController():ShuffleLibrary()
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:PutInLibrary( 2 )
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
Spellshift | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Counter target instant or sorcery spell. Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library.]]></LOCALISED_TEXT>
    <COST type="SacrificeSelf" />
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_STACK )
    filter:AddCardType( CARD_TYPE_INSTANT )
    filter:AddCardType( CARD_TYPE_SORCERY )
    filter:SetStackObjectType( STACK_OBJECT_CARD )
    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_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
      EffectDC():Set_PlayerPtr(3, target:GetPlayer())
       target:CounterSpell() 
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_PlayerPtr(3)
    if player ~= nil then
      local spell_cast = 0
      local total = CountCardsInLibrary( player )
      while total &gt; 0 and spell_cast == 0 do
        local card = player:Library_GetTop()
        if card:GetCardType():Test(CARD_TYPE_INSTANT) ~= 0 or card:GetCardType():Test(CARD_TYPE_SORCERY) ~= 0 then
            EffectDC():Make_Chest(2):Set_CardPtr(0, card)
           spell_cast = spell_cast + 1
        end
         card:GuidedReveal( ZONE_LIBRARY , ZONE_LIBRARY )
        card:PutInLibrary( -1 )
         total = total - 1
      end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local browser = EffectDC():Get_Chest(2)
    local player = EffectDC():Get_PlayerPtr(3)
    if browser ~= nil and player ~= nil then
       player:SetTargetCount( 1 )
       player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_INSTANT_OR_SORCERY_TO_CAST" )
       player:ChooseTargetsFromDCWithFlags( NO_VALIDATION, browser, EffectDC():Make_Targets(1), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local castSpell = EffectDC():Get_Targets(1):Get_CardPtr(0)
    local player = EffectDC():Get_PlayerPtr(3)
    if castSpell ~= nil and player ~= nil then
      if castSpell:CanBePlayed( player ) then
         castSpell:PlayFreeFromAnywhere( player )
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_PlayerPtr(3)
    if player ~= nil then
      player:ShuffleLibrary()
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
Oona's Prowler | Open
Code: Select all
  <ACTIVATED_ABILITY any_player="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Discard a card: Oona’s Prowler gets -2/-0 until end of turn. Any player may activate this ability.]]></LOCALISED_TEXT>
    <COST type="Discard">
      <TARGET_DEFINITION id="6">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:NotTargetted()
      filter:SetZone( ZONE_HAND )
      filter:SetPlayer( EffectController() )
      </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>
    <CONTINUOUS_ACTION layer="7C">
    if EffectSource() ~= nil then
       EffectSource():GetCurrentCharacteristics():Power_Add( -2 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_AVAILABILITY step="declare_blockers" />
    <AI_AVAILABILITY type="in_response" />
  </ACTIVATED_ABILITY>
Darien, King of Kjeldor | Open
Code: Select all
  <TRIGGERED_ABILITY auto_skip="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you’re dealt damage, you may put that many 1/1 white Soldier creature tokens onto the battlefield.]]></LOCALISED_TEXT>
    <TRIGGER value="PLAYER_TOOK_DAMAGE" simple_qualifier="controller" />
    <RESOLUTION_TIME_ACTION>
    local token_count = Damage():GetAmount()
    if token_count &gt; 0 then
       MTG():PutTokensIntoPlay( "TOKEN_SOLDIER_1_1_277462", token_count, EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="TOKEN_SOLDIER_1_1_277462" />
Holy Justiciar | Open
Code: Select all
  <ACTIVATED_ABILITY dangerous="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{2}{W}, {T}: Tap target creature. If that creature is a Zombie, exile it.]]></LOCALISED_TEXT>
    <COST type="Mana" cost="{2}{W}" />
    <COST type="TapSelf" />
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    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_CREATURE_TAP", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_card ~= nil then 
       target_card:Tap()
      if target_card:GetSubType():Test( CREATURE_TYPE_ZOMBIE ) ~= 0 then
         target_card:RemoveFromGame()
      end
    end
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY step="begin_combat" />
    <AI_AVAILABILITY step="end_of_turn" turn="their_turn" />
    <AI_AVAILABILITY type="in_response_dangerous" />
    <AI_AVAILABILITY step="declare_blockers" blocking_or_blocked="1" />
  </ACTIVATED_ABILITY>
Kazandu Blademaster | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Kazandu Blademaster or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Kazandu Blademaster.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_IN_PLAY">
    return (TriggerObject():GetSubType():Test( CREATURE_TYPE_ALLY ) ~= 0 or TriggerObject() == Object())
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Luminescent Rain | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a creature type. You gain 2 life for each permanent you control of that type.]]></LOCALISED_TEXT>
    <RESOLUTION_TIME_ACTION>
    local type_count = 0
    local filter = Object():GetFilter()
    for i = 1000,1227 do
       filter:Clear()
      filter:NotTargetted()
      filter:SetPlayer( EffectController() )
      filter:SetZone(ZONE_IN_PLAY)
      filter:AddSubType( i )
       if filter:Count() &gt; type_count then
          type_count = filter:Count()
       end
    end   
    if type_count &gt; 0 then
      EffectController():GainLife( type_count*2 )
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_PLAYER_LIFE_PLAY" />
  </SPELL_ABILITY>
Magus of the Disk | Open
Code: Select all
  <TRIGGERED_ABILITY internal="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magus of the Disk enters the battlefield tapped.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       TriggerObject():ComesIntoPlayTapped() 
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}, {T}: Destroy all artifacts, creatures, and enchantments.]]></LOCALISED_TEXT>
    <COST type="Mana" cost="{1}" />
    <COST type="TapSelf" />
    <FILTER>
    return (ArtifactsInPlay() or CreaturesInPlay() or EnchantmentsInPlay())
    </FILTER>
    <RESOLUTION_TIME_ACTION>
    if FilteredCard() ~= nil then
       FilteredCard():Destroy()
    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" />
    <SFX text="GLOBAL_EPIPHANY_PLAY" />
  </ACTIVATED_ABILITY>
Magus of the Moat | Open
Code: Select all
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures without flying can’t attack.]]></LOCALISED_TEXT>
    <FILTER>
    return CreaturesWithoutFlying()
    </FILTER>
    <CONTINUOUS_ACTION layer="8">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       characteristics:Characteristic_Set( CHARACTERISTIC_CANT_ATTACK, 1 )
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Card Creation Request Thread

Postby NEMESiS » 18 Jun 2013, 10:31

Thank you Sumomole.
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 70 times
Been thanked: 21 times

Re: Card Creation Request Thread

Postby Kieran » 18 Jun 2013, 13:47

Sumomole, thank you. And yes, I found Shriekmaw in you mod. And you've provided enough to conplete the first deck.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Card Creation Request Thread

Postby BloodReyvyn » 18 Jun 2013, 14:23

Alright, I give... I cannot for the life of me figure out why this demon won't make you sac any permanents. I have re-written the code about 10 times and tried troubleshooting it far more than I care to count, but no matter how I try to do it, it never makes you sacrifice a creature, or even choose one to sacrifice... Any help would be greatly appreciated.

Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="SHADOWBORN_DEMON_9729702" />
  <CARDNAME text="SHADOWBORN_DEMON" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="9729702" />
  <ARTID value="A9729702" />
  <ARTIST name="Lucas Graciano" />
  <CASTING_COST cost="{3}{B}{B}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Demon" />
  <EXPANSION value="SOM" />
  <RARITY metaname="M" />
  <POWER value="5" />
  <TOUGHNESS value="6" />
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <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>
    <CONTINUOUS_ACTION>
      local characteristics = Object():GetCurrentCharacteristics()
      characteristics:Characteristic_Set( CHARACTERISTIC_FLYING, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetZone( ZONE_IN_PLAY )
      filter:AddCardType( CARD_TYPE_CREATURE )
      filter:AddSubType( CREATURE_TYPE_DEMON )
      filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )
      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_CREATURE_TO_DESTROY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if target ~= nil then
       target:Destroy()
      end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_CHOP_PLAY" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetPlayer( EffectController() )
      filter:SetZone( ZONE_GRAVEYARD )
      filter:AddCardType( CARD_TYPE_CREATURE )
      filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
      local creatures = filter:Count()
      return MyUpkeep() and (creatures &lt; 6)
    </TRIGGER>
    <TARGET_DEFINITION id="6">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:AddCardType( CARD_TYPE_CREATURE )
      filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )
      filter:SetPlayer( EffectController() )
      filter:SetZone( ZONE_IN_PLAY )
      filter:SetHint( HINT_ENEMY, EffectController() )
      filter:NotTargetted()
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(6)
    </TARGET_DETERMINATION>
    <PLAYTIME>
      EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(1) )
    </PLAYTIME>
    <RESOLUTION_TIME_ACTION>
        local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
        if target ~= nil
         target:Sacrifice()
        end if
      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_CLAW_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_CLAW_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
Thanks in advance. :)

Another issue I have been having is my approximation of Magus of the Mirror. I tried to make the ability ask a query whether or not you wish to use its ability during your upkeep (as a triggered ability, which it does), but regardless of the option you choose, he does not get sacrificed and life totals remain the same. This one isn't nearly as important to get done, but I figured I would ask anyway. No harm in that right?

| Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="MAGUS_OF_THE_MIRROR_126278" />
  <CARDNAME text="MAGUS_OF_THE_MIRROR" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mage du Miroir]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mago del espejo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Magus des Spiegels]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Magus dello Specchio]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[鏡の大魔術師]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Волхв Зеркала]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mago do Espelho]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="126278" />
  <ARTID value="A126278" />
  <ARTIST name="Christopher Moeller" />
  <CASTING_COST cost="{4}{B}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Admirez  L’image de l’ennemi et de tout ce qu’il a. Confiez-vous à votre envie, et prenez-le. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“¡Observa La imagen del enemigo y todo lo que posee. Confía en tu envidia, y tómalo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Obacht Im Spiegel die Feindin mit all ihrem Besitz. Vertraue deinem Neid, nimm es”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Guarda L’immagine del nemico e di tutto ciò che possiede. Fidati della tua invidia e prenditelo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[しかと見よ!  その敵の姿を、その持つすべてを。 己の妬みに身を任せ、それを奪うのだ。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Смотри Это образ врага и всего, что у него есть. Доверься своей зависти и возьми все».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Observa A imagem do inimigo e tudo o que ela tem. Confie em sua inveja e tome-os.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
  <SUB_TYPE metaname="Wizard" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <POWER value="4" />
  <TOUGHNESS value="2" />
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}, sacrifiez le Mage du Miroir : Échangez votre total de points de vie contre celui de l’adversaire ciblé. Ne jouez cette capacité que pendant votre entretien.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}, sacrificar el Mago del espejo: Intercambia el total de vidas con el oponente objetivo. Juega esta habilidad sólo durante tu mantenimiento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}, opfere den Magus des Spiegels: Tausche deinen Lebenspunktestand mit dem eines Gegners deiner Wahl. Spiele diese Fähigkeit nur während deines Versorgungssegments.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}, Sacrifica il Magus dello Specchio: Scambia i punti vita con un avversario bersaglio. Attiva questa abilità solo durante il tuo mantenimento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}, 鏡の大魔術師を生け贄に捧げる:対戦相手1人を対象とし、そのプレイヤーとライフの総量を交換する。 この能力は、あなたのアップキープの間にのみプレイできる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}, Пожертвуйте Волхва Зеркала: Обменяйтесь количествами жизни с целевым оппонентом. Играйте эту способность только в течение вашего шага поддержки.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}, Sacrifique Mago do Espelho: Permute os totais de pontos de vida com o oponente alvo. Use esta habilidade somente durante sua manutenção.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
      return EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local controller = EffectController()
      if controller ~= nil then
       controller:BeginNewMultipleChoice()
       controller:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
       controller:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
       controller:AskMultipleChoiceQuestion( "CONDITIONAL_QUESTION_BODY" )
      end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local controller = EffectController()
      if controller ~= nil then
       if Object():GetMultipleChoiceResult() == 0 then
     EffectSource():Sacrifice(controller)
       end
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

  <TRIGGERED_ABILITY filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="ABILITY_RESOLVED">
      return Object():GetMultipleChoiceResult() == 0
    </TRIGGER>
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS + FILTER_TYPE_OPPONENTS)
      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_OPPONENT_EXCHANGE_LIFE_TOTALS", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      if Object():GetMultipleChoiceResult() == 0 then
        local target = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
        if target ~= nil then
          local my_life = EffectController():GetLifeTotal()
          local target_life = target:GetLifeTotal()
          EffectController():SetLifeTotal( target_life )
          target:SetLifeTotal( my_life )
        end
      end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
"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: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 14:55

BloodReyvyn wrote:Alright, I give... I cannot for the life of me figure out why this demon won't make you sac any permanents. I have re-written the code about 10 times and tried troubleshooting it far more than I care to count, but no matter how I try to do it, it never makes you sacrifice a creature, or even choose one to sacrifice... Any help would be greatly appreciated.
I'll try to help you :)

according to Indrik Stomphowler 's trigger, it doesn't use auto_skip="1"

I'll do a test now.

EDIT: oops, perhaps you mean the graveyard trigger?
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby thefiremind » 18 Jun 2013, 15:05

BloodReyvyn wrote:Alright, I give... I cannot for the life of me figure out why this demon won't make you sac any permanents. I have re-written the code about 10 times and tried troubleshooting it far more than I care to count, but no matter how I try to do it, it never makes you sacrifice a creature, or even choose one to sacrifice... Any help would be greatly appreciated.
There's no "then" after an "if" and there's an "if" too much after an "end" (doesn't SCRIPT_LOG.TXT warn you about those?). Anyway the ability isn't totally right because Shadowborn Demon has an "intervening if clause": each time an ability text has a condition that starts with "if" and stands between 2 commas, that condition must be verified both at the trigger condition and at the resolution.
PLAYTIME has no meaning outside of a COST block. And PLAY_TIME_ACTION would be wrong, either: when you don't need to target, your choice should happen at resolution. In general, you should get used not to use TARGET_DEFINITIONs and TARGET_DETERMINATIONs (and PLAY_TIME_ACTIONs of course) for abilities that aren't targetted. There are some scenarios where making a definition could be handy anyway, but most of the times you are going to confuse yourself.
Code: Select all
  <TRIGGERED_ABILITY dangerous="1">
    -- localised text
    <TRIGGER value="BEGINNING_OF_STEP">
    if EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( EffectController() )
       filter:SetZone( ZONE_GRAVEYARD )
       filter:AddCardType( CARD_TYPE_CREATURE )
       return filter:CountStopAt(6) &lt; 6
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    local player = EffectController()
    filter:Clear()
    filter:NotTargetted()
    filter:SetPlayer( player )
    filter:SetZone( ZONE_GRAVEYARD )
    filter:AddCardType( CARD_TYPE_CREATURE )
    if filter:CountStopAt(6) &lt; 6 then
       filter:Clear()
       filter:NotTargetted()
       filter:SetController( player )
       filter:SetZone( ZONE_IN_PLAY )
       filter:AddCardType( CARD_TYPE_CREATURE )
       filter:SetHint( HINT_ENEMY, player )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:Sacrifice( EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
BloodReyvyn wrote:I tried to make the ability ask a query whether or not you wish to use its ability during your upkeep (as a triggered ability, which it does), but regardless of the option you choose, he does not get sacrificed and life totals remain the same.
I'm not sure for how long Object():GetMultipleChoiceResult() is saved, but I wouldn't make it cross 2 abilities (I usually don't make it cross even 2 actions without saving it in an EffectDC register). There could be a much easier approximation if you use a conditional cost, I'm not sure about how the game handles 2 conditional costs together, but you just have to try. The only drawback is that you'll always be asked to select the target first, but as long as you play 1v1, there will be only 1 opponent and you won't even notice it.
Code: Select all
  <TRIGGERED_ABILITY dangerous="1">
    -- localised text
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
      return EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
    <COST type="TapSelf" qualifier="conditional" />
    <COST type="SacrificeSelf" qualifier="conditional" />
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetFilterType( FILTER_TYPE_PLAYERS + FILTER_TYPE_OPPONENTS)
      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_OPPONENT_EXCHANGE_LIFE_TOTALS", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION conditional="if">
        local target = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
        if target ~= nil then
          local my_life = EffectController():GetLifeTotal()
          local target_life = target:GetLifeTotal()
          EffectController():SetLifeTotal( target_life )
          target:SetLifeTotal( my_life )
        end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
You only need this ability, nothing else.

gorem2k wrote:according to Indrik Stomphowler 's trigger, it doesn't use auto_skip="1"
auto_skip doesn't interfere with how an ability works, it just tells the game that players who have "automatic resolution" enabled should get that ability resolved immediately. That's why auto_skip should be used only when it's very unlikely that an opponent would need to respond to the ability. Firebreathing abilities, for example, use auto_skip because increasing power without increasing toughness usually leaves the creature as easy to kill as before. Exalted doesn't use auto_skip because that +1/+1 could move the creature away from the killing range of a Searing Spear.

EDIT: forget what I wrote earlier about Hindering Light: my idea might have worked if it said only "that targets a permanent you control", without "you or". [-X
< 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: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 15:44

Well, I tried putting the valuable pieces of codes together. made a quick deck, and when I was asked to sac, I sacrificed Shadowborn himself instead of another one I had in play, and he asked to sac a second creature when put in the graveyard!

buggy card | Open
Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="SHADOWBORN_DEMON_9729702" />
  <CARDNAME text="SHADOWBORN_DEMON" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Shadowborn Demon]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="9729702" />
  <ARTID value="A9729702" />
  <ARTIST name="Lucas Graciano" />
  <CASTING_COST cost="{3}{B}{B}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Demon" />
  <EXPANSION value="SOM" />
  <RARITY metaname="M" />
  <POWER value="5" />
  <TOUGHNESS value="6" />
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <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>
    <CONTINUOUS_ACTION>
      local characteristics = Object():GetCurrentCharacteristics()
      characteristics:Characteristic_Set( CHARACTERISTIC_FLYING, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:SetZone( ZONE_IN_PLAY )
      filter:AddCardType( CARD_TYPE_CREATURE )
      filter:AddSubType( CREATURE_TYPE_DEMON )
      filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )
      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_CREATURE_TO_DESTROY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
      local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if target ~= nil then
       target:Destroy()
      end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_CHOP_PLAY" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY dangerous="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP">
    if EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( EffectController() )
       filter:SetZone( ZONE_GRAVEYARD )
       filter:AddCardType( CARD_TYPE_CREATURE )
       return filter:CountStopAt(6) &lt; 6
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    local player = EffectController()
    filter:Clear()
    filter:NotTargetted()
    filter:SetPlayer( player )
    filter:SetZone( ZONE_GRAVEYARD )
    filter:AddCardType( CARD_TYPE_CREATURE )
    if filter:CountStopAt(6) &lt; 6 then
       filter:Clear()
       filter:NotTargetted()
       filter:SetController( player )
       filter:SetZone( ZONE_IN_PLAY )
       filter:AddCardType( CARD_TYPE_CREATURE )
       filter:SetHint( HINT_ENEMY, player )
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:Sacrifice( EffectController() )
    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_CLAW_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_CLAW_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby thefiremind » 18 Jun 2013, 15:51

What probably happened is that you sacrificed Shadowborn A for Shadowborn B, but since the triggers were already put on the stack, Shadowborn A still wanted his sacrifice after dying.
< 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: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 16:26

thefiremind wrote:What probably happened is that you sacrificed Shadowborn A for Shadowborn B, but since the triggers were already put on the stack, Shadowborn A still wanted his sacrifice after dying.
I meant "I sacrificed Shadowborn himself instead of another different creature I had in play,"

Anyway, this card will surely be included officially in DotP14. along with new set of LUA instructions..
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby sumomole » 18 Jun 2013, 16:58

gorem2k wrote:I meant "I sacrificed Shadowborn himself instead of another different creature I had in play,"

Anyway, this card will surely be included officially in DotP14. along with new set of LUA instructions..
There is an error, TRIGGER_BEGINNING_OF_STEP need specify trigger player, if you don't, it will trigger once per player, you can use simple_qualifier="controller" or TriggeredForMe() or TriggerPlayer() == EffectController(). :)
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 17:50

sumomole wrote:There is an error, TRIGGER_BEGINNING_OF_STEP need specify trigger player, if you don't, it will trigger once per player, you can use simple_qualifier="controller" or TriggeredForMe() or TriggerPlayer() == EffectController(). :)
and it works! :D

here's what I been able to pull for Magus of the Mirror:

incomplete card | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="MAGUS_OF_THE_MIRROR_126278" />
  <CARDNAME text="MAGUS_OF_THE_MIRROR" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mage du Miroir]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mago del espejo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Magus des Spiegels]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Magus dello Specchio]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[鏡の大魔術師]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Волхв Зеркала]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mago do Espelho]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="126278" />
  <ARTID value="A126278" />
  <ARTIST name="Christopher Moeller" />
  <CASTING_COST cost="{4}{B}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Admirez  L’image de l’ennemi et de tout ce qu’il a. Confiez-vous à votre envie, et prenez-le. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“¡Observa La imagen del enemigo y todo lo que posee. Confía en tu envidia, y tómalo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Obacht Im Spiegel die Feindin mit all ihrem Besitz. Vertraue deinem Neid, nimm es”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Guarda L’immagine del nemico e di tutto ciò che possiede. Fidati della tua invidia e prenditelo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[しかと見よ!  その敵の姿を、その持つすべてを。 己の妬みに身を任せ、それを奪うのだ。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Смотри Это образ врага и всего, что у него есть. Доверься своей зависти и возьми все».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Observa A imagem do inimigo e tudo o que ela tem. Confie em sua inveja e tome-os.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
  <SUB_TYPE metaname="Wizard" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <POWER value="4" />
  <TOUGHNESS value="2" />
  <ACTIVATED_ABILITY filter_zone="ZONE_IN_PLAY"> --upkeep = "1" ?
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}, sacrifiez le Mage du Miroir : Échangez votre total de points de vie contre celui de l’adversaire ciblé. Ne jouez cette capacité que pendant votre entretien.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}, sacrificar el Mago del espejo: Intercambia el total de vidas con el oponente objetivo. Juega esta habilidad sólo durante tu mantenimiento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}, opfere den Magus des Spiegels: Tausche deinen Lebenspunktestand mit dem eines Gegners deiner Wahl. Spiele diese Fähigkeit nur während deines Versorgungssegments.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}, Sacrifica il Magus dello Specchio: Scambia i punti vita con un avversario bersaglio. Attiva questa abilità solo durante il tuo mantenimento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}, 鏡の大魔術師を生け贄に捧げる:対戦相手1人を対象とし、そのプレイヤーとライフの総量を交換する。 この能力は、あなたのアップキープの間にのみプレイできる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}, Пожертвуйте Волхва Зеркала: Обменяйтесь количествами жизни с целевым оппонентом. Играйте эту способность только в течение вашего шага поддержки.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}, Sacrifique Mago do Espelho: Permute os totais de pontos de vida com o oponente alvo. Use esta habilidade somente durante sua manutenção.]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <COST type="SacrificeSelf" />
    --<AVAILABILITY>
    --?
    --</AVAILABILITY>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    filter:SetHint( HINT_NEUTRAL, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastNTargetsFromDefinition(0, 2)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():SetTargetCount( 2 )
    for i=0,1 do
      EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_PLAYER" )
    end
    EffectController():ChooseTargets( 0, EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local playerA = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    local playerB = EffectDC():Get_Targets(0):Get_PlayerPtr(1)
    if playerA ~= nil and playerB ~= nil then
      local iA = playerA:GetLifeTotal()
      local iB = playerB:GetLifeTotal()
      if iA ~= iB then   
        playerA:SetLifeTotal( iB )
        playerB:SetLifeTotal( iA )
      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>
  <AI_BASE_SCORE score="600" zone="ZONE_IN_PLAY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
It doesn't check for the upkeep step activation. And switches life between TWO players instead of 1.. copied from Soul Conduit :oops:

EDIT: changed few things now it works but you need to be fast to activate during upkeep!!!

Magus of the Mirror getting closer | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
  <FILENAME text="MAGUS_OF_THE_MIRROR_126278" />
  <CARDNAME text="MAGUS_OF_THE_MIRROR" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mage du Miroir]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mago del espejo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Magus des Spiegels]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Magus dello Specchio]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[鏡の大魔術師]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Magus of the Mirror]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Волхв Зеркала]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mago do Espelho]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="126278" />
  <ARTID value="A126278" />
  <ARTIST name="Christopher Moeller" />
  <CASTING_COST cost="{4}{B}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Admirez  L’image de l’ennemi et de tout ce qu’il a. Confiez-vous à votre envie, et prenez-le. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“¡Observa La imagen del enemigo y todo lo que posee. Confía en tu envidia, y tómalo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Obacht Im Spiegel die Feindin mit all ihrem Besitz. Vertraue deinem Neid, nimm es”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Guarda L’immagine del nemico e di tutto ciò che possiede. Fidati della tua invidia e prenditelo.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[しかと見よ!  その敵の姿を、その持つすべてを。 己の妬みに身を任せ、それを奪うのだ。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“Behold The image of the enemy and all that she has. Trust your envy, and take it.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Смотри Это образ врага и всего, что у него есть. Доверься своей зависти и возьми все».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Observa A imagem do inimigo e tudo o que ela tem. Confie em sua inveja e tome-os.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
  <SUB_TYPE metaname="Wizard" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
  <EXPANSION value="TSP" />
  <RARITY metaname="R" />
  <POWER value="4" />
  <TOUGHNESS value="2" />
  <ACTIVATED_ABILITY upkeep="1" dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T}, sacrifiez le Mage du Miroir : Échangez votre total de points de vie contre celui de l’adversaire ciblé. Ne jouez cette capacité que pendant votre entretien.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}, sacrificar el Mago del espejo: Intercambia el total de vidas con el oponente objetivo. Juega esta habilidad sólo durante tu mantenimiento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}, opfere den Magus des Spiegels: Tausche deinen Lebenspunktestand mit dem eines Gegners deiner Wahl. Spiele diese Fähigkeit nur während deines Versorgungssegments.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}, Sacrifica il Magus dello Specchio: Scambia i punti vita con un avversario bersaglio. Attiva questa abilità solo durante il tuo mantenimento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}, 鏡の大魔術師を生け贄に捧げる:対戦相手1人を対象とし、そのプレイヤーとライフの総量を交換する。 この能力は、あなたのアップキープの間にのみプレイできる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}, Sacrifice Magus of the Mirror: Exchange life totals with target opponent. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}, Пожертвуйте Волхва Зеркала: Обменяйтесь количествами жизни с целевым оппонентом. Играйте эту способность только в течение вашего шага поддержки.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}, Sacrifique Mago do Espelho: Permute os totais de pontos de vida com o oponente alvo. Use esta habilidade somente durante sua manutenção.]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
    <COST type="SacrificeSelf" />
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    filter:SetHint( HINT_NEUTRAL, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastNTargetsFromDefinition(0, 2)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():SetTargetCount( 2 )
    for i=0,1 do
      EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_PLAYER" )
    end
    EffectController():ChooseTargets( 0, EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local playerA = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    local playerB = EffectDC():Get_Targets(0):Get_PlayerPtr(1)
    if playerA ~= nil and playerB ~= nil then
      local iA = playerA:GetLifeTotal()
      local iB = playerB:GetLifeTotal()
      if iA ~= iB then   
        playerA:SetLifeTotal( iB )
        playerB:SetLifeTotal( iA )
      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>
  <TRIGGERED_ABILITY priority="-1">
     <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return ( EffectController():MyTurn() ~= 0 ) and ( MTG():GetStep() == STEP_UPKEEP ) and (Object():Tapped() == 0)
    </TRIGGER>
    <RESOLUTION_TIME_ACTION />
  </TRIGGERED_ABILITY>
  <AI_BASE_SCORE score="600" zone="ZONE_IN_PLAY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby BloodReyvyn » 18 Jun 2013, 21:19

Awesome, thanks again guys.

Actually, I kind of rather like the limited time you have to activate the ability. If you are expecting to use it, you have plenty of time between EOT and the upkeep step to get the mouse to hover over it and it takes only a second to click on the card before the effect timer runs out. However, if you wanted to make it stop on the upkeep, couldn't you just add a multiple choice query without any multiple choice answers during a Play Time Action since it always has the "continue" option? The ability could actually be added to the empty triggered ability in that code if so.
"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: Card Creation Request Thread

Postby gorem2k » 18 Jun 2013, 22:10

BloodReyvyn wrote:However, if you wanted to make it stop on the upkeep, couldn't you just add a multiple choice query without any multiple choice answers during a Play Time Action since it always has the "continue" option? The ability could actually be added to the empty triggered ability in that code if so.
I'm sure someone with more expertise should be able to solve this.

well, i'm now stuck with one of the most beautiful card in Magic history :lol: : Ashling the Pilgrim .

I need help, 'cause this code is garbage to me:

Ashling the Pilgrim | Open
Code: Select all
  <ACTIVATED_ABILITY auto_skip="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}{R}: Put a +1/+1 counter on Ashling the Pilgrim. If this is the third time this ability has resolved this turn, remove all +1/+1 counters from Ashling the Pilgrim, and it deals that much damage to each creature and each player.]]></LOCALISED_TEXT>
    <COST type="Mana" cost="{1}{R}" />
    <RESOLUTION_TIME_ACTION>
    ObjectDC():Float_Inc(0)
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
    end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY auto_skip="1">
    <TRIGGER>
    return (EffectController():MyTurn() == 0) and ObjectDC():Float_Get(0) &gt; 3
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local num_counters = EffectSource():CountCounters( MTG():PlusOnePlusOneCounters())
    EffectDC():Set_Int(1, num_counters)
    if num_counters &gt; 0 then
       EffectSource():RemoveCounters( MTG():PlusOnePlusOneCounters(), num_counters )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
I think I need to put internal="1" somewhere in <TRIGGERED_ABILITY> but there's so many errors. Dragon Whelp is the only similar card I got.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Card Creation Request Thread

Postby RiiakShiNal » 19 Jun 2013, 00:27

Try this:
Code: Select all
  <ACTIVATED_ABILITY auto_skip="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}{R}: Put a +1/+1 counter on Ashling the Pilgrim. If this is the third time this ability has resolved this turn, remove all +1/+1 counters from Ashling the Pilgrim, and it deals that much damage to each creature and each player.]]></LOCALISED_TEXT>
    <COST type="Mana" cost="{1}{R}" />
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
    end
    ObjectDC():Int_Inc(0)
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if (ObjectDC():Int_Get(0) == 3) then
       local num_counters = EffectSource():CountCounters( MTG():PlusOnePlusOneCounters() )
       if (num_counters &gt; 0) then
          -- Deal damage to players
          for i=0,MTG():GetNumberOfPlayers()-1 do
             MTG():GetNthPlayer(i):DealDamage( num_counters, EffectSource() )
          end
          -- Deal damage to creatures
          local oFilter = Object():GetFilter()
          oFilter:Clear()
          oFilter:AddCardType( CARD_TYPE_CREATURE )
          oFilter:SetZone( ZONE_IN_PLAY )
          local nCount = oFilter:EvaluateObjects()
          if (nCount &gt; 0) then
             for i=0,nCount-1 do
                local oCard = oFilter:GetNthEvaluatedObject(i)
                if (oCard ~= nil) then
                   oCard:DealDamage( num_counters, EffectSource() )
                end
             end
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY internal="1" active_zone="ZONE_ANY">
    <TRIGGER value="TRIGGER_END_OF_TURN" />
    <RESOLUTION_TIME_ACTION>
      ObjectDC():Int_Set( 0, 0 )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Edit: Forgot to add the triggered ability to reset the count, now added.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

PreviousNext

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 7 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 7 guests

Login Form