Skip to content

Commit 78ae4b4

Browse files
committed
Adapt to new date manipulation routines
1 parent 3a16897 commit 78ae4b4

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

SerialPrograms/Source/PokemonSwSh/PokemonSwSh_Panels.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@
4747
#include "Programs/NonShinyHunting/PokemonSwSh_StatsReset-Moltres.h"
4848
#include "Programs/NonShinyHunting/PokemonSwSh_StatsReset-Regi.h"
4949

50-
#include "Programs/RNG/PokemonSwSh_CramomaticRNG.h"
51-
#include "Programs/RNG/PokemonSwSh_DailyHighlightRNG.h"
52-
#include "Programs/RNG/PokemonSwSh_SeedFinder.h"
50+
#include "Programs/EggPrograms/PokemonSwSh_EggAutonomous.h"
51+
#include "Programs/EggPrograms/PokemonSwSh_EggFetcher2.h"
52+
#include "Programs/EggPrograms/PokemonSwSh_EggFetcherMultiple.h"
53+
#include "Programs/EggPrograms/PokemonSwSh_EggHatcher.h"
54+
#include "Programs/EggPrograms/PokemonSwSh_EggCombined2.h"
55+
#include "Programs/EggPrograms/PokemonSwSh_EggSuperCombined2.h"
56+
#include "Programs/EggPrograms/PokemonSwSh_GodEggDuplication.h"
57+
#include "Programs/EggPrograms/PokemonSwSh_GodEggItemDupe.h"
5358

5459
#include "Programs/ShinyHuntUnattended/PokemonSwSh_MultiGameFossil.h"
5560
#include "Programs/ShinyHuntUnattended/PokemonSwSh_ShinyHuntUnattended-Regi.h"
@@ -69,14 +74,9 @@
6974
#include "Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-Fishing.h"
7075
#include "Programs/OverworldBot/PokemonSwSh_ShinyHuntAutonomous-Overworld.h"
7176

72-
#include "Programs/EggPrograms/PokemonSwSh_EggAutonomous.h"
73-
#include "Programs/EggPrograms/PokemonSwSh_EggFetcher2.h"
74-
#include "Programs/EggPrograms/PokemonSwSh_EggFetcherMultiple.h"
75-
#include "Programs/EggPrograms/PokemonSwSh_EggHatcher.h"
76-
#include "Programs/EggPrograms/PokemonSwSh_EggCombined2.h"
77-
#include "Programs/EggPrograms/PokemonSwSh_EggSuperCombined2.h"
78-
#include "Programs/EggPrograms/PokemonSwSh_GodEggDuplication.h"
79-
#include "Programs/EggPrograms/PokemonSwSh_GodEggItemDupe.h"
77+
#include "Programs/RNG/PokemonSwSh_CramomaticRNG.h"
78+
#include "Programs/RNG/PokemonSwSh_DailyHighlightRNG.h"
79+
#include "Programs/RNG/PokemonSwSh_SeedFinder.h"
8080

8181
#include "Programs/PokemonSwSh_SynchronizedSpinning.h"
8282
#include "Programs/PokemonSwSh_RaidItemFarmerOKHO.h"

SerialPrograms/Source/PokemonSwSh/Programs/RNG/PokemonSwSh_DailyHighlightRNG.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "CommonFramework/VideoPipeline/VideoFeed.h"
1414
#include "CommonTools/Async/InferenceRoutines.h"
1515
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
16-
#include "NintendoSwitch/Inference/NintendoSwitch_DateReader.h"
16+
#include "NintendoSwitch/Programs/DateSpam/NintendoSwitch_HomeToDateTime.h"
17+
#include "NintendoSwitch/Programs/DateManip/NintendoSwitch_DateManip.h"
1718
#include "NintendoSwitch/Programs/NintendoSwitch_GameEntry.h"
18-
#include "NintendoSwitch/Programs/NintendoSwitch_Navigation.h"
1919
#include "NintendoSwitch/NintendoSwitch_Settings.h"
2020
#include "Pokemon/Pokemon_Strings.h"
2121
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -26,8 +26,6 @@
2626
#include "PokemonSwSh/Programs/RNG/PokemonSwSh_BasicRNG.h"
2727
#include "PokemonSwSh/Programs/RNG/PokemonSwSh_DailyHighlightRNG.h"
2828

29-
#include "Common/Cpp/PrettyPrint.h"
30-
3129

