record and replay the last 2 debug actions

This commit is contained in:
2024-08-27 19:57:11 -05:00
committed by Celtic Minstrel
parent 680150ac3e
commit a4d36abec6
3 changed files with 38 additions and 18 deletions

View File

@@ -2014,6 +2014,36 @@ static void revive_all_dead(bool full_restore) {
}
}
void debug_heal() {
if(recording){
record_action("debug_heal", "");
}
univ.party.gold += 100;
univ.party.food += 100;
revive_all_dead(false);
add_string_to_buf("Debug: Heal party.");
print_buf();
put_pc_screen();
}
void debug_heal_plus_extra() {
if(recording){
record_action("debug_heal_plus_extra", "");
}
univ.party.gold += 100;
univ.party.food += 100;
revive_all_dead(true);
award_party_xp(25);
for(cPlayer& who : univ.party) {
who.priest_spells.set();
who.mage_spells.set();
}
univ.refresh_store_items();
add_string_to_buf("Debug: Add stuff and heal.");
print_buf();
put_pc_screen();
}
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
bool are_done = false;
location pass_point; // TODO: This isn't needed
@@ -2189,18 +2219,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case '=':
if(!univ.debug_mode) break;
univ.party.gold += 100;
univ.party.food += 100;
revive_all_dead(true);
award_party_xp(25);
for(cPlayer& who : univ.party) {
who.priest_spells.set();
who.mage_spells.set();
}
univ.refresh_store_items();
add_string_to_buf("Debug: Add stuff and heal.");
print_buf();
put_pc_screen();
debug_heal_plus_extra();
break;
case 'B':
@@ -2230,12 +2249,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
case 'H':
if(!univ.debug_mode) break;
univ.party.gold += 100;
univ.party.food += 100;
revive_all_dead(false);
add_string_to_buf("Debug: Heal party.");
print_buf();
put_pc_screen();
debug_heal();
break;
case 'K':

View File

@@ -87,5 +87,7 @@ void debug_return_to_start();
void handle_victory(bool record = false);
void debug_increase_age();
void debug_towns_forget();
void debug_heal_plus_extra();
void debug_heal();
#endif

View File

@@ -517,6 +517,10 @@ static void replay_next_action() {
debug_towns_forget();
}else if(t == "edit_stuff_done"){
edit_stuff_done();
}else if(t == "debug_heal"){
debug_heal();
}else if(t == "debug_heal_plus_extra"){
debug_heal_plus_extra();
}
// TODO some of these actions shouldn't call advance_time(). They should return