It is currently 26 Apr 2024, 22:41
   
Text Size

MAGIC DUELS - CARD REQUEST THREAD

Moderator: CCGHQ Admins

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 02 Jun 2016, 18:01

petercal wrote:It didn't occur to me until I saw the result: the game & Flameshadow Conjuring saw that Alter Ego (which cloned into Greenwarden of Murasa) as a Greenwarden of Murasa instead of a fresh Alter Ego & put a token copy of Greenwarden of Murasa into play. In other words, the copying took place before ETB so this situation is not like that with Deceiver of Form.
I didn't think about that, either. I guess it would fall into the case we want if you choose to copy nothing with the original Alter Ego (as long as X > 0 it should survive).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Tejahn » 02 Jun 2016, 19:58




Angel Token produced by Sigil of the Empty Throne.jpg
Angel Token produced by Sigil of the Empty Throne

Massive amounts of mana produced by Nykthos, Shrine to Nyx & Serra's Sanctum.jpg
Massive amounts of mana produced by Nykthos, Shrine to Nyx & Serra's Sanctum


This post is to confirm that all three of the cards work. However, with Nykthos, Shrine to Nyx it should be noted that the activated ability should be used before you lay a single land or whatnot due to the priority bug. I created an XML that superseded the bug but then accidentally deleted the file. The Transcension deck submitted by Xander9009 is complete. Thanks!

thefiremind wrote:Here they are. I haven't tested any of them, so get ready for anything, especially with Starfield of Nyx. Nykthos only works with an activated ability, due to the limitations on mana abilities, while on Serra's Sanctum I added the possibility to auto-tap for a maximum of 10 mana: if you want to extend it so that it can auto-tap for more, or remove this possibility (because you might mistakenly let it auto-tap when you have more enchantments and lose on some mana) it's up to you.
I think it's well enough where it is for the Transcension deck. The build is so proficient at producing mana. In my playtest, the game was over before all the 'extra' mana was needed.

petercal wrote:I tried it on my iPad & it didn't crash. In my game Alter Ego ETB as a copy of Greenwarden of Murasa. Flameshadow Conjuring then triggers & I paid the red mana to put a copy of that Alter Ego into the battlefield. It didn't occur to me until I saw the result: the game & Flameshadow Conjuring saw that Alter Ego (which cloned into Greenwarden of Murasa) as a Greenwarden of Murasa instead of a fresh Alter Ego & put a token copy of Greenwarden of Murasa into play. In other words, the copying took place before ETB so this situation is not like that with Deceiver of Form.
Thanks for testing it. I'll have another look at the codes for Alter Ego and Flameshadow Conjuring for comparative purposes. I think it would be sensible to have Deceiver of Form able to change creature tokens as well.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby petercal » 02 Jun 2016, 20:10

thefiremind wrote:
petercal wrote:It didn't occur to me until I saw the result: the game & Flameshadow Conjuring saw that Alter Ego (which cloned into Greenwarden of Murasa) as a Greenwarden of Murasa instead of a fresh Alter Ego & put a token copy of Greenwarden of Murasa into play. In other words, the copying took place before ETB so this situation is not like that with Deceiver of Form.
I didn't think about that, either. I guess it would fall into the case we want if you choose to copy nothing with the original Alter Ego (as long as X > 0 it should survive).
I tried it again, this time casting Altered Ego with X=1 and not selecting any creature to copy. Altered Ego ETB as itself with a +1/+1 token on it. Flameshadow Conjuring then triggers, putting a token of that fresh Altered Ego onto the battlefield and then asking "Choose a creature to copy" (see screen shot). I tested choosing a token creature once and a non-token creature (other than the original Altered Ego). Both times the Flameshadow Conjuring token of Altered Ego worked and made the applicable clone. So this instance may be applicable to getting Deceiver of Form to work right.

EDIT: I tried one other thing that crashed the game. I had the Flameshadow Conjuring-triggered token copy Jace, Vyrn's Prodigy. That triggered the selection menu for multiple copies of the same Legendary permanent and I kept the token copy of Jace. When I used his ability to flip, the game crashed. I dunno what happened; maybe that's a separate bug.
Attachments
IMG_2495.PNG
Flameshadow Conjuring-triggered token of blank Altered Ego in play & awaiting clone initiation
Last edited by petercal on 02 Jun 2016, 20:30, edited 1 time in total.
petercal
 
