Skip to content

Commit d26e701

Browse files
committed
update checkpoint 29: navigation routine from Cortondo West Pokecenter to West Province Area One Central Pokecenter
1 parent 788651e commit d26e701

File tree

1 file changed

+192
-58
lines changed

1 file changed

+192
-58
lines changed

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

Lines changed: 192 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,17 @@ void checkpoint_29(
8383
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 70, 0, 60);
8484

8585

86-
overworld_navigation(env.program_info(), env.console, context,
87-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
88-
128, 0, 30, 15, false);
86+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
87+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
88+
overworld_navigation(env.program_info(), env.console, context,
89+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
90+
128, 0, 30, 15, false);
91+
},
92+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
93+
pbf_move_left_joystick(context, 255, 255, 40, 50);
94+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
95+
}
96+
);
8997

9098
// align for long stretch 1, part 2
9199
realign_player_from_landmark(
@@ -94,9 +102,17 @@ void checkpoint_29(
94102
{ZoomChange::KEEP_ZOOM, 80, 0, 75}
95103
);
96104

97-
overworld_navigation(env.program_info(), env.console, context,
98-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
99-
128, 0, 12, 12, false);
105+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
106+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
107+
overworld_navigation(env.program_info(), env.console, context,
108+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
109+
128, 0, 24, 12, false);
110+
},
111+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
112+
pbf_move_left_joystick(context, 255, 255, 40, 50);
113+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
114+
}
115+
);
100116

101117
// align for long stretch 1, part 3
102118

@@ -106,9 +122,17 @@ void checkpoint_29(
106122
{ZoomChange::KEEP_ZOOM, 95, 0, 115}
107123
);
108124

109-
overworld_navigation(env.program_info(), env.console, context,
110-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
111-
128, 0, 36, 12, false);
125+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
126+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
127+
overworld_navigation(env.program_info(), env.console, context,
128+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
129+
128, 0, 36, 12, false);
130+
},
131+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
132+
pbf_move_left_joystick(context, 255, 255, 40, 50);
133+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
134+
}
135+
);
112136

113137
// align for long stretch 2
114138
realign_player_from_landmark(
@@ -117,9 +141,17 @@ void checkpoint_29(
117141
{ZoomChange::KEEP_ZOOM, 0, 105, 65}
118142
);
119143

120-
overworld_navigation(env.program_info(), env.console, context,
121-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
122-
128, 0, 45, 15, false);
144+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
145+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
146+
overworld_navigation(env.program_info(), env.console, context,
147+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
148+
128, 0, 45, 15, false);
149+
},
150+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
151+
pbf_move_left_joystick(context, 255, 255, 40, 50);
152+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
153+
}
154+
);
123155

124156
// align for long stretch 3, part 1
125157
realign_player_from_landmark(
@@ -129,9 +161,17 @@ void checkpoint_29(
129161
);
130162

131163

132-
overworld_navigation(env.program_info(), env.console, context,
133-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
134-
128, 0, 20, 10, false);
164+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
165+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
166+
overworld_navigation(env.program_info(), env.console, context,
167+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
168+
128, 0, 20, 10, false);
169+
},
170+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
171+
pbf_move_left_joystick(context, 255, 255, 40, 50);
172+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
173+
}
174+
);
135175

136176
// align for long stretch 3, part 2
137177
realign_player_from_landmark(
@@ -141,9 +181,17 @@ void checkpoint_29(
141181
);
142182

143183

144-
overworld_navigation(env.program_info(), env.console, context,
145-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
146-
128, 0, 30, 10, false);
184+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
185+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
186+
overworld_navigation(env.program_info(), env.console, context,
187+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
188+
128, 0, 30, 10, false);
189+
},
190+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
191+
pbf_move_left_joystick(context, 255, 255, 40, 50);
192+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
193+
}
194+
);
147195

148196
// align for long stretch 3, part 3
149197
realign_player_from_landmark(
@@ -153,27 +201,57 @@ void checkpoint_29(
153201
);
154202

155203

156-
overworld_navigation(env.program_info(), env.console, context,
157-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
158-
128, 0, 30, 10, false);
204+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
205+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
206+
overworld_navigation(env.program_info(), env.console, context,
207+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
208+
128, 0, 30, 10, false);
209+
},
210+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
211+
pbf_move_left_joystick(context, 255, 255, 40, 50);
212+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
213+
}
214+
);
159215

160-
// align for long stretch 3, part 4
161-
realign_player_from_landmark(
162-
env.program_info(), env.console, context,
163-
{ZoomChange::ZOOM_IN, 0, 128, 100},
164-
{ZoomChange::KEEP_ZOOM, 255, 67, 85} //{ZoomChange::KEEP_ZOOM, 255, 70, 90}
216+
// // align for long stretch 3, part 4
217+
// realign_player_from_landmark(
218+
// env.program_info(), env.console, context,
219+
// {ZoomChange::ZOOM_IN, 0, 128, 100},
220+
// {ZoomChange::KEEP_ZOOM, 255, 67, 85} //{ZoomChange::KEEP_ZOOM, 255, 70, 90}
221+
// );
222+
223+
//align for long stretch 3, part 4. just prior to bridge. {0.339062, 0.612037}
224+
place_marker_offset_from_flypoint(env.program_info(), env.console, context,
225+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
226+
FlyPoint::POKECENTER,
227+
{0.339062, 0.612037}
165228
);
166229

167230

168-
overworld_navigation(env.program_info(), env.console, context,
169-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
170-
128, 0, 36, 12, false);
231+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
232+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
233+
overworld_navigation(env.program_info(), env.console, context,
234+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
235+
128, 0, 36, 12, false);
236+
},
237+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
238+
pbf_move_left_joystick(context, 255, 255, 40, 50);
239+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
240+
}
241+
);
171242

