28 Commits

Author SHA1 Message Date
dumb-kevin a66cfaf159 Fix flaky liquid_projectiles_applies_effect test
The hazmat suit doesn't cover eyes/mouth body parts, so liquid
projectile hits to those parts bypass the wetness check and apply
bile_stink. Add a gas mask to the test dummy to cover all body parts.
2026-03-05 01:28:55 +04:00
Andrew Krieger 0215b26cce Rewrite all tests to clear map without touching character map memory, for performance. 2026-02-08 23:05:55 -08:00
mqrause 61d09a9703 Fix boomer bile EOC and remove !shouldfail test (#82593)
* fix boomer bile EOC

* remove !shouldfail test

---------

Co-authored-by: mqrause <martin@qrause.de>
2025-08-27 20:21:34 +02:00
ehughsbaird 06318fb1b4 shouldfail test for liquid projectile effect
For some reason, the goblin background causes this effect to be applied
with duration zero, resulting in a debugmsg. Make a shouldfail test to
exercise this failure until it can be fixed.
2025-08-06 23:59:42 +00:00
ehughsbaird 92066f2034 Silence 'tried to set non-permanent morale'
This does not fix the bug, but it prevents it from occurring in the
test.

The bug is due in some way to trait interaction, and can be trivially
reproduced by creating a world with magiclysm, selecting the goblin
background, stripping naked, and letting boomers take shots at you.
2025-08-05 23:21:06 +00:00
Fris0uman 55150dadcd Merge pull request #81954 from Fris0uman/nakednpc
Use naked prisoners for boomer tests rather than thugs
2025-07-21 22:52:24 -05:00
Fris0uman 8467569c7d Bump up number of boomer shots (#81931)
Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
2025-07-20 12:56:40 -07:00
Fris0uman 1055f5b046 Expand implementation of liquid ammo (#72271)
* Test: basic implementation of boomer bile gun

* Use breathability to measure protection against liquid ammo

* wip on_hit_effect

* Apllying effects on Bp is handled in the effect definition, no need for extra c++

* Let clothing_wetness_mult be 0 when checking for permeability

* Only pass the Bp hit to apply_effects_nodamage

* make bile field glowing

* replace boomer attacks with gun, tweak gun and rounds

* remove BOOMER and BOOMER_GLOW hardcoded special attacks

* on_hit_effects Doc update

Co-authored-by: GuardianDll <GuardianDll@users.noreply.github.com>

* remove reference to inexistant bounce effect

* add missing include

* update gun ammo and boomer to current json style

* fix boomer puking sounds

* give ammo to huge boomer and glutton

* fixes from review

* blinding bile

* only advanced boomer makes glowing bile

* Add test for ammo effect application

* clean up loading code

* add sections to test

* add boomer_head to gun dps data

* tidy up

* fix crash

* fix ammo effect that should be a flag

---------

Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
Co-authored-by: GuardianDll <GuardianDll@users.noreply.github.com>
2025-07-19 14:38:32 -05: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
osuphobia 60c265e76d Refactor ammo_effect_BOUNCE (#79035)
* make projectile_attack void,
add targets_hit to dealt_projectile_attack, and
record hit data in it

* tweak BOUNCE

* Apply suggestions from code review

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

* clang

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-01-10 17:48:30 +01:00
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
PatrikLundell c5c01140ba typified a bit of map.h/cpp + dependents (#76712)
* typified a bit of map.h/cpp + dependents

* demanded changes

* demanded master changes drawn to its conclusion

* second int should be in corresponding location
2024-10-02 23:34:12 -05:00
mqrause 4c69e47b2a change target_handler::trajectory to std::vector<tripoint_bub_ms> and then fix errors until it compiles again (#76671)
Co-authored-by: mqrause <martin@qrause.de>
2024-09-27 12:10:50 -07:00
PatrikLundell 4c6b91838c Removed one getlocal (#73940)
Co-authored-by: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com>
2024-05-25 16:18:25 -05:00
mqrause bd211963e6 move item_pocket::pocket_type to it's own header 2023-11-27 13:22:35 +01:00
John Bytheway e95a4fc9b8 Promote string_id constants to global statics
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.
2021-11-19 19:10:09 -05:00
Kevin Granade 7153384225 Prune some unecessary game.h inclusions 2021-08-27 09:24:15 -07:00
Kevin Granade 362a1f2bd8 Move critter_at() to creature_tracker 2021-08-26 08:55:28 -07:00
John Bytheway ebd549b300 Fix StringMaker ODR violations in tests
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.
2021-07-03 07:42:06 -07:00
Binrui Dong 9fdb7ef59c Run IWYU
* 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++
2021-02-06 00:18:41 -05:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
Kevin Granade 501f14189b Map reference migration part nine (#41717)
* Map reference migration part nine

* Downgrade avatar references to Character

Reducing inclusions of avatar.h and player.h
2020-07-01 14:14:36 +03:00
Kevin Granade 8185212260 Map reference migration part eight 2020-06-28 22:21:07 +00:00
KorGgenT efabc25ab0 update tests with new logic 2020-05-20 16:49:20 -04:00
John Bytheway b83fc88b9e Convert itype_id to string_id<itype>
itype_id is (presumably) one of the oldest type ids in the game.  In
particular, it predates string_id, and was simply a typedef of
std::string.

This is bad for type safety.

Make it be a string_id specialization instead, and update the rest of
the code accordingly.
2020-05-19 21:07:40 -04:00
anothersimulacrum e54f88c82b Add projectiles through obstacle test
The bug where projectiles cannot go through obstacles has come up at
least 2 times. Let's get a test for this so we can know before it
happens.
2020-04-17 21:10:48 -07:00