Debug action: fill active PC's inventory
This commit is contained in:
@@ -2015,6 +2015,24 @@ void debug_give_item() {
|
||||
put_pc_screen(); // In case the item was food or gold
|
||||
}
|
||||
|
||||
void debug_overburden() {
|
||||
if(recording){
|
||||
record_action("debug_overburden", "");
|
||||
}
|
||||
|
||||
cPlayer& pc = univ.current_pc();
|
||||
cItem item(ITEM_DEBUG_HEAVY);
|
||||
// Give the PC very heavy objects that do nothing:
|
||||
while(pc.give_item(item, GIVE_ALLOW_OVERLOAD)){}
|
||||
if(pc.has_space()){
|
||||
// I don't know why this would ever happen, since the weight is 0, but just in case:
|
||||
ASB("Debug: failed to fill " + pc.name + "'s inventory.");
|
||||
}else{
|
||||
ASB("Debug: filled " + pc.name + "'s inventory.");
|
||||
}
|
||||
print_buf();
|
||||
}
|
||||
|
||||
void debug_print_location() {
|
||||
if(recording){
|
||||
record_action("debug_print_location", "");
|
||||
@@ -2390,7 +2408,7 @@ void show_debug_help() {
|
||||
}
|
||||
|
||||
// Non-comprehensive list of unused keys:
|
||||
// Y chijklnoqvy @#$-_+[]{},.'"`~/\|;:
|
||||
// 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);
|
||||
@@ -2401,6 +2419,7 @@ void init_debug_actions() {
|
||||
add_debug_action({'H'}, "Heal", debug_heal);
|
||||
// This one was missing from the old help dialog:
|
||||
add_debug_action({'I'}, "Give item", debug_give_item);
|
||||
add_debug_action({'Y'}, "Fill PC's inventory", debug_overburden);
|
||||
// TODO this is not recorded or replayed because the rsrc you pick might not even be packaged
|
||||
// in the build
|
||||
add_debug_action({'J'}, "Preview a dialog's layout", preview_dialog_xml);
|
||||
|
@@ -86,6 +86,7 @@ void init_debug_actions();
|
||||
void show_debug_help();
|
||||
void debug_fight_encounter(bool wandering);
|
||||
void debug_give_item();
|
||||
void debug_overburden();
|
||||
void debug_print_location();
|
||||
void debug_step_through();
|
||||
void debug_leave_town();
|
||||
|
@@ -784,6 +784,9 @@ static void replay_action(Element& action) {
|
||||
}else if(t == "debug_give_item"){
|
||||
debug_give_item();
|
||||
return;
|
||||
}else if(t == "debug_overburden"){
|
||||
debug_overburden();
|
||||
return;
|
||||
}else if(t == "debug_print_location"){
|
||||
debug_print_location();
|
||||
return;
|
||||
|
Reference in New Issue
Block a user