172-
// align to cross bridge
173-
realign_player_from_landmark(
174-
env.program_info(), env.console, context,
175-
{ZoomChange::ZOOM_IN, 0, 128, 90},
176-
{ZoomChange::KEEP_ZOOM, 255, 35, 67}
243+
// // align to cross bridge
244+
// realign_player_from_landmark(
245+
// env.program_info(), env.console, context,
246+
// {ZoomChange::ZOOM_IN, 0, 128, 90},
247+
// {ZoomChange::KEEP_ZOOM, 255, 35, 67}
248+
// );
249+
250+
// align to cross bridge {0.385937, 0.615741}
251+
place_marker_offset_from_flypoint(env.program_info(), env.console, context,
252+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
253+
FlyPoint::POKECENTER,
254+
{0.385937, 0.615741}
177255
);
178256

179257

@@ -198,23 +276,38 @@ void checkpoint_29(
198276
}catch(OperationFailedException&){ // try again if fall into water
199277
pbf_mash_button(context, BUTTON_A, 250);
200278

279+
// // walk back to start position before bridge
280+
// realign_player_from_landmark(
281+
// env.program_info(), env.console, context,
282+
// {ZoomChange::ZOOM_IN, 255, 255, 180},
283+
// {ZoomChange::KEEP_ZOOM, 33, 0, 175}
284+
// );
285+
201286
// walk back to start position before bridge
202-
realign_player_from_landmark(
203-
env.program_info(), env.console, context,
204-
{ZoomChange::ZOOM_IN, 255, 255, 180},
205-
{ZoomChange::KEEP_ZOOM, 33, 0, 175}
287+
// {0.310937, 0.580556} {0.310937, 0.589815} {0.310937, 0.584259}
288+
place_marker_offset_from_flypoint(env.program_info(), env.console, context,
289+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
290+
FlyPoint::POKECENTER,
291+
{0.310937, 0.584259}
206292
);
207293

208294
overworld_navigation(env.program_info(), env.console, context,
209295
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::CLEAR_WITH_LETS_GO,
210296
128, 0, 20, 20, false);
211297

212298

213-
// align to cross bridge
214-
realign_player_from_landmark(
215-
env.program_info(), env.console, context,
216-
{ZoomChange::ZOOM_IN, 0, 128, 90},
217-
{ZoomChange::KEEP_ZOOM, 255, 35, 67}
299+
// // align to cross bridge
300+
// realign_player_from_landmark(
301+
// env.program_info(), env.console, context,
302+
// {ZoomChange::ZOOM_IN, 0, 128, 90},
303+
// {ZoomChange::KEEP_ZOOM, 255, 35, 67}
304+
// );
305+
306+
// align to cross bridge {0.385937, 0.615741}
307+
place_marker_offset_from_flypoint(env.program_info(), env.console, context,
308+
{ZoomChange::KEEP_ZOOM, 0, 0, 0},
309+
FlyPoint::POKECENTER,
310+
{0.385937, 0.615741}
218311
);
219312

220313

@@ -238,9 +331,18 @@ void checkpoint_29(
238331
);
239332

240333

241-
overworld_navigation(env.program_info(), env.console, context,
242-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
243-
128, 0, 20, 10, false);
334+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
335+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
336+
overworld_navigation(env.program_info(), env.console, context,
337+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
338+
128, 0, 20, 10, false);
339+
},
340+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
341+
pbf_move_left_joystick(context, 255, 255, 40, 50);
342+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
343+
}
344+
);
345+
244346

245347
// align for post-bridge section 2
246348
realign_player_from_landmark(
@@ -250,9 +352,17 @@ void checkpoint_29(
250352
);
251353

252354

253-
overworld_navigation(env.program_info(), env.console, context,
254-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
255-
128, 0, 20, 10, false);
355+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
356+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
357+
overworld_navigation(env.program_info(), env.console, context,
358+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
359+
128, 0, 20, 10, false);
360+
},
361+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
362+
pbf_move_left_joystick(context, 255, 255, 40, 50);
363+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
364+
}
365+
);
256366

257367
// align for post-bridge section 3. move up towards tree
258368
realign_player_from_landmark(
@@ -262,9 +372,17 @@ void checkpoint_29(
262372
);
263373

264374

265-
overworld_navigation(env.program_info(), env.console, context,
266-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
267-
128, 0, 20, 10, false);
375+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
376+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
377+
overworld_navigation(env.program_info(), env.console, context,
378+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
379+
128, 0, 20, 10, false);
380+
},
381+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
382+
pbf_move_left_joystick(context, 255, 255, 40, 50);
383+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
384+
}
385+
);
268386

269387
// align for post-bridge section 4
270388
realign_player_from_landmark(
@@ -274,9 +392,17 @@ void checkpoint_29(
274392
);
275393

276394

277-
overworld_navigation(env.program_info(), env.console, context,
278-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
279-
128, 0, 20, 10, false);
395+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
396+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
397+
overworld_navigation(env.program_info(), env.console, context,
398+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
399+
128, 0, 20, 10, false);
400+
},
401+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
402+
pbf_move_left_joystick(context, 255, 255, 40, 50);
403+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
404+
}
405+
);
280406

281407

282408

@@ -288,9 +414,17 @@ void checkpoint_29(
288414
);
289415

290416

291-
overworld_navigation(env.program_info(), env.console, context,
292-
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
293-
128, 0, 30, 10, false);
417+
handle_when_stationary_in_overworld(env.program_info(), env.console, context,
418+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
419+
overworld_navigation(env.program_info(), env.console, context,
420+
NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY,
421+
128, 0, 30, 10, false);
422+
},
423+
[&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){
424+
pbf_move_left_joystick(context, 255, 255, 40, 50);
425+
realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER);
426+
}
427+
);
294428

295429

296430
// align for post-bridge section 6. set marker past pokecenter

0 commit comments

Comments
 (0)