Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f18c735
FRLG AutoStory: the Magikarp rides into the League; Hall of Fame scre…
dayfine Nov 16, 2026
ca241be
Merge remote-tracking branch 'origin/frlg/check-levels' into frlg/lea…
dayfine Nov 16, 2026
687b139
Merge remote-tracking branch 'origin/frlg/check-levels' into frlg/lea…
dayfine Nov 17, 2026
2cb01ab
Merge remote-tracking branch 'origin/frlg/e4-rows' into frlg/league-k…
dayfine Nov 17, 2026
13f60e2
Merge remote-tracking branch 'origin/frlg/e4-rows' into frlg/league-k…
dayfine Nov 17, 2026
3aabafe
Merge remote-tracking branch 'origin/frlg/e4-rows' into frlg/league-k…
dayfine Nov 17, 2026
ba88773
FRLG PC: a withdrawal of a species the party already has is done
dayfine Nov 17, 2026
36ac777
FRLG PC: a full party's last species comes from its summary
dayfine Nov 17, 2026
dfe27cb
FRLG League: the save check's max HP comes from the same summary
dayfine Nov 17, 2026
122f730
FRLG summary: read low PP drawn in yellow, orange or red
dayfine Nov 17, 2026
c05c48b
FRLG summary: more PP than the full PP reads as unread
dayfine Nov 17, 2026
a649d27
FRLG summary: read the current PP from the digits' cells only
dayfine Nov 17, 2026
9c98fe5
FRLG League: a fight's item caps count from the bag after its top-up
dayfine Nov 17, 2026
f64ad48
CI: pin CommandLineTests with the Blastoise low-PP summary frames (da…
dayfine Nov 17, 2026
b175e57
FRLG StoryEnv: fight_start after the positional fields
dayfine Nov 17, 2026
689bfc8
FRLG League: a try passes by the bag it leaves, not what it spent
dayfine Nov 17, 2026
791d29e
Merge frlg/e4-rows into frlg/league-karp-hof
dayfine Nov 17, 2026
a45fed6
AutoStory verify: phase 1 stops once its verdict is known
dayfine Nov 17, 2026
f552fa5
AutoStory verify tests: tries counted with phase 1's early stop
dayfine Nov 17, 2026
a8d364c
AutoStory League rows test: Bruno's over-spending win leaves 4 Full R…
dayfine Nov 17, 2026
07d41b4
FRLG League top-up: read the lead's PP off its summary every try
dayfine Nov 17, 2026
2ec8d6b
FRLG League: find the foe out by species in the whole party
dayfine Nov 17, 2026
24a991a
FRLG League sends test: Venusaur has no hit without the sun; PolicyVi…
dayfine Nov 17, 2026
5a5195c
FRLG League sends test: the Speed falls apart, as BattleTrack counts …
dayfine Nov 17, 2026
deab8a9
FRLG League: the Champion's win ends at the prize text; the Hall of F…
dayfine Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cpp-ci-serial-programs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ jobs:
with:
# The fork's fixtures: upstream's, the SystemKeyboardDetector and HomeTileReader screenshots and pending FRLG image submissions (Fly landing, party menu, Route 21 battle, Pokemon Mansion 1F and B1F hold frames, and the Pidgey known-moves frame, the PC's box-screen fade, Bruno's Onix Roar battle menus).
repository: 'dayfine/CommandLineTests'
ref: '3c9d2c1dfb31af1e2a1ff44e3f71a24f50f5238d'
ref: 'ab6b437ceae2f346c60f891c5bd282f6b8dd1fac'
path: 'CommandLineTests'

# The unit tests assume the downloadable resources they need are already downloaded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Story Segments

Check warning on line 1 in SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySegments.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=528 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -246,23 +246,31 @@
, m_state(state)
{}

CheckpointReport run(){

Check warning on line 249 in SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySegments.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::Pokemon::VerifyRow::run(): function_lines=38 (advisory above 25, limit 50)
const std::string& id = m_row.spec.id;
say(std::format(
"[Verify] {}: phase 1, {} tries from one save, {} must pass; phase 2, up to {} tries, the first pass saved",
id, m_verify.tries, m_verify.min_pass, m_verify.reset_budget
), m_hooks);
// Phase 1 ends as soon as its verdict is known: min_pass passes, or
// too few tries left to reach it.
size_t passes = 0;
for (size_t c = 1; c <= m_verify.tries; c++){
for (size_t c = 1; c <= m_verify.tries && passes < m_verify.min_pass; c++){
const std::optional<bool> passed = try_once(/*phase=*/1, c, m_verify.tries);
if (!passed){
return std::move(m_result);
}
passes += *passed ? 1 : 0;
if (passes + (m_verify.tries - c) < m_verify.min_pass){
return stop("verify_below_min_pass", std::format(
"phase 1 passed {} of {}, {} left: under {}", passes, c, m_verify.tries - c, m_verify.min_pass
));
}
}
if (passes < m_verify.min_pass){
return stop("verify_below_min_pass", std::format("phase 1 passed {} of {}, under {}", passes, m_verify.tries, m_verify.min_pass));
}
say(std::format("[Verify] {}: phase 1 reached {} passes", id, passes), m_hooks);
for (size_t c = 1; c <= m_verify.reset_budget; c++){
const std::optional<bool> passed = try_once(/*phase=*/2, c, m_verify.reset_budget);
if (!passed){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ class Test_StoryVerifyRow : public UnitTest{

const VerifyRowCase VERIFY_ROW_CASES[] = {
{
.name = "ten passes: saved on the first phase 2 try",
.name = "every try passes: phase 1 stops at its fifth pass, saved on the first phase 2 try",
.input = {.tries = {win()}},
.expectation = {.completed = true, .fights = 11, .saves = 1, .reloads = 10},
.expectation = {.completed = true, .fights = 6, .saves = 1, .reloads = 5},
},
{
.name = "six losses first: min_pass 5 out of reach, phase 1 stops there, no save",
.input = {.tries = {lose()}},
.expectation = {.failure = "verify_below_min_pass", .fights = 6, .saves = 0, .reloads = 5},
},
{
.name = "four passes in phase 1, under min_pass 5: stop, no save",
Expand All @@ -196,18 +201,18 @@ const VerifyRowCase VERIFY_ROW_CASES[] = {
},
{
.name = "phase 2 passes on its third try: saved once",
.input = {.tries = joined(joined(repeated(5, win()), repeated(7, lose())), {win()})},
.expectation = {.completed = true, .fights = 13, .saves = 1, .reloads = 12},
.input = {.tries = joined(joined(repeated(5, win()), repeated(2, lose())), {win()})},
.expectation = {.completed = true, .fights = 8, .saves = 1, .reloads = 7},
},
{
.name = "no pass in the reset budget of 5: stop, no save",
.input = {.tries = joined(repeated(5, win()), {lose()})},
.expectation = {.failure = "verify_out_of_budget", .fights = 15, .saves = 0, .reloads = 14},
.expectation = {.failure = "verify_out_of_budget", .fights = 10, .saves = 0, .reloads = 9},
},
{
.name = "wins over the game's cap don't pass: never saved",
.input = {.tries = joined(repeated(5, win()), {win_over_cap()})},
.expectation = {.failure = "verify_out_of_budget", .fights = 15, .saves = 0, .reloads = 14},
.expectation = {.failure = "verify_out_of_budget", .fights = 10, .saves = 0, .reloads = 9},
},
{
.name = "the save is short of the start check: stop before fighting",
Expand All @@ -217,17 +222,17 @@ const VerifyRowCase VERIFY_ROW_CASES[] = {
{
.name = "a won try whose postcondition check fails right before the save: never saved",
.input = {.verify = {.tries = 2, .min_pass = 0, .reset_budget = 2}, .tries = {win()}, .postconditions_hold = false},
.expectation = {.failure = "verify_out_of_budget", .fights = 4, .saves = 0, .reloads = 3},
.expectation = {.failure = "verify_out_of_budget", .fights = 2, .saves = 0, .reloads = 1},
},
{
.name = "the pass check can't read the game: no save, the loop stops at once",
.input = {.tries = {win()}, .pass_readable = false},
.expectation = {.failure = "postcondition_unread", .fights = 1, .saves = 0, .reloads = 0},
},
{
.name = "min_pass 0 of 2: straight to phase 2",
.input = {.verify = {.tries = 2, .min_pass = 0, .reset_budget = 1}, .tries = {lose(), lose(), win()}},
.expectation = {.completed = true, .fights = 3, .saves = 1, .reloads = 2},
.name = "min_pass 0 of 2: no phase 1 try, straight to phase 2",
.input = {.verify = {.tries = 2, .min_pass = 0, .reset_budget = 1}, .tries = {win()}},
.expectation = {.completed = true, .fights = 1, .saves = 1, .reloads = 0},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <cstddef>
#include <optional>
#include <string>
#include <string_view>
#include "Common/Cpp/Logging/AbstractLogger.h"
#include "Common/Cpp/TestRunners/UnitTestDatabase.h"
Expand Down Expand Up @@ -76,6 +77,9 @@ struct PcView{
std::optional<size_t> box = std::nullopt;
// BOX_GRID: whether the cell under the hand holds a Pokemon, if read.
std::optional<bool> occupied = std::nullopt;
// BOX_GRID: the species' slug of the Pokemon under the hand, if read
// (BoxCellReader, by the caller: this reader has no language).
std::optional<std::string> species = std::nullopt;
};

// The PC's screen on `screen`, with its cursor where it can be read.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
namespace{

// Measured on captures of the page (console B, 2026-11-02): names from
// x 163, y 24 to 32 (with the shadow); the PP's digits y 34 to 43, the
// current PP's to x 216, "/" from 217 to 224, the full PP's from 224.
// x 163, y 24 to 32 (with the shadow); the PP's digits y 34 to 43. Across,
// the game prints (pret pokefirered src/pokemon_summary_screen.c,
// PrintMoveNameAndPP, the pane from x 160) the "PP" label from x 196 to 205,
// the current PP right-aligned in two 6-pixel cells from 206 to 217, "/" from
// 218 and the full PP's two cells from 224. The label takes the PP's colour.
constexpr double ROW_STEP = 28;
constexpr double NAME_TOP = 22;
constexpr double PP_TOP = 33;
Expand Down Expand Up @@ -217,8 +220,41 @@
return dark * 5 > badge.width() * badge.height();
}

// The colours the game writes a move's PP in (pret pokefirered
// src/pokemon_summary_screen.c, sPrintMoveTextColors, palette
// graphics/summary_screen/text_moves.pal): dark grey (32, 32, 32) on a grey
// shadow (222, 222, 222) at full PP or above half; yellow (238, 222, 0) at
// half or less, orange (255, 148, 0) at a quarter or less and red (238, 0, 0)
// at 0, on the shadows (255, 246, 139), (255, 238, 115) and (246, 222, 156).
// The three low-PP colours are the only ones with far more red than blue,
// and their ink has no blue while their shadows have 115 or more.
constexpr uint32_t DARK_PP_INK = 0xff202020;
constexpr uint32_t DARK_PP_SHADOW = 0xffdedede;
constexpr int LOW_PP_MIN_RED_OVER_BLUE = 80;
constexpr int LOW_PP_INK_MAX_BLUE = 64;

// `pp` with low-PP yellow, orange and red redrawn in the dark grey the digit
// templates are cut from: their ink as the dark ink, their shadows as its
// shadow. Dark-grey PP comes back as it was.
ImageRGB32 pp_in_dark_ink(const ImageViewRGB32& pp){
ImageRGB32 ink = pp.copy();
for (size_t y = 0; y < ink.height(); y++){
for (size_t x = 0; x < ink.width(); x++){
const uint32_t pixel = ink.pixel(x, y);
const int red = (pixel >> 16) & 0xff;
const int blue = pixel & 0xff;
if (red - blue < LOW_PP_MIN_RED_OVER_BLUE){
continue;
}
ink.pixel(x, y) = blue < LOW_PP_INK_MAX_BLUE ? DARK_PP_INK : DARK_PP_SHADOW;
}
}
return ink;
}

int read_pp(Logger& logger, const ImageViewRGB32& screen, const ImageFloatBox& box){
const int pp = read_digits_waterfill_template(logger, extract_box_reference(game_box(screen), box), DigitTemplateType::StatBox);
const ImageRGB32 ink = pp_in_dark_ink(extract_box_reference(game_box(screen), box));
const int pp = read_digits_waterfill_template(logger, ink, DigitTemplateType::StatBox);
// A move has at most 64 PP (40 with three PP Ups).
return pp >= 0 && pp <= 64 ? pp : -1;
}
Expand All @@ -229,7 +265,8 @@
return ImageFloatBox(161.0 / 240, (NAME_TOP + ROW_STEP * double(row)) / 160, 76.0 / 240, 12.0 / 160);
}
ImageFloatBox summary_move_pp_box(size_t row){
return ImageFloatBox(204.0 / 240, (PP_TOP + ROW_STEP * double(row)) / 160, 13.0 / 240, 11.0 / 160);
// From 206: the label's last column at 204 read as a "4" in yellow ink.
return ImageFloatBox(206.0 / 240, (PP_TOP + ROW_STEP * double(row)) / 160, 12.0 / 240, 11.0 / 160);
}
ImageFloatBox summary_move_max_pp_box(size_t row){
return ImageFloatBox(224.0 / 240, (PP_TOP + ROW_STEP * double(row)) / 160, 15.0 / 240, 11.0 / 160);
Expand All @@ -253,11 +290,17 @@
if (!row_has_move(screen, row)){
break;
}
moves.push_back(SummaryMove{
SummaryMove move{
.move = read_summary_move_name(logger, language, screen, row),
.pp = read_pp(logger, screen, summary_move_pp_box(row)),
.max_pp = read_pp(logger, screen, summary_move_max_pp_box(row)),
});
};
// More PP than the full PP is a misread, not a reading: unread
// (the League after Agatha: SURF's yellow "6/15" read as 46/15).
if (move.max_pp >= 0 && move.pp > move.max_pp){
move.pp = -1;
}
moves.push_back(std::move(move));
}
return moves;
}
Expand Down Expand Up @@ -348,7 +391,7 @@

} // namespace

void add_tests_SummaryMovesReader(UnitTestDatabase& database){

Check warning on line 394 in SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SummaryMovesReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::add_tests_SummaryMovesReader( UnitTestDatabase & database): function_lines=33 (advisory above 25, limit 50)
// FireRed on console B, 2026-11-02: the story's Squirtle at Lv16, not
// evolved, with WATER GUN where TACKLE was: the battle had forgotten the
// top move for Water Gun instead of BUBBLE.
Expand All @@ -367,6 +410,19 @@
// read as attract, ?, attract and steel-wing before its line's moves
// were in MOVE_NAMES.
database.add<Test_SummaryScreen>("PokemonFRLG/SummaryMovesReader/Pidgey_KnownMoves_eng.png");
// FireRed at the League after Agatha, 2026-11-17: Blastoise with BITE
// 9/25 and SURF 6/15 in yellow, read as -1/-1 while only dark ink was
// read; then BITE 15/25 and SURF 6/15, its yellow "6" read as 46 while
// the box held the yellow "PP" label's edge. Added once the images are in
// the test repo.
for (std::string_view low_pp : {
"PokemonFRLG/SummaryMovesReader/Blastoise_LowPP_eng.png",
"PokemonFRLG/SummaryMovesReader/Blastoise_Surf6_eng.png",
}){
if (Filesystem::exists(std::format("{}{}", UNIT_TEST_RESOURCE_PATH(), low_pp))){
database.add<Test_SummaryScreen>(std::string(low_pp));
}
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "Programs/AutoStory/PokemonFRLG_AutoStoryBattle.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryHallOfFame.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryCheckLevel_Tests.h"
Expand Down Expand Up @@ -208,6 +209,7 @@ static void add_tests_AutoStoryAll(UnitTestDatabase& database){
add_tests_AutoStoryRngLoop(database);
add_tests_AutoStoryCapture(database);
add_tests_AutoStoryPcStorage(database);
add_tests_AutoStoryHallOfFame(database);
add_tests_AutoStoryAbilities(database);
add_tests_AutoStoryCheckLevel(database);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=920 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -557,14 +557,14 @@
}
Pokemon::StoryGameHooks game = story_game(env, story);
Pokemon::SegmentHooks hooks = Pokemon::story_segment_hooks(game);
// A verify row's try passes by the League's item caps, counted from
// its start save (the loop reloads it before each try), and by our
// side as read off the console meeting the next fight's entry
// contract: checked right before the save, never on a guess.
// A verify row's try passes by our side as read off the console
// after the fight, the bag's balance and the lead's HP and PP,
// meeting the next fight's entry contract: checked right before the
// save, never on a guess.
hooks.verify_pass = [&story, &rows](const std::string& id, Pokemon::RunState&){
for (const StoryCheckpoint& row : rows){
if (row.id == id){
return check_league_save(story, row, story.saved_supplies);
return check_league_save(story, row);
}
}
return Pokemon::outcome_ok();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Battle

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattle.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=982 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -57,6 +57,9 @@
constexpr Milliseconds BATTLE_START_TIMEOUT = 20000ms;
// No battle screen for this long: check for the overworld with START.
constexpr Milliseconds BATTLE_GONE = 2000ms;
// After a won battle, how long without a START menu before the scene after
// it is taken as the next step's.
constexpr Milliseconds WON_SCENE = 10000ms;
// A battle screen with neither an arrow nor a menu for this long: B, for
// a prompt the detectors miss.
constexpr Milliseconds STUCK = 8000ms;
Expand Down Expand Up @@ -418,7 +421,7 @@
// after 0 turns" at the rival) and under a move prompt's YES/NO (console
// B, 2026-11-01, Viridian Forest: called over, then stuck at "Stop
// learning?").
bool no_battle_screen(const ImageViewRGB32& screen, WallClock now){

Check warning on line 424 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattle.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::BattleLoop::no_battle_screen( const ImageViewRGB32 & screen , WallClock now): function_lines=32 (advisory above 25, limit 50)
if (!m_seen_battle){
pbf_wait(m_context, POLL);
return false;
Expand All @@ -433,6 +436,13 @@
return true;
}
}
// Won, and no START menu after it: a scene follows the battle (the
// Champion's, Oak into the Hall of Fame: console B, 2026-11-17),
// which is the next step's.
if (m_won && now - m_last_battle > WON_SCENE){
m_console.log("Battle: won (the prize text read); the scene after it is the next step's.");
return true;
}
// Oak's white text box in the rival's battle reads as no battle screen:
// B moves it on, and B does nothing on the overworld once the battle is over.
if (now - m_last_press > 1500ms){
Expand Down Expand Up @@ -665,6 +675,8 @@
std::optional<std::string> letters = read_battle_text(m_language, screen);
if (letters && (m_policy_texts.empty() || m_policy_texts.back() != *letters)){
m_console.log(std::format("Battle: text \"{}\".", *letters));
// pokefirered: "{PLAYER} got ¥{N}\nfor winning!", the battle's last text.
m_won = m_won || letters->find("forwinning") != std::string::npos;
m_policy_texts.push_back(std::move(*letters));
}
}
Expand Down Expand Up @@ -692,6 +704,8 @@
std::vector<std::string> m_policy_texts;
BattleScreen m_last_seen = BattleScreen::NONE;
bool m_seen_battle = false;
// The prize text "for winning" read (League fights read the battle's texts).
bool m_won = false;
bool m_confirmed = false;
bool m_press_a = true;
// A move was chosen and no battle menu has shown since.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Battle Decisions

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=739 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -198,6 +198,7 @@
BattleDecisions::BattleDecisions(Supplies& supplies, BattleKind kind)
: m_supplies(supplies)
, m_kind(kind)
, m_foes(supplies.foes)
{
if (supplies.lead.level > 0){
m_level_cap = static_cast<uint8_t>(std::min(battle_level(supplies.lead) + MAX_LEVELS_IN_BATTLE, 255));
Expand Down Expand Up @@ -313,14 +314,7 @@
}

size_t BattleDecisions::track_foe(){
const std::vector<std::string>& foes = m_supplies.foes;
for (size_t index = m_foe_index; index < foes.size() && !m_supplies.foe_out.empty(); index++){
if (foes[index] == m_supplies.foe_out){
m_foe_index = index;
break;
}
}
return m_foe_index;
return m_foes.out(m_supplies.foe_out);
}

TurnAction BattleDecisions::policy_turn(const PartyStatus& status, std::string heal_reason){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "Pokemon/AutoStory/Pokemon_ScriptedReadings.h"
#include "PokemonFRLG_AutoStoryBattle.h"
#include "PokemonFRLG_AutoStoryBattlePolicy.h"
#include "PokemonFRLG_AutoStoryBattleTrack.h"
#include "PokemonFRLG_AutoStoryParty.h"
#include "PokemonFRLG_AutoStoryPlannedBattle.h"
#include "PokemonFRLG_AutoStoryBattleTurns.h"
Expand Down Expand Up @@ -129,7 +130,8 @@ class BattleDecisions{
std::optional<PlannedBattle> m_planned;
// The lead's Attack and Sp. Atk stages from the X items used, for its attack.
AttackContext m_attack;
size_t m_foe_index = 0;
// The step's foes as they came out.
FoeParty m_foes;
bool m_lost = false;
// A switch back to the lead couldn't be made: the rule is off.
bool m_switch_off = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ struct PolicyView{
StatusCondition status = StatusCondition::NONE;
// Its Speed as POKEMON SKILLS shows it, before badges and stages.
int speed = 0;
// The foe out, in the step's "foes" order; those before it have fainted.
// The foe out, as its slot in the step's "foes" (FoeParty: the
// trainer may send them in any order).
size_t foe_index = 0;
// The foe's HP bar's filled share, 1 when not read.
double foe_fill = 1.0;
Expand Down
Loading
Loading