60 Commits

Author SHA1 Message Date
Antti Riikonen adbc2d35d2 Run tests in CI for multiple sets of mods (#83242)
* Tests are run once for each mod set

* Remove the --mods from build matrix param and add it to test invocation

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* In tests, eoc_selector cancels or selects 1st item

* Return a simpler lambda early instead if we're in test mode

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* Update .github/workflows/matrix.yml

* Add custom event send function support to check_memorial

* Fix npc_talk_test sender

* Fix stats_tracker_test sender

* astyle

* May it please the IWYU

* stats_tracker_count_events test: clean up any existing mobs before test

* stats_tracker_count_events test: well why don't we clean the whole map instead

* stats_tracker_count_events test: just nuke the world

* Apply suggestion from @Maleclypse

* Apply suggestion from @Maleclypse

* I guess spawn_test_monster lives in map_helpers_tests.h now

* Wy u iwyu

* Update matrix.yml

* Update matrix.yml

* More XE test fixes: golem weight, remove plantkin_parchment from known bad uncrafts

* Nutrition info and repair info tests use their own test items

* Appease clang-tidy

* Replace nether cult cabin headless corpse with headful due to mystery test failures

* Strix talons don't need NAILS as prerequisite

* Add Xedra field office to terrain coverage test whitelist

---------

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
2026-08-26 19:54:43 -05:00
John Candlebury e44e0aa8ad Two new aftershock achievements (#87628)
* Two new aftershock achievements

* Apply suggestions from code review

Co-authored-by: np4Huk <22.valiant@gmail.com>

---------

Co-authored-by: np4Huk <22.valiant@gmail.com>
2026-06-18 23:21:23 -05:00
dumb-kevin 019523ac20 Pass sort comparator pairs by const ref, NOLINT enumerate iterator pair
- creature_names_sorted comparator in debug_menu now takes pairs by const reference
- enumerate_as_string iterator pair stays by value with NOLINT; idiomatic for STL-style templates
2026-05-09 10:02:28 +04:00
dumb-kevin 77a999f2fa Mark TU-local helper templates static
- use_amount_stack template in map.cpp is only used inside the TU
- npc_pickup_from_stack template in npcmove.cpp is only used inside the TU
- silences misc-use-internal-linkage
2026-05-09 10:02:28 +04:00
RenechCDDA d5dd0ce23c Dermatik birth just plain kills you 2026-02-03 15:13:08 -05:00
ehughsbaird cedd8af571 Display time with months instead of seasons
Split the 364 day year up into months as so:
The seasons are
Dec, Jan, Feb, Mar -> Winter
Mar, Apr, May, Jun -> Spring
Jun, Jul, Aug, Sep -> Summer
Sep, Oct, Nov, Dec -> Autumn

The first month of each season has 31 days, and the first day of each
season is on the 20th of the first month (the last day on the 19th of
the last month).

For season settings other than 364 days, season display is broken and I
need to consider how to implement this correctly.

Some additional logic was needed for the year transition correctly on
Dec 31 -> Jan 1, because turn_zero is the first day of Spring.

The calendar code isn't too gross, but is still gross.
2025-08-05 14:25:08 +00:00
Procyonae 703cc90a71 Remove STATIC() macro (#81780)
* Remove STATIC macro a-f

Fixes a typo in character_armor where a damage type was somehow being implicitly cast to a bool?

* Remove STATIC macro g-i

Trusts a post 0.H todo comment to do with cables, the PR was huge so I'm just hoping this got migrated properly

* Remove STATIC macro j-z

* Remove make_static.h includes

* Cleanup

* Remove STATIC macro /tests

* Remove comments yesterday me left for today me

* Update clang for STATIC macro removal

* Cleanup round 2

* Cleanup round 2

The A-Z before a-z thing gets me every time >-<
2025-07-15 13:29:50 +02:00
Procyonae aa0d09aec1 Change u_profession condition (#81680)
* Change u_profession to f_has_profession, update EOCs, remove redundant context val

Remove a couple of other unused redundant context variables while I'm here

* Update /tests events
2025-07-14 14:48:06 +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
Standing-Storm 2a219fe7ea [MoM] Add hitting Nether Attunement 5 and Nether Attunement 11 to the list of things that call for concentration checks (#78770)
* Initial commit

* Remove debug message

* Add limit calculation EoC to base maintenance check

* Update src/creature.cpp

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

* Fix tests?

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-26 13:07:07 -06:00
Francisco Machado 151086c0b5 Add ``gains_proficiency`` event (#70194)
* create gains_proficiency event

* add event trigger

* Update EFFECT_ON_CONDITION.md

* updated memorial test

* retrigger checks
2023-12-14 07:53:38 -06:00
John-Candlebury fb8981a174 Aftershock combat drugs 2023-12-08 12:56:00 -06:00
Anton Simakov e920b6881b [Xedra Evolved] Revamp spell learning system (#69586)
* fix unobtainable alchemy 5

* initial commit

* finished bits

* make EOC_XE_ALLOW_GIVING_CLASS has a proper id

* add exp gain to perpetual spells

* Thank you, Mal

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* Update data/mods/Xedra_Evolved/snippets/dreams.json

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* more magic potential conducts, redo the EoC for small performance win (i hope so)

* wtf why riddles are in vanilla

* better riddles

* comparing instead of assigning

* satisfy analyze-text-changes

* move EOC_NONE from examples to generalized EoCs

* update math syntax

* magic potential from tainted mind

* fix improperly given dreamsmith sequence

* prevent constant grow of magic potential from ps

* tweaks tweaks tweaks to make it work

* fix some stuff, make few failsaves

* update formula, simplify thing a bit

* document code changes

* 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>

* Make it less easy to obtain the spell

* Update doc/EFFECT_ON_CONDITION.md

* Update doc/NPCs.md

* syntax error fix

---------

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-03 22:24:15 -06:00
LISPCoC 725161a038 [EoC] Some monster and map related update (#69405)
* monster eoc

* update

* test

* passable_only
2023-11-16 22:36:01 -06:00
John Candlebury 93ab0f982e Isolation Protocol: Perks for all starting professions (#68251)
* Only display hurt message if an effect actually hurts.

* Gain effect event captures affected bparts

* Perks for all starting professions

* Astyle code

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

* Dot Spacing

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-23 21:27:32 -05:00
cakepie 82b6ecba65 Update events to account for ability to swap avatars (debug or upon death) (#63488) 2023-03-21 18:57:09 -07:00
akrieger ec3f896d5b Convert places manually constructing JsonIn to FlexJson 2022-09-15 22:04:54 -07:00
David Seguin f51a26cd1f Jsonify addictions: promote add_type to JSON object 2022-04-17 13:18:55 -04: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
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
John Bytheway 551056f61a Improve messages for some JSON errors
Several of the top-level save files were not providing filenames with
their JSON error messages, because the filename was never passed to the
JsonIn constructor.  Arrange for it to be so passed, to improve those
errors and assist with debugging.
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
I-am-Erk 2f2c3c1a5a Rename skills and merge speech-barter (#44373) 2020-10-04 04:46:29 +00:00
John Bytheway d63d3bd35a Make mutation_category ids be string_ids
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.
2020-09-03 07:39:35 -04:00
Kevin Granade 675d9ae3a1 clear achievement tracker (#43060)
* clear achievement tracker

* Guard against rounding errors with Approx()

* Add requirements to wield test.

* Manually set margins for comparison

* Just accept minor variation in results

* Verify that behavioral needs are needed

* Fix oracle checks

* Clear temperature cache in behavior test
2020-08-21 10:02:37 +03:00
Kevin Granade 3888b13fac Clear global stats tracker in tests (#43042)
* Clear global stats tracker in tests

* Clear stats tracker in memorial test too
2020-08-20 10:22:48 +03:00
Fris0uman 98f32ab0a3 Replace some body_part with bodypart_id (#42677) 2020-08-16 16:16:05 +03:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
Kevin Granade bc9a51e384 Remove event_subscriber declaration from event_bus.h 2020-08-03 22:09:45 +00:00
Kevin Granade 8528491974 Make memorial test inclusive (#42558) 2020-07-30 20:32:53 +03:00
Kevin Granade 6d1841ac67 Precompiled Catch2 header (#42453)
* Hoist catch.hpp include to the top of files

* Precompile the catch header in tests
2020-07-29 01:28:26 +03:00
Kevin Granade 346d4c19fa Make several more members private in game (#42255)
* Make scent_map private in game

* Make timed events private in game.

* Make achievements tracker private in game

* Make memoial tracker private in game

* Make scenario variable private in game
2020-07-20 10:20:58 +03:00
John Bytheway 84c016c8d5 CI fixes 20200718 (#42262)
* Don't compare bool to int

This was giving a warning on Visual Studio.

* Make memorial test platform-independent

It failed on platforms with a different newline character.
2020-07-19 10:49:47 +03:00
Kevin Granade 1ea5556a41 Global reference migration part 32 (#42215) 2020-07-17 12:59:41 +03:00
John Bytheway 0e67554630 Migrate memorial logs to json
Change the intermediate form of the memorial logs (the thing that's
saved in the save directory, not the memorial directory) from plain text
to json.

Primary reason is to allow easier access to the timestamps from the log
as time_points, but also to reduce the amount of custom parsing code we
have in the game (eventually, once we can remove the legacy format).
2020-07-13 20:05:19 -04:00
nexusmrsep c876885a3a Blood overhaul (#41219)
* blood types
* new items distribution tables
* items: band-aids, IFAK, tourniquet  and bleeding stopping power adjustments
* json: obsolete BLEED flag
* docs: update info on effect on bleeding and vitamin counters
* debug menu tool for bleeding self
* obsolete BLOOD flag - more instances
* tourniquet and new bleeding interactions and UI
* unlock damage type bleeding
* allow negative vitamin rates
* blood and redcells loss pools as vitamin counters
* effects: hypovolemia, anemia, redcell_anemia, refurbished bleeding
* cbm: nanobots updated effect on bleeding
* new events for death from bleeding, hypovolemia or fatal loss of red cells
* pause will trigger putting pressure on bleeding wound
* hardcoded effects of hypovolemia, anemias, updated bleeding
* bleeding monsters lose hp, lost staunches bleeding
* obsolete monster melee bleeding, taken over by damage type bleeding
* update for special monster attacks in regard to updated bleeding
* updated NPC reactions to bleeding, hypovolemia
* debug menu bleed self update to upstream/master
* pressure on wound includes wield/broken/encumbered status
* iron deficiency anemia compromises redcells
* make hypovolemia pull water from body
* compact hypovolemia effects
2020-07-11 07:10:46 +00:00
Kevin Granade 3e5891a497 Break subject's leg first to fix formatting errors
Depending on test ordering, the broke an arm event test could fail, because it would ALSO trigger a message reporting that the "Maintain Structural Integrity" conduct was lost.
2020-07-07 18:23:04 -07:00
Kevin Granade 8f27fb597d Global reference migration part 15 2020-07-03 01:41:50 +00:00
nexusmrsep 8730abdbb4 New achievements etc. (#41438) 2020-06-26 21:48:46 +00:00
John Bytheway 7bf9730e3a Add total_time_played to game_over event
This is probably the most useful place to have such an event.
2020-06-11 07:58:05 -04:00
John Bytheway 6942ac56f1 Add events for game save & load and debug menu
These events are intended to flesh out the future game history browser
with useful information, including:
* Which versions of CDDA were used for a game.
* How much real-world time was spent on a game.
* What debug menu options were used during the game.

These seem like things people would be interested to see about their
past games.
2020-06-11 07:58:05 -04:00
John Bytheway 2ba981c8a5 Fix memorial test failures on Magiclysm
When Magiclysm is enabled some of the tests in memorial_test would have
unwanted side-effects which caused the test to fail, such as triggering
achievements.  Send some additional events prior to the test events to
flush out those side-effects and make the tests more reliable.
2020-06-08 07:58:03 -04:00
ZhilkinSerg 64dacad7b0 Merge branch 'master' into magic-achievements 2020-06-03 21:59:04 +03:00
John Bytheway b4c4df56a6 Add more to game_start event
We want the game_start event to record everything relevant about the
starting character (the sorts of things people expect to see in a
memorial log).

This adds some of those things:
* Name
* Grammatical gender
* Profession
* Game version
2020-06-01 09:38:30 -04:00
KorGgenT ff11969e85 create spell learning and forgetting infrastructure 2020-05-31 22:24:04 -04:00
ZhilkinSerg 339ac5c123 Make add_type a class enum 2020-04-13 15:07:09 +03:00
John Bytheway e189957ff2 Run IWYU 20200408 (#39364)
* Helper script to run IWYU

* Run IWYU

* Update deprecated headers

* Run IWYU again

* Re-suppress cxxabi.h

This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.

* Remove extra SDL header includes

* Fix ime.cpp headers

Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.

* Update game.h

* Move new point.h includes inside #ifdef

* Re-add platform_win.h to mapsharing.cpp

* Apply suggestions from code review

Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
2020-04-10 12:16:19 +03:00
Kevin Granade bb37aa18d5 Hotterfix memorial test. 2020-04-03 00:55:57 -07:00
ZhilkinSerg 0d68ac8f51 Hotfix memorial test 2020-04-03 09:53:19 +03:00
klorpa c8bc8d8fa4 Spelling/Punctuation Fixes (#38885) 2020-04-03 00:49:01 +03:00