* Use ammo_effect_str_id instead of std::string
* replace RECOVER_ flag with a new field
* Update json
* Update doc
* remove unused ammo_effect
* update mods
* fix ids for clang
---------
Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
* Convert integer parsing test to use normal TEST_CASEs
* Rename test name too similar to another
* Test to enforce normalized test names
* Normalize TEST_CASE names (scripted)
It turns out that a lot of loading code depends on
the availability of certain damage types.
I see two ways to resolve this:
1) Juggle the loading order of JSON types so that damage
types always load first.
2) Add deferred processing for every type with inline
damage type definitions.
I went with option 2, which is better but still
not great since new code that loads damage/resistance
definitions would need to also call finalize_damage_map
in the finalizing stage. Option 1 would cause problems
for mods, especially because the load order would matter.
None of this can be done piecemeal, it has to all be ripped
out in one go unless we want commits that don't compile
on their own.
* refactor away damage resist code duplication
Refactoring the damage resist functions to remove code duplication
should increase maintainability and readability. This change was
prompted by investigating one of a series of subtle bugs that were
introduced during other changes to the damage resist calculations.
* simplify item::_environmental_resist default argument
This clang-tidy check looks for potentially-expensive-to-copy value
parameters which are only used as const values.
If they are only used once, in an assignment or initialization, then
their use will be converted to std::move. This can save a copy in some
cases.
Otherwise, the parameter will be converted to a const reference, which
can also save a copy in some cases.
Our string_id constants were a mixture of temporaries, locals, and
globals. Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.