Repository navigation
Conversation
Move the boss-stage check and boss inference that read_battle_menu() runs after the summary read into GlobalState::infer_boss_from_opponent(), and the boss passed to end_adventure_action() into GlobalState::caught_boss(). No behavior change. Add native tests that pin down today's results, including the cases a later fix changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ught() Comment the boss field and boss_if_caught() so the two are told apart: the boss known all adventure long versus the boss only when the adventure caught it, for the end-of-adventure decision. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
boss_if_caught() no longer takes the caught count: whether the boss was caught is decided from GlobalState::wins (the boss is the fourth battle), so it stays right if non-boss catches are ever skipped. It still returns the boss whatever the battles won; the tests set wins on the caught screen instead of passing a count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
commented
Nov 2, 2026
dayfine
commented
Nov 2, 2026
Comments on the MaxLairBossState cases that record main's wrong behaviour, and a blank line between accept_opponent() and boss_if_caught(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
commented
Nov 3, 2026
dayfine
commented
Nov 4, 2026
|
|
||
|
|
||
|
|
||
| namespace{ |
Owner
Author
There was a problem hiding this comment.
namespace{ -> move it to line 23
Owner
Author
|
|
||
|
|
||
| namespace{ | ||
| using MaxLairInternal::GlobalState; |
Owner
Author
There was a problem hiding this comment.
Dropped in f6b95cd now that the tests live inside namespace MaxLairInternal in PokemonSwSh_MaxLair_State_Tests.cpp.
| namespace{ | ||
| using MaxLairInternal::GlobalState; | ||
|
|
||
| struct BossStateCase{ |
Owner
Author
There was a problem hiding this comment.
maybe
BossStateTestCaseInput
BossStateTestCaseExpectation
and then using BossStateTestCase = std::pair<BossStateTestCaseInput, BossStateTestCaseExpectation>?
Owner
Author
| } | ||
|
|
||
| void add_tests(UnitTestDatabase& database){ | ||
| add_tests_MaxLairBossState(database); |
Owner
Author
There was a problem hiding this comment.
I think this intrusion means we should add a new test file
Owner
Author
dayfine
marked this pull request as ready for review
November 4, 2026 05:24
dayfine
commented
Nov 4, 2026
| std::string boss_if_caught; | ||
| }; | ||
|
|
||
| using BossStateTestCase = std::pair<BossStateTestCaseInput, BossStateTestCaseExpectation>; |
Owner
Author
There was a problem hiding this comment.
actually let's make this a struct so cases[] can have field names
Owner
Author
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
main; no parent PRs. Test-only prep for the Max Lair boss fix in #172; no behavior change.Moves the Max Lair boss-stage check and boss inference into
GlobalStatehelpers and pins today's results with native tests, so the fix PR shows only the changed behavior and the test expectations it flips.GlobalState::accept_opponent()holds the check and inference thatread_battle_menu()ran after the summary read, unchanged (with an internalis_boss_battle()helper); it returns false when the read doesn't fit the battle stage so the caller retries. The header-read check stays where it was.GlobalState::boss_if_caught()returns the boss passed toend_adventure_action()on the caught screen; today that is the identified boss whatever happened. It takes no catch count: "caught" is to be decided from the battles won (wins; the boss is the fourth battle), not from how many Pokemon were caught. Comments on it and on thebossfield tell apart the boss known all adventure long from the boss only when caught.PokemonSwSh::MaxLairBossStatecases inPokemonSwSh_MaxLair_State_Tests.{h,cpp}record current results, including the ones the fix changes, markedTODO: to be fixed(a rental read at the boss stage becomes the boss; a lost adventure still reports the boss).How to review: the lines removed from
read_battle_menu()reappear inPokemonSwSh_MaxLair_State.cppwith renames (state.dropped, theopponentlocal becomesopponent_slug), so compare them by eye; then readPokemonSwSh_MaxLair_State_Tests.cpp, which setswinson the caught screen.