The original source had remnants of a PC-specific experience gain adjustment, which
appeared to be intended as a debugging aid.
I've restored and implemented it, and used it on the debug party.
It doesn't necessary need to be relegated to only a debug feature, but for now, that's
good enough.
It seemed like it was intended as a mirror of cTown::difficulty, yet there didn't seem to
be anything that ever wrote to it.
So I just made everything use cTown::difficulty directly instead.
This should help avoid issues from integer overflow (which is technically undefined behaviour)
while also allowing such issues to be addressed centrally if they still exist.
This also adds an Allow Resist flag to determine whether the target's
Mage Spells or Priest Spells skill can reduce the amount drained.
Thanks to @fosnola for spotting this issue.
The fields array was fixed at 64x64, which is fine for all towns
supported in legacy BoE.
However, we intend to support even larger towns in the future,
and also it seems silly to hold so much extra space for a smaller town.
So now, the fields array is a 2D vector that matches the size of the terrain vector.
The setup array is similarly a list of 2D vectors.
This radically changes the format used to store the setup array in a saved game.
Older saves won't crash the game, but fields will be messed up or missing.
Resetting towns is recommended.
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 should avoid any format inconsistencies, like missing newlines and the like.
Although a basic save and load works, there may still be some issues with the format.
This probably renders older saved games incompatible.
The format is mostly the same, but there are a few small changes
in the name of making the format more uniform.
This covers only the places where they were used to indicate
a preset selection in constructors.
The usage in qdpict where they're actually passed to the Resource Manager,
as well as the 4-character constants representing file types and creator
codes, are still present.
- Context type (town/out/scen) is now an enum
- Don't expose internals in the header
- Use a state struct to pass things around through the system
- Fix special AFFECT_DEADNESS case for default party selection
- Maybe other bits and pieces?