Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
788acab
AutoStory: one check table decides which checks each level runs
dayfine Nov 16, 2026
64c68d6
AutoStory checks: code health (options label helper, std::format in t…
dayfine Nov 16, 2026
47afdd0
Merge remote-tracking branch 'origin/frlg/moved-trainers' into frlg/c…
dayfine Nov 16, 2026
7bac365
FRLG AutoStory: battles read their own items; prechecks only verify
dayfine Nov 16, 2026
8a1f6af
FRLG AutoStory: name the bag rows in the load check test (GCC danglin…
dayfine Nov 16, 2026
2e43050
FRLG AutoStory: battle items from the real bag; reads leave the curso…
dayfine Nov 16, 2026
dbf8224
FRLG AutoStory: read_battle_pocket's result no longer shadows its row…
dayfine Nov 16, 2026
d390604
FRLG AutoStory: a boulder push taps twice a tile, each tap read off t…
dayfine Nov 16, 2026
13d1614
FRLG AutoStory: walks after a boulder push plan around the boulder wh…
dayfine Nov 16, 2026
2158fc1
FRLG AutoStory: a push's lost tap waits for the quiet overworld, then…
dayfine Nov 16, 2026
d98be19
FRLG routes: a route between two tiles of one map stays on that map
dayfine Nov 16, 2026
6fdafbc
FRLG routes: a hold on to a warp that sees no black finds the player …
dayfine Nov 16, 2026
836df1a
FRLG routes: a wild battle after a warp's fade, on the new map, is no…
dayfine Nov 16, 2026
0eb3e99
FRLG 19.04d: Strength stays on across the save; reach the hole boulde…
dayfine Nov 16, 2026
3c03d4b
FRLG boulder presses: the class comment back above its class
dayfine Nov 16, 2026
13f6eb4
FRLG boulders: a boulder pushed down a hole is gone from the floor
dayfine Nov 16, 2026
5d7479a
FRLG battles: strongest move on matchup ties; Parlyz Heal on PAR
dayfine Nov 16, 2026
6698100
FRLG PC: wait through the box screens' fade before reading the hand
dayfine Nov 16, 2026
de33fc1
FRLG AutoStory: open START for a save only on a quiet overworld; keep…
dayfine Nov 16, 2026
5f02c29
Merge remote-tracking branch 'origin/frlg/check-levels' into frlg/che…
dayfine Nov 16, 2026
e7ee9b6
FRLG AutoStory: a Full Restore at yellow or red HP in a high-risk fight
dayfine Nov 16, 2026
32bb0fa
FRLG AutoStory: attacks picked by Gen 3 damage, stages and foe stats …
dayfine Nov 16, 2026
c63ef65
AutoStory: a door's fade before a step is looked at until it settles
dayfine Nov 16, 2026
662b8c6
FRLG AutoStory: X items only where setup pays; a heal below half befo…
dayfine Nov 16, 2026
7716a21
FRLG AutoStory: a lead dragged out by Roar or Whirlwind is switched b…
dayfine Nov 16, 2026
e0ff23b
FRLG AutoStory: the lead-out rule and its readers in their own module
dayfine Nov 16, 2026
853ce65
FRLG AutoStory: lead-out tests as a designated case table; switch_lea…
dayfine Nov 16, 2026
bf6a907
FRLG AutoStory: the League as one checkpoint, planned from the bag at…
dayfine Nov 16, 2026
9fb959f
FRLG AutoStory: between League fights, unknown HP is read again, not …
dayfine Nov 16, 2026
373c4ce
FRLG AutoStory: #613's test fixes - same-map routes keep the other ma…
dayfine Nov 16, 2026
a59738c
FRLG AutoStory: #613's recovery and Mt. Moon tests after the person-a…
dayfine Nov 16, 2026
2a9bd13
FRLG AutoStory: Victory Road's floor sims carry run flags; dialogs-at…
dayfine Nov 16, 2026
220632a
FRLG AutoStory: story routes plan round trainers' lines
dayfine Nov 16, 2026
7827b16
FRLG AutoStory: story routes weigh only fixed trainers' lines (LINE_T…
dayfine Nov 16, 2026
926cb6a
FRLG AutoStory: story routes don't weigh the open-leg check; Rock Tun…
dayfine Nov 16, 2026
e454336
FRLG League: policy table rows for sleep, status at KO risk, heal esc…
dayfine Nov 17, 2026
bf77930
FRLG League: foe_threats for our Lv54 Blastoise; Solar Beam's charge …
dayfine Nov 17, 2026
84f8c7a
FRLG League: the planned policy (PokemonSimulation #111) as data plus…
dayfine Nov 17, 2026
9fecd80
FRLG battle bag: track the Items pocket's cursor within a battle
dayfine Nov 17, 2026
8d0738c
FRLG AutoStory: a Max Elixir restores the lead's PP in the story's count
dayfine Nov 17, 2026
419d462
FRLG League: battle by the planned policy, from the sim's foe parties
dayfine Nov 17, 2026
79ea67f
FRLG League: top up between fights by planned_between()
dayfine Nov 17, 2026
b226e9b
FRLG League: track foe stages, status and weather from the battle tex…
dayfine Nov 17, 2026
3bc5cc8
FRLG League: planned policy tests as name/input/expectation tables; s…
dayfine Nov 17, 2026
a0a58ea
FRLG League: parity test against the sim's planned decisions
dayfine Nov 17, 2026
2a1f0eb
FRLG League: test that our lead back in after Roar meets no second In…
dayfine Nov 17, 2026
bf6c308
FRLG League: no second Intimidate when our lead comes back in
dayfine Nov 17, 2026
493328b
FRLG League parity test: inputs before the state put_back() changes; …
dayfine Nov 17, 2026
e43d6dc
FRLG League: test Torrent on our Surf under a third of our HP
dayfine Nov 17, 2026
f44e675
FRLG League: planned damage with Torrent and the other pinch abilities
dayfine Nov 17, 2026
1b99bda
FRLG League: drop budgeted C2 cases the planned policy replaced
dayfine Nov 17, 2026
6f62c17
FRLG AutoStory: move status_name/cure_of into Supplies.cpp and drop u…
dayfine Nov 17, 2026
de68aa2
Fork Draft CI: 120-minute job timeout
dayfine Nov 17, 2026
82d5d85
FRLG fault sweep: 5 wild-battle seeds per row, 30 with PA_SLOW_TESTS
dayfine Nov 17, 2026
a5a0c7a
FRLG AutoStory: split pure CaptureLogic from Capture.cpp and console_…
dayfine Nov 17, 2026
05839e7
FRLG AutoStory: rename CaptureLogic/Capture to Capture/CaptureConsole
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
4 changes: 2 additions & 2 deletions .github/workflows/cpp-ci-serial-programs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ jobs:
uses: actions/checkout@v7
if: inputs.run-tests
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 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: '6e1d3bb33a0365d295280fcce9a01194d0df01a9'
ref: '3c9d2c1dfb31af1e2a1ff44e3f71a24f50f5238d'
path: 'CommandLineTests'

# The unit tests assume the downloadable resources they need are already downloaded
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/fork-draft-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ jobs:
compiler: default
run-clang-query: true
run-tests: true
# The build takes ~5 minutes with ccache; a run past an hour has a test hanging.
timeout-minutes: 60
# The build takes ~5 minutes with ccache; the FRLG sims take most of the rest.
# A run past two hours has a test hanging.
timeout-minutes: 120
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "Pokemon_StoryStepExecutor_Tests.h"
#include "Pokemon_Transitions_Tests.h"
#include "Types/Pokemon_StoryActionArg_Tests.h"
#include "Types/Pokemon_StoryCheckLevel_Tests.h"

namespace PokemonAutomation{
namespace Pokemon{
Expand All @@ -59,6 +60,7 @@ inline void add_tests_AutoStory(UnitTestDatabase& database){
add_tests_StoryStepExecutor(database);
add_tests_StoryStepJson(database);
add_tests_StoryActionArg(database);
add_tests_StoryCheckLevel(database);
add_tests_AuthoredCheckpointJson(database);
add_tests_StoryFiles(database);
add_tests_StorySavePolicy(database);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ struct StoryInterrupts{
InterruptKnobs knobs = {};
InterruptHandlerTable handlers = {};
// Looks at a screen that stays UNSETTLED (a fade with no battle yet)
// before it fails the step as "interrupt_unsettled". A step that
// before it fails the step as "interrupt_unsettled": enough for a
// battle's opening to show its battle, or for a door's fade to settle
// as a warp, battle_after_fade (8 s) after it came back up. BDSP's
// 300 ms looks cover 12 s, FRLG's 400 ms looks 16 s. A step that
// starts on it gets it on the first look.
size_t max_looks = 3;
// The same, for a screen that may be a battle's opening: enough looks
// for its battle to show. BDSP's 300 ms looks cover 12 s, past its
// battle_after_fade (8 s), after which a fade with no battle settles.
size_t max_opening_looks = 40;
size_t max_unsettled_looks = 40;
// Interrupts cleared for one step before it fails as
// "too_many_interrupts".
size_t max_per_step = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,22 @@ void StepGuard::on_failure(const StoryStep&, const OperationFailedException&){}
void StepGuard::on_interrupt(const StoryStep&, const InterruptCheck&){}

void StepGuard::on_screen(const StoryStep&, const ScreenSettle&){}
void StepGuard::on_check_skipped(const StoryStep&, const std::string&){}


TableExecutor::TableExecutor(const StoryActionTable& table, StepGuard& guard)
TableExecutor::TableExecutor(const StoryActionTable& table, StepGuard& guard, StoryCheckLevel check_level)
: m_table(table)
, m_guard(guard)
, m_check_level(check_level)
{}

Outcome TableExecutor::run(const StoryStep& step, RunState& state){
m_guard.before_step(step);
const StoryAction* action = m_table.find(step);
if (action != nullptr && action->check && !runs_check(m_check_level, *action->check)){
m_guard.on_check_skipped(step, skipped_check_line(step.name, m_check_level));
return outcome_unchanged();
}
size_t cleared = 0;
while (true){
if (std::optional<Outcome> failed = clear_interrupts(step, state, cleared)){
Expand Down
15 changes: 13 additions & 2 deletions SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "Pokemon_StoryInterrupts.h"
#include "Pokemon_StoryStepExecutor.h"
#include "Types/Pokemon_StoryActionSpec.h"
#include "Types/Pokemon_StoryCheckLevel.h"

namespace PokemonAutomation{
namespace Pokemon{
Expand All @@ -51,6 +52,9 @@ struct StoryAction{
// The args its steps may carry (StoryStep::args); a step with any
// other, or without a required one, fails lint_story_checkpoint().
std::vector<StoryArgSpec> args = {};
// A pure check, the kind it is (StoryActionSpec::check): a
// TableExecutor skips it at a level that does not run that kind.
std::optional<StoryCheckKind> check = {};
};


Expand Down Expand Up @@ -105,6 +109,9 @@ class StepGuard{
// failed) ended, interrupt or not: e.g. log it, so a run log shows
// whether the scene before had ended before the step's first input.
virtual void on_screen(const StoryStep& step, const ScreenSettle& screen);
// The step is a check the run's level skips (skipped_check_line()):
// e.g. log `line`.
virtual void on_check_skipped(const StoryStep& step, const std::string& line);
};


Expand All @@ -122,8 +129,9 @@ enum class AfterFailure{
// Runs each step with the table's action for it, inside `guard`.
class TableExecutor : public StoryStepExecutor{
public:
// `table` and `guard` must outlive the executor.
TableExecutor(const StoryActionTable& table, StepGuard& guard);
// `table` and `guard` must outlive the executor. `check_level` is the
// run's (StoryRunOptions): TESTING, every check, by default.
TableExecutor(const StoryActionTable& table, StepGuard& guard, StoryCheckLevel check_level = StoryCheckLevel::TESTING);

// The table's action for the step (run_action()); with none, the
// step is unsupported (unsupported_step()). An OperationFailedException
Expand All @@ -132,6 +140,8 @@ class TableExecutor : public StoryStepExecutor{
// With interrupts set, each step first clears what stopped the player
// since the step before, and a failed step that an interrupt explains
// runs again once it is cleared.
// A step whose action is a check of a kind the check level doesn't run
// (runs_check()) changes nothing and runs nothing.
virtual Outcome run(const StoryStep& step, RunState& state) override;

// The game's interrupts between steps, which must outlive the
Expand All @@ -153,6 +163,7 @@ class TableExecutor : public StoryStepExecutor{
const StoryActionTable& m_table;
StepGuard& m_guard;
const StoryInterrupts* m_interrupts = nullptr;
const StoryCheckLevel m_check_level;
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ class FakeGuard : public StepGuard{
virtual void on_failure(const StoryStep& step, const OperationFailedException& error) override{
trace.push_back(std::format("failed {}: {}", step.name, error.message()));
}
virtual void on_check_skipped(const StoryStep&, const std::string& line) override{
trace.push_back(line);
}
};

StoryAction throwing(){
Expand Down Expand Up @@ -252,6 +255,50 @@ UnitTestResult test_guard_stop_rethrows(){
return true;
}

// A check step (a LEVEL step's PARTY_STATS) at each check level: run where
// the level runs its kind, else skipped as unchanged and logged. A step
// that is not a check runs at every level.
UnitTestResult test_check_steps_follow_the_level(){
struct Input{
StoryCheckLevel level;
StoryStep step;
};
struct Expectation{
std::string failure;
std::vector<std::string> trace;
};
struct Case{
std::string name;
Input input;
Expectation expectation;
};
const StoryStep check = make(StoryStepKind::GAME, "lead_lv50", "level");
const StoryStep talk = make(StoryStepKind::TALK, "giovanni");
const Case cases[] = {
{"a check at thorough", {StoryCheckLevel::THOROUGH, check}, {"level ran", {"before lead_lv50"}}},
{"a check at default", {StoryCheckLevel::DEFAULT, check}, {"", {"before lead_lv50", "lead_lv50: skipped (checks: default)"}}},
{"not a check at speedrun", {StoryCheckLevel::SPEEDRUN, talk}, {"talk ran", {"before giovanni"}}},
};
StoryActionTable table;
StoryAction level = named("level ran");
level.check = StoryCheckKind::PARTY_STATS;
table.add(StoryStepKind::GAME, "level", std::move(level));
table.add(StoryStepKind::TALK, "", named("talk ran"));
for (const Case& item : cases){
FakeGuard guard;
TableExecutor executor(table, guard, item.input.level);
RunState state;
const Outcome outcome = executor.run(item.input.step, state);
if (outcome.failure != item.expectation.failure || guard.trace != item.expectation.trace){
return std::format("{}: got \"{}\" after {} guard lines.", item.name, outcome.failure, guard.trace.size());
}
if (item.expectation.failure.empty() && !outcome.changed_nothing){
return std::format("{}: expected the skipped check to change nothing.", item.name);
}
}
return true;
}


struct StoryActionsCase{
struct Input{
Expand Down Expand Up @@ -306,6 +353,10 @@ const StoryActionsCase STORY_ACTIONS_CASES[] = {
.input = {.name = "executor: a stop row rethrows", .test = test_guard_stop_rethrows},
.expectation = {.description = "rethrows on a stop row and passes other exceptions through"},
},
{
.input = {.name = "executor: a check step at each check level", .test = test_check_steps_follow_the_level},
.expectation = {.description = "runs where its kind runs, else skipped, unchanged and logged"},
},
};

} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,16 @@ bool InterruptHandlerTable::step_starts_on(StoryStepKind step, InterruptKind kin

namespace{

// Whether an UNSETTLED verdict on `look` may be a battle's opening: its
// fade is white (an encounter's flash), still down (a battle's fade ends
// on the battle), or came after a dialog box (a trainer's lines).
bool may_open_a_battle(const ScreenLook& look, const InterruptVerdict& verdict){
const auto fade = std::find_if(verdict.evidence.begin(), verdict.evidence.end(), [](const ScreenEventChange& change){
return change.edge == ScreenEventEdge::ROSE &&
(change.event == ScreenEvent::FADE_WHITE || change.event == ScreenEvent::FADE_BLACK);
});
if (fade == verdict.evidence.end()){
return false;
}
const bool still_down = std::none_of(verdict.evidence.begin(), verdict.evidence.end(), [](const ScreenEventChange& change){
return change.edge == ScreenEventEdge::FELL;
});
if (fade->event == ScreenEvent::FADE_WHITE || still_down){
return true;
}
return std::any_of(look.log.changes().begin(), look.log.changes().end(), [&](const ScreenEventChange& change){
return change.event == ScreenEvent::DIALOG_BOX && change.edge == ScreenEventEdge::ROSE &&
look.window.start <= change.time && change.time < fade->time;
});
}

// The look's verdict, looked at again while it is unsettled, up to
// max_looks looks in all, or max_opening_looks while it may be a battle's
// opening; not again before a step that starts on it. `screen` is how the
// last look ended.
// max_unsettled_looks looks in all; not again before a step that starts
// on it. `screen` is how the last look ended.
InterruptVerdict settled_verdict(const StoryInterrupts& interrupts, StoryStepKind step, ScreenSettle& screen){
ScreenLook look = interrupts.look(true);
InterruptVerdict verdict = classify_interrupt(look.log, look.window, interrupts.knobs);
const bool home = look.log.showing().has(ScreenEvent::SWITCH_HOME_MENU);
if (!home && !interrupts.handlers.step_starts_on(step, InterruptKind::UNSETTLED)){
for (size_t looks = 1; verdict.kind == InterruptKind::UNSETTLED; looks++){
const size_t limit = may_open_a_battle(look, verdict) ? interrupts.max_opening_looks : interrupts.max_looks;
if (looks >= limit){
if (looks >= interrupts.max_unsettled_looks){
break;
}
look = interrupts.look(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
* that is its battle's opening, still playing (BDSP's Starly battle right
* after the starter is picked), and the step waits for it itself.
*
* Before another step, an unsettled screen that may be a battle's opening
* (a white flash, a fade still down, a fade after a dialog box) is looked
* at until its battle shows, up to max_opening_looks looks: the walk
* before the step ended in grass or in a trainer's sight. The battle is
* then cleared as any other. A fade that came back up with no box before
* it (a door's) is looked at max_looks times only.
* Before another step, an unsettled screen is looked at until it settles,
* up to max_unsettled_looks looks. A battle's opening (a white flash, a
* fade still down, a fade after a dialog box) settles on its battle: the
* walk before the step ended in grass or in a trainer's sight. The battle
* is then cleared as any other. A door's fade, back up, settles as a warp
* once no battle came for battle_after_fade; whatever the game scripts
* after the door (the Elite Four rooms walk the player in for 2.5 s,
* taking no input) is over by then, and the warp is cleared as any other.
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,55 @@ UnitTestResult test_unsettled_looks_again(){
return expect_trace(game, {"look", "look again", "clear warp", "told warp ", "run walk"});
}

// A door's fade is no battle's opening: three looks, as before.
// The looks before the scene after an Elite Four door, 400 ms each: the
// step into the door ended before its black (100 to 500 ms), then the
// room's script walks the player in for 2.5 s with no input taken, the
// screen showing nothing (FRLG reports no PLAYER_CAN_MOVE), until the
// look at `until_ms`. Console B, 20.02 enter_brunos_room, 2026-11-16.
std::vector<ScreenLook> door_then_walk_in(int until_ms){
const ScreenEvents nothing;
std::vector<ScreenLook> out;
for (int ms = 400; ms <= until_ms; ms += 400){
std::vector<Frame> frames = {{0, nothing}, {100, BLACK}};
if (ms > 500){
frames.push_back({500, nothing});
}
frames.push_back({ms, frames.back().events});
out.push_back(look_of(frames, ms));
}
return out;
}

// A door's fade back up, then a scripted walk: unsettled while a battle
// may still show (battle_after_fade, 8 s after the fade), looked at
// until it settles as a warp, not failed after a few looks. The scene
// after it runs, then the next step.
UnitTestResult test_door_then_scripted_walk(){
FakeGame game;
game.screens = door_then_walk_in(8800);
StoryInterrupts interrupts = fake_interrupts(game);
const FakeRun scene = run_step(game, interrupts, make(StoryStepKind::MASH, "enter_brunos_room"));
if (!scene.outcome.succeeded()){
return std::format("Expected the scene to run after the walk, got {}", to_string(scene.outcome));
}
game.screens = {quiet()};
game.looks = 0;
const FakeRun next = run_step(game, interrupts, make(StoryStepKind::ROUTE, "before_bruno"));
if (!next.outcome.succeeded()){
return std::format("Expected the next step to run, got {}", to_string(next.outcome));
}
std::vector<std::string> expected = {"look"};
expected.insert(expected.end(), /*count=*/21, "look again");
expected.insert(expected.end(), {"clear warp", "told warp ", "run enter_brunos_room", "look", "run before_bruno"});
return expect_trace(game, expected);
}

// A door's fade that never settles: at most max_unsettled_looks looks.
UnitTestResult test_unsettled_is_bounded(){
FakeGame game;
game.screens = {black_unsettled()};
game.screens = door_then_walk_in(8800);
StoryInterrupts interrupts = fake_interrupts(game);
interrupts.max_unsettled_looks = 3;
const FakeRun run = run_step(game, interrupts, make(StoryStepKind::ROUTE, "walk"));
if (run.outcome.failure != "interrupt_unsettled"){
return std::format("Expected interrupt_unsettled, got {}", to_string(run.outcome));
Expand All @@ -348,8 +392,7 @@ UnitTestResult test_unsettled_before_a_battle(){

// A battle's opening still playing when a walk step begins: the walk
// before it ended in grass or in a trainer's sight. The looks wait for the
// battle, past max_looks,
// and its handler clears it before the step.
// battle, and its handler clears it before the step.
UnitTestResult test_opening_before_a_walk(ScreenLook opening, ScreenLook battle, const std::string& kind, const std::string& handler){
FakeGame game;
game.screens = {opening, opening, opening, opening, std::move(battle), quiet()};
Expand All @@ -370,12 +413,12 @@ UnitTestResult test_trainer_opening_before_a_walk(){
return test_opening_before_a_walk(trainer_opening(), trainer(), "trainer sight", "trainer");
}

// A white that shows no battle and does not settle: max_opening_looks.
// A white that shows no battle and does not settle: max_unsettled_looks.
UnitTestResult test_opening_is_bounded(){
FakeGame game;
game.screens = {white_unsettled()};
StoryInterrupts interrupts = fake_interrupts(game);
interrupts.max_opening_looks = 5;
interrupts.max_unsettled_looks = 5;
const FakeRun run = run_step(game, interrupts, make(StoryStepKind::ROUTE, "walk"));
if (run.outcome.failure != "interrupt_unsettled"){
return std::format("Expected interrupt_unsettled, got {}", to_string(run.outcome));
Expand Down Expand Up @@ -468,7 +511,7 @@ UnitTestResult test_screen_before_each_step(){
// fails unsettled, and the guard hears the fade was showing.
game.screens = {look_of({{0, WALK}, {100, BLACK}}, 300)};
StoryInterrupts interrupts = fake_interrupts(game);
interrupts.max_opening_looks = 2;
interrupts.max_unsettled_looks = 2;
const StoryActionTable table = table_of({}, game);
ScreenGuard guard(game);
TableExecutor executor(table, guard);
Expand Down Expand Up @@ -733,8 +776,12 @@ const StoryInterruptsCase STORY_INTERRUPTS_CASES[] = {
.expectation = {.description = "a white with no battle after it is a warp"},
},
{
.input = {.name = "unsettled: at most max_looks looks", .test = test_unsettled_is_bounded},
.expectation = {.description = "a door's fade: interrupt_unsettled after three looks"},
.input = {.name = "unsettled: a door's fade, then the room's scripted walk", .test = test_door_then_scripted_walk},
.expectation = {.description = "looked at until it settles as a warp; the scene, then the next step"},
},
{
.input = {.name = "unsettled: at most max_unsettled_looks looks", .test = test_unsettled_is_bounded},
.expectation = {.description = "a fade that never settles: interrupt_unsettled after them"},
},
{
.input = {.name = "unsettled: a battle's opening before a battle step", .test = test_unsettled_before_a_battle},
Expand All @@ -749,7 +796,7 @@ const StoryInterruptsCase STORY_INTERRUPTS_CASES[] = {
.expectation = {.description = "waits for the battle, fights it, then the walk"},
},
{
.input = {.name = "unsettled: at most max_opening_looks for an opening", .test = test_opening_is_bounded},
.input = {.name = "unsettled: at most max_unsettled_looks for an opening", .test = test_opening_is_bounded},
.expectation = {.description = "a white with no battle: interrupt_unsettled"},
},
{
Expand Down
Loading