Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2b98f73
BDSP AutoStory: a sim test for the Mart clown staying out of column 5…
dayfine Nov 12, 2026
8df2cc3
BDSP AutoStory: wait for the Mart clown at both ends of his box, a ti…
dayfine Nov 12, 2026
1de59e0
BDSP AutoStory wander wait: a side's walk in its own function; the cl…
dayfine Nov 12, 2026
8f5e29e
BDSP AutoStory: a sim test for the Poketch Company's clown walking of…
dayfine Nov 12, 2026
d1036d9
BDSP AutoStory: 00.05b and 00.05c wait for the Poketch Company's clow…
dayfine Nov 12, 2026
41c9d2e
BDSP AutoStory 00.05c: the later routes keep off the Wonder Station's…
dayfine Nov 12, 2026
e97d003
BDSP AutoStory: route goldens for 00.05b/00.05c ending against the co…
dayfine Nov 12, 2026
d4d1588
BDSP AutoStory: read the coupons in the Bag; sim cases for held coupo…
dayfine Nov 12, 2026
c5d00b3
BDSP AutoStory 00.05b/00.05c: coupons from the Bag; the company clown…
dayfine Nov 12, 2026
cd66983
BDSP AutoStory: 00.05c's known certainty gap moves to step 13
dayfine Nov 12, 2026
be3dde3
BDSP AutoStory: route goldens for 00.05c's walk to the company's sign
dayfine Nov 12, 2026
983174e
BDSP AutoStory sim: the BDSP events in their own functions
dayfine Nov 12, 2026
16f3205
BDSP AutoStory 00.05c: no clown re-talks; 00.05b's coupon check is th…
dayfine Nov 12, 2026
2e51ebb
BDSP AutoStory: the open-leg greeter test keeps its walk to the compa…
dayfine Nov 12, 2026
c532aec
BDSP AutoStory: route goldens for 00.05c's walk from its start to the…
dayfine Nov 12, 2026
f6dee1c
BDSP AutoStory: the open-leg greeter test's note in its header comment
dayfine Nov 12, 2026
4435ed5
BDSP AutoStory: 00.05c ends below the east-exit sign (59, 21) on taps…
dayfine Nov 12, 2026
6be7b0e
BDSP AutoStory: "measured" legs in the story table; route goldens for…
dayfine Nov 12, 2026
d9da2c0
BDSP AutoStory: 00.05c ends below the east-exit sign on its planned r…
dayfine Nov 12, 2026
76e01a7
BDSP AutoStory: a leg that ends at a wall is a wall leg; no wall-and-…
dayfine Nov 12, 2026
468a503
BDSP AutoStory: regenerate the simulation's plan golden (it was stale)
dayfine Nov 12, 2026
a456c27
BDSP AutoStory: a wall leg held up with a start tile at its wall ends…
dayfine Nov 12, 2026
43cc360
BDSP AutoStory: run to the wall and tap back again, except after a ta…
dayfine Nov 12, 2026
2d3712a
BDSP AutoStory: a leg to a wall turns first; with the facing unknown …
dayfine Nov 12, 2026
53d281c
BDSP AutoStory: a Trainer battle met by a wall leg is fought as a tra…
dayfine Nov 12, 2026
91c202d
BDSP AutoStory: walk_to_wall_turning() takes the wall leg's turn and …
dayfine Nov 12, 2026
e0e1094
CI: check out the Packages commit that carries the BDSP AutoStory opt…
dayfine Nov 13, 2026
046d7e3
BDSP AutoStory: a trainer who freezes the walk a tile short of a wall…
dayfine Nov 13, 2026
6f44b58
BDSP AutoStory: frozen-trainer test as input/expectation case; chrono…
dayfine Nov 13, 2026
cf59453
BDSP AutoStory: a leg that may have slid onto a warp looks for the fa…
dayfine Nov 13, 2026
445745d
Merge branch 'bdsp/0005c-plaza' into bdsp/wanderer-zone-stand
dayfine Nov 13, 2026
fad3c96
BDSP AutoStory: RouteIO watches for a dialogue box and the banner in …
dayfine Nov 13, 2026
2384e78
BDSP AutoStory: the wall leg count's constant goes with its functions…
dayfine Nov 13, 2026
2b020c3
Merge branch 'mu/0005c-plaza' into mu/wander-zone
dayfine Nov 13, 2026
73f04b6
BDSP walk: still persons are anchors on #432 too; goldens and the sec…
dayfine Nov 13, 2026
cdca5e0
Merge branch 'bdsp/0005c-plaza' into bdsp/wanderer-zone-stand
dayfine Nov 13, 2026
ded5274
BDSP AutoStory: 00.04 into_moms_call back to 2550 ms on #432; the sim…
dayfine Nov 13, 2026
8a570a6
BDSP AutoStory: a recovery hold or probe that goes through a warp or …
dayfine Nov 13, 2026
8f06163
BDSP AutoStory: 01.02's Gate routes leave by holding east to the door…
dayfine Nov 13, 2026
ae2c18f
wip-plan
dayfine Nov 13, 2026
d995740
BDSP AutoStory: 01.02 scenes walked into, mine doors settle as doors,…
dayfine Nov 13, 2026
5f49e04
BDSP AutoStory: a whole-screen change ends a walk as a warp only on a…
dayfine Nov 13, 2026
73e9ea9
BDSP sim: qualify coord-event trigger names by map (coord_event_0 col…
dayfine Nov 13, 2026
715273c
BDSP AutoStory: fault-sweep gap names and plan golden for the Oreburg…
dayfine Nov 13, 2026
d3f78f9
BDSP AutoStory: route plans golden for the Oreburgh scene steps
dayfine Nov 13, 2026
cfc4693
BDSP AutoStory: split look() and the door steps; evidence struct for …
dayfine Nov 13, 2026
94ccaef
BDSP AutoStory: document the whole-screen change aliases
dayfine Nov 13, 2026
4d02674
BDSP AutoStory 01.10: a wall leg by a wander zone tells the wall from…
dayfine Nov 13, 2026
3ce1ca2
BDSP AutoStory: wall_leg's wanderer check and pace note in their own …
dayfine Nov 13, 2026
697e769
BDSP AutoStory: 01.10's start off its declared tiles stays a known fa…
dayfine Nov 13, 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
6 changes: 4 additions & 2 deletions .github/workflows/cpp-ci-serial-programs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ jobs:
- name: Checkout Packages
uses: actions/checkout@v7
with:
repository: 'PokemonAutomation/Packages'
ref: 'master'
# Upstream master plus the BDSP AutoStory option-screen templates (22 PNGs the
# AutoStoryResources test requires); drop this once they are merged upstream.
repository: 'dayfine/Packages'
ref: '7d108a255bfbd4923af1fb0cf49245f2c2483594'
path: 'Arduino-Source/Packages'

- name: Prepare pinned BDSP map resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Robust Leg Planner

Check warning on line 1 in SerialPrograms/Source/Pokemon/Navigation/Pokemon_RobustLegPlanner.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=571 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -385,6 +385,11 @@
return consolidated;
}