Posts: 13
Joined: 07 Sep 2012, 05:12
Has thanked: 12 times
Been thanked: 0 time

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Tejahn » 02 Jun 2016, 20:25

Indeed. I'll try to change the Deceiver of Form code to match your findings. Thanks again.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Xander9009 » 03 Jun 2016, 03:58

Just wanted to mention that the issue with Choked Estuary has been figured out. It had a variable that was named "EffectController" and was missing "local". So, it was a global instead of a local and named the same as the function.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Tejahn » 03 Jun 2016, 19:21

Glad to know you figured it out. Thanks for the information.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 04 Jun 2016, 21:29

EDIT: It works now! I also made some improvements here and there so that the "internal" abilities don't trigger if it's not necessary, and used GetGlobalIndex as Xander9009 suggested.
Briarbridge Patrol (working most of the times) | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BRIARBRIDGE_PATROL_199409953" />
  <CARDNAME text="BRIARBRIDGE_PATROL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Briarbridge Patrol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Patrouille du Pont de Bruyère]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Patrulla de Puentespino]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dornstrauchweg-Patrouille]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Pattuglia di Ponterovo]]></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[Patrulheiro de Pontespinho]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[荆桥巡卫]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[荊橋巡衛]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="199409953" />
  <ARTID value="199409953" />
  <ARTIST name="Greg Opalinski" />
  <CASTING_COST cost="{3}{G}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" />
  <SUB_TYPE metaname="Warrior" />
  <EXPANSION value="SOI" />
  <RARITY metaname="U" />
  <POWER value="3" />
  <TOUGHNESS value="3" />
  <TRIGGERED_ABILITY linked_ability_group="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Briarbridge Patrol deals damage to one or more creatures, investigate.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la Patrouille du Pont de Bruyère inflige des blessures à au moins une créature, enquêtez.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que la Patrulla de Puentespino haga daño a una o más criaturas, investiga.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn die Dornstrauchweg-Patrouille einer oder mehreren Kreaturen Schaden zufügt, stelle Nachforschungen an.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la Pattuglia di Ponterovo infligge danno a una o più creature, indaga.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[茨橋の巡回兵がクリーチャー1体以上にダメージを与えるたび、調査を行う。]]></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 Patrulheiro de Pontespinho causar dano a uma ou mais criaturas, investigue.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当荆桥巡卫对一个或数个生物造成伤害时,探查。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當荊橋巡衛對一個或數個生物造成傷害時,探查。]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_OBJECT" simple_qualifier="self">
    if SecondaryObject():GetCardType():Test(CARD_TYPE_CREATURE) and LinkedDC():Get_Int(1) == 0 then
       LinkedDC():Set_Int(1, 1) -- Shut the trigger off until the first one goes on the stack
       return true
    end
    return false
    </TRIGGER>
    <PLAY_TIME_ACTION>
    LinkedDC():Set_Int(1, 0) -- Turn the trigger on again
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    MTG():PutTokensOntoBattlefield( "TOKEN_CLUE_5_A_395375", 1, EffectController() )
    EffectController():Investigated()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" active_zone="ZONE_ANY">
    <TRIGGER value="SACRIFICE">
    return TriggerObject():GetSubType():Test(ARTIFACT_TYPE_CLUE)
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local chest = LinkedDC():Get_Chest(0)
    if chest == nil then
       chest = LinkedDC():Make_Chest(0)
    end
    chest:Int_Add( TriggerPlayer():GetGlobalIndex(), 1 ) -- Remember that TriggerPlayer sacrificed a Clue
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" active_zone="ZONE_ANY">
    <TRIGGER value="BEGINNING_OF_TURN">
    return LinkedDC():Get_Chest(0) ~= nil
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    LinkedDC():Free_Compartment(0) -- Reset sacrifices for all players
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" active_zone="ZONE_ANY">
    <TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_ANY" from_zone="ZONE_ANY" simple_qualifier="self">
    -- This ability and the following one make the chest persist through zone changes
    return LinkedDC():Get_Chest(0) ~= nil
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local delayDC = EffectDC():Make_Chest(0)
    delayDC:Make_Chest(0):CopyFrom( LinkedDC():Get_Chest(0) )
    MTG():CreateDelayedTrigger(1, delayDC)
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1" replacement_effect="1" linked_ability_group="1">
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_ANY" from_zone="ZONE_ANY" simple_qualifier="self" />
    <RESOLUTION_TIME_ACTION>
    if LinkedDC():Get_Chest(0) == nil then
       LinkedDC():Make_Chest(0):CopyFrom( EffectDC():Get_Chest(0) )
    end
    </RESOLUTION_TIME_ACTION>
    <CLEANUP fire_once="1" />
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY linked_ability_group="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of each end step, if you sacrificed three or more Clues this turn, you may put a creature card from your hand onto the battlefield.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de chaque étape de fin, si vous avez sacrifié au moins 3 indices ce tour-ci, vous pouvez mettre sur le champ de bataille une carte de créature de votre main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al principio de cada paso final, si sacrificaste tres o más pistas este turno, puedes poner una carta de criatura de tu mano en el campo de batalla.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zu Beginn jedes Endsegments und falls du in diesem Zug drei oder mehr Hinweise geopfert hast, kannst du eine Kreaturenkarte aus deiner Hand ins Spiel bringen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio di ogni sottofase finale, se hai sacrificato tre o più Indizi in questo turno, puoi mettere sul campo di battaglia una carta creatura dalla tua mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各終了ステップの開始時に、あなたがこのターンに手掛かりを3つ以上生け贄に捧げていた場合、あなたはあなたの手札からクリーチャー・カードを1枚戦場に出してもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 종료단의 시작에, 당신이 이 턴에 단서를 세 개 이상 희생했다면, 당신은 생물 카드 한 장을 당신의 손에서 전장에 놓을 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале каждого заключительного шага, если в этом ходу вы пожертвовали не менее трех Улик, вы можете положить карту существа из вашей руки на поле битвы.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de cada etapa final, se você sacrificou três ou mais Pistas neste turno, você pode colocar um card de criatura de sua mão no campo de batalha.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在每个结束步骤开始时,若本回合中你牺牲了三个或更多线索,则你可以将一张生物牌从你手上放进战场。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在每個結束步驟開始時,若本回合中你犧牲了三個或更多線索,則你可以將一張生物牌從你手上放進戰場。]]></LOCALISED_TEXT>
    <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_END_OF_TURN
    </TRIGGER>
    <INTERVENING_IF ignore_resolution_check="1">
    local chest = LinkedDC():Get_Chest(0)
    if chest ~= nil then
       return chest:Get_Int( EffectController():GetGlobalIndex() ) &gt; 2 -- Check if EffectController sacrificed more than 2 clues
    end
    return false
    </INTERVENING_IF>
    <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:SetZone( ZONE_HAND, EffectController() )
    filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
    if filter:CountStopAt(1) == 1 then
       EffectController():ChooseItem( "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
    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:PutOntoBattlefield( EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_5_A_395375" />
  <SFX text="COMBAT_CHOP_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_CHOP_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
The idea is to intercept all sacrifices of Clues by all players and save the counts in a LinkedDC chest, because you never know who might take control of the Patrol.

EDIT 2: As Xander9009 noticed, there's a scenario where this method doesn't work: copies of Briarbridge Patrol won't have the information about previously sacrificed Clues. In order to fix the card for that scenario, external data chests are required.
@Tejahn: I can do that if you want, but that will mean that I'll have to use one or more LOL files and you'll have to include them in your ZED.
Last edited by thefiremind on 05 Jun 2016, 14:06, edited 9 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Xander9009 » 04 Jun 2016, 23:22

While I don't immediately see a problem (though I will go toy with it and see if I can figure it out), I'm curious if GetGlobalIndex() still works. I used it in 214 successfully on one single card: Dream Salvage. It appeared to consistently return a single value for any given player. However, before using it, you might test that a) it still works at all, and b) that it doesn't change the index if a player leaves the game.
You could try and see if the code I used for 2014 works as a starting working point. It does not, however, account for the card changing controllers, so that would need to be reimplemented. But if it works in Magic Duels, then it might be easier to change that. Not sure.

