Skip to content

Commit c718388

Browse files
committed
add more blank checkpoints
1 parent 2538234 commit c718388

File tree

3 files changed

+226
-0
lines changed

3 files changed

+226
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,13 @@ void AutoStory::test_checkpoints(
611611
checkpoint_list.push_back([&](){checkpoint_47(env, context, notif_status_update);});
612612
checkpoint_list.push_back([&](){checkpoint_48(env, context, notif_status_update);});
613613
checkpoint_list.push_back([&](){checkpoint_49(env, context, notif_status_update);});
614+
checkpoint_list.push_back([&](){checkpoint_50(env, context, notif_status_update);});
615+
checkpoint_list.push_back([&](){checkpoint_51(env, context, notif_status_update);});
616+
checkpoint_list.push_back([&](){checkpoint_52(env, context, notif_status_update);});
617+
checkpoint_list.push_back([&](){checkpoint_53(env, context, notif_status_update);});
618+
checkpoint_list.push_back([&](){checkpoint_54(env, context, notif_status_update);});
619+
checkpoint_list.push_back([&](){checkpoint_55(env, context, notif_status_update);});
620+
614621

615622
for (int checkpoint = start; checkpoint <= end; checkpoint++){
616623
if (checkpoint == 0){

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

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,180 @@ void checkpoint_50(
9494
}
9595

9696

97+
// todo: uncomment checkpoint_save
98+
void checkpoint_51(
99+
SingleSwitchProgramEnvironment& env,
100+
ProControllerContext& context,
101+
EventNotificationOption& notif_status_update
102+
){
103+
AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
104+
bool first_attempt = true;
105+
while (true){
106+
try{
107+
if (first_attempt){
108+
// checkpoint_save(env, context, notif_status_update);
109+
first_attempt = false;
110+
}else{
111+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
112+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
113+
env.log("Wait 10 seconds.");
114+
context.wait_for(Milliseconds(10 * 1000));
115+
save_game_from_overworld(env.program_info(), env.console, context);
116+
}
117+
118+
context.wait_for_all_requests();
119+
120+
break;
121+
}catch(OperationFailedException&){
122+
context.wait_for_all_requests();
123+
env.console.log("Resetting from checkpoint.");
124+
reset_game(env.program_info(), env.console, context);
125+
stats.m_reset++;
126+
env.update_stats();
127+
}
128+
}
129+
130+
}
131+
132+
// todo: uncomment checkpoint_save
133+
void checkpoint_52(
134+
SingleSwitchProgramEnvironment& env,
135+
ProControllerContext& context,
136+
EventNotificationOption& notif_status_update
137+
){
138+
AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
139+
bool first_attempt = true;
140+
while (true){
141+
try{
142+
if (first_attempt){
143+
// checkpoint_save(env, context, notif_status_update);
144+
first_attempt = false;
145+
}else{
146+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
147+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
148+
env.log("Wait 10 seconds.");
149+
context.wait_for(Milliseconds(10 * 1000));
150+
save_game_from_overworld(env.program_info(), env.console, context);
151+
}
152+
153+
context.wait_for_all_requests();
154+
155+
break;
156+
}catch(OperationFailedException&){
157+
context.wait_for_all_requests();
158+
env.console.log("Resetting from checkpoint.");
159+
reset_game(env.program_info(), env.console, context);
160+
stats.m_reset++;
161+
env.update_stats();
162+
}
163+
}
164+
165+
}
166+
167+
// todo: uncomment checkpoint_save
168+
void checkpoint_53(
169+
SingleSwitchProgramEnvironment& env,
170+
ProControllerContext& context,
171+
EventNotificationOption& notif_status_update
172+
){
173+
AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
174+
bool first_attempt = true;
175+
while (true){
176+
try{
177+
if (first_attempt){
178+
// checkpoint_save(env, context, notif_status_update);
179+
first_attempt = false;
180+
}else{
181+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
182+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
183+
env.log("Wait 10 seconds.");
184+
context.wait_for(Milliseconds(10 * 1000));
185+
save_game_from_overworld(env.program_info(), env.console, context);
186+
}
187+
188+
context.wait_for_all_requests();
189+
190+
break;
191+
}catch(OperationFailedException&){
192+
context.wait_for_all_requests();
193+
env.console.log("Resetting from checkpoint.");
194+
reset_game(env.program_info(), env.console, context);
195+
stats.m_reset++;
196+
env.update_stats();
197+
}
198+
}
199+
200+
}
201+
202+
// todo: uncomment checkpoint_save
203+
void checkpoint_54(
204+
SingleSwitchProgramEnvironment& env,
205+
ProControllerContext& context,
206+
EventNotificationOption& notif_status_update
207+
){
208+
AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
209+
bool first_attempt = true;
210+
while (true){
211+
try{
212+
if (first_attempt){
213+
// checkpoint_save(env, context, notif_status_update);
214+
first_attempt = false;
215+
}else{
216+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
217+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
218+
env.log("Wait 10 seconds.");
219+
context.wait_for(Milliseconds(10 * 1000));
220+
save_game_from_overworld(env.program_info(), env.console, context);
221+
}
222+
223+
context.wait_for_all_requests();
224+
225+
break;
226+
}catch(OperationFailedException&){
227+
context.wait_for_all_requests();
228+
env.console.log("Resetting from checkpoint.");
229+
reset_game(env.program_info(), env.console, context);
230+
stats.m_reset++;
231+
env.update_stats();
232+
}
233+
}
234+
235+
}
236+
237+
// todo: uncomment checkpoint_save
238+
void checkpoint_55(
239+
SingleSwitchProgramEnvironment& env,
240+
ProControllerContext& context,
241+
EventNotificationOption& notif_status_update
242+
){
243+
AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
244+
bool first_attempt = true;
245+
while (true){
246+
try{
247+
if (first_attempt){
248+
// checkpoint_save(env, context, notif_status_update);
249+
first_attempt = false;
250+
}else{
251+
enter_menu_from_overworld(env.program_info(), env.console, context, -1);
252+
// we wait 10 seconds then save, so that the initial conditions are slightly different on each reset.
253+
env.log("Wait 10 seconds.");
254+
context.wait_for(Milliseconds(10 * 1000));
255+
save_game_from_overworld(env.program_info(), env.console, context);
256+
}
257+
258+
context.wait_for_all_requests();
259+
260+
break;
261+
}catch(OperationFailedException&){
262+
context.wait_for_all_requests();
263+
env.console.log("Resetting from checkpoint.");
264+
reset_game(env.program_info(), env.console, context);
265+
stats.m_reset++;
266+
env.update_stats();
267+
}
268+
}
269+
270+
}
97271

98272
}
99273
}

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,51 @@ void checkpoint_50(
3333
EventNotificationOption& notif_status_update
3434
);
3535

36+
// start:
37+
// end:
38+
void checkpoint_51(
39+
SingleSwitchProgramEnvironment& env,
40+
ProControllerContext& context,
41+
EventNotificationOption& notif_status_update
42+
);
43+
44+
45+
// start:
46+
// end:
47+
void checkpoint_52(
48+
SingleSwitchProgramEnvironment& env,
49+
ProControllerContext& context,
50+
EventNotificationOption& notif_status_update
51+
);
52+
53+
54+
// start:
55+
// end:
56+
void checkpoint_53(
57+
SingleSwitchProgramEnvironment& env,
58+
ProControllerContext& context,
59+
EventNotificationOption& notif_status_update
60+
);
61+
62+
63+
// start:
64+
// end:
65+
void checkpoint_54(
66+
SingleSwitchProgramEnvironment& env,
67+
ProControllerContext& context,
68+
EventNotificationOption& notif_status_update
69+
);
70+
71+
72+
// start:
73+
// end:
74+
void checkpoint_55(
75+
SingleSwitchProgramEnvironment& env,
76+
ProControllerContext& context,
77+
EventNotificationOption& notif_status_update
78+
);
79+
80+
3681

3782

3883
}

0 commit comments

Comments
 (0)