17 Commits

Author SHA1 Message Date
GuardianDll ac3bdfab64 move body_part_type::type to enums.h to resolve include loop 2025-09-14 20:33:03 +02:00
moxian 2ee44002fd Mechanically IWYU the tests
python3 ~/github/include-what-you-use/iwyu_tool.py -j5 -p build $( find
src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f
tools/iwyu/bad_files.txt )  --  -Xiwyu --comment_style=long -Xiwyu -
-max_line_length=1000 -Xiwyu --cxx17ns -Xiwyu
--mapping_file=../tools/iwyu/cata.imp   | tee out/iwyu/f-a-01.txt >
/dev/null

followed by

cat out/iwyu/f-a-02.txt | python3
~/github/include-what-you-use/fix_includes.py --reorder --nosafe_headers

followed by manual fixups of <stddef.h> -> <cstddef> and similar.

tests/generic_factory_test.cpp gets mangled very badly (IWYU bug) so
it's excluded from the list.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 288068  576136 17898260
$ cat tests/obj/tiles/*.inc | wc
 167044  334088 10465766

post-processed source (clang -E):
./make_preproc.sh src/
68567896 177775140 2134075721
./make_preproc.sh tests/
39341957 102891720 1243323710
2025-02-10 00:46:57 -08:00
Procyonae 982df19d0f Change /tests remaining uses of raw string item initialisation to use itype_id s
"remaining uses" being somewhat of an understatement -_-
2025-01-10 15:31:15 +00:00
Anton Simakov 71ed5cde9c Port some mutation/cbm specific fields to enchantments, part 3 (#72173)
* remove weakness_to_water, add WEAKNESS_TO_WATER as replacement, fix it not working with negative values

* remove fat_to_max_hp, make FAT_TO_MAX_HP as replacement

* remove healthy_rate, create HEALTHY_RATE as a replacement

* remove scent_mask, adds SCENT_MASK to replace it

* remove consume_time_modifier, make CONSUME_TIME_MOD as replacement

* remove reading_speed_multiplier

* remove overmap_sight and overmap_multiplier

* remove sweat_multiplier, add SWEAT_MULTIPLIER as replacement

* remove vomit_multiplier

* remove stamina_regen_modifier, make STAMINA_REGEN_MOD as replacement

* remove fatigue_regen_modifier, make FATIGUE_REGEN as replacement

* remove fatigue_modifier

* remove noise_modifier

* remove crafting_speed_multiplier

* remove casting_time_multiplier

* remove bionic_mana_penalty

* remove mana_regen_multiplier

* remove mana_multiplier

* remove mana_modifier

* refine water damage to allow float values, make it tick once per second instead of once per minute

* lintin and fixin

* Astyle

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* clang tidy

* Astyle

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* more

* more

* data types are hard

* ill squash it in the future, believe me

* Astyle

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* refine crafting speed calculations

* update tests

* Update tests/mutation_test.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* add identifier to enchantment

* int to double?

* refine mutation OM vision test to check actual OM vision

* Update src/character.cpp

Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>

* the last bist of sight test

* final test tweaks

* fix widget test mismatch

* add escape character to fix test

* fix two nocturnal trait

* fix multiple errors

* make new overmap sight test use test mutations, that work all the time (eagleeyed doesn't work at night)

* fix field duplication

* more fixes after merge

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>
2024-03-09 17:39:06 -06:00
Venera3 5aa9176243 Add limb tests (#70924)
* Limb tests

* Breakage tests + suffer fix

* clang

* Fix tests

* Update limb_test.cpp
2024-01-15 22:13:55 -06:00
Alexey 07356b65a5 Normalize TEST_CASE names (#66241)
* 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)
2023-06-17 13:57:19 -03:00
David Seguin 6141f7651e damage_type: jsonify damage types
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.
2023-04-24 01:38:15 -04:00
Eric 9aad1a31a6 Improve portal dungeon monsters. Add ability to use variables in enchantment strengths (#60788)
* Add forms and change flavor

* Compiles, untested, ugly

* Inheritance

* Update magic_enchantment.cpp

* Update magic_enchantment.cpp

* cleanup

* Add multiply

* Add new monsters

* Fixes

* Fixes

* Update nether.json

* Update magic_enchantment.cpp

* Update magic_enchantment.cpp

* Update magic_enchantment.h

* Update magic_enchantment.h

* Update magic_enchantment.cpp

* Update magic_enchantment.h

* Update dialogue.h

* Update dialogue_helpers.h
2022-09-20 23:45:30 -04:00
David Seguin ddcbe2b222 Weighted limb types: Set usage of primary type where applicable 2022-02-23 00:41:21 -05:00
David Seguin 4cdce63f64 Weighted limb types: Unit tests 2022-02-22 22:25:17 -05:00
David Seguin 96a9f12267 Weighted limb types: Convert limb types to a weighted list 2022-02-22 22:25:16 -05:00
David Seguin 0b6722b87f Multi-limbscore modifiers: Unit tests 2022-02-10 16:39:28 -05:00
David Seguin 25f67b1407 Multi-limbscore modifiers: Add capability for weighted lists 2022-02-10 14:15:22 -05:00
David Seguin 784c10cb4e Multi-limbscore modifiers: Ability to specify multiple limb scores 2022-02-10 12:33:57 -05:00
Binrui Dong 3acbcaaaf8 Move some template specializations of StringMaker<T>::convert<T> to a cpp file 2022-01-04 02:22:29 +08:00
David Seguin 06da8a6847 Natural Resistances (#53462)
* Load damage resistances for body parts and mutation armour BP types

* Apply damage resistances from body parts

* Use resistances object and rename fields for consistency

* Documentation & style fixes

* Add unit tests
2021-12-17 10:59:09 -08:00
David Seguin 427c1c6825 Jsonify Limb Scores & Character Modifiers (#53069)
* Use generic text function for displaying limb encumbrance effects

* Partial jsonification of limb scores

* astyle and json style corrections

* Generate modifier descriptions + Scroll info box

* Partial jsonification of character modifiers

* Style corrections + Add character_mod to translation

* Remove unnecessary static string_id's (clang-tidy)

* Documentation - limb scores and character modifiers

* Switch over to new string extraction system

* Add unit tests for limb scores and character modifiers

* Clang-tidy: use proper string_id name

* Post-merge fix: L comes before Q

* Post-rebase cleanup: new fields / new scores / changed modifiers

- New fields for `character_mod`: "override_encumb" & "override_wounds"
- Migrated new "footing" limb score
- Modified "melee_stamina_cost_mod" to force lift score to be affected by encumbrance
- Updated documentation

* Unhardcode body parts whose encumbrance affects dodge

* Fix reference to non-reference
2021-12-03 22:25:07 -08:00