In case you want to look at it:
Briarbridge Patrol - 2014 | Open
Code: Select all
   <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
      <TRIGGER value="SACRIFICE" simple_qualifier="controller">
         return TriggerObject():GetSubType():Test(ARTIFACT_TYPE_CLUE)
      </TRIGGER>
      <RESOLUTION_TIME_ACTION layer="1">
         LinkedDC():Int_Inc(0)
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY linked_ability_group="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of each end step, if you sacrificed three or more Clues this turn, you may put a creature card from your hand onto the battlefield.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de chaque étape de fin, si vous avez sacrifié au moins 3 indices ce tour-ci, vous pouvez mettre sur le champ de bataille une carte de créature de votre main.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al principio de cada paso final, si sacrificaste tres o más pistas este turno, puedes poner una carta de criatura de tu mano en el campo de batalla.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zu Beginn jedes Endsegments und falls du in diesem Zug drei oder mehr Hinweise geopfert hast, kannst du eine Kreaturenkarte aus deiner Hand ins Spiel bringen.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio di ogni sottofase finale, se hai sacrificato tre o più Indizi in questo turno, puoi mettere sul campo di battaglia una carta creatura dalla tua mano.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各終了ステップの開始時に、あなたがこのターンに手掛かりを3つ以上生け贄に捧げていた場合、あなたはあなたの手札からクリーチャー・カードを1枚戦場に出してもよい。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 종료단의 시작에, 당신이 이 턴에 단서를 세 개 이상 희생했다면, 당신은 생물 카드 한 장을 당신의 손에서 전장에 놓을 수 있다.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале каждого заключительного шага, если в этом ходу вы пожертвовали не менее трех Улик, вы можете положить карту существа из вашей руки на поле битвы.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de cada etapa final, se você sacrificou três ou mais Pistas neste turno, você pode colocar um card de criatura de sua mão no campo de batalha.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在每个结束步骤开始时,若本回合中你牺牲了三个或更多线索,则你可以将一张生物牌从你手上放进战场。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在每個結束步驟開始時,若本回合中你犧牲了三個或更多線索,則你可以將一張生物牌從你手上放進戰場。]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_END_OF_TURN
      </TRIGGER>
      <INTERVENING_IF ignore_resolution_check="1">
         return LinkedDC():Get_Int(0) &gt;= 3
      </INTERVENING_IF>
      <RESOLUTION_TIME_ACTION>
         local filter = ClearFilter()
         filter:SetZone(ZONE_HAND, EffectController())
         filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
         EffectController():ChooseItem("CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0), QUERY_FLAG_MAY)
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local Target = EffectDC():Get_Targets(0):Get_CardPtr(0)
         if Target ~= nil then
            Target:PutOntoBattlefield(EffectController())
         end 
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_END_OF_TURN
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         LinkedDC():Set_Int(0, 0)
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
Also, I somehow never noticed the "BEGINNING_OF_TURN" trigger... I should probably make it use that.
Last edited by Xander9009 on 05 Jun 2016, 09:55, edited 1 time in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 05 Jun 2016, 08:15

I saw your code, but unfortunately it doesn't help me because you are getting the sacrifices for the Patrol's controller only, and only when it's already on the battlefield. Also, you are using the same LinkedDC register for both abilities (including the one you haven't pasted here), how does that work?

