44 *
55 */
66
7+ #include " CommonFramework/GlobalSettingsPanel.h"
78#include " CommonFramework/ProgramStats/StatsTracking.h"
89#include " CommonTools/Async/InferenceRoutines.h"
910#include " CommonTools/VisualDetectors/BlackScreenDetector.h"
@@ -53,7 +54,17 @@ std::unique_ptr<StatsTracker> MegaShardFarmer_Descriptor::make_stats() const{
5354
5455
5556
56- MegaShardFarmer::MegaShardFarmer (){}
57+ MegaShardFarmer::MegaShardFarmer ()
58+ : SKIP_SHARDS(
59+ " <b>Skip getting Shards (for testing purposes):</b>" ,
60+ LockMode::UNLOCK_WHILE_RUNNING,
61+ false
62+ )
63+ {
64+ if (PreloadSettings::instance ().DEVELOPER_MODE ){
65+ PA_ADD_OPTION (SKIP_SHARDS);
66+ }
67+ }
5768
5869void MegaShardFarmer::program (SingleSwitchProgramEnvironment& env, ProControllerContext& context){
5970 MegaShardFarmer_Descriptor::Stats& stats = env.current_stats <MegaShardFarmer_Descriptor::Stats>();
@@ -95,15 +106,15 @@ void MegaShardFarmer::program(SingleSwitchProgramEnvironment& env, ProController
95106 // Bring out a Pokemon.
96107 pbf_press_dpad (context, DPAD_UP, 1000ms, 0ms);
97108
98- #if 1
99- // Break all the shards.
100- uint8_t x = stats.rounds % 2 == 0 ? 128 - 32 : 128 + 32 ;
101- ssf_press_right_joystick (context, x, 128 , 0ms, 40000ms, 0ms);
102- for (int c = 0 ; c < 40 ; c++){
103- ssf_press_button (context, BUTTON_ZL, 240ms, 400ms, 80ms);
104- pbf_press_button (context, BUTTON_B, 160ms, 520ms);
109+ if (!SKIP_SHARDS){
110+ // Break all the shards.
111+ uint8_t x = stats.rounds % 2 == 0 ? 128 - 32 : 128 + 32 ;
112+ ssf_press_right_joystick (context, x, 128 , 0ms, 40000ms, 0ms);
113+ for (int c = 0 ; c < 40 ; c++){
114+ ssf_press_button (context, BUTTON_ZL, 240ms, 400ms, 80ms);
115+ pbf_press_button (context, BUTTON_B, 160ms, 520ms);
116+ }
105117 }
106- #endif
107118 },
108119 {{black_screen}}
109120 );
@@ -128,8 +139,8 @@ void MegaShardFarmer::fly_back(SingleSwitchProgramEnvironment& env, ProControlle
128139 pbf_move_right_joystick (context, 128 , 255 , 80ms, 80ms);
129140
130141 // Tap the stick to lock on to Le Yeah if you're already on top of it.
131- pbf_move_left_joystick (context, 32 , 128 , 40ms, 500ms );
132- // pbf_move_left_joystick(context, 128, 255, 80ms , 500ms);
142+ pbf_move_left_joystick (context, 128 , 192 , 40ms, 120ms );
143+ pbf_move_left_joystick (context, 128 , 64 , 40ms , 500ms);
133144
134145 BlackScreenOverWatcher black_screen (COLOR_BLUE, {0.1 , 0.1 , 0.8 , 0.2 });
135146
0 commit comments