Page 1 of 1

Containment Priest

PostPosted: 18 Aug 2015, 14:01
by Xander9009
Alright, so I've been working on Containment Priest for a awhile now and can't seem to get it to work. After some testing, I discovered that if I check that a creature WAS cast, it triggers for all creature cast that enter the battlefield. However, if I set it back to checking for creatures that weren't cast, it goes back to never triggering. However, that's all for ZONECHANGE_END and without pre_trigger="1". It should be pre_trigger and it should be ZONECHANGE_TRANSITION, but I can't get those to work.

Containment Priest | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="CONTAINMENT_PRIEST_CW_389470" />
   <CARDNAME text="CONTAINMENT_PRIEST" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Prêtresse du confinement]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacerdotisa de la mesura]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Einhaltgebietende Priesterin]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacerdotessa del Contenimento]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[封じ込める僧侶]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[围护僧侣]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="389470" />
   <ARTID value="CW389470" />
   <ARTIST name="John Stanko" />
   <CASTING_COST cost="{1}{W}" />
   <FLAVOURTEXT>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Certaines protections nécessitent un brin de finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cierta clase de protección requiere algo de sutileza.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mancher Schutz bedarf etwas Geschick.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alcune protezioni richiedono una certa dose di tatto.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[防御によっては、多少技巧が必要となることもあります。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[有些保护需要无微不至。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
   </FLAVOURTEXT>
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Human" />
   <SUB_TYPE metaname="Cleric" />
   <EXPANSION value="C14" />
   <RARITY metaname="R" />
   <POWER value="2" />
   <TOUGHNESS value="2" />
   <STATIC_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destello.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aufblitzen]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lampo]]></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[Lampejo]]></LOCALISED_TEXT>
      <INTRINSIC characteristic="CHARACTERISTIC_FLASH" />
   </STATIC_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si une créature non-jeton devait arriver sur le champ de bataille et qu’elle n’a pas été lancée, exilez-la à la place.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si una criatura que no sea ficha fuera a entrar al campo de batalla y no fue lanzada, en vez de eso, exíliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls eine Nichtspielsteinkreatur ins Spiel kommen würde und sie nicht gewirkt wurde, schicke sie stattdessen ins Exil.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se una creatura non pedina sta per entrare nel campo di battaglia e non è stata lanciata, invece esiliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[トークンでないクリーチャーが唱えられずに戦場に出るなら、代わりにそれを追放する。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[如果某非衍生物的生物将进战场,且未有牌手施放之,则改为将它放逐。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <TRIGGER value="ZONECHANGE_TRANSITION" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
         if TriggerObject():IsToken() == false and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) and TriggerObject():WasCast() == false then
            MTG():OverrideEvent()
            return true
         end
         return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         if TriggerObject ~= nil then
            TriggerObject():Exile()
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <HELP title="MORE_INFO_BADGE_TITLE_12" body="MORE_INFO_BADGE_BODY_12" zone="ZONE_ANY" />
   <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" />
   <AUTHOR><![CDATA[Xander9009]]></AUTHOR>
   <EDITORS><![CDATA[Xander9009]]></EDITORS>
   <DATE><![CDATA[04-02-15]]></DATE>
</CARD_V2>
That is what I think the code should be, but it doesn't seem to work. Can anyone test it to see if it works for them? ALternatively, can anyone spot what is wrong with the code?

I also tried zonechange_considered. It works better but still not completely. Specifically, it works even if replacement_effect and pre_trigger are set, but it (just like zonechange_transition) only works if checking for cards that WERE cast.

ZONECHANGE_CONSIDERED | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="CONTAINMENT_PRIEST_CW_389470" />
   <CARDNAME text="CONTAINMENT_PRIEST" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Prêtresse du confinement]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacerdotisa de la mesura]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Einhaltgebietende Priesterin]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacerdotessa del Contenimento]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[封じ込める僧侶]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[围护僧侣]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="389470" />
   <ARTID value="CW389470" />
   <ARTIST name="John Stanko" />
   <CASTING_COST cost="{1}{W}" />
   <FLAVOURTEXT>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Certaines protections nécessitent un brin de finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cierta clase de protección requiere algo de sutileza.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mancher Schutz bedarf etwas Geschick.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alcune protezioni richiedono una certa dose di tatto.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[防御によっては、多少技巧が必要となることもあります。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[有些保护需要无微不至。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
   </FLAVOURTEXT>
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Human" />
   <SUB_TYPE metaname="Cleric" />
   <EXPANSION value="C14" />
   <RARITY metaname="R" />
   <POWER value="2" />
   <TOUGHNESS value="2" />
   <STATIC_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destello.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aufblitzen]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lampo]]></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[Lampejo]]></LOCALISED_TEXT>
      <INTRINSIC characteristic="CHARACTERISTIC_FLASH" />
   </STATIC_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si une créature non-jeton devait arriver sur le champ de bataille et qu’elle n’a pas été lancée, exilez-la à la place.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si una criatura que no sea ficha fuera a entrar al campo de batalla y no fue lanzada, en vez de eso, exíliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls eine Nichtspielsteinkreatur ins Spiel kommen würde und sie nicht gewirkt wurde, schicke sie stattdessen ins Exil.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se una creatura non pedina sta per entrare nel campo di battaglia e non è stata lanciata, invece esiliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[トークンでないクリーチャーが唱えられずに戦場に出るなら、代わりにそれを追放する。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[如果某非衍生物的生物将进战场,且未有牌手施放之,则改为将它放逐。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
         if TriggerObject():IsToken() == false and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) and TriggerObject():WasCast() == false then
            MTG():OverrideEvent()
            return true
         end
         return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         if TriggerObject ~= nil then
            TriggerObject():Exile()
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <HELP title="MORE_INFO_BADGE_TITLE_12" body="MORE_INFO_BADGE_BODY_12" zone="ZONE_ANY" />
   <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" />
   <AUTHOR><![CDATA[Xander9009]]></AUTHOR>
   <EDITORS><![CDATA[Xander9009]]></EDITORS>
   <DATE><![CDATA[04-02-15]]></DATE>
</CARD_V2>
Change TriggerObject():WasCast() == false to TriggerObject():WasCast() == true and it'll immediately exile any creature anyone casts before it can enter the battlefield. But as it is right now, it does nothing.

Re: Containment Priest

PostPosted: 19 Aug 2015, 11:24
by RiiakShiNal
Why don't you use the SPELL_PLAYED trigger then temporarily store the protected card pointer in a LinkedDC() chest (remember you would have to be able to store multiple pointers to account for creatures with Flash) to compare with what you get from the ZONECHANGE_END trigger?

It may not be as easy or as clean, but it would just about be guaranteed to work (and would account for casting a creature from virtually anywhere).

Re: Containment Priest

PostPosted: 19 Aug 2015, 14:25
by Xander9009
RiiakShiNal wrote:Why don't you use the SPELL_PLAYED trigger then temporarily store the protected card pointer in a LinkedDC() chest (remember you would have to be able to store multiple pointers to account for creatures with Flash) to compare with what you get from the ZONECHANGE_END trigger?

It may not be as easy or as clean, but it would just about be guaranteed to work (and would account for casting a creature from virtually anywhere).
I had considered that but I wasn't certain if the SPELL_PLAYED trigger would be enough to fix it, and I hadn't thought about flash creatures, so thanks for pointing that out.

So, basically, a SPELL_PLAYED trigger stores a pointer in a LinkedDC, making sure not to overwrite anything already in there. A ZONECHANGE_END pre_trigger replacement_effect checks if a creature entering the battlefield is in the chest. If so, it removes it from the chest. If not, it exiles it. With the pointer only being protected once, it doesn't really need removed, since it can't trigger the ZONECHANGE_END trigger again without first leaving the battlefield, but it'll keep the chest empty between creature casts.

That's what I'm going to go try. If I've missed something, please correct me.

Re: Containment Priest

PostPosted: 19 Aug 2015, 16:09
by Xander9009
Okay, so it's almost working. Here's the code:
Containment Priest | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="CONTAINMENT_PRIEST_CW_389470" />
   <CARDNAME text="CONTAINMENT_PRIEST" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Prêtresse du confinement]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacerdotisa de la mesura]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Einhaltgebietende Priesterin]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacerdotessa del Contenimento]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[封じ込める僧侶]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[围护僧侣]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Containment Priest]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="389470" />
   <ARTID value="CW389470" />
   <ARTIST name="John Stanko" />
   <CASTING_COST cost="{1}{W}" />
   <FLAVOURTEXT>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Certaines protections nécessitent un brin de finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cierta clase de protección requiere algo de sutileza.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mancher Schutz bedarf etwas Geschick.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alcune protezioni richiedono una certa dose di tatto.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[防御によっては、多少技巧が必要となることもあります。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[有些保护需要无微不至。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Some protection requires a bit of finesse.]]></LOCALISED_TEXT>
   </FLAVOURTEXT>
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Human" />
   <SUB_TYPE metaname="Cleric" />
   <EXPANSION value="C14" />
   <RARITY metaname="R" />
   <POWER value="2" />
   <TOUGHNESS value="2" />
   <STATIC_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Flash]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destello.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aufblitzen]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lampo]]></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[Lampejo]]></LOCALISED_TEXT>
      <INTRINSIC characteristic="CHARACTERISTIC_FLASH" />
   </STATIC_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1">
      <TRIGGER value="SPELL_PLAYED">
         if TriggerObject() ~= nil and TriggerObject():WasCast and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) then
            LinkedDC():Int_Inc(0)
            LinkedDC():Set_CardPtr(LinkedDC():Get_Int(0), TriggerObject())
            LinkedDC():Protect_CardPtr(LinkedDC():Get_Int(0))
         end
         return false
      </TRIGGER>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si une créature non-jeton devait arriver sur le champ de bataille et qu’elle n’a pas été lancée, exilez-la à la place.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si una criatura que no sea ficha fuera a entrar al campo de batalla y no fue lanzada, en vez de eso, exíliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls eine Nichtspielsteinkreatur ins Spiel kommen würde und sie nicht gewirkt wurde, schicke sie stattdessen ins Exil.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se una creatura non pedina sta per entrare nel campo di battaglia e non è stata lanciata, invece esiliala.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[トークンでないクリーチャーが唱えられずに戦場に出るなら、代わりにそれを追放する。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[如果某非衍生物的生物将进战场,且未有牌手施放之,则改为将它放逐。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[If a nontoken creature would enter the battlefield and it wasn’t cast, exile it instead.]]></LOCALISED_TEXT>
      <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" pre_trigger="1">
         if TriggerObject():IsToken() == false and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) then
            for i=1,LinkedDC():Get_Int(0) do
               if LinkedDC():Get_CardPtr(i) ~= nil and LinkedDC():Get_CardPtr(i) == TriggerObject() then
                  return false
               end
            end
            MTG():OverrideEvent()
            return true
         end
         return false
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         if TriggerObject ~= nil then
            if TriggerObject():GetZone() == ZONE_EXILE then
               EffectDC():Protect_CardPtr(COMPARTMENT_ID_PARAM_TRIGGER_OBJECT)
               TriggerObject():QueueZoneChange(ZONE_CEASED_TO_EXIST, Object():GetOwner())
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         if TriggerObject() ~= nil then
            TriggerObject():Exile()
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
<!--    <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
      <TRIGGER value="STATE_BASED_EFFECTS">
         local filter = ClearFilter()
         filter:SetZone(ZONE_STACK)
         if filter:CountStopAt(1) == 0 then
            LinkedDC():Clear()
         end
         return false
      </TRIGGER>
   </TRIGGERED_ABILITY> -->
   <HELP title="MORE_INFO_BADGE_TITLE_12" body="MORE_INFO_BADGE_BODY_12" zone="ZONE_ANY" />
   <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" />
   <AUTHOR><![CDATA[Xander9009]]></AUTHOR>
   <EDITORS><![CDATA[Xander9009]]></EDITORS>
   <DATE><![CDATA[04-02-15]]></DATE>
