Page 1 of 1

[confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 09 Jun 2018, 22:09
by Korath
Describe the Bug:
  1. Ob Nixilis, Unshackled doesn't trigger for Doubling Chant, whether in automatic or manual mode.
  2. Doubling Chant doesn't find anything in automatic mode.
Which card did behave improperly ?
Doubling Chant, for both.

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Dev master head, cde9295.

What exactly should be the correct behavior/interaction ?
  1. 10 life and sac a creature for each search. (There might only be one search, though, per this nonsensical ruling mentioning Aven Mindcensor.)
  2. I'd expect automatic mode to always find one of each creature (even if it'd be disadvantageous to do so, like if it's an Infernal Denizen or you really are supposed to lose 10 life for each creature you search for).
Are any other cards possibly affected by this bug ?
Looking at the implementation of Doubling Chant, which implements tutoring itself from first principles, I sure hope not.

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 30 Oct 2020, 08:48
by FastEddie
#2 is fixed in commit 80e0a7fe8.

Ironically, it never used new_global_tutor in the first place for the manual search. Auto mode never triggered because the condition in the if-clause was wrong (id == -1 instead of id != -1 to exclude face-down cards and similar stuff). Both are addressed now.

As for #1 Doubling Chant only checks whether Grafdigger's Cage is in play but nothing else. I presume Ob Nixilis, Unshackled uses some kind of trigger or trap that needs to be checked but didn't look into it (yet).

Edit: had a look at Ob Nixilis, Unshackled and Leonin Arbiter as reference. Seems like there is no elegant way, only coding up Ob Nixilis, Unshackled directly inside Doubling Chant and new_global_tutor :( .

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 31 Oct 2020, 05:47
by drool66
The elegant way to do it would probably be to port EVENT_SEARCH_LIBRARY to Manalink, have it trigger during new_global_tutor() (where Ob-Nix is now would be a good place) and Doubling Chant and whatever else tutors without using new_global_tutor(), have Ob-Nix look for the event and smash face when he sees it.

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 01 Nov 2020, 12:50
by FastEddie
I thought a bit about this and will go down this route partly. Ob Nixilis, Unshackled and Aven Mindcensor should (and hopefully will) become part of new_global_tutor (I haven't found either effect there and I think it's the natural place) and then go through all cards that search the library and make sure they use new_global_tutor (I already fixed a few that took great pains to avoid using it...).
Implementing a new event is beyond me for the moment, but this may come at a later stage. Doing that would enable us to implement thing how they should be, i.e. the cards themselves taking care of certain things and not putting everything in the new_global_tutor.

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 01 Nov 2020, 13:05
by Aswan jaguar
Ob Nixilis, Unshackled is in new_global_tutor() and Aven Mindcensor is in new_select_a_card() which is what new_global_tutor() uses so for me Ob Nixilis, Unshackled should also go also to new_select_a_card() instead of trying to change all cards to use new_global_tutor.

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 01 Nov 2020, 13:43
by FastEddie
Indeed, you are right (as usual). This leaves only Doubling Chant's auto mode as it works around using new_global_tutor. Would it make sense to add another tutor mode, TUTOR_DECK_AUTO say, that picks test.qty cards that pass the test? Checking for cards like Ob Nixilis, Unshackled should remain centralized and maybe put into a separate function as both new_select_a_card and the new tutor mode would need it.
Ob Nixilis, Unshackled should also go also to new_select_a_card()
This would also fix Gifts Ungiven (and probably a few more) that legimately work around the tutor but don't trigger Ob Nixilis, Unshackled as of now.

Re: [confirmed]Ob Nixilis, Unshackled vs. Doubling Chant

PostPosted: 02 Nov 2020, 14:23
by FastEddie
#1 is fixed in commit 15c248d92.

I added a new mode TUTOR_FROM_DECK_AUTO that basically does the job while accounting for permanents and effects that forbid or hinder searching libraries.

Save games for both cases with and without Ob Nixilis, Unshackled are attached so feel free to kill yourself with style :) .

Ob Nixilis, Unshackled's effect went to new_select_a_card() to address a wider range of cards.

I will see whether I can move all effects affecting "search library" from new_global_tutor() to new_select_a_card() so that those are always accounted for. Not yet sure about Grafdigger's Cage, though.