Add the missing cached_mutations guard in update_cached_mutations
when old enchantment mutation cache is not empty. This prevents
re-adding enchantment mutations that are already cached.
Guard the corrupted counter update so enchantment-only traits are
not inserted into my_mutations by accident.
Make mutation_effect idempotent for integrated armor by skipping
wear_item when that integrated item is already worn.
Add regression tests covering both the cached mutation reapply path
and repeated mutation_effect calls for integrated fur armor.
Now that there's different levels of overmap vision, change the
displayed map information based on it.
To reduce the load of specifying this data for all of the overmap
terrains, this is specified in a separate oter_vision type that overmap
terrains reference. For a given vision level, the name, symbol, and
color level of the terrain will be replaced with those specified in the
oter_vision it references. If the oter_vision doesn't have an entry for
that vision level, the information from the overmap terrain will be
shown. If the oter_vision specifies that it should blend with adjacent
tiles at that vision level, a suitable adjacent tile will be chosen
instead, and the information for that tile (depending on vision level)
will be shown.
The prefixing used for tileset ids is messy, but it's constrained and
the tiles overmap works.
Adjust the code that reveals tiles to reveal at these various different
levels. It's nothing exciting, and there are a lot of improvements to be
made, but it works well enough to showcase the feature.
* Remove Alpha special casing
* Adjust vitamin requirement to break threshold
* Increase max vitamin dose of alpha
* Apply suggestions from code review
* 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>
* 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)
* Mutation system refinements, take two: squashed edition
created with copious amounts of agony and ice cream
* proofreading, resolve test failure
* I realy should try magiclysm one of these days
* on second thought, no popups for now
* the github test run took TWO HOURS. AAAAH
* [wailing]
* Flagify COLDBLOOD mutations
* Documented the new flags in JSON_FLAGS.md
* Test cases for some mutations I flagified
* Apply astyle fixes
* Clang tidy corrections
* And astyle again ;_;
* Tear down entire threshold calcs + rebuild them
* Debug options for testing mutation categories
* New character menu properly removes mutations
* Adds mutations to Nerd- I mean Manatouched
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
* Migrate mutations to a weighted vitamin based EOC-run system
* Human Mutagen and Mutagen Chelator
Human mutagen (aka purifier) has no overdose effect at the moment, but is set up for later when it will trigger terrible overdose effects if you have any threshold.
Mutagen Chelator does not currently appear anywhere legitimately, would love some feedback on where it should be and how/if it should be created.
Co-authored-by: Mikenyes <25803648+Mikenyes@users.noreply.github.com>
Co-authored-by: Fris0uman <41293484+Fris0uman@users.noreply.github.com>
Co-authored-by: Venera3 <72006894+Venera3@users.noreply.github.com>
- src: Factor out all code references to SELFAWARE trait
- data: Remove SELFAWARE from starting traits
- data: Change SELFAWARE to OPTIMISTIC for Meditation hobby
- data/mods: Remove SELFAWARE from all mods
- tests: Remove SELFAWARE from test that doesn't need it
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.
Catch2 provides a customization point for converting our types to
strings by specializing the StringMaker template.
We have some specializations in stringmaker.h, but this feature was only
working intermittently. I finally figured out that was due to an ODR
violation. The test files that didn't include stringmaker.h were
compiling a different specialization than the ones that did.
Re-jig the test includes so that any file including catch.hpp also
includes stringmaker.h, thereby ensuring that the custom
specializations are used everywhere and there is no ODR violation.
I achieved this by adding a new cata_catch.h header and making all
existing headers include catch.hpp via the new header.
* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
The intended purpose of these mutation tests was somewhat obscure, and
the output on failure could be difficult to interpret. This commit aims
to improve them in the following ways:
- Add a new test focused on a simple example with only 3 mutations
- Add explanatory comments to each test, to clarify the intent
- Replace 'auto' variables with explicit types, to aid static analysis
- Reduce the number of unnecessary assertions, to make output cleaner
Use the new clang-tidy check to convert a bunch of declarations to
static.
In a few cases, there were 'secret' dependencies being exposed without
headers. Convert those to work via headers instead.
The mutation_category_trait objects have ids, but they were just
std::strings. Make them be a string_id<mutation_category_trait>
instead.
This is a general move towards type safety, although the specific goal I
wanted to achieve was better validity checking of cata_variants.
Correct the "overmap_sight" mutation value map to be additive, rather
than multiplicative. Include a regression test that failed before this
change, and passes afterward.
Fix#42853
For reasons I do not understand, using "multiplicative" here caused the
"Self-Aware" trait to nullify the overmap sight adjustments from both
the "Scout" and "Topographagnosia" traits.
* Fix missing declarations
Mark functions with no prior declarations as static, and remove the
unused ones.
* Move debug_is_safe_string definition
Put it inside !WIN32 since it's only used there.
A first step towards IWYU support. Doing the sorting first because it
makes reviewing any additions or removals of headers much simpler.
The IWYU order is:
- Associated headers
- Misc system headers
- C++ STL headers
- Other project headers
The biggest change is moving system headers before project headers (they
are usually afterwards in Cata at the moment.
The associated header for a cpp file is the header file which declares
the functions defined in that cpp file. Normally that's the one which
shares the same name (up to extension), and if so IWYU figures it out
automatically.
However, in this project there are many corner cases, so we need to use
IWYU pragma: associated to tell it which header (or, in some cases,
which headers) is the associated header. We are unusual in having
multiple associated headers for some files, which might lead to
discovering some interesting IWYU bugs later, but in theory it is
supported.