Skip to content

Conversation

@Kiousu
Copy link

@Kiousu Kiousu commented Feb 4, 2026

Fixes ChangesZone trigger timing for battlefield-origin events so newly-entered objects don’t retroactively observe older leaves/dies events (Brutal Cathar / Slaughter Specialist case).

Also adds focused regression canaries in GameSimulationTest for:

  • exile-and-return timing (Brutal Cathar, Fiend Hunter, Banisher Priest),
  • normal simultaneous death observer behavior,
  • command-zone/leave watcher behavior (Oubliette),
  • replacement + leaves-battlefield path (Rest in Peace + Skyclave Apparition),
  • LKI counter-dependent dies behavior (Jotun Owl Keeper).

No functional changes outside trigger timing guard + tests.

game.getPhaseHandler().devModeSet(PhaseType.MAIN1, catharController);
SpellAbility catharSa = brutalCathar.getFirstSpellAbility();
AssertJUnit.assertNotNull(catharSa);
catharSa.setTargetCard(specialist);
Copy link
Contributor

@tool4ever tool4ever Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmn thanks, but you picked a pretty difficult problem for your first PR...

anyway I thought I already fixed the trigger handling (and only left the issue open for the replacement effect part):
while I see this test fails without the engine change I suspect that's only because you're not providing the LastStateBattlefield correctly when destroying 🤷‍♂️

also here a target is set for the permanent spell which makes no sense (it's possible the AI targets the trigger by itself later though)
this kind of leads me to believe this is generated by an AI once again fooling itself? 👎

Copy link
Author

@Kiousu Kiousu Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, absolutely my mistake.

I think that the tests should be valid now. At the very least, I think I've fixed the two issues that you've pointed out. Dropping the guard I added causes the following tests to fail:
testBanisherPriestReturnDoesNotSeePastOpponentDeath
testBrutalCatharDoesNotTriggerReturnedSlaughterSpecialistFromItsDeath
testBrutalCatharReturnDoesNotSeeSimultaneousOtherCreatureDeaths

If I’m still missing something and the tests are still wrong, that’s on me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the most terrible thought. What if I misread/misremembered the card?

In a case of tragic serendipity, the test was right for the wrong reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to recreate testBrutalCatharReturnDoesNotSeeSimultaneousOtherCreatureDeaths ingame and it seems to work fine:
image

so unfortunately I still don't trust those tests 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started with the test, got the test wrong. The issue was always solved. Sorry for wasting time.

@Kiousu Kiousu requested a review from tool4ever February 4, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants