Sanity pass of saved game format

This adds several fields to the saved game format that were simply missing.
- Monster boolean flags (for summons)
- Some missing monster ability details (for summons)
- Special on talk (for creatures)
- Max SP and morale (for creatures)
- Source scenario (for encounter notes)

It also changes the default resist to 0 instead of 100, meaning that
resistances will be saved almost always, but should be loaded correctly.

The target location is no longer saved for creatures.
There was already code that nulled it out after loading,
so now that just happens during loading instead.

The town active flags (belt_present and quickfire_present)
are now set during loading instead of after loading.

This changes the save format, so there will be minor incompatibilities.
In particular, monster health won't be loaded correctly from older saves.
This commit is contained in:
2023-01-20 23:51:35 -05:00
parent 642a863594
commit c7c8f3fa77
6 changed files with 42 additions and 38 deletions

View File

@@ -95,25 +95,7 @@ void finish_load_party(){
build_outdoors();
erase_out_specials();
if(!town_restore) {
center = univ.party.out_loc;
}
else {
for(int i = 0; i < univ.town.monst.size(); i++){
univ.town.monst[i].targ_loc.x = 0;
univ.town.monst[i].targ_loc.y = 0;
}
// Set up field booleans
for(int j = 0; j < univ.town->max_dim; j++)
for(int k = 0; k < univ.town->max_dim; k++) {
if(univ.town.is_quickfire(j,k))
univ.town.quickfire_present = true;
if(univ.scenario.ter_types[univ.town->terrain(j,k)].special == eTerSpec::CONVEYOR)
univ.town.belt_present = true;
}
center = univ.party.town_loc;
}
center = town_restore ? univ.party.town_loc : univ.party.out_loc;
redraw_screen(REFRESH_ALL);
univ.cur_pc = first_active_pc();