</CARD_V2>
The only problem right now is that if I cast a creature and then Containment Priest, then the fact that it was cast normally is not caught and the creature ends up exiled no matter what. I tried giving it another copy of the triggered ability that stores the spells cast and giving it active_zone="ZONE_HAND" (I first tried ZONE_ANY), but it didn't work. If Containment Priest itself didn't have flash, I wouldn't be too worried about it, since it'll only ever likely cause a problem if it's cast while there's a creature spell on the stack that was also cast, which wouldn't happen very often at all if it wasn't for the fact that Containment Priest has flash.

I'm not 100% certain what else to try. I was under the impression linked ability groups were maintained across zone changes, but in case they're not, I'll try switching to an ObjectDC, since I know I can protect that chest.

EDIT: That seems to have been the problem. With an RSN_ObjectDC instead of a LinkedDC, it works like it should. A couple of tweaks (so it only uses an int and a chest, rather than an int and an indefinitely long list of card pointers and clear the chest whenever the stack is empty and the chest isn't) and it'll be ready to go.

Re: Containment Priest

PostPosted: 20 Aug 2015, 11:21
by RiiakShiNal
Just as a point of note, chests can be nested so you can create an ObjectDC chest at register 2134 then in that put an int at index 0 and a chest at index 1 with the internal chest holding the indefinitely long list of pointers. This is one of the tricks I use for RSN_ObjectDC to keep my impact on other things to an absolute minimum.

Re: Containment Priest

PostPosted: 20 Aug 2015, 11:29
by Xander9009
Yeah, I know. To avoid affecting anything else, it only uses RSN_ObjectDC register 0. Instead of nesting a chest in sub-register 1, I just made the card pointers start at 1 with 0 holding the number. Since it's only using a very low register, it shouldn't affect anything else using the CW's method, at least, and I can't immediately think of anything from other mods that would. (The CW's method of non-interference is basically if a card uses an RSN_ObjectDC on another card, it must use a constant/register which is at least 100, and since it always has a prefix, it's always a lot larger than ever than. So, 0-99 are reserved for cards affecting only their own RSN_ObjectDC. I figured that was a good compromise.)

Re: Containment Priest

PostPosted: 20 Aug 2015, 13:29
by thefiremind
Just throwing a random thought here: has anybody already thought about using a check for
Code: Select all
creature:GetZone() ~= ZONE_STACK
in order to determine if it wasn't cast? (It should be GetErstwhileZone but in ZONECHANGE_CONSIDERED triggers, the zone change hasn't been performed yet if I remember correctly, so it's GetZone.)

On a different note, I noticed that the latest code from Xander9009 is missing () after WasCast inside the first SPELL_PLAYED trigger condition. Maybe you already spotted that on the XML and didn't think about correcting it in the post, but just in case...

Re: Containment Priest

PostPosted: 20 Aug 2015, 13:42
by Xander9009
Checking if it's on the stack would make sense. No, I hadn't considered that. I don't remember if I noticed the missing parentheses, but I removed the check anyway since, as far as I know, a spell can't trigger the "spell played" without being cast. When I get these four cards I'm working on now to work how they should, I'll come back and see if those changes work. However, the card is working as it should (as far as I can tell), so I'm not as worried about it now. The code was even directly portable to make Hallowed Moonlight. I'll definitely test it when I get a chance, though. It may make the card a lot simpler and thus prevent possible bugs I haven't noticed, yet, so thanks.

Re: Containment Priest

PostPosted: 06 Mar 2016, 12:14
by thanosyro
hope someone could fix this. But as i see the card is dead. Anyways kudos to guys that worked hard to make it function.

Re: Containment Priest

PostPosted: 06 Mar 2016, 13:50
by RiiakShiNal
I'm not sure what you mean about dead, based on the posts it sounds like the card is currently working.

Re: Containment Priest

PostPosted: 06 Mar 2016, 14:38
by thanosyro
Riiak, i just created an exact copy of my real cards deck and wanted to try it on your tool. Well, the lady was not functioning. Creatures re-entered the battlefield like gentlemen. If i am missing something i d be happy to listen.

Re: Containment Priest

PostPosted: 06 Mar 2016, 20:41
by Xander9009
I recalled this card working, because as soon as we fixed it here, I made a deck based around it using a bunch of cards that cheaply exile creatures temporarily. I just went and tested the deck again and while there were a few hiccups, it always seemed to work relatively correctly.

The only problems I saw were:
1: When the card manifested from Reality Shift, it was exiled (like it was supposed to be), but it remained looking like the manifest token.
2: When I exiled my own Banisher Priest, which had itself exiled another creature, the other creature should have tried to enter the battlefield and been exiled instead. Instead, the creature that had been exiled by Banisher Priest disappeared altogether.

But neither of these would prevent the card from working in the vast majority of situations (and while the manifest bug is annoying, it's not likely to actually affect anything, and could probably be fixed by putting some extra zone-checking in the manifest code).

I'm not sure why it's not working on your end. Do you have any mods installed other than the CW? (I don't expect so, but I can't think of much else that would affect this.)

Re: Containment Priest

PostPosted: 07 Mar 2016, 05:57
by thanosyro
thanks Xander
The problem is with Containment Priest "Community Core"
When i replaced with Containment Priest "VXP" version problem solved.
So happy right now. Thanks guys!
ps
Now awaiting someone fix "Titan's Presence"