Page 1 of 1

[fixed]Firescreamer bug

PostPosted: 27 Aug 2021, 21:12
by etphonehome
Firescreamer activated during my cleanup step and +1/+0 didn't clean up at the end of the turn.

Now that this happened, i think i've already seen other cards activate their effects during my cleanup phase like that was their turn already, AI untap their cards and don't loose the until EOT effect, like it considered my cleanup phase like the AI turn already

THX

Re: Firescreamer bug

PostPosted: 28 Aug 2021, 11:32
by Aswan jaguar
I think most of the issue here, is explained by Korath as how ending phase should work and how it works in manalink and what needs to be done: viewtopic.php?f=86&t=18013&p=190420&hilit=at+the+beginning+of+the+end#p190420

Re: [confirmed]Firescreamer bug

PostPosted: 28 Aug 2021, 14:59
by Korath
If until-end-of-turn effects are being treated as at-the-start-of-the-next-end-step triggers, then that's a recent, gamebreaking bug right now that shouldn't wait until everything I mention there is correct.

What's happening is that most effects timed "until end of turn" are removed during EVENT_CLEANUP, which is - as mentioned in my old post linked above - sent before TRIGGER_EOT. (Some happen during TRIGGER_EOT, which is an unambiguous error: while the events and triggers sent in the original implementation only mostly match up to the current game turn sequence, and while might have mislabelled some of them, we do know that these effects should end at an event, not a trigger.) There was an unused and incomplete framework to allow instant- and interrupt-speed responses to triggers; that was enabled to allow Stifle and similar cards. So the AI is pumping these creatures during TRIGGER_EOT, and the effects last until the next time EVENT_CLEANUP is sent, near the end of the next turn.

The fastest mitigation is to disable instant+interrupt-speed responses to triggers during TRIGGER_EOT. This is really the absolute minimum that must be done before another release: being able to Stifle end-step triggers is not worth having Shivan Dragon pumps persisting into the next turn.

The real fix is to move the parts of cleanup_phase() and end_turn_phase() around, at least to put EVENT_CLEANUP after TRIGGER_EOT even if everything else doesn't end up where it ultimately should. That should be feasible even without moving either into C: EVENT_CLEANUP is sent (manually with a for-loop in card-index-ascending order, rather than in timestamp order by dispatch_event()) as the last part of cleanup_phase(), and there's function calls that can be easily hooked in end_turn_phase() just after TRIGGER_EOT is dispatched. I'd try putting it just before the reassess_all_cards() call, and seeing whether cards with enough damage marked on them to kill them once their temporary toughness pumps wear off work properly.

Re: [confirmed]Firescreamer bug

PostPosted: 28 Aug 2021, 20:03
by drool66
It looks like it was activating in response to TRIGGER_EOT. Fixed for now by disabling interaction under that trigger sic:

cant_be_responded_to |= trigger_condition == TRIGGER_EOT;

Committed in 133af66