Skip to content

Commit 6071341

Browse files
committed
checkpoint 54: At East Province (Area Three) Watchtower.
1 parent a7d98b5 commit 6071341

File tree

2 files changed

+325
-4
lines changed

2 files changed

+325
-4
lines changed

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

Lines changed: 323 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*
55
*/
66

7+
#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
8+
79
#include "CommonFramework/Exceptions/OperationFailedException.h"
810
#include "CommonTools/Async/InferenceRoutines.h"
911
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
@@ -28,11 +30,11 @@ namespace PokemonSV{
2830

2931

3032
std::string AutoStory_Segment_23::name() const{
31-
return "";
33+
return "23: Orthworm Titan";
3234
}
3335

3436
std::string AutoStory_Segment_23::start_text() const{
35-
return "Start: ";
37+
return "Start: Defeated Levincia Gym (Electric). At Levincia (North) Pokecenter.";
3638
}
3739

3840
std::string AutoStory_Segment_23::end_text() const{
@@ -69,6 +71,268 @@ void checkpoint_54(
6971
[&](size_t attempt_number){
7072

7173

74+
DirectionDetector direction;
75+
direction.change_direction(env.program_info(), env.console, context, 1.341);
76+
pbf_move_left_joystick(context, 128, 0, 450, 100);
77+
78+
// marker 1
79+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 160, 0, 35);
80+
81+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
82+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
83+
overworld_navigation(env.program_info(), env.console, context,
84+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
85+
128, 0, 24, 8, false);
86+
},
87+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
88+
pbf_move_left_joystick(context, 0, 255, 40, 50);
89+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
90+
}
91+
);
92+
93+
// marker 2
94+
realign_player_from_landmark(
95+
env.program_info(), env.console, context,
96+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
97+
{ZoomChange::ZOOM_IN, 200, 0, 80}
98+
);
99+
100+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
101+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
102+
overworld_navigation(env.program_info(), env.console, context,
103+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
104+
128, 0, 40, 10, false);
105+
},
106+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
107+
pbf_move_left_joystick(context, 0, 255, 40, 50);
108+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
109+
}
110+
);
111+
112+
// marker 3
113+
realign_player_from_landmark(
114+
env.program_info(), env.console, context,
115+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
116+
{ZoomChange::ZOOM_IN, 190, 0, 115}
117+
);
118+
119+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
120+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
121+
overworld_navigation(env.program_info(), env.console, context,
122+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
123+
128, 0, 24, 8, false);
124+
},
125+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
126+
pbf_move_left_joystick(context, 0, 255, 40, 50);
127+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
128+
}
129+
);
130+
131+
// marker 4
132+
realign_player_from_landmark(
133+
env.program_info(), env.console, context,
134+
{ZoomChange::KEEP_ZOOM, 128, 255, 50},
135+
{ZoomChange::ZOOM_IN, 150, 0, 112}
136+
);
137+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
138+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
139+
overworld_navigation(env.program_info(), env.console, context,
140+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
141+
128, 0, 20, 10, false);
142+
},
143+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
144+
pbf_move_left_joystick(context, 0, 255, 40, 50);
145+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
146+
}
147+
);
148+
149+
// marker 5
150+
realign_player_from_landmark(
151+
env.program_info(), env.console, context,
152+
{ZoomChange::KEEP_ZOOM, 128, 255, 50},
153+
{ZoomChange::ZOOM_IN, 135, 0, 107}
154+
);
155+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
156+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
157+
overworld_navigation(env.program_info(), env.console, context,
158+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
159+
128, 0, 16, 8, false);
160+
},
161+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
162+
pbf_move_left_joystick(context, 0, 255, 40, 50);
163+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
164+
}
165+
);
166+
167+
// marker 6
168+
realign_player_from_landmark(
169+
env.program_info(), env.console, context,
170+
{ZoomChange::KEEP_ZOOM, 128, 255, 50},
171+
{ZoomChange::ZOOM_IN, 120, 0, 95}
172+
);
173+
174+
// walk forward until dialog
175+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
176+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
177+
overworld_navigation(env.program_info(), env.console, context,
178+
NavigationStopCondition::STOP_DIALOG, NavigationMovementMode::DIRECTIONAL_ONLY,
179+
128, 0, 16, 8, false);
180+
},
181+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
182+
pbf_move_left_joystick(context, 255, 255, 40, 50);
183+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
184+
}
185+
);
186+
187+
mash_button_till_overworld(env.console, context, BUTTON_A);
188+
189+
// resume marker 6
190+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
191+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
192+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
193+
overworld_navigation(env.program_info(), env.console, context,
194+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
195+
128, 0, 16, 8, false);
196+
},
197+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
198+
pbf_move_left_joystick(context, 255, 255, 40, 50);
199+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
200+
}
201+
);
202+
203+
// marker 7
204+
realign_player_from_landmark(
205+
env.program_info(), env.console, context,
206+
{ZoomChange::KEEP_ZOOM, 128, 255, 50},
207+
{ZoomChange::ZOOM_IN, 110, 0, 55}
208+
);
209+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
210+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
211+
overworld_navigation(env.program_info(), env.console, context,
212+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
213+
128, 0, 20, 10, false);
214+
},
215+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
216+
pbf_move_left_joystick(context, 255, 255, 40, 50);
217+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
218+
}
219+
);
220+
221+
// marker 8
222+
realign_player_from_landmark(
223+
env.program_info(), env.console, context,
224+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
225+
{ZoomChange::ZOOM_IN, 0, 50, 60}
226+
);
227+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
228+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
229+
overworld_navigation(env.program_info(), env.console, context,
230+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
231+
128, 0, 30, 10, false);
232+
},
233+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
234+
pbf_move_left_joystick(context, 0, 255, 40, 50);
235+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
236+
}
237+
);
238+
239+
// marker 9. at crossroads
240+
realign_player_from_landmark(
241+
env.program_info(), env.console, context,
242+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
243+
{ZoomChange::ZOOM_IN, 0, 110, 115}
244+
);
245+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
246+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
247+
overworld_navigation(env.program_info(), env.console, context,
248+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
249+
128, 0, 40, 10, false);
250+
},
251+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
252+
pbf_move_left_joystick(context, 0, 255, 40, 50);
253+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
254+
}
255+
);
256+
257+
// marker 10
258+
realign_player_from_landmark(
259+
env.program_info(), env.console, context,
260+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
261+
{ZoomChange::ZOOM_IN, 0, 80, 125}
262+
);
263+
264+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
265+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
266+
overworld_navigation(env.program_info(), env.console, context,
267+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
268+
128, 0, 10, 10, false);
269+
},
270+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
271+
pbf_move_left_joystick(context, 0, 255, 40, 50);
272+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
273+
}
274+
);
275+
276+
// marker 11
277+
realign_player_from_landmark(
278+
env.program_info(), env.console, context,
279+
{ZoomChange::KEEP_ZOOM, 255, 128, 50},
280+
{ZoomChange::ZOOM_IN, 0, 85, 135}
281+
);
282+
283+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
284+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
285+
overworld_navigation(env.program_info(), env.console, context,
286+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
287+
128, 0, 24, 8, false);
288+
},
289+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
290+
pbf_move_left_joystick(context, 255, 255, 40, 50);
291+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
292+
}
293+
);
294+
295+
// marker 12
296+
realign_player_from_landmark(
297+
env.program_info(), env.console, context,
298+
{ZoomChange::KEEP_ZOOM, 255, 128, 50},
299+
{ZoomChange::ZOOM_IN, 0, 70, 140}
300+
);
301+
302+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
303+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
304+
overworld_navigation(env.program_info(), env.console, context,
305+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
306+
128, 0, 24, 8, false);
307+
},
308+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
309+
pbf_move_left_joystick(context, 255, 255, 40, 50);
310+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
311+
}
312+
);
313+
314+
// marker 13
315+
realign_player_from_landmark(
316+
env.program_info(), env.console, context,
317+
{ZoomChange::KEEP_ZOOM, 255, 128, 50},
318+
{ZoomChange::ZOOM_IN, 0, 45, 130}
319+
);
320+
321+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
322+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
323+
overworld_navigation(env.program_info(), env.console, context,
324+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
325+
128, 0, 20, 10, false);
326+
},
327+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
328+
pbf_move_left_joystick(context, 255, 255, 40, 50);
329+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
330+
}
331+
);
332+
333+
fly_to_overlapping_flypoint(env.program_info(), env.console, context);
334+
335+
72336
});
73337

