record and replay debug return to start

This commit is contained in:
2024-08-27 16:57:37 -05:00
committed by Celtic Minstrel
parent dc45c4b8c3
commit f7b367ad72
3 changed files with 26 additions and 16 deletions

View File

@@ -1951,6 +1951,28 @@ void debug_ghost_mode() {
print_buf();
}
void debug_return_to_start() {
if(recording){
record_action("debug_return_to_start", "");
}
if(univ.party.in_boat >= 0) {
add_string_to_buf(" Not while in boat.");
return;
}
if(univ.party.in_horse >= 0) {
add_string_to_buf(" Not while on horse.");
return;
}
force_town_enter(univ.scenario.which_town_start,univ.scenario.where_start);
start_town_mode(univ.scenario.which_town_start,9);
position_party(univ.scenario.out_sec_start.x,univ.scenario.out_sec_start.y,
univ.scenario.out_start.x,univ.scenario.out_start.y);
center = univ.party.town_loc = univ.scenario.where_start;
redraw_screen(REFRESH_ALL);
add_string_to_buf("Debug: You return to the start.");
print_buf();
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2211,22 +2233,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'R':
if(!univ.debug_mode) break;
if(univ.party.in_boat >= 0) {
add_string_to_buf(" Not while in boat.");
break;
}
if(univ.party.in_horse >= 0) {
add_string_to_buf(" Not while on horse.");
break;
}
force_town_enter(univ.scenario.which_town_start,univ.scenario.where_start);
start_town_mode(univ.scenario.which_town_start,9);
position_party(univ.scenario.out_sec_start.x,univ.scenario.out_sec_start.y,
univ.scenario.out_start.x,univ.scenario.out_start.y);
center = univ.party.town_loc = univ.scenario.where_start;
redraw_screen(REFRESH_ALL);
add_string_to_buf("Debug: You return to the start.");
print_buf();
debug_return_to_start();
break;
case 'S':

View File

@@ -83,5 +83,6 @@ void debug_clean_up();
void debug_stealth_detect_life_firewalk();
void debug_fly();
void debug_ghost_mode();
void debug_return_to_start();
#endif

View File

@@ -505,6 +505,8 @@ static void replay_next_action() {
debug_fly();
}else if(t == "debug_ghost_mode"){
debug_ghost_mode();
}else if(t == "debug_return_to_start"){
debug_return_to_start();
}
// TODO some of these actions shouldn't call advance_time(). They should return