Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Trying to sort out Sidisi
Moderator: CCGHQ Admins
Trying to sort out Sidisi
by volrathxp » 21 Sep 2014, 21:25
So I'm trying to sort out how Sidisi, Brood Tyrant and how her second trigger works. Right now I've got a trigger, but I'm not really sure how to make that trigger fire appropriately. Sidisi says that "whenever one or more creature cards are put into your graveyard from your library..." which means that no matter how many creatures go into your yard from a mill, you should always only get 1 trigger (and therefore only 1 zombie token).
This is what I have right now, so just need to sort it out from here.
This is what I have right now, so just need to sort it out from here.
- Sidisi Trigger | Open
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’au moins une carte de créature est mise dans votre cimetière depuis votre bibliothèque, mettez sur le champ de bataille un jeton de créature 2/2 noire Zombie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que una o más criaturas vayan de tu biblioteca a tu cementerio, pon en el campo de batalla una ficha de criatura Zombie negra 2/2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn eine oder mehr Kreaturenkarten von deiner Bibliothek auf deinen Friedhof gelegt werden, bringe einen 2/2 schwarzen Zombie-Kreaturenspielstein ins Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta una o più carte creatura vengono messe nel tuo cimitero dal tuo grimorio, metti sul campo di battaglia una pedina creatura Zombie 2/2 nera.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー・カードが1枚以上あなたのライブラリーからあなたの墓地に置かれるたび、黒の2/2のゾンビ・クリーチャー・トークンを1体戦場に出す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신의 서고에서 한 개 이상의 생물이 당신의 무덤으로 갈 때마다, 2/2 흑색 좀비 생물 토큰 한 개를 전장에 놓는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда одна или несколько карт существ попадают на ваше кладбище из вашей библиотеки, положите на поле битвы одну фишку существа 2/2 черный Зомби.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que um ou mais cards de criaturas forem colocados do seu grimório no seu cemitério, coloque no campo de batalha uma ficha de criatura preta 2/2 do tipo Zumbi.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_LIBRARY" />
</TRIGGERED_ABILITY>
volrathxp
Re: Trying to sort out Sidisi
by thefiremind » 21 Sep 2014, 22:51
First, active_zone="ZONE_GRAVEYARD" is wrong: that means that the ability would trigger only when the card itself is in a graveyard, that's not what we want.
About how to code "one or more", it's the first time I have to deal with this kind of problem, so I would go by trial and error as much as you. Basically what should happen is that each effect should trigger this once, and then no more until another effect kicks in. I would suggest trying something along those lines:
EDIT: Another trigger that might be worth trying is STATE_BASED_EFFECTS... does anyone think that state-based are checked while multiple cards change zone at once?
About how to code "one or more", it's the first time I have to deal with this kind of problem, so I would go by trial and error as much as you. Basically what should happen is that each effect should trigger this once, and then no more until another effect kicks in. I would suggest trying something along those lines:
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_LIBRARY">
if LinkedDC():Get_Int(0) == 0 and TriggerObject():GetOwner() == EffectController() and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) then
LinkedDC():Set_Int(0, 1) -- disable this trigger
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
MTG():PutTokensOntoBattlefield( "TOKEN_ZOMBIE_2_2_B_...", 1, EffectController() )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
<TRIGGER value="STACK_PUSHED" />
<RESOLUTION_TIME_ACTION>
LinkedDC():Set_Int(0, 0) -- re-enable the other trigger
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
EDIT: Another trigger that might be worth trying is STATE_BASED_EFFECTS... does anyone think that state-based are checked while multiple cards change zone at once?
Last edited by thefiremind on 21 Sep 2014, 23:00, edited 3 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Trying to sort out Sidisi
by volrathxp » 21 Sep 2014, 22:57
I will give this a shot. Thanksthefiremind wrote:First, active_zone="ZONE_GRAVEYARD" is wrong: that means that the ability would trigger only when the card itself is in a graveyard, that's not what we want.
About how to code "one or more", it's the first time I have to deal with this kind of problem, so I would go by trial and error as much as you. Basically what should happen is that each effect should trigger this once, and then no more until another effect kicks in. I would suggest trying something along those lines:Note: I have never used STACK_PUSHED before, so it's just an idea that probably won't work, and even if it worked as I imagine, it would probably fail when the milling effect is done through an internal (replacement_effect or replacement_query) trigger, such as dredge. I don't have any better ideas, though. At least it's a starting point.
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_LIBRARY">
if LinkedDC():Get_Int(0) == 0 and TriggerObject():GetOwner() == EffectController() and TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) then
LinkedDC():Set_Int(0, 1) -- disable this trigger
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
MTG():PutTokensOntoBattlefield( "TOKEN_ZOMBIE_2_2_B_...", 1, EffectController() )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1">
<TRIGGER value="STACK_PUSHED" />
<RESOLUTION_TIME_ACTION>
LinkedDC():Set_Int(0, 0) -- re-enable the other trigger
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
I was sorting out looking at Narcomeba and that's where that came from.
volrathxp
Re: Trying to sort out Sidisi
by Tejahn » 21 Sep 2014, 23:41
I just uploaded a deck using her. I'll use TFM's code instead of the one I posted since it's cleaner.
Re: Trying to sort out Sidisi
by thefiremind » 22 Sep 2014, 08:26
Please test it before calling it right (I would suggest testing it at least against dredge and against milling while another mill effect is on the stack). Maybe your code won't be cleaner but it will work better, who knows?Tejahn wrote:I just uploaded a deck using her. I'll use TFM's code instead of the one I posted since it's cleaner.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Trying to sort out Sidisi
by NeoAnderson » 22 Sep 2014, 10:09
I have tested your code Fire, it works with multiple instances of milling effect like Millstone, or Thought Scour..so i think it should work also with Dredge mechanic..thefiremind wrote:Please test it before calling it right (I would suggest testing it at least against dredge and against milling while another mill effect is on the stack). Maybe your code won't be cleaner but it will work better, who knows?Tejahn wrote:I just uploaded a deck using her. I'll use TFM's code instead of the one I posted since it's cleaner.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Trying to sort out Sidisi
by Tejahn » 25 Sep 2014, 14:37
I tested your code also and everything seems fine. And as you said, both codes are working properly.thefiremind wrote:Please test it before calling it right (I would suggest testing it at least against dredge and against milling while another mill effect is on the stack). Maybe your code won't be cleaner but it will work better, who knows?Tejahn wrote:I just uploaded a deck using her. I'll use TFM's code instead of the one I posted since it's cleaner.
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests