It is currently 07 Jul 2021, 13:51
   
Text Size

Sigarda, Host of Herons (and Bruna too)

Moderators: Xander9009, CCGHQ Admins

Sigarda, Host of Herons (and Bruna too)

Postby BlindWillow » 23 Jul 2012, 06:02

I was digging through the future Selesnya deck some more and realized that Wilt-Leaf Liege presented the solution (namely that, like discard, the sacrifice trigger has a TriggerPlayer() associated with it for the controller of the sacrifice effect) to a card I had tried but failed to code for DOTP 2012: Sigarda, Host of Herons. Here's the code for that:

Code: Select all
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    characteristics:Characteristic_Set( CHARACTERISTIC_FLYING, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <STATIC_ABILITY commaspace="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[hexproof]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[défense talismanique]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[antimaleficio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[fluchsicher]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[anti-malocchio]]></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[resistência à magia]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    characteristics:Characteristic_Set( CHARACTERISTIC_HEXPROOF, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Spells and abilities your opponents control can’t cause you to sacrifice permanents.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les sorts et les capacités que vos adversaires contrôlent ne peuvent pas vous faire sacrifier de permanents.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Los hechizos y habilidades que controlan tus oponentes no te pueden hacer sacrificar permanentes.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zaubersprüche und Fähigkeiten, die deine Gegner kontrollieren, können dich nicht dazu bringen, bleibende Karten zu opfern.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le magie e le abilità controllate dai tuoi avversari non possono farti sacrificare permanenti.]]></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[As mágicas e habilidades que seus oponentes controlam não podem fazer com que você sacrifique permanentes.]]></LOCALISED_TEXT>
    <TRIGGER value="SACRIFICE">
    return TriggerPlayer() ~= nil and TriggerObject():GetController() == EffectController() and TriggerPlayer():GetTeam() ~= EffectController():GetTeam()
    </TRIGGER>
  </TRIGGERED_ABILITY>
I tested it in a Planechase match with Nicol Bolas, and there's nothing like having Barter in Blood leave you unscathed. I, on the other hand, was able to use both Qasali Pridemage and Loxodon Hierarch unimpeded. I've attached the full xml file (zipped since the .xml extension is scary).

Edit: above code doesn't work as intended. Use the code from further down in this thread (thefiremind's and mine) or the code from the updated attachment.
Attachments
sigarda.zip
(2.66 KiB) Downloaded 301 times
Last edited by BlindWillow on 06 Aug 2012, 23:06, edited 2 times in total.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons

Postby thefiremind » 23 Jul 2012, 08:31

Wow, that's nice! I'm glad I'm not the only one who experiments on cards that need just a brilliant idea to get coded. :D Besides that, I wanted to make a deck inspired from the W/G Angels intro deck from Avacyn Restored, but it would have looked weird if I couldn't include Sigarda (at least as an unlockable).
< 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: 719 times

Re: Sigarda, Host of Herons

Postby BlindWillow » 23 Jul 2012, 18:02

