Page 1 of 1

[fixed]Vraska, Golgari Queen can sac itself

PostPosted: 30 May 2024, 15:02
by Althuna
Not sure if reported already, but AI seems to not use Vraska, Golgari Queen. (I think always?)

I attached save.

Re: Vraska, Golgari Queen

PostPosted: 02 Jun 2024, 11:05
by Aswan jaguar
AI does use Vraska, Golgari Queen when it sees a direct advantage from the draw (that can use the card drawn that turn) or when it will draw a valuable for AI card as AI knows which card will draw and in the case of Vraska, Golgari Queen if I am not wrong the card it will draw has to have more value than the one AI will sacrifice. So the +1 life +2 loyalty counters to sac a Badlands to get a Badlands in your savegame is not valued for AI so much.

An issue that I can't find out why happens is that you can sacrifice Vraska, Golgari Queen itself to it's ability despite there is code to prevent this.
Code: Select all
test.not_me = 1;

Re: [confirmed]Vraska, Golgari Queen can sac itself

PostPosted: 02 Jun 2024, 17:51
by drool66
The sacrifice happens during EVENT_RESOLVE_ACTIVATION, therefore:
Code: Select all
            if( new_sacrifice(player, card, player, SAC_DONE, &test) ){
should be:
Code: Select all
            DECL_INST();
            int pp = inst->parent_controller, pc = inst->parent_card;
            if( new_sacrifice(pp, pc, pp, SAC_DONE, &test) ){
Furthermore,
Code: Select all
   choice = DIALOG(player, card, event,
               DLG_RANDOM, DLG_PLANESWALKER,
               "Sac to draw and gain life", 1, 5, 2,
               "Destroy target nonland", can_target(&td), count_counters(player, card, COUNTER_LOYALTY) > 3 ? 15 : 1, -3,
               "Emblem", 1, 20, -9);
Code: Select all
   choice = DIALOG(player, card, event,
               DLG_RANDOM, DLG_PLANESWALKER,
               "Sac to draw and gain life", new_can_sacrifice(player, card, player, &test), 5, 2,
               "Destroy target nonland", can_target(&td), count_counters(player, card, COUNTER_LOYALTY) > 3 ? 15 : 1, -3,
               "Emblem", 1, 20, -9);
(and the test should be built up top, along with the target definition)

Again, I still can't test anything, so Aswan jaguar if you want to test and commit, otherwise I can either come back and commit later.

Re: [confirmed]Vraska, Golgari Queen can sac itself

PostPosted: 03 Jun 2024, 12:28
by Aswan jaguar
Fixed in commit 960bc9e as suggested above.