74338
}
@@ -81,6 +345,63 @@ void checkpoint_55(
81345
){
82346
checkpoint_reattempt_loop(env, context, notif_status_update, stats,
83347
[&](size_t attempt_number){
348+
/////////////////////
349+
350+
// get_off_ride(env.program_info(), env.console, context);
351+
352+
353+
// direction.change_direction(env.program_info(), env.console, context, 0.261);
354+
// pbf_move_left_joystick(context, 128, 0, 500, 100);
355+
// pbf_move_left_joystick(context, 0, 0, 500, 100);
356+
357+
// // now aligned to corner.
358+
359+
// direction.change_direction(env.program_info(), env.console, context, 3.736);
360+
// pbf_move_left_joystick(context, 128, 0, 400, 100);
361+
362+
// direction.change_direction(env.program_info(), env.console, context, 5.306);
363+
// pbf_move_left_joystick(context, 128, 0, 700, 100);
364+
365+
366+
// direction.change_direction(env.program_info(), env.console, context, 4.988);
367+
// pbf_move_left_joystick(context, 128, 0, 800, 100);
368+
// pbf_move_left_joystick(context, 255, 0, 500, 100);
369+
370+
// // now aligned to the wall next to the hole/passage
371+
372+
// // walk away from wall slightly
373+
// pbf_move_left_joystick(context, 128, 255, 50, 100);
374+
// get_on_ride(env.program_info(), env.console, context);
375+
376+
// direction.change_direction(env.program_info(), env.console, context, 0.366);
377+
// pbf_move_left_joystick(context, 128, 0, 250, 100);
378+
379+
// direction.change_direction(env.program_info(), env.console, context, 2.565);
380+
// // run at Orthworm. run into its second position as well.
381+
// pbf_move_left_joystick(context, 128, 0, 50, 0);
382+
// pbf_controller_state(context, BUTTON_LCLICK, DPAD_NONE, 128, 0, 128, 128, 500);
383+
// pbf_move_left_joystick(context, 255, 0, 500, 500);
384+
385+
// get_off_ride(env.program_info(), env.console, context);
386+
387+
// direction.change_direction(env.program_info(), env.console, context, 0.261);
388+
// pbf_move_left_joystick(context, 128, 0, 500, 100);
389+
// pbf_move_left_joystick(context, 0, 0, 500, 100);
390+
391+
// // now aligned to corner.
392+
393+
// direction.change_direction(env.program_info(), env.console, context, 3.736);
394+
// pbf_move_left_joystick(context, 128, 0, 400, 100);
395+
396+
// direction.change_direction(env.program_info(), env.console, context, 5.306);
397+
// pbf_move_left_joystick(context, 128, 0, 700, 100);
398+
399+
400+
// direction.change_direction(env.program_info(), env.console, context, 4.988);
401+
// pbf_move_left_joystick(context, 128, 0, 800, 100);
402+
// pbf_move_left_joystick(context, 255, 0, 500, 100);
403+
404+
// // now aligned to the wall next to the hole/passage
84405

85406

86407
});

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

Lines changed: 2 additions & 2 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,

0 commit comments

Comments
 (0)