21 Commits

Author SHA1 Message Date
Andrew Krieger 0215b26cce Rewrite all tests to clear map without touching character map memory, for performance. 2026-02-08 23:05:55 -08:00
PatrikLundell 586cf5f1ce Mapify: character etc. sees + sundry others (#79699)
* Mapify: character etc. sees + sundry others

* demanded changes

* Corrected correction
2025-02-18 09:29:22 -06:00
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08: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
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
PatrikLundell 456a199f5c typified a bit of map.cpp and dependents 2024-10-08 16:23:15 +02:00
Procyonae e9f4fbd110 Remove extern ter ids (#72766) 2024-04-04 07:08:37 -07:00
RenechCDDA c2c814edff Merge branch 'master' into magic_BAD 2024-03-10 11:08:36 -04: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
RenechCDDA b0882ee2eb Update tests for protected moves variable 2024-03-09 16:33:12 -05:00
Anton Simakov 1c2c14e123 Port some mutation/cbm specific fields to enchantments, part 2 (#72106)
* remove stealth_modifier

* remove attackcost_modifier

* remove pain_modifier

* remove metabolism_modifier

* remove thirst_modifier

* remove SLOWS_THIRST flag

* remove obtain_cost_multiplier

* remove stomach_size_multiplier

* remove cardio_multiplier, create CARDIO_MULTIPLIER as replacement

* remove weight_capacity_bonus and weight_capacity_modifier

* Apply suggestions from code review

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

* fix few mistakes

* reorder bionic_data struct as clang tidy suggests

* satisfy clang tidy

* Update src/character.cpp

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

* fixing conflict wtf

* cleaning up

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 16:19:28 -06:00
anoobindisguise 542103e6fb More structure for bionic bodyparts (#70828)
* test

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update src/character.cpp

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

* check limbs for being bionic for some attacks

* no infecting bionic limbs

* effects_require_organic

* effects_require_organic

* don't apply effects if effects_require_organic and it is a bioniclimb

* Update src/mattack_actors.cpp

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

* don't make pain yelps if bionic limb is hit

* Update monattack.cpp

* Update monattack.cpp

* Update character.cpp

* Update character.cpp

* Update src/character.cpp

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

* Update integrated.json

* Update bodypart.cpp

* Update bodypart.h

* simplify

* Apply suggestions from code review

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

* Update bodypart.cpp

* Update bodypart.h

* Update character.cpp

* Update character.cpp

* Update integrated.json

* Update integrated.json

* Update integrated.json

* Update integrated.json

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update character.cpp

* Update bionic_limbs

* Update bionic_limbs

* Update bodypart.cpp

* Update bodypart.h

* flagify

* flagify

* flagify

* Update body_parts.json

* flagify

* Update src/character.cpp

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

* Update src/monattack.cpp

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

* Update character.cpp

* Update src/character.cpp

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

* Update character.cpp

* get_organic_size_sum

* get_organic_size_sum

* Update character.cpp

* some fixes

* adjust hit_size to favor legs over arms

* enchantments to lose limbs

* Update src/character.cpp

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

* Update data/json/enchantments.json

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

* Update data/json/enchantments.json

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

* different message for bionic limb damage

* bionic limbs cannot be bandaged

* modify existing stored calories according to limb changes

* undo

* fungus diverts to torso if you have bionic arms

* Update player_hardcoded_effects.cpp

* Update src/player_hardcoded_effects.cpp

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

* Update player_hardcoded_effects.cpp

* Update player_hardcoded_effects.cpp

* Update player_hardcoded_effects.cpp

* Update player_hardcoded_effects.cpp

* sort

* don't mess with hit size stuff for now

* Update src/character.cpp

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

* move bionic parts here

* Delete bionic_limbs

* enchantment changes

* changes

* bionic limb doesn't hurt

* Update creature.cpp

* resist_limb_flags

* resist_limb_flags

* resist_limb_flags

* Update effect.h

* get_windage_effect()

* windage effect

* windage

* Update bodypart.h

* Update bodypart.cpp

* Update body_parts.json

* start per limbing exhaustion

* apply windage effects per limb

* Update bodypart.cpp

* Update bodypart.h

* Update creature.cpp

* Update creature.cpp

* already a flag for this

* already a thing for this

* Update effects.json

* Update effects.json

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Update character.cpp

* Update character.cpp

* fix errors on winding

* prevent errors upon windedness

* Update character.cpp

* Update character.h

* Apply suggestions from code review

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

* Update character.cpp

* Update character.h

* Update char_healing_test.cpp

* Update character.h

* Update character.cpp

* Update char_healing_test.cpp

* Update character.cpp

* Update character.h

* Update src/character.cpp

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

* Update character.cpp

* Update effects.json

* lose kcal on installation

* tank treads

* bionic treads

* Update body_parts.json

* Update src/bionics.cpp

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

* Update bionics.cpp

* Update body_parts.json

* Update enchantments.json

* burn_energy_legs,arms,all()

* Apply suggestions from code review

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

* Update character.cpp

* individualized limb replacement enchants

* split into sided limb armor

* Apply suggestions from code review

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

* limb replacer bionics

* add limb bionics

* tank treads get storage

* fixes

* fixes

* Apply suggestions from code review

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

* Update integrated.json

* Update bionics.json

* dragging veh burn_energy_all

* melee attack burn_energy_arms

* grab break burn_energy_arms

* smash terrain burn_energy_arms

* bows burn_energy_arms, martialarts burn_energy_all

* burn_energy for butchery and pulping

* swim and climb are full body exercise

* fix possible div/0 error

* fixes

* positive burn energy

* burn energy positive

* burn energy positive

* Update activity_actor.cpp

* Update activity_handlers.cpp

* Update character.cpp

* Update character_escape.cpp

* Update activity_actor.cpp

* Update character.cpp

* Update integrated.json

* Update bionics.json

* Update bionics.json

* Update bionics.json

* Update integrated.json

* Update src/activity_actor.cpp

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

* Update integrated.json

* Update integrated.json

* Update body_parts.json

* fixes for burn_energy

* tally_organic_size();

* stamina test for bionics

* Update src/mutation.cpp

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

* Update src/character.cpp

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

* Update src/character.cpp

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

* Update src/character.cpp

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

* get_bionic_limb_percentage

* Update char_stamina_test.cpp

* fix > issue for two_bionic_burn_rate

* fix unneeded newline

* nolimb enchants

* no limb muts

* add_mut_on_removal

* Update tests/char_stamina_test.cpp

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

* Update bionics.json

* no_power_effect

* get_no_power_effect

* no power effects

* mod_power_level infrastructure

* no_power_effect

* no_power_effect

* Update character.cpp

* fix an error from fixing conflicts

* fix error

* redelete buggy flags

* fix bird wings, un-add my no limb enchs

* bionics give correct muts on removal

* no_limb_LR -> no_leftright_limb

* move enchantments to limbs mod

* move enchantments to limbs mod

* remove trailing space

* move effects to limbs mod

* move effects to limbs mod

* move bionic limbs to limbs mod

* move bionic limbs to limbs mod

* move bionic integrated armor to limbs mod

* move bionic integrated armor to limbs mod

* move bionics to limbs mod

* move bionics to limbs mod

* Create bionics.json to hold testing limb bionics

* undo changes to mutations.json

* fix a reversion while deleting changes

* readd missing resist_traits

* add testing bionic data

* update the test with testing bionics

* correct missing test_s

* yet more fixes

* fixes

* Extra fixes

* Add subparts

* Logos linted

* TEST_s

* yet more typo fixes

* move tally_organic_size() to a better location

* move tally_organic_size() to a better location

* correct the expected hit_size

* workaround to limbs loading in wrong order

* cache burn_energy values to save memory

* cache burn_energy values to save memory

* Apply suggestions from code review

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

* reorder some energy use calcs

* Update src/character.cpp

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

* json formatting

* fix -mod

* ensure correct legs for cardio test

* Safety recalc

* add recalculate_bodyparts() to remove_bionic

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-03 18:34:37 -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
Dillon Matchett dbd8cd966a Incremental skills (#65004)
* Down to construction.cpp

* finished crafting

* crafting gui

* Update faction.cpp

* Update faction_camp.cpp

* Update game.cpp

* down to handle action

* Update iexamine.cpp

* Update item.cpp

* Update iuse.cpp

* Update iuse_actor.cpp

* down to mattack

* Update melee.cpp

* Update mission_companion.cpp

* Update monattack.cpp

* up to npcmove

* Update npctalk.cpp

* Update npctrade.cpp

* Update ranged.cpp

* Update recipe.cpp

* Update trap.cpp

* Update trapfunc.cpp

* Update vehicle_use.cpp

* Update veh_type.cpp

* Update veh_utils.cpp

* tests

* was too big

* test fixes

* clang
2023-04-18 00:39:49 -04:00
anoobindisguise 1866f166ba Fix BMI system and add penalties for obesity (#60597)
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
2023-03-11 19:18:44 -08:00
Zhilkin Serg e44f38af40 Remove excessive empty lines 2022-12-06 10:42:15 +03:00
ArgonMercury 921e536ef6 Cardio overhaul; divorce BMR from cardio and fix health, athletics, and traits effects on cardio (#60202)
* Divorces cardio from bmr and makes cardiofit modifiers effectively functional

* Update cardio test

* Update weird cardio accumulator health check

* Strip pre-cardio test number comments from test, as many were incorrect

* remove magic numbers

* remove one last magic number I missed

* Adjust iteminfo test to match expected stamina usage

* astyle fix
2022-10-26 11:49:02 +02:00
Fris0uman 51599d5088 Implement Daily health vs Lifestyle system (#57331) 2022-06-19 17:07:54 -07:00
Ryan Breuer 49d19e29f6 Update stamina tests 2022-03-09 22:44:51 -06:00
Eric Pierce 6ec8d8cc34 tests: Fine-tune cardio test for determinism
- Adjust step expectations to match new deterministic stamina regen
- Separate [base] test case so it can be easily run by itself
- Capture turns as well as steps in running_steps
- Use can_run() for the loop condition
2022-01-01 17:06:42 -07:00
Eric Pierce 2d4a90c880 Add cardio_test.cpp
This test covers several aspects of cardio fitness, stamina, and running
distance, especially related to mutations affecting cardio and stamina,
and in particular the three CARDIO traits affected by #52980.

Some FIXMEs are noted, where trait buffs have changed significantly
since the introduction of cardio, and may need to be rebalanced.

Several stub test cases are included to invite future collaboration.
2021-12-31 13:57:04 -07:00