thefiremind wrote:Wow, that's nice! I'm glad I'm not the only one who experiments on cards that need just a brilliant idea to get coded.
Thanks. For some reason I get more of a kick out of creating new cards than playing the game itself (not that it's not also enjoyable). I am going to try to see if I can code Bruna, Light of Alabaster next, now that we have Sovereigns of Lost Alara to draw from. Any suggestions would be most welcome.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons

Postby BlindWillow » 25 Jul 2012, 19:43

Here's what I came up with for Bruna (full xml file attached):

Code: Select all
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    characteristics:Characteristic_Set( CHARACTERISTIC_FLYING, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <STATIC_ABILITY commaspace="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[vigilance]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[vigilance]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[vigilancia.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wachsamkeit]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[cautela]]></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[vigilância]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    characteristics:Characteristic_Set( CHARACTERISTIC_VIGILANCE, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Bruna, Light of Alabaster attacks or blocks, you may attach to it any number of Auras on the battlefield and you may put onto the battlefield attached to it any number of Aura cards that could enchant it from your graveyard and/or hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que Bruna, la Lumière de l’albâtre attaque ou bloque, vous pouvez lui attacher n’importe quel nombre d’auras sur le champ de bataille et vous pouvez mettre sur le champ de bataille, attachées à elle, n’importe quel nombre de cartes d’aura qui pourraient l’enchanter depuis votre cimetière et/ou votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que Bruna, Luz de Alabastro ataque o bloquee, puedes anexarle cualquier cantidad de auras que haya en el campo de batalla y puedes poner en el campo de batalla, anexadas a ella, cualquier cantidad de cartas de aura que puedan encantarla desde tu cementerio y/o tu mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn Bruna vom Alabasterschwarm angreift oder blockt, kannst du eine beliebige Anzahl an Auren im Spiel an sie anlegen und eine beliebige Anzahl an Aurakarten aus dem Friedhof und/oder der Hand an sie angelegt ins Spiel bringen, mit denen du sie verzaubern kannst.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta Bruna, Luce di Alabastro attacca o blocca, puoi assegnarle un qualsiasi numero di Aure sul campo di battaglia e puoi mettere sul campo di battaglia a lei assegnate un qualsiasi numero di carte Aura che possono incantarla dal tuo cimitero e/o dalla tua mano.]]></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[Toda vez que Bruna, Luz do Bando Alabastro, ataca ou bloqueia, você pode anexar a ela um número qualquer de Auras que já estejam no campo de batalha, e pode colocar no campo de batalha anexado a ela qualquer número de cards de Aura que poderiam encantá-la vindas de seu cemitério e/ou de sua mão.]]></LOCALISED_TEXT>
    <TRIGGER value="ATTACKING" simple_qualifier="self" />
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetZone( ZONE_IN_PLAY )
    filter:NotTargetted()
    local filter_count1 = filter:EvaluateObjects()

    local candidateDC = EffectDC():Make_Chest(2)
    local candidateCount = 0

    if filter_count1 &gt; 0 then
       for i=0,filter_count1-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_HAND )
    filter:NotTargetted()
    local filter_count2 = filter:EvaluateObjects()
             
    if filter_count2 &gt; 0 then
       for i=0,filter_count2-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_GRAVEYARD )
    filter:NotTargetted()
    local filter_count3 = filter:EvaluateObjects()
             
    if filter_count3 &gt; 0 then
       for i=0,filter_count3-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    if candidateCount &gt; 0 then
   EffectController():SetTargetCount( candidateCount )
   for i=0,candidateCount-1 do
      EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_AURA" )
   end
   EffectController():ChooseTargetsFromDCWithFlags( NO_VALIDATION, candidateDC, EffectDC():Make_Targets(3), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local creature = TriggerObject()
    local targets = EffectDC():Get_Targets(3)
    if targets ~= nil then
       local aura = targets:Get_CardPtr(0)
       local i = 1
       while (aura ~= nil and creature ~= nil) do
      if aura:GetZone() == ZONE_IN_PLAY then
         aura:Attach( creature )
      else
         aura:PutIntoPlayAttachedTo( EffectController(), creature )
      end
      aura = targets:Get_CardPtr(i)
          i=i+1
       end
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_SUNBLAST_PLAY" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY>
    <TRIGGER value="BLOCKING" simple_qualifier="self" />
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetZone( ZONE_IN_PLAY )
    filter:NotTargetted()
    local filter_count1 = filter:EvaluateObjects()

    local candidateDC = EffectDC():Make_Chest(2)
    local candidateCount = 0

    if filter_count1 &gt; 0 then
       for i=0,filter_count1-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_HAND )
    filter:NotTargetted()
    local filter_count2 = filter:EvaluateObjects()
             
    if filter_count2 &gt; 0 then
       for i=0,filter_count2-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    filter:Clear()
    filter:AddCardType( CARD_TYPE_ENCHANTMENT )
    filter:AddSubType( ENCHANTMENT_TYPE_AURA )
    filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_GRAVEYARD )
    filter:NotTargetted()
    local filter_count3 = filter:EvaluateObjects()
             
    if filter_count3 &gt; 0 then
       for i=0,filter_count3-1 do
          local candidate = filter:GetNthEvaluatedObject(i)
          if candidate:CanAttachTo(TriggerObject()) ~= 0 then
             candidateDC:Set_CardPtr( candidateCount, candidate )
             candidateCount = candidateCount + 1
          end
       end
    end

    if candidateCount &gt; 0 then
   EffectController():SetTargetCount( candidateCount )
   for i=0,candidateCount-1 do
      EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_AURA" )
   end
   EffectController():ChooseTargetsFromDCWithFlags( NO_VALIDATION, candidateDC, EffectDC():Make_Targets(3), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local creature = TriggerObject()
    local targets = EffectDC():Get_Targets(3)
    if targets ~= nil then
       local aura = targets:Get_CardPtr(0)
       local i = 1
       while (aura ~= nil and creature ~= nil) do
      if aura:GetZone() == ZONE_IN_PLAY then
         aura:Attach( creature )
      else
         aura:PutIntoPlayAttachedTo( EffectController(), creature )
      end
      aura = targets:Get_CardPtr(i)
          i=i+1
       end
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_SUNBLAST_PLAY" />
  </TRIGGERED_ABILITY>
I chose not to exclude Auras already attached to Bruna, as there is technically no reason not to be able to do so (and nothing bad happens whether one does so or not). However, it can be somewhat confusing during the selection process.
Attachments
bruna.zip
(3.48 KiB) Downloaded 271 times
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby nabeshin » 27 Jul 2012, 14:23

BlindWillow wrote:I was digging through the future Selesnya deck some more and realized that Wilt-Leaf Liege presented the solution (namely that, like discard, the sacrifice trigger has a TriggerPlayer() associated with it for the controller of the sacrifice effect) to a card I had tried but failed to code for DOTP 2012: Sigarda, Host of Herons. Here's the code for that:
if to whom "DOTP 2012: Sigarda, Host of Herons" is necessary, I can lay out...
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 31 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby BlindWillow » 05 Aug 2012, 22:01

Well, so much for that idea. That will teach me not to test even seemingly minor changes. Apparently there isn't a TriggerPlayer associated with the sacrifice trigger. The code I had actually tested was the following:

Code: Select all
    <TRIGGER value="SACRIFICE">
    return TriggerObject():GetController() == EffectController() and TriggerPlayer():GetTeam() ~= EffectController():GetTeam()
    </TRIGGER>
However, if you add TriggerPlayer() ~= nil (which I thought would make no difference but would merely allow Planes to cause sacrificing normally) to those conditions, no trigger prevention occurs and everything sacrifices as per usual.

It's very strange, though, what happens with my original code (without TriggerPlayer() ~= nil). It works...sort of. The game behaves very strangely, though. Cards that you can play aren't highlighted while ones you can't are. Sometimes damage effects aren't handled correctly too.

I guess what baffles me is why it works (in the sense that I can sacrifice my own creatures but sacrificing done to opponents' spells/abilities is prevented). The error messaging reports a parameter mismatch for both my and opponents' spells/abilities. So what makes the difference in-game if there is no TriggerPlayer associated with sacrificing?

I guess if you want to post the solution you came up with for DOTP 2012, nabeshin, I would be interested in taking a look at it.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby RiiakShiNal » 05 Aug 2012, 22:40

Maybe you should look at the SecondaryObject() in the trigger and if SecondaryObject():GetPlayer() ~= nil check to see if it is an opponent. I say this because only objects can cause something to be sacrificed.
RiiakShiNal
Programmer
 
Posts: 2160
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 483 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby BlindWillow » 06 Aug 2012, 04:24

RiiakShiNal wrote:Maybe you should look at the SecondaryObject() in the trigger and if SecondaryObject():GetPlayer() ~= nil check to see if it is an opponent.
No luck. SecondaryObject() is also nil. The sacrifice trigger really seems to include very little information. :(
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby thefiremind » 06 Aug 2012, 08:34

I'm not sure if it can be done, but if your code really has major drawbacks (generating SCRIPT_LOG.TXT entries is a major drawback for me :D) and needs to be changed, I thought about checking who's the controller of the spell/ability that currently is first on the stack: if it's controlled by an opponent, then it means that whatever is happening is to blame on an opponent, and your trigger could override the sacrifice. There should be some functions to inspect the stack, but nobody ever used them and I can't even remember what exactly we can do... I'm going to check them right now.

EDIT: I can't seem to use GetStackObjectController or GetStackObjectCard properly, they always return nil. But I found a workaround and I think I made a working Sigarda:
Code: Select all
  <TRIGGERED_ABILITY internal="1">
    <TRIGGER value="SPELL_ABOUT_TO_RESOLVE">
    ObjectDC():Set_PlayerPtr(0, TriggerObject():GetPlayer())
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY internal="1">
    <TRIGGER value="ABILITY_ABOUT_TO_RESOLVE">
    ObjectDC():Set_PlayerPtr(0, TriggerObject():GetPlayer())
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Spells and abilities your opponents control can’t cause you to sacrifice permanents.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les sorts et les capacités que vos adversaires contrôlent ne peuvent pas vous faire sacrifier de permanents.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Los hechizos y habilidades que controlan tus oponentes no te pueden hacer sacrificar permanentes.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zaubersprüche und Fähigkeiten, die deine Gegner kontrollieren, können dich nicht dazu bringen, bleibende Karten zu opfern.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le magie e le abilità controllate dai tuoi avversari non possono farti sacrificare permanenti.]]></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[As mágicas e habilidades que seus oponentes controlam não podem fazer com que você sacrifique permanentes.]]></LOCALISED_TEXT>
    <TRIGGER value="SACRIFICE" simple_qualifier="objectyoucontrol">
    if ObjectDC() ~= nil then
       local last_caster = ObjectDC():Get_PlayerPtr(0)
       if last_caster ~= nil and last_caster:GetTeam() ~= EffectController():GetTeam() then
          override = 1
          return true
       end
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
It saves the player of the spell or ability that is about to resolve, then when it's time to sacrifice a creature, it overrides the sacrifice if that player was an opponent. I tested it only with a spell: Innocent Blood. I didn't test it with an ability, but I hope it works anyway.
< 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: 719 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby BlindWillow » 06 Aug 2012, 22:56

