diff --git a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.cpp b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.cpp index b6bd7a8349..53150be1bf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.cpp @@ -30,8 +30,10 @@ bool GlobalState::accept_opponent(){ if (!is_boss_battle(*this) && is_boss(opponent_slug)){ return false; } - // Infer the boss if we don't know it. - if (is_boss_battle(*this) && boss.empty()){ + // Infer the boss if we don't know it. Only a single boss species counts: + // a rental read here is a misread (Kyurem read as Mimikyu, 2026-11-02) + // and must not become the boss. A later turn's read can still record it. + if (is_boss_battle(*this) && boss.empty() && opponent.size() == 1 && is_boss(opponent_slug)){ boss = opponent_slug; } return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.h b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.h index e6aa8e7050..4b34bfecec 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.h +++ b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State.h @@ -174,7 +174,8 @@ struct GlobalState{ // Returns false when the opponent read doesn't fit this battle stage (a // boss before the fourth battle), so the caller retries the read. On an - // accepted read at the fourth battle, records the boss if none is known. + // accepted read at the fourth battle, records the boss if none is known + // and the read is a single boss species. bool accept_opponent(); // The same boss, but only if the adventure caught it, else empty: for the diff --git a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State_Tests.cpp index b5b27ac65b..fbd162aa6e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonSwSh/MaxLair/Framework/PokemonSwSh_MaxLair_State_Tests.cpp @@ -74,12 +74,16 @@ const BossStateTestCase CASES[] = { .input = {.name = "rental before three wins", .wins = 2, .opponent = {"mimikyu-disguised"}, .boss = "", .final_wins = 3}, .expectation = {.accepted = true, .boss = "", .boss_if_caught = ""}, }, - // TODO: to be fixed: a rental at the boss stage is accepted as the boss and reported caught. { - .input = {.name = "Mimikyu at boss stage", .wins = 3, .opponent = {"mimikyu-disguised"}, .boss = "", .final_wins = 3}, - .expectation = {.accepted = true, .boss = "mimikyu-disguised", .boss_if_caught = "mimikyu-disguised"}, + .input = {.name = "Mimikyu at boss stage is not the boss", .wins = 3, .opponent = {"mimikyu-disguised"}, .boss = "", .final_wins = 3}, + .expectation = {.accepted = true, .boss = "", .boss_if_caught = ""}, }, - // TODO: to be fixed: a rental misread as the boss is kept after the real boss is read. + { + .input = {.name = "Kyurem after a rejected Mimikyu read", .wins = 3, .opponent = {"kyurem"}, .boss = "", .final_wins = 4}, + .expectation = {.accepted = true, .boss = "kyurem", .boss_if_caught = "kyurem"}, + }, + // A wrong boss can no longer be recorded (see the cases above); one that + // is already known is kept. { .input = {.name = "Kyurem after Mimikyu misidentification", .wins = 3, .opponent = {"kyurem"}, .boss = "mimikyu-disguised", .final_wins = 3}, .expectation = {.accepted = true, .boss = "mimikyu-disguised", .boss_if_caught = "mimikyu-disguised"}, @@ -102,17 +106,16 @@ const BossStateTestCase CASES[] = { .input = {.name = "empty boss-stage read", .wins = 3, .opponent = {}, .boss = "", .final_wins = 3}, .expectation = {.accepted = true, .boss = "", .boss_if_caught = ""}, }, - // TODO: to be fixed: a two-candidate read is accepted and the first is taken as the boss. { - .input = {.name = "ambiguous boss-stage read", .wins = 3, .opponent = {"kyurem", "mimikyu-disguised"}, .boss = "", .final_wins = 3}, - .expectation = {.accepted = true, .boss = "kyurem", .boss_if_caught = "kyurem"}, + .input = {.name = "ambiguous boss-stage read is not the boss", .wins = 3, .opponent = {"kyurem", "mimikyu-disguised"}, .boss = "", .final_wins = 3}, + .expectation = {.accepted = true, .boss = "", .boss_if_caught = ""}, }, // TODO: to be fixed: a rental read at the boss stage is accepted, and the boss is reported caught without a fourth win. { .input = {.name = "rental read after known boss", .wins = 3, .opponent = {"mimikyu-disguised"}, .boss = "kyurem", .final_wins = 3}, .expectation = {.accepted = true, .boss = "kyurem", .boss_if_caught = "kyurem"}, }, - // TODO: to be fixed: a rental read at the boss stage is accepted and the rental is reported as the caught boss. + // TODO: a rental boss recorded before this fix is still reported as caught. { .input = {.name = "fourth win after rental boss", .wins = 3, .opponent = {"mimikyu-disguised"}, .boss = "mimikyu-disguised", .final_wins = 4}, .expectation = {.accepted = true, .boss = "mimikyu-disguised", .boss_if_caught = "mimikyu-disguised"},