record and replay Create new PC

This commit is contained in:
2024-08-24 14:14:03 -05:00
committed by Celtic Minstrel
parent 2471a3e005
commit ec8c412018
3 changed files with 29 additions and 20 deletions

View File

@@ -2665,6 +2665,31 @@ void handle_drop_pc() {
}
}
void handle_new_pc() {
if(recording){
record_action("handle_new_pc", "");
}
if(!(is_town())) {
add_string_to_buf("Add PC: Town mode only.");
print_buf();
return;
}
if(univ.party.free_space() == 6) {
ASB("Add PC: You already have 6 PCs.");
print_buf();
return;
}
if(univ.town->has_tavern) {
give_help(56,0);
create_pc(6,nullptr);
} else {
add_string_to_buf("Add PC: You cannot add new characters in this town. Try in the town you started in.", 2);
}
print_buf();
put_pc_screen();
put_item_screen(stat_window);
}
void new_party() {
if(recording){
record_action("new_party", "");

View File

@@ -26,6 +26,7 @@ void increase_age();
void handle_hunting();
void switch_pc(short which);
void handle_drop_pc();
void handle_new_pc();
void new_party();
void handle_death();
void start_new_game(bool force = false);

View File

@@ -348,6 +348,8 @@ static void replay_next_action() {
handle_new_pc_graphic();
}else if(t == "handle_rename_pc"){
handle_rename_pc();
}else if (t == "handle_new_pc"){
handle_new_pc();
}
// TODO some of these actions shouldn't call advance_time(). They should return
@@ -689,26 +691,7 @@ void handle_menu_choice(eMenu item_hit) {
case eMenu::OPTIONS_NEW_PC:
// TODO record and replay
if(!(is_town())) {
add_string_to_buf("Add PC: Town mode only.");
print_buf();
break;
}
if(univ.party.free_space() == 6) {
ASB("Add PC: You already have 6 PCs.");
print_buf();
break;
}
if(univ.town->has_tavern) {
give_help(56,0);
create_pc(6,nullptr);
} else {
add_string_to_buf("Add PC: You cannot add new characters in this town. Try in the town you started in.", 2);
}
print_buf();
put_pc_screen();
put_item_screen(stat_window);
handle_new_pc();
break;
case eMenu::OPTIONS_JOURNAL: