Skip to content

Commit 2bfa79d

Browse files
authored
Autostory Segment 23: Go to East Province (Area Three) Watchtower. (#689)
* checkpoint 54: At East Province (Area Three) Watchtower. * partially complete checkpoint 55 * add blank Autostory segments
1 parent f254f3a commit 2bfa79d

15 files changed

+987
-147
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
#include "PokemonSV_AutoStory_Segment_22.h"
4747
#include "PokemonSV_AutoStory_Segment_23.h"
4848
#include "PokemonSV_AutoStory_Segment_24.h"
49+
#include "PokemonSV_AutoStory_Segment_25.h"
50+
#include "PokemonSV_AutoStory_Segment_26.h"
51+
#include "PokemonSV_AutoStory_Segment_27.h"
52+
#include "PokemonSV_AutoStory_Segment_28.h"
53+
#include "PokemonSV_AutoStory_Segment_29.h"
4954
#include "PokemonSV_AutoStory.h"
5055

5156
#include <iostream>
@@ -88,8 +93,13 @@ std::vector<std::unique_ptr<AutoStory_Segment>> make_autoStory_segment_list(){
8893
segment_list.emplace_back(std::make_unique<AutoStory_Segment_20>());
8994
segment_list.emplace_back(std::make_unique<AutoStory_Segment_21>());
9095
segment_list.emplace_back(std::make_unique<AutoStory_Segment_22>());
91-
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_23>());
96+
segment_list.emplace_back(std::make_unique<AutoStory_Segment_23>());
9297
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_24>());
98+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_25>());
99+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_26>());
100+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_27>());
101+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_28>());
102+
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_29>());
93103

94104
return segment_list;
95105
};

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

Lines changed: 266 additions & 88 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class AutoStory_Segment_23 : public AutoStory_Segment{
2727
};
2828

2929

30-
// start:
31-
// end:
30+
// start: Defeated Levincia Gym (Electric). At Levincia (North) Pokecenter.
31+
// end: At East Province (Area Three) Watchtower.
3232
void checkpoint_54(
3333
SingleSwitchProgramEnvironment& env,
3434
ProControllerContext& context,
@@ -37,62 +37,6 @@ void checkpoint_54(
3737
);
3838

3939

40-
// start:
41-
// end:
42-
void checkpoint_55(
43-
SingleSwitchProgramEnvironment& env,
44-
ProControllerContext& context,
45-
EventNotificationOption& notif_status_update,
46-
AutoStoryStats& stats
47-
);
48-
49-
// start:
50-
// end:
51-
void checkpoint_56(
52-
SingleSwitchProgramEnvironment& env,
53-
ProControllerContext& context,
54-
EventNotificationOption& notif_status_update,
55-
AutoStoryStats& stats
56-
);
57-
58-
// start:
59-
// end:
60-
void checkpoint_57(
61-
SingleSwitchProgramEnvironment& env,
62-
ProControllerContext& context,
63-
EventNotificationOption& notif_status_update,
64-
AutoStoryStats& stats
65-
);
66-
67-
// start:
68-
// end:
69-
void checkpoint_58(
70-
SingleSwitchProgramEnvironment& env,
71-
ProControllerContext& context,
72-
EventNotificationOption& notif_status_update,
73-
AutoStoryStats& stats
74-
);
75-
76-
// start:
77-
// end:
78-
void checkpoint_59(
79-
SingleSwitchProgramEnvironment& env,
80-
ProControllerContext& context,
81-
EventNotificationOption& notif_status_update,
82-
AutoStoryStats& stats
83-
);
84-
85-
// start:
86-
// end:
87-
void checkpoint_60(
88-
SingleSwitchProgramEnvironment& env,
89-
ProControllerContext& context,
90-
EventNotificationOption& notif_status_update,
91-
AutoStoryStats& stats
92-
);
93-
94-
95-
9640

9741
}
9842
}

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

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,153 @@ void AutoStory_Segment_24::run_segment(
6060
}
6161

6262

63+
void checkpoint_55(
64+
SingleSwitchProgramEnvironment& env,
65+
ProControllerContext& context,
66+
EventNotificationOption& notif_status_update,
67+
AutoStoryStats& stats
68+
){
69+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
70+
[&](size_t attempt_number){
71+
72+
// todo: try to align to left side of tunnel. then charge at Orthworm
73+
// reset if caught in battle.
74+
/////////////////////
75+
76+
// get_off_ride(env.program_info(), env.console, context);
77+
78+
79+
// direction.change_direction(env.program_info(), env.console, context, 0.261);
80+
// pbf_move_left_joystick(context, 128, 0, 500, 100);
81+
// pbf_move_left_joystick(context, 0, 0, 500, 100);
82+
83+
// // now aligned to corner.
84+
85+
// direction.change_direction(env.program_info(), env.console, context, 3.736);
86+
// pbf_move_left_joystick(context, 128, 0, 400, 100);
87+
88+
// direction.change_direction(env.program_info(), env.console, context, 5.306);
89+
// pbf_move_left_joystick(context, 128, 0, 700, 100);
90+
91+
92+
// direction.change_direction(env.program_info(), env.console, context, 4.988);
93+
// pbf_move_left_joystick(context, 128, 0, 800, 100);
94+
// pbf_move_left_joystick(context, 255, 0, 500, 100);
95+
96+
// // now aligned to the wall next to the hole/passage
97+
98+
// // walk away from wall slightly
99+
// pbf_move_left_joystick(context, 128, 255, 50, 100);
100+
// get_on_ride(env.program_info(), env.console, context);
101+
102+
// direction.change_direction(env.program_info(), env.console, context, 0.366);
103+
// pbf_move_left_joystick(context, 128, 0, 250, 100);
104+
105+
// direction.change_direction(env.program_info(), env.console, context, 2.565);
106+
// // run at Orthworm. run into its second position as well.
107+
// pbf_move_left_joystick(context, 128, 0, 50, 0);
108+
// pbf_controller_state(context, BUTTON_LCLICK, DPAD_NONE, 128, 0, 128, 128, 500);
109+
// pbf_move_left_joystick(context, 255, 0, 500, 500);
110+
111+
// get_off_ride(env.program_info(), env.console, context);
112+
113+
// direction.change_direction(env.program_info(), env.console, context, 0.261);
114+
// pbf_move_left_joystick(context, 128, 0, 500, 100);
115+
// pbf_move_left_joystick(context, 0, 0, 500, 100);
116+
117+
// // now aligned to corner.
118+
119+
// direction.change_direction(env.program_info(), env.console, context, 3.736);
120+
// pbf_move_left_joystick(context, 128, 0, 400, 100);
121+
122+
// direction.change_direction(env.program_info(), env.console, context, 5.306);
123+
// pbf_move_left_joystick(context, 128, 0, 700, 100);
124+
125+
126+
// direction.change_direction(env.program_info(), env.console, context, 4.988);
127+
// pbf_move_left_joystick(context, 128, 0, 800, 100);
128+
// pbf_move_left_joystick(context, 255, 0, 500, 100);
129+
130+
// // now aligned to the wall next to the hole/passage
131+
132+
133+
});
134+
135+
}
136+
137+
void checkpoint_56(
138+
SingleSwitchProgramEnvironment& env,
139+
ProControllerContext& context,
140+
EventNotificationOption& notif_status_update,
141+
AutoStoryStats& stats
142+
){
143+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
144+
[&](size_t attempt_number){
145+
146+
147+
});
148+
149+
}
150+
151+
void checkpoint_57(
152+
SingleSwitchProgramEnvironment& env,
153+
ProControllerContext& context,
154+
EventNotificationOption& notif_status_update,
155+
AutoStoryStats& stats
156+
){
157+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
158+
[&](size_t attempt_number){
159+
160+
161+
});
162+
163+
}
164+
165+
void checkpoint_58(
166+
SingleSwitchProgramEnvironment& env,
167+
ProControllerContext& context,
168+
EventNotificationOption& notif_status_update,
169+
AutoStoryStats& stats
170+
){
171+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
172+
[&](size_t attempt_number){
173+
174+
175+
});
176+
177+
}
178+
179+
void checkpoint_59(
180+
SingleSwitchProgramEnvironment& env,
181+
ProControllerContext& context,
182+
EventNotificationOption& notif_status_update,
183+
AutoStoryStats& stats
184+
){
185+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
186+
[&](size_t attempt_number){
187+
188+
189+
});
190+
191+
}
192+
193+
void checkpoint_60(
194+
SingleSwitchProgramEnvironment& env,
195+
ProControllerContext& context,
196+
EventNotificationOption& notif_status_update,
197+
AutoStoryStats& stats
198+
){
199+
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
200+
[&](size_t attempt_number){
201+
202+
203+
});
204+
205+
}
206+
207+
208+
209+
63210

64211
}
65212
}

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,62 @@ class AutoStory_Segment_24 : public AutoStory_Segment{
2727
};
2828

2929

30+
// start: At East Province (Area Three) Watchtower.
31+
// end:
32+
void checkpoint_55(
33+
SingleSwitchProgramEnvironment& env,
34+
ProControllerContext& context,
35+
EventNotificationOption& notif_status_update,
36+
AutoStoryStats& stats
37+
);
38+
39+
// start:
40+
// end:
41+
void checkpoint_56(
42+
SingleSwitchProgramEnvironment& env,
43+
ProControllerContext& context,
44+
EventNotificationOption& notif_status_update,
45+
AutoStoryStats& stats
46+
);
47+
48+
// start:
49+
// end:
50+
void checkpoint_57(
51+
SingleSwitchProgramEnvironment& env,
52+
ProControllerContext& context,
53+
EventNotificationOption& notif_status_update,
54+
AutoStoryStats& stats
55+
);
56+
57+
// start:
58+
// end:
59+
void checkpoint_58(
60+
SingleSwitchProgramEnvironment& env,
61+
ProControllerContext& context,
62+
EventNotificationOption& notif_status_update,
63+
AutoStoryStats& stats
64+
);
65+
66+
// start:
67+
// end:
68+
void checkpoint_59(
69+
SingleSwitchProgramEnvironment& env,
70+
ProControllerContext& context,
71+
EventNotificationOption& notif_status_update,
72+
AutoStoryStats& stats
73+
);
74+
75+
// start:
76+
// end:
77+
void checkpoint_60(
78+
SingleSwitchProgramEnvironment& env,
79+
ProControllerContext& context,
80+
EventNotificationOption& notif_status_update,
81+
AutoStoryStats& stats
82+
);
83+
84+
85+
3086

3187

3288
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* AutoStory
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
*/
6+
7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
8+
#include "CommonTools/Async/InferenceRoutines.h"
9+
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
10+
#include "PokemonSV/Programs/PokemonSV_GameEntry.h"
11+
#include "PokemonSV/Programs/PokemonSV_SaveGame.h"
12+
#include "PokemonSV/Programs/PokemonSV_MenuNavigation.h"
13+
#include "PokemonSV/Programs/PokemonSV_WorldNavigation.h"
14+
#include "PokemonSV_AutoStoryTools.h"
15+
#include "PokemonSV_AutoStory_Segment_25.h"
16+
17+
//#include <iostream>
18+
//using std::cout;
19+
//using std::endl;
20+
//#include <unordered_map>
21+
//#include <algorithm>
22+
23+
namespace PokemonAutomation{
24+
namespace NintendoSwitch{
25+
namespace PokemonSV{
26+
27+
28+
29+
30+
std::string AutoStory_Segment_25::name() const{
31+
return "";
32+
}
33+
34+
std::string AutoStory_Segment_25::start_text() const{
35+
return "Start: ";
36+
}
37+
38+
std::string AutoStory_Segment_25::end_text() const{
39+
return "End: ";
40+
}
41+
42+
void AutoStory_Segment_25::run_segment(
43+
SingleSwitchProgramEnvironment& env,
44+
ProControllerContext& context,
45+
AutoStoryOptions options,
46+
AutoStoryStats& stats
47+
) const{
48+
49+
50+
stats.m_segment++;
51+
env.update_stats();
52+
context.wait_for_all_requests();
53+
env.console.log("Start Segment " + name(), COLOR_ORANGE);
54+
55+
// checkpoint_(env, context, options.notif_status_update, stats);
56+
57+
context.wait_for_all_requests();
58+
env.console.log("End Segment " + name(), COLOR_GREEN);
59+
60+
}
61+
62+
63+
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)