EDIT: I found the problem. I haven't bothered to check before, but Int_Inc doesn't exist anymore in Magic Duels. Now if you want to do Int_Inc(x), you need to do Int_Add(x, 1). The Patrol now works if the Clues are sacrificed when it's already on the battlefield. I just need to make the LinkedDC chest persistent somehow.

EDIT 2: Done! I updated the previous post with the working code.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Xander9009 » 05 Jun 2016, 09:55

thefiremind wrote:I saw your code, but unfortunately it doesn't help me because you are getting the sacrifices for the Patrol's controller only, and only when it's already on the battlefield. Also, you are using the same LinkedDC register for both abilities (including the one you haven't pasted here), how does that work?

EDIT: I found the problem. I haven't bothered to check before, but Int_Inc doesn't exist anymore in Magic Duels. Now if you want to do Int_Inc(x), you need to do Int_Add(x, 1). The Patrol now works if the Clues are sacrificed when it's already on the battlefield. I just need to make the LinkedDC chest persistent somehow.

EDIT 2: Done! I updated the previous post with the working code.
Good! I hadn't noticed that I was reusing the register. I'd never sacrificed clues before and after dealing damage with him, so it'd never been a problem. Moved the sacrifice tracking into a sub-chest. I tried just changing the linked_ability_group="1" to ="2", but it didn't work. I tested multiple linked ability groups it before and could have sworn it worked... Oh well. Didn't end up using it on any cards anyway.