// The way back: the direction opposite `direction`.
inline Direction opposite(Direction direction){
return Direction(((int)direction + 2) % 4);
}

// Dijkstra over sets of places the player may stand on.
template <typename Model>
class Search{
Expand Down Expand Up @@ -438,15 +443,21 @@

void expand(const Spread& spread, long long cost){
for (Direction direction : ALL_DIRECTIONS){
if (auto wall = to_wall_leg(m_model, spread, direction, m_costs)){
relax(spread, cost, std::move(*wall));
const auto wall = to_wall_leg(m_model, spread, direction, m_costs);
if (wall){
relax(spread, cost, Expansion<State>(*wall));
}
// A held leg unsafe at one length may be safe at a longer one.
for (int tiles = 1; tiles <= m_costs.max_open_tiles; tiles++){
auto open = open_leg(m_model, spread, direction, tiles, m_costs);
if (!open){
break;
}
// An open leg that ends where the leg to the wall does is
// that leg: it is held until the wall stops the player.
if (wall && wall->leg.tiles == open->leg.tiles && wall->leg.after == open->leg.after){
continue;
}
if (!open->unsafe){
relax(spread, cost, std::move(*open));
}
Expand All @@ -456,14 +467,24 @@

// Only the start may be wider than costs.max_spread: every leg must
// bring the player within it.
void relax(const Spread& spread, long long cost, Expansion<State> expansion){

Check warning on line 470 in SerialPrograms/Source/Pokemon/Navigation/Pokemon_RobustLegPlanner.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::Pokemon::RobustLegPlannerInternal::Search::relax( const Spread & spread , long long cost , Expansion<State> expansion): function_lines=30 (advisory above 25, limit 50)
Spread& next = expansion.leg.after;
normalize<Model>(next);
if (next.size() > m_costs.max_spread || next == spread){
return;
}
if (spread != m_start){
const RobustLeg<State>& prev = m_nodes.at(spread).leg;
const Node& arrived = m_nodes.at(spread);
const RobustLeg<State>& prev = arrived.leg;
// A run to a wall and back after a tapped leg: the taps left the
// player on a known tile, so the run past it and back adds a
// turn for nothing. From the start or after a leg to a wall it
// is how a long leg is made fast and exact.
if (prev.to_wall && arrived.parent != m_start && expansion.leg.direction == opposite(prev.direction)){
if (!m_nodes.at(arrived.parent).leg.to_wall){
return;
}
}
if (joins(prev, expansion.leg)){
expansion.cost -= m_costs.per_leg;
}
Expand Down
2 changes: 2 additions & 0 deletions SerialPrograms/Source/PokemonBDSP/PokemonBDSP_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Inference/PokemonBDSP_DialogDetector.h"
#include "Inference/PokemonBDSP_MenuDetector.h"
#include "Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Actions_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FrozenTrainer_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FaultSweep_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.h"
Expand Down Expand Up @@ -36,7 +37,7 @@



void add_tests(UnitTestDatabase& database){

Check warning on line 40 in SerialPrograms/Source/PokemonBDSP/PokemonBDSP_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonBDSP::add_tests( UnitTestDatabase & database): function_lines=26 (advisory above 25, limit 50)
add_tests_DialogDetector(database);
add_tests_MenuDetector(database);
add_tests_AutoStory_Actions(database);
Expand All @@ -54,6 +55,7 @@
add_tests_AutoStory_PlannedRoute(database);
add_tests_AutoStory_SimulatedRoute(database);
add_tests_AutoStory_GridSim(database);
add_tests_AutoStory_FrozenTrainer(database);
add_tests_AutoStory_WallBattleSim(database);
add_tests_AutoStory_RecoveryWalk(database);
add_tests_AutoStory_StorySim(database);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* BDSP AutoStory - Actions Tests

Check warning on line 1 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Actions_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=693 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -26,6 +26,7 @@
#include "PokemonBDSP/Programs/AutoStory/Detect/PokemonBDSP_AutoStory_BattleMenuReader.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Location.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_StoryLanguage.h"
#include "PokemonBDSP_AutoStory_BagScreen.h"
#include "PokemonBDSP_AutoStory_BattleMoves.h"
#include "PokemonBDSP_AutoStory_Center.h"
#include "PokemonBDSP_AutoStory_Events.h"
Expand Down Expand Up @@ -562,6 +563,27 @@
}


// The Potion after a fight reads the lead's HP when the Bag opens and goes
// on to the pocket and the list only if a dose is needed (lab-B 2026-11-12:
// it found the Potion, opened the party, read 80% and "no Potion needed").
UnitTestResult test_potion_need(Logger&){
struct Case{ std::string_view name; double hp; size_t dose; PotionNeed need; };
const Case cases[] = {
{"full HP", 1.0, 0, PotionNeed::FULL},
{"80% on the first dose with the check at 80%", 0.80, 0, PotionNeed::ENOUGH},
{"a bit over the check", 0.90, 0, PotionNeed::ENOUGH},
{"under the check", 0.55, 0, PotionNeed::NEEDED},
{"the second dose heals on until full", 0.85, 1, PotionNeed::NEEDED},
{"fainted", 0.0, 0, PotionNeed::FAINTED},
};
for (const Case& c : cases){
if (potion_need(c.hp, c.dose, 0.8) != c.need){
return std::string(c.name) + ": wrong verdict.";

Check warning on line 581 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Actions_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
}
return true;
}

struct AutoStoryActionsInput{
std::string name;
std::function<UnitTestResult(Logger&)> body;
Expand Down Expand Up @@ -597,6 +619,10 @@


const AutoStoryActionsCase AUTO_STORY_ACTIONS_CASES[] = {
{
.input = {"Potion after a fight: the lead's HP decides before the Bag is searched", test_potion_need},
.expectation = {},
},
{
.input = {"new-game intro decisions", test_intro_decisions},
.expectation = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,35 @@

// One Potion on the lead, from the overworld, its HP read before and after
// in the Bag. HEALED when no dose is needed (HP full, or above
// `heal_below` on the first look, or no Potion when only checking) or the
// `heal_below` on the first look) or the
// dose filled it; GIVEN when HP rose but is not full yet.
Dose potion_dose(VideoStream& stream, ProControllerContext& context, size_t dose, double heal_below){

Check warning on line 206 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Bag.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonBDSP::potion_dose( VideoStream & stream , ProControllerContext & context , size_t dose , double heal_below): function_lines=45 (advisory above 25, limit 50)
stream.log("[Potion] Finding Bag/Medicine/Potion; dose " + std::to_string(dose + 1) + "/3.");
if (!find_bag_item_by_name(stream, context, "potion", 1, 5)){
// No Potion left is not a failure: the next Center heals. After Roark
// the one Potion went on the first dose and the second found the
// Medicine pocket empty (lab-B, 2026-11-08 15:26).
stream.log("[Potion] No Potion left in the Bag after " + std::to_string(dose) + " dose(s); going on.", COLOR_ORANGE);
return Dose::NONE_LEFT;
}
stream.log("[Potion] Opening the Bag; dose " + std::to_string(dose + 1) + "/3.");

Check warning on line 207 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Bag.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
// The lead's HP shows as soon as the Bag opens: read it before the
// pocket is walked and the list scanned for a Potion nobody needs.
open_menu(stream, context, MenuCursorPosition::BAG, 5);
pbf_wait(context, 1000ms);
const double before = confirmed_potion_hp(stream, context);
stream.log("[Potion] Slot 1 HP bar before use=" + std::to_string(before * 100) + "%.");

Check warning on line 213 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Bag.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
if (before >= 0.98){
switch (potion_need(before, dose, heal_below)){
case PotionNeed::FULL:
return Dose::HEALED;
}
if (dose == 0 && before >= heal_below){
case PotionNeed::ENOUGH:
stream.log("[Potion] Slot 1 HP is at least " + std::to_string(heal_below * 100) + "%; no Potion needed.");

Check warning on line 218 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Bag.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
return Dose::HEALED;
}
if (before <= 0.005){
case PotionNeed::FAINTED:
OperationFailedExceptionWithScreenshot::fire(ErrorReportMode::SEND_ERROR_REPORT,
"Potion: Slot 1 appears fainted; a Potion cannot revive it.",
stream);
case PotionNeed::NEEDED:
break;
}
if (!find_bag_item_in_open_bag(stream, context, "potion", 1)){
// No Potion left is not a failure: the next Center heals. After Roark
// the one Potion went on the first dose and the second found the
// Medicine pocket empty (lab-B, 2026-11-08 15:26).
stream.log("[Potion] No Potion left in the Bag after " + std::to_string(dose) + " dose(s); going on.", COLOR_ORANGE);
return Dose::NONE_LEFT;
}
pbf_press_button(context, BUTTON_A, 80ms, 500ms);
pbf_press_button(context, BUTTON_A, 80ms, 500ms);
Expand Down Expand Up @@ -326,6 +331,16 @@
return stats.average.r > 220 && stats.average.g > 220 && stats.average.b > 220 && stats.stddev.sum() < 20;
}

PotionNeed potion_need(double hp, size_t dose, double heal_below){
if (hp >= 0.98){
return PotionNeed::FULL;
}
if (dose == 0 && hp >= heal_below){
return PotionNeed::ENOUGH;
}
return hp <= 0.005 ? PotionNeed::FAINTED : PotionNeed::NEEDED;
}

BagPocketMovePlan plan_bag_pocket_move(int current, int target){
if (current < 1 || current > 8 || target < 1 || target > 8){
return {};
Expand Down Expand Up @@ -381,6 +396,19 @@
return found;
}

std::vector<bool> bag_has_items(
VideoStream& stream, ProControllerContext& context, const std::vector<std::string>& names, int target_pocket
){
std::vector<bool> found;
open_menu(stream, context, MenuCursorPosition::BAG, 5);
pbf_wait(context, 1000ms);
for (const std::string& name : names){
found.push_back(find_bag_item_in_open_bag(stream, context, name, target_pocket));
}
bag_back_to_overworld(stream, context, "Bag: Did not return to the overworld after looking for the Key Items.");
return found;
}

void use_potion_first_pokemon(VideoStream& stream, ProControllerContext& context, double heal_below){
OverlayBoxScope hp_overlay(stream.overlay(), COLOR_GREEN, {0.137, 0.160, 0.202, 0.016}, "");
bool healed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <cstddef>
#include <string>
#include <vector>
#include "CommonFramework/ImageTypes/ImageViewRGB32.h"
#include "CommonFramework/Tools/VideoStream.h"
#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h"
Expand Down Expand Up @@ -52,6 +53,15 @@ bool bag_has_item(
int target_pocket
);

// Open the Bag from the overworld once, look for each of `names` in the
// pocket, and close it again. Whether each is there, in `names`' order.
std::vector<bool> bag_has_items(
VideoStream& stream,
ProControllerContext& context,
const std::vector<std::string>& names,
int target_pocket
);

// Read the lead's HP bar in the Bag and, if it is below `heal_below` (a
// fraction of full), use Potions until it is full. heal_below = 1 always
// heals; 0.5 only checks and heals when the lead is under half, and is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ constexpr std::string_view STORY_ITEM_OCR = R"JSON({
"eng": {
"potion": ["Potion"], "antidote": ["Antidote"], "paralyze-heal": ["Paralyze Heal"],
"awakening": ["Awakening"], "poke-ball": ["Poké Ball", "Poke Ball"], "repel": ["Repel"],
"super-repel": ["Super Repel"], "max-repel": ["Max Repel"], "escape-rope": ["Escape Rope"]
"super-repel": ["Super Repel"], "max-repel": ["Max Repel"], "escape-rope": ["Escape Rope"],
"coupon-1": ["Coupon 1"], "coupon-2": ["Coupon 2"], "coupon-3": ["Coupon 3"]
},
"fra": {
"potion": ["Potion"], "antidote": ["Antidote"], "paralyze-heal": ["Anti-Para"],
Expand Down Expand Up @@ -109,6 +110,12 @@ std::string read_bag_item_slug(Logger& logger, Language language, const ImageVie
return StoryItemMatcher::instance().read(logger, language, image);
}

bool bag_item_named(Language language, std::string_view slug){
const JsonValue json = parse_json(std::string(STORY_ITEM_OCR));
const JsonObject* names = json.to_object_throw().get_object(language_data(language).code);
return names != nullptr && names->get_value(std::string(slug)) != nullptr;
}


} // namespace PokemonBDSP
} // namespace NintendoSwitch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define PokemonAutomation_PokemonBDSP_AutoStory_BagItemReader_H

#include <string>
#include <string_view>
#include "Common/Cpp/Logging/AbstractLogger.h"
#include "CommonFramework/ImageTypes/ImageViewRGB32.h"
#include "CommonFramework/Language.h"
Expand All @@ -24,6 +25,10 @@ namespace PokemonBDSP{
// "" when it is none of them.
std::string read_bag_item_slug(Logger& logger, Language language, const ImageViewRGB32& image);

// Whether the reader has a name for the item `slug` in `language` (the
// coupons have their English names only).
bool bag_item_named(Language language, std::string_view slug);


} // namespace PokemonBDSP
} // namespace NintendoSwitch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* BDSP AutoStory - Bag screen

Check warning on line 1 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_BagScreen.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<header>: header_symbols=8 (advisory above 6, limit 8)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -41,6 +41,19 @@
BagPocketMovePlan plan_bag_pocket_move(int current, int target);


// What a first look at the lead's HP says about a Potion.
enum class PotionNeed{
FULL, // nothing to heal
ENOUGH, // on the first dose, at or above `heal_below`: no Potion needed
FAINTED, // a Potion cannot revive it
NEEDED,
};
// Whether the lead at `hp` (a fraction of full) needs dose number `dose`
// (0 first) of a Potion. Read before the Bag's pocket is walked for the
// Potion: no search when none is needed.
PotionNeed potion_need(double hp, size_t dose, double heal_below);


} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include <functional>
#include <map>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include "Pokemon/Navigation/Pokemon_MapData.h"
#include "PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryExecutor.h"
Expand Down Expand Up @@ -77,8 +79,19 @@ bool asks_someone_else(const Pokemon::MapData& map, Pokemon::TilePos stand, Poke
// data/games/bdsp/maps/jubilife_city.json (decomp range 1). The story map
// leaves him out of its wanderers (the decomp hides him behind a flag).
Pokemon::TileBox jubilife_mart_clown_box();
// A Jubilife clown's coupon (00.05b): his talk step and the Key Item's
// Bag slug.
struct ClownCoupon{
std::string_view step;
std::string_view slug;
};
// The three clowns' coupons: the Mart's 1, the company's 2, the TV's 3.
std::span<const ClownCoupon> jubilife_clown_coupons();
// The row the Poketch Company's clown wanders, round (15, 18), as the
// Mart clown's box.
Pokemon::TileBox jubilife_company_clown_box();
// The tiles 00.05c may start on: against the Poketch Company's sign
// (00.05b's end), and on the street east (its own end, 01.01's start).
// (00.05b's end), and below the east-exit sign (its own end, 01.01's start).
std::pair<Pokemon::TilePos, Pokemon::TilePos> jubilife_start_tiles();


Expand Down
Loading
Loading