2020#include " PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
2121#include " PokemonSV/Inference/Overworld/PokemonSV_OverworldDetector.h"
2222#include " PokemonSV/Inference/Overworld/PokemonSV_OliveDetector.h"
23+ #include " PokemonSV/Inference/Overworld/PokemonSV_NoMinimapDetector.h"
2324#include " PokemonSV_AutoStory_Segment_00.h"
2425#include " PokemonSV_AutoStory_Segment_01.h"
2526#include " PokemonSV_AutoStory_Segment_02.h"
3738#include " PokemonSV_AutoStory_Segment_14.h"
3839#include " PokemonSV_AutoStory_Segment_15.h"
3940#include " PokemonSV_AutoStory_Segment_16.h"
40- // #include "PokemonSV_AutoStory_Segment_17.h"
41- // #include "PokemonSV_AutoStory_Segment_18.h"
42- // #include "PokemonSV_AutoStory_Segment_19.h"
43- // #include "PokemonSV_AutoStory_Segment_20.h"
44- // #include "PokemonSV_AutoStory_Segment_21.h"
45- // #include "PokemonSV_AutoStory_Segment_22.h"
46- // #include "PokemonSV_AutoStory_Segment_23.h"
47- // #include "PokemonSV_AutoStory_Segment_24.h"
41+ #include " PokemonSV_AutoStory_Segment_17.h"
42+ #include " PokemonSV_AutoStory_Segment_18.h"
43+ #include " PokemonSV_AutoStory_Segment_19.h"
44+ #include " PokemonSV_AutoStory_Segment_20.h"
45+ #include " PokemonSV_AutoStory_Segment_21.h"
46+ #include " PokemonSV_AutoStory_Segment_22.h"
47+ #include " PokemonSV_AutoStory_Segment_23.h"
48+ #include " PokemonSV_AutoStory_Segment_24.h"
4849#include " PokemonSV_AutoStory.h"
4950
50- // #include <iostream>
51- // using std::cout;
52- // using std::endl;
51+ #include < iostream>
52+ using std::cout;
53+ using std::endl;
5354// #include <unordered_map>
5455// #include <algorithm>
5556
@@ -81,11 +82,11 @@ std::vector<std::unique_ptr<AutoStory_Segment>> make_autoStory_segment_list(){
8182 segment_list.emplace_back (std::make_unique<AutoStory_Segment_14>());
8283 segment_list.emplace_back (std::make_unique<AutoStory_Segment_15>());
8384 segment_list.emplace_back (std::make_unique<AutoStory_Segment_16>());
84- // segment_list.emplace_back(std::make_unique<AutoStory_Segment_17>());
85- // segment_list.emplace_back(std::make_unique<AutoStory_Segment_18>());
86- // segment_list.emplace_back(std::make_unique<AutoStory_Segment_19>());
87- // segment_list.emplace_back(std::make_unique<AutoStory_Segment_20>());
88- // segment_list.emplace_back(std::make_unique<AutoStory_Segment_21>());
85+ segment_list.emplace_back (std::make_unique<AutoStory_Segment_17>());
86+ segment_list.emplace_back (std::make_unique<AutoStory_Segment_18>());
87+ segment_list.emplace_back (std::make_unique<AutoStory_Segment_19>());
88+ segment_list.emplace_back (std::make_unique<AutoStory_Segment_20>());
89+ segment_list.emplace_back (std::make_unique<AutoStory_Segment_21>());
8990 // segment_list.emplace_back(std::make_unique<AutoStory_Segment_22>());
9091 // segment_list.emplace_back(std::make_unique<AutoStory_Segment_23>());
9192 // segment_list.emplace_back(std::make_unique<AutoStory_Segment_24>());
@@ -213,6 +214,7 @@ AutoStory::AutoStory()
213214 )
214215 , MAINSTORY_NOTE{
215216 " Ensure you have a level 100 Gardevoir with the moves in the following order: Moonblast, Dazzling Gleam, Psychic, Mystical Fire.<br>"
217+ " Also, make sure you have two other strong pokemon (e.g. level 100 Talonflames)<br>"
216218 " Refer to the documentation on github for more details."
217219 }
218220 , START_DESCRIPTION(
@@ -600,26 +602,30 @@ void AutoStory::test_checkpoints(
600602 checkpoint_list.push_back ([&](){checkpoint_34 (env, context, notif_status_update);});
601603 checkpoint_list.push_back ([&](){checkpoint_35 (env, context, notif_status_update);});
602604 checkpoint_list.push_back ([&](){checkpoint_36 (env, context, notif_status_update);});
603- // checkpoint_list.push_back([&](){checkpoint_37(env, context, notif_status_update);});
604- // checkpoint_list.push_back([&](){checkpoint_38(env, context, notif_status_update);});
605- // checkpoint_list.push_back([&](){checkpoint_39(env, context, notif_status_update);});
606- // checkpoint_list.push_back([&](){checkpoint_40(env, context, notif_status_update);});
607- // checkpoint_list.push_back([&](){checkpoint_41(env, context, notif_status_update);});
608- // checkpoint_list.push_back([&](){checkpoint_42(env, context, notif_status_update);});
609- // checkpoint_list.push_back([&](){checkpoint_43(env, context, notif_status_update);});
610- // checkpoint_list.push_back([&](){checkpoint_44(env, context, notif_status_update);});
611- // checkpoint_list.push_back([&](){checkpoint_45(env, context, notif_status_update);});
612- // checkpoint_list.push_back([&](){checkpoint_46(env, context, notif_status_update);});
613- // checkpoint_list.push_back([&](){checkpoint_47(env, context, notif_status_update);});
614- // checkpoint_list.push_back([&](){checkpoint_48(env, context, notif_status_update);});
615- // checkpoint_list.push_back([&](){checkpoint_49(env, context, notif_status_update);});
605+ checkpoint_list.push_back ([&](){checkpoint_37 (env, context, notif_status_update);});
606+ checkpoint_list.push_back ([&](){checkpoint_38 (env, context, notif_status_update);});
607+ checkpoint_list.push_back ([&](){checkpoint_39 (env, context, notif_status_update);});
608+ checkpoint_list.push_back ([&](){checkpoint_40 (env, context, notif_status_update);});
609+ checkpoint_list.push_back ([&](){checkpoint_41 (env, context, notif_status_update);});
610+ checkpoint_list.push_back ([&](){checkpoint_42 (env, context, notif_status_update);});
611+ checkpoint_list.push_back ([&](){checkpoint_43 (env, context, notif_status_update);});
612+ checkpoint_list.push_back ([&](){checkpoint_44 (env, context, notif_status_update);});
613+ checkpoint_list.push_back ([&](){checkpoint_45 (env, context, notif_status_update);});
614+ checkpoint_list.push_back ([&](){checkpoint_46 (env, context, notif_status_update);});
615+ checkpoint_list.push_back ([&](){checkpoint_47 (env, context, notif_status_update);});
616+ checkpoint_list.push_back ([&](){checkpoint_48 (env, context, notif_status_update);});
617+ checkpoint_list.push_back ([&](){checkpoint_49 (env, context, notif_status_update);});
616618
617619 for (int checkpoint = start; checkpoint <= end; checkpoint++){
618620 if (checkpoint == 0 ){
619621 console.log (" checkpoint_0" );
620622 checkpoint_list[checkpoint]();
621623 continue ;
622624 }
625+ bool has_minimap = true ;
626+ if (checkpoint < 3 ){
627+ has_minimap = false ;
628+ }
623629
624630 const size_t DIGITS = 3 ;
625631 std::string number = std::to_string (checkpoint);
@@ -629,11 +635,21 @@ void AutoStory::test_checkpoints(
629635 if (checkpoint >= start_loop && checkpoint <= end_loop){
630636 for (int i = 0 ; i < loop; i++){
631637 if (i > 0 ){
632- reset_game (env.program_info (), console, context);
633- enter_menu_from_overworld (env.program_info (), env.console , context, -1 );
634- // we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
635- env.log (" Wait 10 seconds." );
636- context.wait_for (Milliseconds (10 * 1000 ));
638+ try {
639+ reset_game (env.program_info (), console, context);
640+ enter_menu_from_overworld (env.program_info (), env.console , context, -1 , MenuSide::NONE, has_minimap);
641+ // we wait 5 seconds then save, so that the initial conditions are slightly different on each reset.
642+ env.log (" Wait 5 seconds." );
643+ context.wait_for (Milliseconds (5 * 1000 ));
644+ }catch (...){
645+ // try one more time
646+ reset_game (env.program_info (), console, context);
647+ enter_menu_from_overworld (env.program_info (), env.console , context, -1 , MenuSide::NONE, has_minimap);
648+ // we wait 5 seconds then save, so that the initial conditions are slightly different on each reset.
649+ env.log (" Wait 5 seconds." );
650+ context.wait_for (Milliseconds (5 * 1000 ));
651+
652+ }
637653 }
638654 console.log (" checkpoint_" + number + " : loop " + std::to_string (i));
639655 checkpoint_list[checkpoint]();
@@ -740,7 +756,7 @@ void AutoStory::test_code(SingleSwitchProgramEnvironment& env, BotBaseContext& c
740756 // 128, 0, 60, 10, false);
741757
742758 DirectionDetector direction;
743-
759+
744760 return ;
745761 }
746762
0 commit comments