82 Commits

Author SHA1 Message Date
Tektolnes 3015a27a34 Partial dodge and limb shielding/deflection (#89470)
Co-authored-by: Maya Granade <kevin.granade@gmail.com>
Co-authored-by: Thelis Stambolliu <110344314+FarFarLakeSea@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-17 21:10:30 +01:00
Matthew Richmond 9020833ece Stabilize test state resets and highway debug logging (#88577)
* Stabilize test state resets and highway debug logging

* tests: widen melee damage tolerance

* ci: retry overmap coverage

* ci: retry shader compile
2026-09-08 15:08:34 +02:00
GuardianDll 96d084a1f7 Zombies and humanoid monsters in general have vital weakpoints 2026-06-06 19:29:12 +02:00
thaelina ecb7ed024c Tests
Removed x_max x_cur x_bonus accesses outside of setters and getters in the character namespace
2026-03-02 03:17:11 -06:00
Kevin Granade 110bff7cf1 Greatly increase DPS threshold to require adding a weapon to the DPS test
Also prune the melee weapon expected damage entries to match
Squish remaining entries into one file.
2025-10-21 16:04:11 -07: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
anothersimulacrum a76e405e74 Check DPS of all items with sufficient DPS
Also, only do it for DDA because magiclysm runs in the tests?
2024-06-18 23:52:47 +00:00
Fris0uman 5fa102a572 Enforce mon_ prefix for monster id (#72734)
* Test for mon_ prefix

* Replace LIXA_ with mon_

* deal with pseudo monsters

* Check for prefix in vanilla monster during data load

* better cpp

* fix hardcoded ids

---------

Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
2024-04-09 18:33:44 -04: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
mqrause 1f4efdbfd0 jsonize test data (#62024)
Co-authored-by: mqrause <martin@qrause.de>
2022-11-13 23:25:50 -05:00
nopenoperson 915705fbd2 Update effective_dps_test.cpp 2022-11-11 18:08:45 +01:00
Ezra Shaw ee4522b0bc update "expected_dps_test" for these changes 2022-10-09 15:52:09 +13:00
Aerin 3f63c448f6 Spears, spears, and more spears! A spear overhaul. (#61482)
* Preliminary spear changes

* add spear shaft item

* Add proper spear knife to tests

* spear shaft recipes

* Add more spears to test, adjust DPS numbers to run tests again

* reduce improper spear volume and weight to make them suck a bit less

* adjust a few tests, run em again

* Remove durable from copper spear

* remove parry back down to block

* Add all the recipes

* lower oil requirements for spear shaft by half

* fix the tests, hopefully the last time

* polearm flag for qiang and dory
2022-10-05 14:51:03 -04:00
anoobindisguise 3a06265be8 buff the stone spear (#61355)
* buff the stone spear

* Update effective_dps_test.cpp
2022-10-02 12:02:07 -04:00
the merchant 9c0cfeabde Kitchen Cleaver(s) damage adjustment (#60467)
* update kitchen_knives.json

changing values of bash/cut damage for both items.

* Update effective_dps_test.cpp
2022-09-03 07:47:44 -03:00
ANickelN e0b9547961 Audit To-Hit of Swords and Blades (#59656)
* Audit To-Hit of Swords and Blades

* Fix Tanto length

* Update effective_dps_test.cpp

* Lowered damage of Combat Saws

* Fix Zweihander

* Nerf Kukri

* Change Tanto Length again

* Fix Various Stuff

* Update effective_dps_test.cpp
2022-08-12 23:21:05 -03:00
ANickelN 91faee6493 Audit To-Hit Values of Kitchen Knives (#59599)
* Audit To-Hit Values of Kitchen Knives

* Update effective_dps_test.cpp

* Nerf Meat Cleaver to match Veg Cleaver

* Update effective_dps_test.cpp

* small description change
2022-08-05 13:56:52 -03:00
ANickelN cfbad93aa0 Audit To-Hit for Polearms (#59606)
* Audit To-Hit for Polearms

Most polearms were changed to have "neutral" balance, because while they may be long with a weight on one end, they are MEANT to be used for stabbing so it didn't seem appropriate to give them the "uneven" tag given that the description of the "good" balance tag says "Well-balanced for swinging or stabbing."

* Qiang is point not line

* Slight buff to most spears

* Update effective_dps_test.cpp

* Nerf Qiang

* Nerf Polearms a Bit

* Update effective_dps_test.cpp

* Nerf Survivor Naginata

* Update effective_dps_test.cpp
2022-08-03 22:06:11 -03:00
ANickelN cccfec2611 Audit To-Hit for Bludgeons (#59577) 2022-07-27 23:22:10 +03:00
Aerin 005f40fcab Nerf tonfa/baton damage, make tonfas autolearned. (#58910)
* Reduce damage of tonfas and batons and make tonfas autolearned.

* Update DPS tests

* Remove DURABLE_MELEE from wooden tonfa, make recipe a bit easier
2022-07-18 12:48:00 -04:00
mqrause 979718d90a change return type of Character::get_wielded_item to item_location (#58666)
Co-authored-by: mqrause <martin@qrause.de>
2022-07-09 02:03:09 -04:00
Aerin f97c81efda Wood axe and hatchet adjustments (#57370)
* Fix up wood axe and hatchet

* Update test
2022-05-04 11:27:14 -03:00
Aerin b73a2852b1 Give longsword some techniques (#57395)
* Update swords_and_blades.json

* Slight damage modification

* Update tests
2022-05-04 11:26:34 -03:00
Aerin 42c118bbba Kitchen knives and cleavers damage buff (#57204)
* Knives and cleavers

* Fix DPS tests
2022-04-28 10:42:07 -07:00
Aerin 76c4d025be Nailboard, 2-by-sword, nord, crude sword adjustments + fixes (#57147)
* Nailboard and 2-by-sword + derivatives adjustments

* Belt clip the swords, add budget steel to crude sword

* Fixed the expected DPS tests
2022-04-27 21:28:23 -04:00
avianArsonist fbd6e18572 Reduce length of staff sling, reduce damage to reflect length reduction (#56254)
* Shorten the staff sling and remove wood sawing
Reduce length, weight, and volume of staff sling
* Reduce bash damage of staff sling
* Changed effective dps test to reflect damage changes, pulled from the pull request's error logs
2022-03-26 15:35:18 -07:00
Anton Burmistrov 5e32b20761 Nerfed bashing damage of quarterstaff, staff sling, and bo (#55668)
* Nerfed quarterstaff and staff sling
* Nerf bo too
* Updated tests
2022-03-02 18:36:59 -08:00
Hymore246 dd3c572cfc Unarmed weapons are wearable and added wrist sub-limbs (#54313)
Co-authored-by: Dillon Matchett <dillon.matchett@gmail.com>
2022-02-16 16:45:13 -08:00
VarrenKrytor ead55d1ec1 Added Bō to weapons (#55033) 2022-02-12 10:02:14 +03:00
I-am-Erk 2eb7a4e00c Weakpoints as objects (#53486) 2021-12-23 20:41:10 -08: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
Eric Pierce a24cb498c0 Add more bolt-turning tools (#51936)
* Change existing "wrench" to "adjustable wrench"

Rename existing wrench to have a more specific name, in preparation of
adding several other kinds of wrench.

Also reduce existing wrench volume; steel density is around 8 g/ml.
Preserve original weight, but reduce volume.

Lowering the volume increased the wrench's effective density, making it
do slightly (~0.94) more damage per second, from 7 to 8 DPS. Adjust the
test case accordingly.

* Add new wrenches and wrenching tools

- cordless impact wrench - medium-battery-powered, for bolts or lug nuts
- locking pliers - can turn bolts (but not fine bolts), and clamp
- socket wrench set - regular or fine bolts, but not lug nuts
- socket screwdriver set - screws or fine bolts
- large adjustable wrench - large bolts or lug nuts
- small adjustable wrench - fine bolts only

* Add new wrench tools to various itemgroups

* Remove WHEEL_FAST from gunsmith kits and bionic

* Change vehicle wheel requirement to tools

Listing specific tools that can fasten a vehicle wheel allows the use of
charged power tools like the cordless impact wrench.

Including the WHEEL_FAST quality requirement is redundant in this case
and clutters the UI, but these three tools are now the only ones with
that quality.
2021-10-04 08:45:10 +03:00
Joshua Chin 142b56a492 Weakpoints (Part 2.1): Ignore weakpoints for item DPS calculations (#51404)
* Ignore weakpoints for item DPS calculations

* Increase epsilon between actual and expected DPS

* Fix bug with rapid strike calculation

* set effective_dps_test to use a test soldier

* Update zed_soldiers.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
2021-09-06 08:26:27 -07:00
Kevin Granade db4d92a523 Prune obsolete entities from before 0.F (#51309) 2021-09-04 13:01:22 -07:00
Fireiy aab58c00f9 Decrease copper axe volume (#50679)
* Update woodworking.json

* Update effective_dps_test.cpp
2021-08-13 22:22:20 -07:00
Binrui Dong 1e80860103 Update expected DPS values in test 2021-08-01 22:26:56 +08:00
somepersondunno e3ab44e0a3 Fixes melee weapon variant inconsistencies. (#49856)
* Fixes melee weapon variant inconsistencies.

Previously, the fake battleaxe had the wide technique while the legitimate version lacked it. Fake weapons should still break easily, but you should be able to do the same attacks with every version of a melee weapon so long as you possess the skills.

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2021-07-31 17:39:34 -07:00
Coolthulhu 4b3bc9eece Fix for accumulating sounds 2021-07-29 17:43:31 -07:00
anothersimulacrum 32ee90952a Fix clang-tidy function size warning (#50145)
Move all the SECTIONs to sub functions to make the clang-tidy function
size check happy.
2021-07-22 19:09:00 -07:00
anothersimulacrum 8717cb8a8e Improve DPS test behavior with GHA problem matcher (#50125)
The problem matchers with GitHub actions are meant to make seeing errors
in tests easier, without having to navigate through the somewhat clumsy
interface to find the errors.
However, because the CHECK does not include the name of the item, this
is still required.
Move the CHECK to be on the line with the item name, so it is not
necessary to go through the clumsy GHA interface.

This does mean the test will not print failures and the expected value
to stdout. I think that being more compatible with the GHA problem
matchers is worth making this slightly more annoying to manually run.
2021-07-22 18:25:32 -07:00
anothersimulacrum ef8144d972 Fix JSON errors, DPS test, partial proficiency test (#49779)
* Fix JSON errors, DPS test

Add a missing comma, two spaces between sentences, and fix the DPS
test.

The DPS test probably could use something more than just matching the
value, but that's all I'm doing for now.

* Fix partial proficiency tests

'practice_proficiency' was not practicing the correct amount due to
focus or other changes when this test was run in conjunction with other
tests.

Add a function to unconditionally practice a proficiency a certain
amount, and use it.

* Fix old-style monster death function
2021-07-09 15:01:15 -04:00
Salty Panda 29b322ebc8 Balance quarterstaff and sling staff (#49082)
* Balance quarterstaves

Remove durable melee, reduce discrepancies between quarterstaff and staff sling, add staff sling to quarterstaff martial arts, adjust quarterstaves according to wood density and recipe components' weight/vol

* Update dps tests for quarterstaves, add tests for sling staff

* Update data/json/items/ranged/slings.json
2021-07-08 19:56:32 -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
anothersimulacrum 525188723a Nerf baselard and bone shiv damage (#49514)
The baselard and bone shiv, when plugged into the effective DPS test,
produced expected values of 22.5 - 3.5 points above any conventional
knife. Drop the damage of the baselard to match other knives, and drop
the damage of bone knive to roughly 75% of that, as per GAME_BALANCE.md
on makeshift weapons. (I overshot a bit, but I think where it is is
fine).

Also, move the combat knife to sort the effective dps test knife section
again.
2021-07-01 17:38:51 -07:00
Binrui Dong 5ac071b656 Updated bagh_nakha expected DPS value (#48555) 2021-04-16 16:47:13 -07:00
souricelle 4a67b7ccc0 Remove Unarmed Weapon flags from bladed weapons (#48503)
* Remove Unarmed Weapon flags
* Tweak expected DPS for adjusted weapons
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2021-04-13 19:29:39 -07:00
Lamandus 5172bb5b4d Tweaks for Halligen bar and NY Hook 2021-03-02 11:59:03 +01:00
Binrui Dong 5150a4b764 Update expected dps of heavy flashlight in unit test 2021-02-22 15:56:08 -08:00