Thanks for the help, thefiremind. Only one minor addition to your code, and it appears to work perfectly (tested abilities and spells and sac responses to opponents' spells). The code just needs the following:

Code: Select all
  <TRIGGERED_ABILITY internal="1">
    <TRIGGER value="SPELL_RESOLVED">
    ObjectDC():Set_PlayerPtr(0, nil)
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY internal="1">
    <TRIGGER value="ABILITY_RESOLVED">
    ObjectDC():Set_PlayerPtr(0, nil)
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
Otherwise, the first sac cost (e.g. Evolving Wilds) you pay after an opponent has cast a spell/used an ability will be prevented. I also changed GetPlayer() to GetController() for the abilities triggers, if that makes any difference. Oh, and no need for "override = 1", as there is no action overriding the sacrifice.

Finally, I think we have Sigarda up and running for real. =D>
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby thefiremind » 06 Aug 2012, 23:16

Good! I enjoyed the teamwork, we should find some other complicated card to do... :lol:
< 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: 719 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby BlindWillow » 06 Aug 2012, 23:24

How about Sisters of Stone Death? Alas, I think the first ability is still impossible to code.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby thefiremind » 06 Aug 2012, 23:32

BlindWillow wrote:How about Sisters of Stone Death? Alas, I think the first ability is still impossible to code.
You can't even imagine how much I would want that card, I have it in paper and I always enjoyed to play it because the three steps to take control of an opponent's creature feel more evil than just a Mind Control. :lol:

I started a discussion about that mechanic here, but what we miss is a check to see if a creature can block another creature... we have a lot of freedom when disabling a block (totally customizable EVASION_TEST trigger and the new CANT_BLOCK_TEST), but really poor options when forcing a block (Lure characteristic, Goblin Fire Fiend characteristic, and nothing else).
< 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: 719 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby luh-koala » 07 Aug 2012, 01:08

a restoration for Sigarda:

Image
Image
_______________________________
Nothing is true, everything is permited.
User avatar
luh-koala
 
Posts: 31
Joined: 03 Aug 2012, 12:30
Has thanked: 9 times
Been thanked: 3 times

Re: Sigarda, Host of Herons (and Bruna too)

Postby thefiremind » 07 Aug 2012, 08:28

I think that the original art for Sigarda is a bit blurry on purpose, because she's against sunlight. You did a great job, but the added detail on the face makes her seem a man with a wig. :lol:
< 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: 719 times

Next

Return to 2013

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: No registered users and 3 guests

Login Form