Int_Inc being removed is certainly not the issue I would have expected...

I also went ahead and added the ability to track multiple players sacrificing clues and gaining control of the card. Here's the tested code for that, if you'd like to see how the GetGlobalIndex() can simplify things. (But with Int_Inc, not Int_Add. Though that's a really simple change.)

Briarbridge Patrol - 2014 | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="BRIARBRIDGE_PATROL_CW_409953" />
   <CARDNAME text="BRIARBRIDGE_PATROL" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Briarbridge Patrol]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Patrouille du Pont de Bruyère]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Patrulla de Puentespino]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dornstrauchweg-Patrouille]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Pattuglia di Ponterovo]]></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[Patrulheiro de Pontespinho]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[荆桥巡卫]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[荊橋巡衛]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="409953" />
   <ARTID value="BRIARBRIDGE_PATROL" />
   <ARTIST name="Greg Opalinski" />
   <CASTING_COST cost="{3}{G}" />
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Human" />
   <SUB_TYPE metaname="Warrior" />
   <EXPANSION value="SOI" />
   <RARITY metaname="U" />
   <POWER value="3" />
   <TOUGHNESS value="3" />
    <TRIGGERED_ABILITY linked_ability_group="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Briarbridge Patrol deals damage to one or more creatures, investigate.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la Patrouille du Pont de Bruyère inflige des blessures à au moins une créature, enquêtez.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que la Patrulla de Puentespino haga daño a una o más criaturas, investiga.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn die Dornstrauchweg-Patrouille einer oder mehreren Kreaturen Schaden zufügt, stelle Nachforschungen an.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la Pattuglia di Ponterovo infligge danno a una o più creature, indaga.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[茨橋の巡回兵がクリーチャー1体以上にダメージを与えるたび、調査を行う。]]></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 Patrulheiro de Pontespinho causar dano a uma ou mais criaturas, investigue.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当荆桥巡卫对一个或数个生物造成伤害时,探查。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當荊橋巡衛對一個或數個生物造成傷害時,探查。]]></LOCALISED_TEXT>
      <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_OBJECT" simple_qualifier="self" damage_type="combat">
         if TriggerObject():GetOwner() == EffectController() then
            LinkedDC():Int_Inc(0)
         end
         return SecondaryObject():GetCardType():Test(CARD_TYPE_CREATURE) and LinkedDC():Get_Int(0) == 1
      </TRIGGER>
      <PLAY_TIME_ACTION>
         LinkedDC():Clear()
      </PLAY_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         CW_General_FireTrigger(CW_TRIGGER_INVESTIGATE, EffectSourceLKI():GetController())
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         CW_Tokens("CLUE_A_C_S")
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY linked_ability_group="2">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of each end step, if you sacrificed three or more Clues this turn, you may put a creature card from your hand onto the battlefield.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de chaque étape de fin, si vous avez sacrifié au moins 3 indices ce tour-ci, vous pouvez mettre sur le champ de bataille une carte de créature de votre main.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al principio de cada paso final, si sacrificaste tres o más pistas este turno, puedes poner una carta de criatura de tu mano en el campo de batalla.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zu Beginn jedes Endsegments und falls du in diesem Zug drei oder mehr Hinweise geopfert hast, kannst du eine Kreaturenkarte aus deiner Hand ins Spiel bringen.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio di ogni sottofase finale, se hai sacrificato tre o più Indizi in questo turno, puoi mettere sul campo di battaglia una carta creatura dalla tua mano.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[各終了ステップの開始時に、あなたがこのターンに手掛かりを3つ以上生け贄に捧げていた場合、あなたはあなたの手札からクリーチャー・カードを1枚戦場に出してもよい。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[각 종료단의 시작에, 당신이 이 턴에 단서를 세 개 이상 희생했다면, 당신은 생물 카드 한 장을 당신의 손에서 전장에 놓을 수 있다.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале каждого заключительного шага, если в этом ходу вы пожертвовали не менее трех Улик, вы можете положить карту существа из вашей руки на поле битвы.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de cada etapa final, se você sacrificou três ou mais Pistas neste turno, você pode colocar um card de criatura de sua mão no campo de batalha.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在每个结束步骤开始时,若本回合中你牺牲了三个或更多线索,则你可以将一张生物牌从你手上放进战场。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在每個結束步驟開始時,若本回合中你犧牲了三個或更多線索,則你可以將一張生物牌從你手上放進戰場。]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_END_OF_TURN
      </TRIGGER>
      <INTERVENING_IF ignore_resolution_check="1">
         return LinkedDC():Get_Int(EffectController():GetGlobalIndex()) &gt;= 3
      </INTERVENING_IF>
      <RESOLUTION_TIME_ACTION>
         local filter = ClearFilter()
         filter:SetZone(ZONE_HAND, EffectController())
         filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
         EffectController():ChooseItem("CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0), QUERY_FLAG_MAY)
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local Target = EffectDC():Get_Targets(0):Get_CardPtr(0)
         if Target ~= nil then
            Target:PutOntoBattlefield(EffectController())
         end 
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="2" active_zone="ZONE_ANY">
      <TRIGGER value="SACRIFICE">
         return TriggerObject():GetSubType():Test(ARTIFACT_TYPE_CLUE)
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         LinkedDC():Int_Inc(TriggerPlayer():GetGlobalIndex())
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="2" active_zone="ZONE_ANY">
      <TRIGGER value="BEGINNING_OF_TURN" />
      <RESOLUTION_TIME_ACTION>
         LinkedDC():Clear()
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         RSN_Characteristics_CreateManagers()
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TOKEN_REGISTRATION reservation="1" type="_MANAGER_CHARACTERISTICS" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_1" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_2" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_3" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_4" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_5" />
   <TOKEN_REGISTRATION reservation="1" type="TOKEN_CLUE_A_C_S_CW_6" />
   <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, Xander9009, Xander9009, Xander9009]]></EDITORS>
   <DATE><![CDATA[18-04-16, 28-04-16, 09-05-16, 05-06-16]]></DATE>
