52 Commits

Author SHA1 Message Date
RenechCDDA da2aaffffd Add quick setup option to clear map 2026-06-22 15:07:51 -04: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
Andrew Krieger 0215b26cce Rewrite all tests to clear map without touching character map memory, for performance. 2026-02-08 23:05:55 -08:00
Holli 3dbab0f9ed Recontextualize atomic powered tools (#83244)
* Remove atomic stuff

* lint

* lint2

* fix tests (hopefully)

* fix tests more

* fix tests

* fix tests

* fix afs
2025-10-10 23:29:16 -05:00
marilynias 2669961799 Allow reading ebooks when its dark from most edevices (#81157)
* ebooks can be read in dark

* apply flag on contents change

* add test

* rm dup check, add comment

* correct flag usage

* iwuy

* ordering

* ordering 2

* ordering 3
2025-06-10 22:55:12 -05:00
marilynias ad08f7e6d8 Allow [R]eading from nearby ebooks (#80508)
* allow nearby efiles selector

* allow reading eboks from adjacent tiles

* add safety checks

* fix safety

* obtain ereader if not ALLOWS_REMOTE_USE

* fix sanitycheck

* add test

* ordering

* includes

* missing quote
2025-04-08 14:46:41 -05:00
PatrikLundell f9900fccc2 Merge pull request #79670 from PatrikLundell/mapify
mapify: split ammo remaining into link and non link
2025-02-16 14:49:56 -06:00
PatrikLundell 7bfa56fa99 Merge branch 'master' into mapify 2025-02-13 08:46:56 +01:00
PatrikLundell 0ac675121c mapified a little item prompting a lot of vehicle 2025-02-11 15:10:00 +01: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
ShnitzelX2 a594545fa7 replace software, e-book functions with e-file
item categories for software, files
2025-01-24 12:26:12 -05: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
PatrikLundell 580e60acc3 typified item.h + cpp 2024-11-25 14:44:12 +01:00
Procyonae fa1e64ec8f Remove the redundant includes bc I were just being lazy 2024-06-05 11:38:35 +01:00
Procyonae 47eb971c97 Forgot /tests 2024-05-31 21:48:49 +01:00
Binrui Dong fa907827f1 Enable clang-tidy check readability-duplicate-include (#71826) 2024-02-19 17:09:24 +03:00
Anton Simakov 466042af77 Remove rags (#71411)
* remove rags

* migrate rag to cotton sheet
2024-02-01 20:09:02 -06:00
random-cdda-modder e6983be8ae Fixes #71315. Add ereader power consumption to read_activity_actor. 2024-01-29 23:47:29 +02:00
mqrause bd211963e6 move item_pocket::pocket_type to it's own header 2023-11-27 13:22:35 +01:00
andrei 0e78201e6c character: fix fine detail vision (#67295) 2023-07-30 19:53:43 +03: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
anoobindisguise 18fe8ad6ea rework read time formula (#65280)
* rework read time formula

* rework the formula again

* fix

* again

* hopefully fix int related issues

* fix the test

* more test fixes
2023-05-18 08:02:01 -03:00
Alexey 7afa062d96 Make read_activity_actor accept time_duration 2023-04-23 04:16:01 +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
Fris0uman 9c66556e71 Replace time as int with time_duration (#59079)
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
2022-07-16 19:21:32 +03:00
mqrause d688521e7b Character::i_add returns an item_location (#58191)
Co-authored-by: mqrause <martin@qrause.de>
2022-06-18 21:27:30 -04:00
KorGgenT 99a62861eb Create wrapper for worn items called outfit 2022-02-27 23:44:51 -05:00
David Seguin 427c1c6825 Jsonify Limb Scores & Character Modifiers (#53069)
* Use generic text function for displaying limb encumbrance effects

* Partial jsonification of limb scores

* astyle and json style corrections

* Generate modifier descriptions + Scroll info box

* Partial jsonification of character modifiers

* Style corrections + Add character_mod to translation

* Remove unnecessary static string_id's (clang-tidy)

* Documentation - limb scores and character modifiers

* Switch over to new string extraction system

* Add unit tests for limb scores and character modifiers

* Clang-tidy: use proper string_id name

* Post-merge fix: L comes before Q

* Post-rebase cleanup: new fields / new scores / changed modifiers

- New fields for `character_mod`: "override_encumb" & "override_wounds"
- Migrated new "footing" limb score
- Modified "melee_stamina_cost_mod" to force lift score to be affected by encumbrance
- Updated documentation

* Unhardcode body parts whose encumbrance affects dodge

* Fix reference to non-reference
2021-12-03 22:25:07 -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
Venera3 d1de0e6680 Astyle 2021-10-17 16:24:23 +02:00
Venera3 7fc9beed59 Give the poor dummies eyes 2021-10-17 08:58:52 +02:00
Eric 51520f6245 Move more player to character (#50971)
* player to character

* Update npc_talk_test.cpp
2021-08-23 00:58:51 -07:00
I-am-Erk 4814255da0 Tweaking skill rust to fix learning overall (#50176)
* better learning!
phase 1: Track highest xp ever reached, recover rust faster if you are below it, and also gain xp while you regain rust.
increment highestlevel if your highestexperience gets there.
* books only train theory
* rename "highest" to "knowledge" save confusion in long run
* recipe requirements can be theory based
* Books increase theory
and your ability to read a book is based on your theory level
* rust rate drops as you accumulate rust
* make book larnin' show theory experience
Run rust once per day, not at random times. Change the amount of xp lost instead of the frequency you do rust. It's a lot easier to calculate.
* book theory gain falls off as level gap increases
* NPC skill affects their teaching

Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2021-08-11 19:09:59 -07:00
Saicchi 3b0d1fdd13 ebook reading tests 2021-07-31 16:39:38 -03:00
Saicchi ac81446087 Move ACT_READ from activity_handler to activity_actor (#46304)
* act_read initial body

Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: Binrui Dong <brett.browning.dong@gmail.com>

* convert act_read into an activity_actor

* update reading tests

* act_read minor fixes

* rebase act_read to experimental build 2021-07-17-0839

Co-authored-by: Saicchi <Saicchi@users.noreply.github.com>
Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Co-authored-by: Binrui Dong <brett.browning.dong@gmail.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2021-07-18 08:38:29 -07:00
John Bytheway 8cc6378fc5 clang-tidy modernize-use-emplace (#48661)
* Port code to emplace_back

This is clang-tidy making automated changes to convert push_back into
emplace_back whenever the argument to push_back is either a constructor
call for the type in question of an expression of a type implicitly
convertible to the type in question.

This should eliminate one move-construction of the inserted object for
each call.

* Enable clang-tidy modernize-use-emplace
2021-07-03 07:42:06 -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
sacrificerXY 3ba8909324 Add avatar::clear_identified() 2020-12-07 16:54:59 -08:00
sacrificerXY 0bba9ec092 Add new helper function get_book_mastery (#45475) 2020-11-28 10:28:39 +03:00
sacrificerXY 8d66860af1 Update reading tests
- Use identify() instead of do_read()
- Use Character dummy instead of avatar where appropriate
- Incorporate code review changes
2020-11-18 17:27:26 +08:00
Aivean c32a629ceb replace all item flag constants with static string_ids
remove adapter has_flag (and related) methods that took string argument
change all remaining method signatures where item flags were passed as strings
2020-10-18 19:56:40 -07:00
I-am-Erk 2f2c3c1a5a Rename skills and merge speech-barter (#44373) 2020-10-04 04:46:29 +00:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
Fris0uman 10e6058207 Remove body_part from effect (#42277)
* Effects use bodypart_id
* remove default value and unecessary overrides
* effect_map use bodypart_str_id, and replace num_bp with bp_null
2020-08-01 22:45:04 +00: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
Fris0uman 68e91cfe72 Move encumbrance to bodyparts (#41860) 2020-07-08 09:37:37 +03:00
Valiant 4bc615e53a Fix reading test 2020-05-14 11:32:53 +04:00
KorGgenT e879fcd328 more test fixes 2020-05-02 16:05:11 -04: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