38 Commits

Author SHA1 Message Date
Matthew Richmond 19d85af769 Suppress spellbook preview learning messages (#88602)
* Avoid spellbook preview learning messages

* Format spell preview test
2026-09-09 18:51:50 -05:00
Matthew Richmond e9cd5cc2e7 Merge pull request #88586 from IcarusOfTroy/feature/suppress-spell-tab-warning
Fix false supernatural ability availability warning
2026-09-09 09:25:53 -05:00
RenechCDDA da2aaffffd Add quick setup option to clear map 2026-06-22 15:07:51 -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
andrei 70f9c26037 eoc: merge variable helper structs
and prepare it for generic_factory
2025-08-31 13:16:12 +03:00
Denis Solonkov 89dc10246b Allow swapping hotkeys in magic menu. 2025-06-20 21:01:41 +02: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
PatrikLundell 99aeb7b990 Load npcs and deal with their bodies 2025-01-25 09:49:42 +01:00
moxian f6c71bc5e9 update paths to moved docs 2025-01-14 12:39:38 -08:00
b3brodie 40c4342e8a Merge branch 'CleverRaven:master' into magic_type 2025-01-07 01:45:12 -08:00
PatrikLundell befd4486d1 sundry typification (#78985)
* sundry typification

* demanded work around
2025-01-06 22:26:26 -06:00
Bates Brodie 01def1e20a Add magic energy type field to magic type and add chronomancy 2025-01-05 22:46:45 -08:00
mqrause 8981dd679b use typed tripoints in magic.h and adjacent code 2024-09-28 05:28:58 +02:00
PatrikLundell ef6b53acfb typified a little bit of map.h + dependents (#76340)
* typified a little bit of map.h + dependents
2024-09-27 15:10:36 -07:00
I-am-Erk 0898a35860 Rename fatigue to sleepiness (#72708)
* Rename fatigue to sleepiness

I feel like this is going to break some stuff?

* seems my upstream was not up to date. fun.

* A few more I missed

* astyle, json style

gangnam style? Is that still a thing?

* docs

* rename fatigue.json

also catches a few bad f+r I missed

* Update itemgroups.json

* fd_fatigue --> fd_reality_tear

* Update data/mods/MindOverMatter/mapgen/microlab_rooms.json

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

* missed some fd_sleepiness

* fd_sleepines in tests

I really thought I got these already gr.

* Update doc/MAGIC.md

* some clang fizes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-04 20:36:46 -05:00
Binrui Dong 39a13c544f Fix clang-tidy error in magic_spell_test.cpp (#72067) 2024-02-29 11:48:30 +03:00
LetterShapedGlyphs 660d9608e2 Allow summoned creatures to leave without creating a corpse (#72005)
* No Free Lunch

Player summoned animals should not leave behind functional corpses.

* Missing Line

flag check

* remove extra not

woops

* Summoned Creature Tests

new debug spell and new test
2024-02-27 09:31:39 -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
Eric b411b72968 Allow spells to use dialog variables. (#64416) 2023-03-23 18:55:20 -07:00
Alexey a93bdcad64 Disable NPCs triggering spell learned achievements (#62984) 2023-01-05 23:01:02 -05:00
Fris0uman 51599d5088 Implement Daily health vs Lifestyle system (#57331) 2022-06-19 17:07:54 -07: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 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
KorGgenT 37222e361e Refactor spell_type to use a shape enum for spell aoe 2020-10-05 01:19:13 -04:00
Eric Pierce b5395f599e Tidy up permanent spell effect test 2020-09-02 21:23:17 -06:00
Eric Pierce 7aab3f1c9f Indicate permanent-duration spells in spell info
Spells with the PERMANENT flag now show "Duration: Permanent" in the
spell info panel, instead of incorrectrly showing a limited duration.

Spells with the PERMANENT flag fall into two categories:

- Item-spawning, which can only be truly permanent if spell is max level
- Monster-summong, which can be permanent at any spell level

This commit displays "Permanent" duration only if the spell fits one of
those two categories, and includes a test case of both contingencies
using duration_string with both item-spawning and monster-summoning.

Clarify MAGIC.md documentation for the PERMANENT flag in this regard.
2020-09-02 17:21:41 -06:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
anothersimulacrum 5e8dc9071e Remove magic and enchantment includes in Character (#42680)
In an effort to speed up build times, replace that variables that use
these with pimpl<T>s and remove the headers.
2020-08-03 16:41:02 -07: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 cf21972870 Global reference migration part 21 (#41942) 2020-07-08 09:26:50 +03:00
ZhilkinSerg 7264a72dfa Use constant references in function parameters 2020-05-29 11:01:28 +03:00
ZhilkinSerg 01596cf799 Rename magic_energy_type and make it a class enum 2020-05-29 11:01:28 +03:00
ZhilkinSerg d327e413bb Remove redundant empty lines 2020-05-25 15:00:17 +03:00
Eric Pierce 0f2bcab0a7 Add test spells (json) and spell tests (cpp)
Test spell functions and effects with fake spells in the `TEST_DATA` mod.

Exercises these functions:

- spell class:
  - name
  - exp_to_next_level
  - get_level, set_level
  - damage, range, aoe
  - duration_string
  - cast_spell_effect

- spell_effect class:
  - target_attack
  - spawn_summoned_monster
  - recover_energy

Related JSON data:

- name, max_level
- min_damage, max_damage, damage_increment
- min_duration, max_duration, duration_increment
- min_range, max_range, range_increment
- min_aoe, max_aoe, aoe_increment
- effect, effect_str
- base_energy_cost, energy_source

Also fixes a potential infinite loop in spell::gain_levels when attempting to
reach the maximum spell level.

Co-authored-by: Curtis Merrill <curtis.r.merrill@gmail.com>
2020-05-09 16:00:19 -06:00