Skip to content

Commit dffe2cb

Browse files
committed
rearrange Autostory Segments - end each (main story) segment in a Pokecenter.
1 parent 3ddc558 commit dffe2cb

13 files changed

+592
-585
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ std::vector<std::unique_ptr<AutoStory_Segment>> make_autoStory_segment_list(){
8383
segment_list.emplace_back(std::make_unique<AutoStory_Segment_19>());
8484
segment_list.emplace_back(std::make_unique<AutoStory_Segment_20>());
8585
segment_list.emplace_back(std::make_unique<AutoStory_Segment_21>());
86-
segment_list.emplace_back(std::make_unique<AutoStory_Segment_22>());
86+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_22>());
8787
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_23>());
8888
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_24>());
8989

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ std::string AutoStory_Segment_17::start_text() const{
3737
}
3838

3939
std::string AutoStory_Segment_17::end_text() const{
40-
return "End: Defeated Cascarrafa Gym (Water). Inside Cascarrafa Gym building.";
40+
return "End: Defeated Cascarrafa Gym (Water). At Porto Marinada Pokecenter.";
4141
}
4242

4343
void AutoStory_Segment_17::run_segment(
@@ -177,6 +177,16 @@ void checkpoint_38(
177177
env.console.log("Battle Water Gym.");
178178
run_trainer_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG);
179179
mash_button_till_overworld(env.console, context, BUTTON_A, 360);
180+
181+
// Gym now defeated. now in Cascaraffa gym building
182+
context.wait_for_all_requests();
183+
pbf_move_left_joystick(context, 128, 255, 500, 100);
184+
pbf_wait(context, 3 * TICKS_PER_SECOND);
185+
// wait for overworld after leaving Gym
186+
wait_for_overworld(env.program_info(), env.console, context, 30);
187+
188+
// fly to Porto Marinada pokecenter
189+
move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 80, 150});
180190

181191
break;
182192
}catch(OperationFailedException&){

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void checkpoint_37(
3737
);
3838

3939
// start: Won auction at Porto Marinada, passed Gym challenge.
40-
// end: Defeat Cascarrafa Gym
40+
// end: Defeat Cascarrafa Gym. At Porto Marinada Pokecenter.
4141
void checkpoint_38(
4242
SingleSwitchProgramEnvironment& env,
4343
ProControllerContext& context,

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ std::string AutoStory_Segment_18::name() const{
3434
}
3535

3636
std::string AutoStory_Segment_18::start_text() const{
37-
return "Start: Defeated Cascarrafa Gym (Water). Inside Cascarrafa Gym building.";
37+
return "Start: Defeated Cascarrafa Gym (Water). At Porto Marinada Pokecenter.";
3838
}
3939

4040
std::string AutoStory_Segment_18::end_text() const{
@@ -79,14 +79,6 @@ void checkpoint_39(
7979
}
8080
context.wait_for_all_requests();
8181

82-
pbf_move_left_joystick(context, 128, 255, 500, 100);
83-
pbf_wait(context, 3 * TICKS_PER_SECOND);
84-
// wait for overworld after leaving Gym
85-
wait_for_overworld(env.program_info(), env.console, context, 30);
86-
87-
// fly to Porto Marinada pokecenter
88-
move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 80, 150});
89-
9082
DirectionDetector direction;
9183

9284
// section 1

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AutoStory_Segment_18 : public AutoStory_Segment{
2727
};
2828

2929

30-
// start: Defeated Cascarrafa Gym (Water). At Cascarrafa Gym.
30+
// start: Defeated Cascarrafa Gym (Water). At Porto Marinada Pokecenter.
3131
// end: Defeated Great Tusk/Iron Treads.
3232
void checkpoint_39(
3333
SingleSwitchProgramEnvironment& env,

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::string AutoStory_Segment_20::start_text() const{
3939
}
4040

4141
std::string AutoStory_Segment_20::end_text() const{
42-
return "End: Defeated Artazon Gym (Grass). Inside gym building.";
42+
return "End: Defeated Artazon Gym (Grass). At East Province (Area One) Pokecenter.";
4343
}
4444

4545
void AutoStory_Segment_20::run_segment(
@@ -58,6 +58,7 @@ void AutoStory_Segment_20::run_segment(
5858
checkpoint_43(env, context, options.notif_status_update, stats);
5959
checkpoint_44(env, context, options.notif_status_update, stats);
6060
checkpoint_45(env, context, options.notif_status_update, stats);
61+
checkpoint_46(env, context, options.notif_status_update, stats);
6162

6263
context.wait_for_all_requests();
6364
env.console.log("End Segment " + name(), COLOR_GREEN);
@@ -559,6 +560,71 @@ void checkpoint_45(
559560

560561

561562

563+
void checkpoint_46(
564+
SingleSwitchProgramEnvironment& env,
565+
ProControllerContext& context,
566+
EventNotificationOption& notif_status_update,
567+
AutoStoryStats& stats
568+
){
569+
570+
bool first_attempt = true;
571+
while (true){
572+
try{
573+
if (first_attempt){
574+
checkpoint_save(env, context, notif_status_update, stats);
575+
first_attempt = false;
576+
}else{
577+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
578+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
579+
env.log("Wait 10 seconds.");
580+
context.wait_for(Milliseconds(10 * 1000));
581+
save_game_from_overworld(env.program_info(), env.console, context);
582+
}
583+
584+
context.wait_for_all_requests();
585+
586+
pbf_move_left_joystick(context, 128, 255, 500, 100);
587+
pbf_wait(context, 3 * TICKS_PER_SECOND);
588+
// wait for overworld after leaving Gym
589+
wait_for_overworld(env.program_info(), env.console, context, 30);
590+
591+
// fly to Porto Marinada pokecenter
592+
move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 255, 128, 50});
593+
594+
// section 1. set marker to pokecenter
595+
realign_player_from_landmark(
596+
env.program_info(), env.console, context,
597+
{ZoomChange::KEEP_ZOOM, 255, 0, 50},
598+
{ZoomChange::ZOOM_IN, 0, 0, 0}
599+
);
600+
overworld_navigation(env.program_info(), env.console, context,
601+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
602+
128, 0, 80, 20, false);
603+
604+
// section 2. set marker past pokecenter
605+
handle_unexpected_battles(env.program_info(), env.console, context,
606+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
607+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 180, 0, 30);
608+
});
609+
overworld_navigation(env.program_info(), env.console, context,
610+
NavigationStopCondition::STOP_TIME, NavigationMovementMode::DIRECTIONAL_ONLY,
611+
128, 15, 12, 12, false);
612+
613+
fly_to_overlapping_flypoint(env.program_info(), env.console, context);
614+
615+
break;
616+
}catch(OperationFailedException&){
617+
context.wait_for_all_requests();
618+
env.console.log("Resetting from checkpoint.");
619+
reset_game(env.program_info(), env.console, context);
620+
stats.m_reset++;
621+
env.update_stats();
622+
}
623+
}
624+
625+
626+
627+
}
562628

563629
}
564630
}

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ void checkpoint_45(
5353
AutoStoryStats& stats
5454
);
5555

56+
// start: Defeated Artazon Gym (Grass). Inside gym building.
57+
// end: At East Province (Area One) Pokecenter.
58+
void checkpoint_46(
59+
SingleSwitchProgramEnvironment& env,
60+
ProControllerContext& context,
61+
EventNotificationOption& notif_status_update,
62+
AutoStoryStats& stats
63+
);
5664

5765

5866
}

0 commit comments

Comments
 (0)