It is currently 20 Aug 2018, 17:04
   
Text Size

DotP2015: Ob Nixilis, Unshackled vs developers' weirdness

Moderators: Xander9009, CCGHQ Admins

DotP2015: Ob Nixilis, Unshackled vs developers' weirdness

Postby thefiremind » 19 Jul 2015, 00:19

From the "Modding tests" topic in the DotP2015 section:
thefiremind wrote:Ob Nixilis, Unshackled: I'm thinking about a trick to code this one, but I'm not sure if it works. It would be similar to the trick that allows Flamewaker Adept to "intercept" scry.
Well... I made it! It took me a long while because the developers have been weird: in order to correctly use INTERROGATE_SEARCHED_LIBRARY, you need to use both SetPlayer and SetSecondaryPlayer to define the player you want to check, otherwise you get the count for all players.

Here's the full code:
Ob Nixilis, Unshackled (tested) | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="OB_NIXILIS_UNSHACKLED_199383330" />
  <CARDNAME text="OB_NIXILIS_UNSHACKLED" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Ob Nixilis, Unshackled]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Ob Nixilis, libéré de ses chaînes]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Ob Nixilis liberado]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ob Nixilis der Entfesselte]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ob Nixilis, Libero dai Vincoli]]></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[Ob Nixilis, Libertado]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[破枷的欧尼希兹]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[破枷的歐尼希茲]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="199383330" />
  <ARTID value="199383330" />
  <ARTIST name="Karl Kopinski" />
  <CASTING_COST cost="{4}{B}{B}" />
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Demon" />
  <EXPANSION value="M15" />
  <RARITY metaname="R" />
  <POWER value="4" />
  <TOUGHNESS value="4" />
  <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>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[飞行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[飛行]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
  <STATIC_ABILITY commaspace="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[trample]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[piétinement]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[arrolla.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[verursacht Trampelschaden]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[travolgere]]></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[atropelar]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[践踏]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[踐踏]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_TRAMPLE" />
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD">
    for i=0,MTG():GetNumberOfStartingPlayers()-1 do
       local player = MTG():GetNthStartingPlayer(i)
       if player ~= nil then
          local interrogation = MTG():ClearInterrogationQuery()
          interrogation:SetPlayer(player)
          interrogation:SetSecondaryPlayer(player)
          LinkedDC():Set_Int( i, interrogation:Count(INTERROGATE_SEARCHED_LIBRARY, INTERROGATE_THIS_GAME) )
       end
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever an opponent searches his or her library, that player sacrifices a creature and loses 10 life.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’un adversaire cherche dans sa bibliothèque, ce joueur sacrifie une créature et perd 10 points de vie.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que un oponente busque en su biblioteca, ese jugador sacrifica una criatura y pierde 10 vidas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn ein Gegner seine Bibliothek durchsucht, opfert dieser Spieler eine Kreatur und verliert 10 Lebenspunkte.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta un avversario passa in rassegna il suo grimorio, quel giocatore sacrifica una creatura e perde 10 punti vita.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[対戦相手1人が自分のライブラリーを探すたび、そのプレイヤーはクリーチャーを1体生け贄に捧げ、10点のライフを失う。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[상대가 자신의 서고에서 카드를 찾을 때마다, 그 플레이어는 생물 한 개를 희생하고 생명 10점을 잃는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда оппонент ищет в своей библиотеке, тот игрок жертвует существо и теряет 10 жизней.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que um oponente procura algo no próprio grimório, ele sacrifica uma criatura e perde 10 pontos de vida.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当一位对手搜寻其牌库时,该牌手牺牲一个生物且失去10点生命。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當一位對手搜尋其牌庫時,該玩家犧牲一個生物且失去10點生命。]]></LOCALISED_TEXT>
    <TRIGGER value="SPELL_OR_ABILITY_CAUSED_SHUFFLE" pre_trigger="1">
    for i=0,MTG():GetNumberOfStartingPlayers()-1 do
       local player = MTG():GetNthStartingPlayer(i)
       if player ~= nil then
          local interrogation = MTG():ClearInterrogationQuery()
          interrogation:SetPlayer(player)
          interrogation:SetSecondaryPlayer(player)
          local searches = interrogation:Count(INTERROGATE_SEARCHED_LIBRARY, INTERROGATE_THIS_GAME)
          if player:GetTeam() ~= EffectController():GetTeam() then
             if searches &gt; LinkedDC():Get_Int(i) then
                local delayDC = EffectDC():Make_Chest(i)
                delayDC:Set_PlayerPtr(0, player)
                MTG():CreateDelayedTrigger(1, delayDC)
             end
          end
          LinkedDC():Set_Int(i, searches)
       end
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1">
    <CLEANUP fire_once="1" />
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever an opponent searches his or her library, that player sacrifices a creature and loses 10 life.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’un adversaire cherche dans sa bibliothèque, ce joueur sacrifie une créature et perd 10 points de vie.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que un oponente busque en su biblioteca, ese jugador sacrifica una criatura y pierde 10 vidas.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn ein Gegner seine Bibliothek durchsucht, opfert dieser Spieler eine Kreatur und verliert 10 Lebenspunkte.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta un avversario passa in rassegna il suo grimorio, quel giocatore sacrifica una creatura e perde 10 punti vita.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[対戦相手1人が自分のライブラリーを探すたび、そのプレイヤーはクリーチャーを1体生け贄に捧げ、10点のライフを失う。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[상대가 자신의 서고에서 카드를 찾을 때마다, 그 플레이어는 생물 한 개를 희생하고 생명 10점을 잃는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда оппонент ищет в своей библиотеке, тот игрок жертвует существо и теряет 10 жизней.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que um oponente procura algo no próprio grimório, ele sacrifica uma criatura e perde 10 pontos de vida.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当一位对手搜寻其牌库时,该牌手牺牲一个生物且失去10点生命。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當一位對手搜尋其牌庫時,該玩家犧牲一個生物且失去10點生命。]]></LOCALISED_TEXT>
    <TRIGGER value="SPELL_OR_ABILITY_CAUSED_SHUFFLE" />
    <RESOLUTION_TIME_ACTION>
    local controller = EffectDC():Get_PlayerPtr(0)
    if controller ~= nil then
       local filter = ClearFilter()
       filter:Add(FE_CONTROLLER, OP_IS, controller)
       filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
       controller:ChooseItem( "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local controller = EffectDC():Get_PlayerPtr(0)
    if controller ~= nil then
       local chosen = EffectDC():Get_Targets(1):Get_CardPtr(0)
       if chosen ~= nil then
          controller:Sacrifice(chosen)
       end
       controller:LoseLife(10)
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever another creature dies, put a +1/+1 counter on Ob Nixilis, Unshackled.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’une autre créature meurt, mettez un marqueur +1/+1 sur Ob Nixilis, libéré de ses chaînes.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que otra criatura muera, pon un contador +1/+1 sobre Ob Nixilis liberado.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn eine andere Kreatur stirbt, lege eine +1/+1-Marke auf Ob Nixilis den Entfesselten.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta un’altra creatura muore, metti un segnalino +1/+1 su Ob Nixilis, Libero dai Vincoli.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[他のクリーチャーが1体死亡するたび、解き放たれし者、オブ・ニクシリスの上に+1/+1カウンターを1個置く。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[다른 생물이 죽을 때마다, 풀려난 오브 닉실리스에 +1/+1 카운터 한 개를 올려놓는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда другое существо умирает, положите один жетон +1/+1 на Об-Никсилиса, Освобожденного.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que outra criatura morrer, coloque um marcador +1/+1 em Ob Nixilis, Libertado.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当另一个生物死去时,在破枷的欧尼希兹上放置一个+1/+1指示物。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當另一個生物死去時,在破枷的歐尼希茲上放置一個+1/+1指示物。]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD">
    return TriggerObject() ~= EffectSource() and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE)
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <HELP title="MORE_INFO_BADGE_TITLE_1" body="MORE_INFO_BADGE_BODY_1" 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" />
  <AI_BASE_SCORE score="600" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
The idea is to keep track of how many times all players searched their libraries. When this number is found raised for an opponent, a delayed trigger is fired, which makes the ability work. I repeated the ability text in the delayed trigger because, even if you can't see it anymore on the bottom right in DotP2015, you can see it by zooming Ob Nixilis.

My test consisted in commenting out the opponent check and searching my own library, in order to see if Ob Nixilis punished me (try to use only either SetPlayer or SetSecondaryPlayer in the interrogations and he will always punish all players :lol:). I may have missed some strange scenarios this way, so feel free to test more.
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 715 times

Re: DotP2015: Ob Nixilis, Unshackled vs developers' weirdnes

Postby Tejahn » 19 Jul 2015, 01:26

Great work as always! I'll go ahead and brew a deck featuring Ob Nixilis, Unshackled and report any weird happenings. Thanks!
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: DotP2015: Ob Nixilis, Unshackled vs developers' weirdnes

Postby Tejahn » 19 Jul 2015, 06:12




I was about to test a deck with Ob Nixilis, Unshackled and realized I can only have 4 of the 24 Shadowborn Apostle's I need. Is there a way to allow a large number of cards in you deck similar to how lands are placed? I remember reading of a way to enforce 4 of each card somewhere. If someone can provide the method that would be great. I'd prefer if we counld disable the entire rarity system completely. I've been changing the cards to commons just in case I need four of them in my decks.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: DotP2015: Ob Nixilis, Unshackled vs developers' weirdnes

Postby thefiremind » 19 Jul 2015, 08:44

Tejahn wrote:Is there a way to allow a large number of cards in you deck similar to how lands are placed? I remember reading of a way to enforce 4 of each card somewhere.
It is possible to enforce 4 by modifying the profile. In fact, if you code a card as common the first time, then run the game at least once, then change that card's rarity, you will retain 4 copies of that card anyway (the square with the number "4" will be gray instead of golden, as if you were still missing copies). However I don't think you can enforce a number of copies greater than 4 since the number is partially used for the foiling information (rather than 1,2,3,4 for each copy you have, a foiled card will be marked with 9,10,11,12 in the profile).
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 715 times

Re: DotP2015: Ob Nixilis, Unshackled vs developers' weirdnes

Postby Xander9009 » 19 Jul 2015, 10:22

I'm glad to see that it's now possible with no hard coded lists that would need updated. :) (The one I made for the CW works, but any card that shuffles the library without searching it has to go in a list or they'll fire Ob's trigger. I hate hard coded lists.)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2818
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 101 times
Been thanked: 420 times

Re: DotP2015: Ob Nixilis, Unshackled vs developers' weirdnes

Postby Tejahn » 19 Jul 2015, 13:46

Shadowborn Apostle - Multiple Copies.png
Shadowborn Apostle - Multiple Copies

Card Pool XML.png
Card Pool XML


thefiremind wrote:It is possible to enforce 4 by modifying the profile. In fact, if you code a card as common the first time, then run the game at least once, then change that card's rarity, you will retain 4 copies of that card anyway (the square with the number "4" will be gray instead of golden, as if you were still missing copies). However I don't think you can enforce a number of copies greater than 4 since the number is partially used for the foiling information (rather than 1,2,3,4 for each copy you have, a foiled card will be marked with 9,10,11,12 in the profile).
That's unfortunate. However, your response prompted me to think harder so I decided to try a workaround. At first, I was going to make copies of the Shadowborne Apostle XML, rename each file, and store them in their proper places. But as the screenshot above demonstrates I decided to just add the same name to the CARD POOL XML five more times and I can now add up to four copies of each card because of the common rarity.

Xander9009 wrote:I'm glad to see that it's now possible with no hard coded lists that would need updated. :) (The one I made for the CW works, but any card that shuffles the library without searching it has to go in a list or they'll fire Ob's trigger. I hate hard coded lists.)
Yes. I was glad to hear that he made it work. I'm grateful for the Firemind's Foresight and insight.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form