@@ -107,8 +107,8 @@ FriendshipFarmer::FriendshipFarmer()
107107 FARMING_OPTION.add_listener (*this );
108108}
109109
110- void FriendshipFarmer::on_config_value_changed (void * object) {
111- if (FARMING_OPTION == FarmingOption::Cafe) {
110+ void FriendshipFarmer::on_config_value_changed (void * object){
111+ if (FARMING_OPTION == FarmingOption::Cafe){
112112 NUM_PARTY_MEMBERS.set_visibility (ConfigOptionState::ENABLED);
113113 }
114114 else {
@@ -161,7 +161,7 @@ void FriendshipFarmer::enter_cafe(SingleSwitchProgramEnvironment& env, ProContro
161161 OverworldPartySelectionWatcher overworld (COLOR_WHITE, &env.console .overlay ());
162162 int ret2 = 0 ;
163163
164- switch (ret) {
164+ switch (ret){
165165 case 0 :
166166 env.log (" Detected A button." );
167167 pbf_press_button (context, BUTTON_A, 80ms, 40ms);
@@ -196,7 +196,7 @@ void FriendshipFarmer::enter_cafe(SingleSwitchProgramEnvironment& env, ProContro
196196 { overworld }
197197 );
198198
199- if (ret2 == 0 ) {
199+ if (ret2 == 0 ){
200200 env.log (" Returned to overworld." );
201201 continue ;
202202 }
@@ -220,7 +220,7 @@ void FriendshipFarmer::enter_cafe(SingleSwitchProgramEnvironment& env, ProContro
220220 }
221221}
222222
223- void FriendshipFarmer::exit_bench (SingleSwitchProgramEnvironment& env, ProControllerContext& context) {
223+ void FriendshipFarmer::exit_bench (SingleSwitchProgramEnvironment& env, ProControllerContext& context){
224224 FriendshipFarmer_Descriptor::Stats& stats = env.current_stats <FriendshipFarmer_Descriptor::Stats>();
225225
226226 int reset_attempt = 0 ;
@@ -251,15 +251,15 @@ void FriendshipFarmer::exit_bench(SingleSwitchProgramEnvironment& env, ProContro
251251 selection_arrow_watcher,
252252 white_dialog_watcher,
253253 blue_dialog_watcher,
254- black_screen
254+ black_screen
255255 }
256256 );
257257 context.wait_for (100ms);
258258
259259 OverworldPartySelectionWatcher overworld (COLOR_WHITE, &env.console .overlay ());
260260 int ret2 = 0 ;
261261
262- switch (ret) {
262+ switch (ret){
263263 case 0 :
264264 env.log (" Detected A button." );
265265 return ;
@@ -279,15 +279,15 @@ void FriendshipFarmer::exit_bench(SingleSwitchProgramEnvironment& env, ProContro
279279 case 5 :
280280 env.log (" Detected day change." );
281281 ret2 = wait_until (
282- env.console , context,
283- 30s,
284- {overworld}
282+ env.console , context,
283+ 30s,
284+ {overworld}
285285 );
286286
287287 if (ret2 == 0 ){
288288 env.log (" Returned to overworld." );
289289 continue ;
290- }
290+ }
291291
292292 ++stats.errors ;
293293 env.update_stats ();
@@ -297,7 +297,7 @@ void FriendshipFarmer::exit_bench(SingleSwitchProgramEnvironment& env, ProContro
297297 env.console
298298 );
299299 default :
300- if (seen_selection_arrow && ++reset_attempt <= 10 ) {
300+ if (seen_selection_arrow && ++reset_attempt <= 10 ){
301301 env.log (" Attempting to face the bench." );
302302 pbf_move_left_joystick (context, 128 , 0 , 250ms, 0ms);
303303 continue ;
@@ -314,7 +314,7 @@ void FriendshipFarmer::exit_bench(SingleSwitchProgramEnvironment& env, ProContro
314314 }
315315}
316316
317- void FriendshipFarmer::exit_cafe (SingleSwitchProgramEnvironment& env, ProControllerContext& context) {
317+ void FriendshipFarmer::exit_cafe (SingleSwitchProgramEnvironment& env, ProControllerContext& context){
318318 FriendshipFarmer_Descriptor::Stats& stats = env.current_stats <FriendshipFarmer_Descriptor::Stats>();
319319
320320 while (true ){
@@ -349,7 +349,7 @@ void FriendshipFarmer::exit_cafe(SingleSwitchProgramEnvironment& env, ProControl
349349 OverworldPartySelectionWatcher overworld (COLOR_WHITE, &env.console .overlay ());
350350 int ret2 = 0 ;
351351
352- switch (ret) {
352+ switch (ret){
353353 case 0 :
354354 env.log (" Detected A button." );
355355 return ;
@@ -373,7 +373,7 @@ void FriendshipFarmer::exit_cafe(SingleSwitchProgramEnvironment& env, ProControl
373373 { overworld }
374374 );
375375
376- if (ret2 == 0 ) {
376+ if (ret2 == 0 ){
377377 env.log (" Returned to overworld." );
378378 continue ;
379379 }
@@ -432,28 +432,28 @@ void FriendshipFarmer::hang_out_bench(SingleSwitchProgramEnvironment& env, ProCo
432432 selection_arrow_watcher,
433433 white_dialog_watcher,
434434 blue_dialog_watcher,
435- black_screen
435+ black_screen
436436 }
437437 );
438438 context.wait_for (100ms);
439439
440440 OverworldPartySelectionWatcher overworld (COLOR_WHITE, &env.console .overlay ());
441441 int ret2 = 0 ;
442442
443- switch (ret) {
443+ switch (ret){
444444 case 0 :
445445 env.log (" Detected A button." );
446446 pbf_press_button (context, BUTTON_A, 80ms, 40ms);
447447 continue ;
448448 case 1 :
449- env.log (" Detected B button. Waiting 10 Seconds." ); // Wait 10 seconds to gain friendship points.
449+ env.log (" Detected B button. Waiting 10 Seconds." ); // Wait 10 seconds to gain friendship points.
450450 context.wait_for (10000ms);
451451 pbf_press_button (context, BUTTON_B, 80ms, 40ms);
452452 return ;
453453 case 2 :
454454 env.log (" Detected selection arrow." );
455455 seen_selection_arrow = true ;
456- // Select second option to hang out on bench.
456+ // Select second option to hang out on bench.
457457 pbf_press_dpad (context, DPAD_DOWN, 40ms, 40ms);
458458 pbf_press_button (context, BUTTON_A, 80ms, 40ms);
459459 continue ;
@@ -469,7 +469,7 @@ void FriendshipFarmer::hang_out_bench(SingleSwitchProgramEnvironment& env, ProCo
469469 if (seen_selection_arrow){
470470 env.log (" Detected loading screen. Hanging out on bench." );
471471 continue ;
472- }
472+ }
473473
474474 env.log (" Detected day change." );
475475 ret2 = wait_until (
@@ -478,7 +478,7 @@ void FriendshipFarmer::hang_out_bench(SingleSwitchProgramEnvironment& env, ProCo
478478 { overworld }
479479 );
480480
481- if (ret2 == 0 ) {
481+ if (ret2 == 0 ){
482482 env.log (" Returned to overworld." );
483483 continue ;
484484 }
@@ -507,24 +507,23 @@ void FriendshipFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
507507
508508 FriendshipFarmer_Descriptor::Stats& stats = env.current_stats <FriendshipFarmer_Descriptor::Stats>();
509509
510- if (FARMING_OPTION.get () == FarmingOption::Cafe){
510+ if (FARMING_OPTION.get () == FarmingOption::Cafe){
511511 env.log (" Cafe Method Started" );
512512
513- for (int i = 0 ; i < NUM_PARTY_MEMBERS; ++i)
514- {
513+ for (int i = 0 ; i < NUM_PARTY_MEMBERS; ++i){
515514 int drinks_needed;
516515
517- // Each drink at cafe gives 30 friendship points.
518- // Evolve = 160 points = 5.33 drinks
519- // Max = 255 points = 8.5 drinks
520- if (FRIENDSHIP_AMOUNT.get () == FriendshipAmount::Evolve) {
516+ // Each drink at cafe gives 30 friendship points.
517+ // Evolve = 160 points = 5.33 drinks
518+ // Max = 255 points = 8.5 drinks
519+ if (FRIENDSHIP_AMOUNT.get () == FriendshipAmount::Evolve){
521520 drinks_needed = 6 ;
522521 }
523522 else {
524523 drinks_needed = 9 ;
525524 }
526525
527- for (int d = 0 ; d < drinks_needed; ++d) {
526+ for (int d = 0 ; d < drinks_needed; ++d){
528527 enter_cafe (env, context);
529528 exit_cafe (env, context);
530529
@@ -543,14 +542,14 @@ void FriendshipFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
543542 env.log (" Bench Method Started" );
544543 int hang_outs_needed;
545544
546- // Each hangout on bench gives 10 friendship points.
547- // Evolve = 160 points = 16 hangouts
548- // Max = 255 points = 26 hangouts
545+ // Each hangout on bench gives 10 friendship points.
546+ // Evolve = 160 points = 16 hangouts
547+ // Max = 255 points = 26 hangouts
549548 if (FRIENDSHIP_AMOUNT.get () == FriendshipAmount::Evolve){
550549 hang_outs_needed = 16 ;
551550 }
552551 else {
553- hang_outs_needed = 26 ;
552+ hang_outs_needed = 26 ;
554553 }
555554
556555 for (int i = 0 ; i < hang_outs_needed; ++i)
@@ -559,7 +558,7 @@ void FriendshipFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
559558 exit_bench (env, context);
560559
561560 ++stats.hang_out_sessions ;
562- env.update_stats ();
561+ env.update_stats ();
563562 }
564563 }
565564
0 commit comments