3230
namespace PokemonAutomation{
3331
namespace NintendoSwitch{
@@ -80,27 +78,27 @@ std::unique_ptr<StatsTracker> DailyHighlightRNG_Descriptor::make_stats() const{
8078

8179
DailyHighlightRNG::DailyHighlightRNG()
8280
: NUM_HIGHLIGHTS(
83-
"<b>Number of highlights:</b><br>How many daily highlights should be bought. <br>Zero will run until you stop the program.",
81+
"<b>Number of Highlights:</b><br>How many daily highlights should be bought. <br>Zero will run until you stop the program.",
8482
LockMode::UNLOCK_WHILE_RUNNING, 0)
8583
, FIX_TIME_WHEN_DONE(
86-
"<b>Fix Time when Done:</b><br>Fix the time after the program finishes.<br>Doesn't do anything if Number of highlights is 0.",
84+
"<b>Fix Time when Done:</b><br>Fix the time after the program finishes.<br>Doesn't do anything if Number of Highlights is 0.",
8785
LockMode::UNLOCK_WHILE_RUNNING, false)
8886
, GO_HOME_WHEN_DONE(false)
8987
, SAVE_INTERVAL(
90-
"<b>Save Every this Many Day Skips:</b><br>(zero disables saving)",
88+
"<b>Save Every this Many Day Skips:</b><br>Zero disables saving.",
9189
LockMode::UNLOCK_WHILE_RUNNING,
9290
20
9391
)
9492
, CALIBRATION_INTERAVAL(
95-
"<b>Calibrate the number of NPCs this many Day Skips:</b><br>Zero will only calibrate once.",
93+
"<b>Calibrate the Number of NPCs this Many Day Skips:</b><br>Zero will only calibrate once.",
9694
LockMode::UNLOCK_WHILE_RUNNING,
9795
10
9896
)
9997
, HIGHLIGHT_SELECTION(
10098
"<b>Desired Highlights:</b>",
10199
"Highlight",
102100
DAILY_HIGHLIGHT_DATABASE().database(),
103-
"bottle-cap-1")
101+
"dream-ball")
104102
, NOTIFICATION_STATUS_UPDATE("Status Update", true, false, std::chrono::seconds(3600))
105103
, NOTIFICATIONS({
106104
&NOTIFICATION_STATUS_UPDATE,
@@ -417,12 +415,12 @@ void DailyHighlightRNG::return_to_overworld(SingleSwitchProgramEnvironment& env,
417415
void DailyHighlightRNG::advance_date(SingleSwitchProgramEnvironment& env, ProControllerContext& context, uint8_t& year) {
418416
context.wait_for(200ms);
419417
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
420-
home_to_date_time(context, true, false);
418+
home_to_date_time(env.console, context, true);
421419
pbf_press_button(context, BUTTON_A, 160ms, 240ms);
422420
context.wait_for_all_requests();
423421

424422
VideoOverlaySet overlays(env.console.overlay());
425-
DateChangeWatcher date_reader;
423+
DateChangeWatcher date_reader(env.console);
426424
date_reader.make_overlays(overlays);
427425

428426
DateTime date{ 2000, 12, 31, 1, 0, 0 }; // 31st December for fixed Normal weather
@@ -545,7 +543,7 @@ void DailyHighlightRNG::program(SingleSwitchProgramEnvironment& env, ProControll
545543
}
546544

547545
// Do required advances
548-
size_t target_advances = calculate_target(env, rng.get_state(), num_npcs, HIGHLIGHT_SELECTION.all_slugs()); // TODO: make highlight selection
546+
size_t target_advances = calculate_target(env, rng.get_state(), num_npcs, HIGHLIGHT_SELECTION.all_slugs());
549547
env.console.log("Needed advances: " + std::to_string(target_advances));
550548
do_rng_advances(env.console, context, rng, target_advances, ADVANCE_PRESS_DURATION, ADVANCE_RELEASE_DURATION);
551549

@@ -566,7 +564,7 @@ void DailyHighlightRNG::program(SingleSwitchProgramEnvironment& env, ProControll
566564

567565
if (FIX_TIME_WHEN_DONE) {
568566
pbf_press_button(context, BUTTON_HOME, 160ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
569-
home_to_date_time(context, false, false);
567+
home_to_date_time(env.console, context, false);
570568
pbf_press_button(context, BUTTON_A, 20, 105);
571569
pbf_press_button(context, BUTTON_A, 20, 105);
572570
pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);

0 commit comments

Comments
 (0)