Skip to content
Merged
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
aa1537e
fix bug with user-supplied calibrations and add additional check
theastrogoth May 17, 2026
a2cca2d
add egg program
theastrogoth May 17, 2026
21f2f8d
merge main
theastrogoth Jun 2, 2026
b4693cb
update egg program
theastrogoth Jun 2, 2026
2c6cbd0
merge oopsie
theastrogoth Jun 2, 2026
4b4af01
various updates
theastrogoth Jun 2, 2026
89357c6
working program
theastrogoth Jun 3, 2026
9fe97d5
fixes and tweaks
theastrogoth Jun 6, 2026
8a1143c
Merge branch 'main' into egg-rng-program
theastrogoth Jun 6, 2026
eb4b299
teachy tv fix
theastrogoth Jun 6, 2026
1c941ca
Merge branch 'main' into egg-rng-program
theastrogoth Jun 8, 2026
71118bb
fix program stats updates
theastrogoth Jun 8, 2026
823aaad
fix use of pickup seed buttons
theastrogoth Jun 8, 2026
bc6e98c
oops
theastrogoth Jun 8, 2026
37b21d6
avoid wasting calibration info
theastrogoth Jun 9, 2026
c744467
oops, not static
theastrogoth Jun 9, 2026
836072e
small fixes
theastrogoth Jun 9, 2026
244c5b4
Merge branch 'main' into egg-rng-program
theastrogoth Jun 10, 2026
4f95fcc
tweaks to calibration
theastrogoth Jun 12, 2026
84aef5b
Merge branch 'main' into egg-rng-program
theastrogoth Jun 12, 2026
87fc9f6
remove teachy tv option
theastrogoth Jun 13, 2026
ee68c24
separate out reusable utilities and patterns for RNG programs
theastrogoth Jun 17, 2026
8b5c39f
Merge branch 'main' into egg-rng-program
theastrogoth Jun 17, 2026
20a5c43
fix egg histories initialization
theastrogoth Jun 17, 2026
615260c
Merge branch 'main' into egg-rng-program
theastrogoth Jun 18, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* Daycare Man Detector
*
* From: https://github.com/PokemonAutomation/
*
*/

#include "Common/Cpp/Color.h"
#include "CommonFramework/ImageTools/ImageBoxes.h"
#include "CommonFramework/ImageTools/ImageStats.h"
#include "CommonFramework/ImageTypes/ImageRGB32.h"
#include "CommonFramework/ImageTypes/ImageViewRGB32.h"
#include "CommonFramework/VideoPipeline/VideoOverlayScopes.h"
#include "CommonTools/Images/SolidColorTest.h"
#include "PokemonFRLG/PokemonFRLG_Settings.h"
#include "PokemonFRLG_DaycareManDetector.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{

DaycareManDetector::DaycareManDetector(Color color)
: m_box_man(0.741827, 0.492067, 0.052404, 0.009375) // rgb(98, 219, 173)
, m_box_grass(0.345047, 0.798244, 0.079690, 0.056954) // rgb(98, 219, 173)
, m_box_puddle(0.892758, 0.025567, 0.059451, 0.091126) // rgb(82, 177, 255)
, m_box_sand(0.103447, 0.513473, 0.026563, 0.030375) // rgb(255, 251, 127)
, m_box_roof(0.744762, 0.767868, 0.007590, 0.127197) // rgb(255, 93, 60)
{}
void DaycareManDetector::make_overlays(VideoOverlaySet& items) const{
const BoxOption& GAME_BOX = GameSettings::instance().GAME_BOX;
items.add(COLOR_RED, GAME_BOX.inner_to_outer(m_box_grass));
items.add(COLOR_GREEN, GAME_BOX.inner_to_outer(m_box_grass));
items.add(COLOR_BLUE, GAME_BOX.inner_to_outer(m_box_puddle));
items.add(COLOR_YELLOW, GAME_BOX.inner_to_outer(m_box_sand));
items.add(COLOR_ORANGE, GAME_BOX.inner_to_outer(m_box_roof));
}
bool DaycareManDetector::detect(const ImageViewRGB32& screen){
ImageViewRGB32 game_screen = extract_box_reference(screen, GameSettings::instance().GAME_BOX);

return (
!is_solid(extract_box_reference(game_screen, m_box_man), { 0.200, 0.447, 0.353 }, 0.25, 20) // if egg is ready, the man is blocking the grass
&& is_solid(extract_box_reference(game_screen, m_box_grass), { 0.200, 0.447, 0.353 }, 0.25, 20)
&& is_solid(extract_box_reference(game_screen, m_box_puddle), { 0.160, 0.344, 0.496 }, 0.25, 20)
&& is_solid(extract_box_reference(game_screen, m_box_sand), { 0.403, 0.396, 0.201 }, 0.25, 20)
&& is_solid(extract_box_reference(game_screen, m_box_roof), { 0.625, 0.228, 0.147 }, 0.25, 20)
);
}


}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* Daycare Man Detector
*
* From: https://github.com/PokemonAutomation/
*
*/

#ifndef PokemonAutomation_PokemonFRLG_DaycareManDetector_H
#define PokemonAutomation_PokemonFRLG_DaycareManDetector_H

#include "Common/Cpp/Logging/AbstractLogger.h"
#include "CommonFramework/VideoPipeline/VideoOverlayScopes.h"
#include "CommonTools/VisualDetector.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{

// Detects the grass in front of where the Day Care Man usually stands.
// If an egg is ready, he will occupy the space. Otherwise, it will be solid green (empty grass).
// Also detects other parts of the scene to avoid triggering on a black screen, etc
class DaycareManDetector : public StaticScreenDetector{
public:
DaycareManDetector(Color color);

virtual void make_overlays(VideoOverlaySet& items) const;
bool detect(const ImageViewRGB32& screen);

private:
ImageFloatBox m_box_man;
ImageFloatBox m_box_grass;
ImageFloatBox m_box_puddle;
ImageFloatBox m_box_sand;
ImageFloatBox m_box_roof;
};
class DaycareManWatcher : public DetectorToFinder<DaycareManDetector>{
public:
DaycareManWatcher(Color color)
: DetectorToFinder("DaycareManWatcher", std::chrono::milliseconds(250), color)
{}
};


}
}
}
#endif
2 changes: 2 additions & 0 deletions SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Panels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "Programs/RngManipulation/PokemonFRLG_StaticRng.h"
#include "Programs/RngManipulation/PokemonFRLG_WildRng.h"
#include "Programs/RngManipulation/PokemonFRLG_RoamingLegendaryRng.h"
#include "Programs/RngManipulation/PokemonFRLG_EggRng.h"
#include "Programs/TestPrograms/PokemonFRLG_SoundListener.h"
#include "Programs/TestPrograms/PokemonFRLG_ReadStats.h"
#include "Programs/TestPrograms/PokemonFRLG_ReadBattleLevelUp.h"
Expand Down Expand Up @@ -77,6 +78,7 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
if (IS_BETA_VERSION || PreloadSettings::instance().DEVELOPER_MODE){
ret.emplace_back("---- Untested/Beta/WIP ----");
ret.emplace_back(make_single_switch_program<RoamingLegendaryRng_Descriptor, RoamingLegendaryRng>());
ret.emplace_back(make_single_switch_program<EggRng_Descriptor, EggRng>());
}

if (PreloadSettings::instance().DEVELOPER_MODE){
Expand Down
Loading
Loading