From 0a5abec8e1b3859396877217a7781d1a311b588f Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Feb 2025 15:55:31 -0600 Subject: [PATCH] Debug action: kill the party --- src/game/boe.actions.cpp | 16 +++++++++++++++- src/game/boe.actions.hpp | 1 + src/game/boe.main.cpp | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index a1b290f3..17d97a92 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -2081,6 +2081,19 @@ void debug_kill() { print_buf(); } +void debug_kill_party() { + if(recording){ + record_action("debug_kill_party", ""); + } + for(short i = 0; i < 6; i++) { + if(univ.party[i].is_alive()) + kill_pc(univ.party[i],eMainStatus::ABSENT); + } + draw_terrain(); + add_string_to_buf("Debug: Kill the party."); + advance_time(false, true, true); +} + void debug_magic_map() { if(recording){ record_action("debug_magic_map", ""); @@ -2364,7 +2377,7 @@ void show_debug_help() { } // Non-comprehensive list of unused keys: -// UXYZ chijklnoqvy @#$-_+[]{},.'"`~/\|;: +// UYZ chijklnoqvy @#$-_+[]{},.'"`~/\|;: void init_debug_actions() { add_debug_action({'B'}, "Leave town", debug_leave_town); add_debug_action({'C'}, "Get cleaned up (lose negative status effects)", debug_clean_up); @@ -2394,6 +2407,7 @@ void init_debug_actions() { }); add_debug_action({'T'}, "Enter town", debug_enter_town); add_debug_action({'W'}, "Refresh jobs/shops", debug_refresh_stores); + add_debug_action({'X'}, "Kill party", debug_kill_party); add_debug_action({'='}, "Heal, increase magic skills", debug_heal_plus_extra); add_debug_action({'<'}, "Make one day pass", debug_increase_age); add_debug_action({'>'}, "Reset towns (excludes the one you're in, if any)", debug_towns_forget); diff --git a/src/game/boe.actions.hpp b/src/game/boe.actions.hpp index f360c279..1892c8eb 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -90,6 +90,7 @@ void debug_print_location(); void debug_step_through(); void debug_leave_town(); void debug_kill(); +void debug_kill_party(); void debug_magic_map(); void debug_enter_town(); void debug_refresh_stores(); diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 90fe149a..0fec6c09 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -771,6 +771,9 @@ static void replay_action(Element& action) { }else if(t == "debug_kill"){ debug_kill(); return; + }else if(t == "debug_kill_party"){ + debug_kill_party(); + return; }else if(t == "debug_magic_map"){ debug_magic_map(); return;