</CARD_V2>
EDIT: Nevermind. I DID test that awhile back, and I just tried again, and this time it worked. Earlier I'd missed an "end" in another ability, and I think that might have interfered. This means no chests are needed, which combined with the GetGlobalIndex being used to avoid the loops makes the code pretty simple.

I tested it by sacrificing before, during, and after dealing damage and changing control. The AI even sacrificed some donated clues and then I gave it the patrol and it behaved properly. This code seems to work fine in all situations except 2.
1) It didn't work when I played it from my library AFTER sacrificing the clues.
2) If a token copy is made of the Briarbridge Patrol after sacrificing clues, that token wouldn't have the necessary information, because it didn't exist. The same would hold true for making a creature a copy of the patrol. I'm not sure it's worth fixing, considering how rare such a series of events would be, but the ways I'm currently thinking of that might deal with it are either to move the tracking to a manager token or to a PlayerDataChest, which itself would be easiest to do without having multiple cards trying to increment the registers for one sacrifice by using a manager. It should be do-able using only functions, though.
Last edited by Xander9009 on 05 Jun 2016, 10:20, edited 1 time in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 05 Jun 2016, 10:04

Xander9009 wrote:Here's the tested code for that, if you'd like to see how the GetGlobalIndex() can simplify things.
Nice, I'll use GetGlobalIndex myself. Editing code now... :)
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Xander9009 » 05 Jun 2016, 10:20

thefiremind wrote:
Xander9009 wrote:Here's the tested code for that, if you'd like to see how the GetGlobalIndex() can simplify things.
Nice, I'll use GetGlobalIndex myself. Editing code now... :)
I edited my last post. Just in case you're curious about the multiple linked_ability_group registers. I tested it again, and it worked fine. Not that you need to use that idea (it doesn't really simplify it much or speed it up at all), just as a neat thing I don't think is well-known.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 05 Jun 2016, 11:05

Xander9009 wrote:1) It didn't work when I played it from my library AFTER sacrificing the clues.
That's because you aren't making LinkedDC persist through zone changes in any way. As far as I know, there are some zone changes where it persists by itself, and other ones where it doesn't. My code should hopefully work for any zone change.
Xander9009 wrote:2) If a token copy is made of the Briarbridge Patrol after sacrificing clues, that token wouldn't have the necessary information, because it didn't exist.
I haven't thought about that. Yes, the problem would be solved by using player chests, but the code would become a bit more complicated because you should make sure that only one Patrol updates the counts each time a Clue is sacrificed (we did that a lot of times in DotP2014 so we know how). I'm also trying to avoid using custom functions because I'm coding for a pack that won't be mine and I don't want to be always saying "here you need constant X declared in LOL file Y, otherwise the card won't work". Tejahn should have the last word about that.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby Xander9009 » 05 Jun 2016, 18:11

thefiremind wrote:
Xander9009 wrote:1) It didn't work when I played it from my library AFTER sacrificing the clues.
That's because you aren't making LinkedDC persist through zone changes in any way. As far as I know, there are some zone changes where it persists by itself, and other ones where it doesn't. My code should hopefully work for any zone change.
Ah shoot. I see how you managed that. I just caught that the abilities were active in any zone. I'd seen the LinkedDC not be wiped with certain zone changes and assumed that meant it was safe from one zone to another, and that it just had to exist in a zone for it to be alright. I wasn't aware some zone changes weren't safe.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: MAGIC DUELS - CARD REQUEST THREAD

Postby thefiremind » 05 Jun 2016, 18:25

Xander9009 wrote:I'd seen the LinkedDC not be wiped with certain zone changes and assumed that meant it was safe from one zone to another, and that it just had to exist in a zone for it to be alright. I wasn't aware some zone changes weren't safe.
You're not the only one: Stainless doesn't know about that, either. In fact their official implementation of Diregraf Colossus currently gets no +1/+1 counters if it's put onto the battlefield from a graveyard because it uses LinkedDC before the zone change in order to include itself in the Zombie count. :mrgreen:

EDIT: @Tejahn: I made 4 more cards: Dark Petition, Deadly Tempest, Malicious Affliction, Psychic Intrusion. Some notes:
  • Deadly Tempest: it doesn't really check if the creatures are destroyed: it just checks that they left the battlefield. It should be alright in most cases. I tried to intercept the creatures through a DESTROYED delayed trigger, but the information was coming back too late and putting the life loss into the delayed trigger seemed wrong to me.
  • Malicious Affliction: there's no official DERIVED_INFO for Morbid and I was too lazy to write it myself, so you won't see any [Creatures died this turn: x] information.
  • Psychic Intrusion: You'll get to see the opponent's hand first, and then the query that lets you choose the card. I couldn't think of a better way to let you know the cards in the opponent's hand so that you could take the zone into account when choosing. The cards in hand will remain on the left during the query.
EDIT 2: Whoever was the one who already downloaded the ZIP file, I just remembered that Malicious Affliction could suffer the same bug as the storm mechanic in DotP2014, so I applied the same old fix to it: I'm sorry but you'll have to download it again.
Attachments
4 cards 6-Jun-2016.zip
(12.39 KiB) Downloaded 227 times
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

PreviousNext

Return to Magic Duels

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 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 1 guest

Login Form