183 Commits

Author SHA1 Message Date
Curtis Merrill 63be141baf remove inventory class and reimplement invlets under avatar
stash starting inv that doesn't fit

fix save load order

initialize string hint in android build to none

reuse free assigned invlet and move it

Update npc.cpp

Update character_inventory.cpp

Update src/avatar.cpp

Update src/npc.cpp

Update src/avatar.cpp

Co-Authored-By: dobbry-vechur <dumbkevin@proton.me>
2026-09-21 16:15:22 -04:00
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
RenechCDDA f4e1bee069 Remove dead ncurses code for dialogue window 2026-08-11 21:26:55 -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
salartarium 88a2c7aac9 Merge pull request #84102 from salartarium/typo1
A vs An NPC
2025-12-22 09:11:30 +01:00
RenechCDDA c048a5293d Merge pull request #82938 from RenechCDDA/small_refactor_npc_talk_test
Small cleanup in npc_talk_test
2025-09-19 13:42:43 +02:00
andrei 2cce541b4b math/tests: fix math tests for data types 2025-04-08 09:23:00 +03:00
marilynias 1271c8b08a Refactor and consolidate wield (#79719)
* refactor wield

* refactor wield

* rename wield_new, replace tests

* return early

* fix test and .h var name

* add unwield from game.wield
add_msg_if_player

* remove references to u.

* small fixes

* missing ;

* fix unwield

* fix test

* remove_old for compatibility

* wrong paranthesis

* correct wield_new

* use more wield_new, remove some reminder comments

* fix craft

* fix wielding from reloading

* remove commented out code

* rename weapon -> wielded

* IWYU

* fix wrong move cost
use correct wield for 'one of the bottles is wielded' test

* remove debug msg

* fix tests / clang-tidy

* I hate those tests

* fex 2/3 tests

* please let this be the last test

* clang-tidy

* apply some reviews, remove reminder comments

* re-work; overload item_location from item,

* fix missing item replacement

* fix using item after removing

* revert unecessary changes

* fix missed revert

* move steal check to avatar overload

* this time for real

* extend wield( item_location loc)

* fix

* forgot to do the actual wielding

* fix moves test, apply clang-tidy

* correct obtain cost, doc

* clang-tidy, cleaner conditional

* ordering

* move to std::optional instead of default

* fix optional

* fix 2

---------

Co-authored-by: marilynias <marilynias57+github@gmail.com>
2025-03-01 22:46:14 +01:00
PatrikLundell 0448b8953f Mapified pos_bub, posx, and posy in the talker class hierarchy (#79753)
* parking

* mapified pos_bub, posx, and posy in the talker hierarchy

* demanded changes

* demanded changes

* demanded changes

* fixed bugs

* implement virtual operation, make pos_x, pos_y absolute

* implement virtual operation, make pos_x, pos_y absolute
2025-02-24 07:54:55 +01: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
PatrikLundell 537d9d12a1 Standardized get/set pos operations for talker/creature class hierarchy (#79206)
* Standardized get/set pos operations for talker/creature class hierarchy

* sort out merge failure
2025-01-20 08:20:58 +01:00
PatrikLundell f14346c5db Rename map:: get_global->get_abs, bub_from_abs->get_bub, omt_from_abs->get_omt (#79167)
* Renamed map:: getglobal->get_abs, bub_from_abs->get_bub, omt_from_abs->get_omt

* astyle
2025-01-16 09:15:04 +01:00
Procyonae 40f0b39e62 Merge branch 'master' into RemoveStringInitialisingItems 2025-01-10 17:00:48 +00: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 befd4486d1 sundry typification (#78985)
* sundry typification

* demanded work around
2025-01-06 22:26:26 -06:00
RenechCDDA 43c2abf54a Fix some tests that relied on previous ordering, maybe 2024-12-21 02:22:39 -05:00
ShnitzelX2 7b59707239 clear basecamps for tests in clear_map()
fix test npc_talk_location
2024-11-24 13:43:47 -05:00
Anton Simakov cf579ac306 get rid of npctalk_var_ prefix for eoc variables (#77515)
* get rid of npctalk_var_ prefix for eoc variables

* cleanup after #77055

* deprecate more of type and context

* migrate item vars, make migration happen only once

* doc updates

* migrate u/npc/monster variables

* fix context var migration

* remove `substr( 12 )` in math parser

* move migration to a single function where possible

* no auto

* please clang

* Please clang more

* fix submap load test

* clean up after #77656

* cleanups after #77520
2024-11-16 22:58:03 -06:00
PatrikLundell f89a647c9c Converted coordinate_conversions.h usages (#76754)
* Converted coordinate_conversions.h usages

* missed to remove an 'inline'

* sorting out merge issues

* Update src/iexamine.cpp

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

* should alternate lines from the two sources in merge

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-11 22:33:47 -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
Holli 49ba2873a4 Move Zombie Bio Operators to No Hope (#76744)
* migrate bio ops to NH

* lint (i forgor)

* Update npc_talk_test.cpp
2024-10-02 23:32:56 -05: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
Anton Simakov 3234e8c628 Replace u/npc_has_var with compare_string (#76036)
* npc pass

* u_val and the rest of fixes
2024-08-30 21:36:17 -05:00
RenechCDDA c18d04f1c3 Follower rules UI: Hotkeys,focus follows selection, can close window by pressing close button.
Also fixed this in mission ui
2024-06-30 17:27:39 -07:00
Kamejeir d3ae4fd311 erk and knives (#73993)
* merger readability commit

* small kitchen knife

* large kitchen knife

* huge kitchen knife

* kitchen cleavers
2024-06-18 00:31:03 -05:00
Procyonae ea83940106 Merge branch 'master' into RemoveExternMoraleTypes 2024-06-09 12:45:20 +01:00
Procyonae b03844f927 Remove legacy npc_class id handling and extern list (#74354) 2024-06-07 10:13:38 -04: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
Anton Simakov 7f16ac8925 calorie related math effect (#73136)
* Add `calories()` math function

* add assigning function

* remove u_val version of the kcal checks

* replaces all instances of u_val('kcal') with new function

* document change

* fix clang tidy error

* Update src/math_parser_diag.cpp

Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>

* Update src/math_parser_diag.cpp

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

* resolve the rest of shiv, fix (potentially) few tests

* missed the zero

* remove percent calories assigning since you can't assign calories as percent anymore

* remove math kcal test because it's not a shim

* the way this test is made drive me insane

* i was told this can fix the test

* spare me

* now this one is my fault

* fix MoM using old syntax

* Do floating point math

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>

* get rid of magic number

* revert `Do floating point math` because i don't want static cast all the returns in the function.
better approach would be divide this function in two, one for raw value that return int, one for percent value that return double
or function that return healthy kcal directly

* add `-> double`

* Update src/math_parser_diag.cpp

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>

---------

Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
2024-04-22 23:05:34 -05:00
andrei 812a5e39c5 More idiomatic true/false EOC argument
Add true/false as mathematical constants, and use a double for the
true/false keyword argument.
2024-04-06 16:01:56 +00:00
anothersimulacrum 5c4c164c7c By default, EOCs train proficiencies normally
Instead of bypassing the normal training methods, by default train the
difference between the old value and the new value. If an argument is
added, revert to the old behavior (and allow silly things like negative
training).

This is scruffy and probably not very idiomatic for EOC stuff.
2024-04-06 06:19:45 +00: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
Maleclypse dedc16b89d Merge pull request #71141 from Brambor/iwyu
split-off `input_context.h` from `input.h`; run iwyu to always include `input.h` directly
2024-01-24 23:19:47 -06:00
andrei a481fd5a1d eoc: port time_since_cataclysm to math 2024-01-24 03:23:42 +02:00
andrei 94a546d3ae eoc: port time_since_var to math 2024-01-24 03:23:42 +02:00
Brambor 0e10f72171 iwyu: always include "input.h" & "input_context.h" directly; remove excessive includes
for all files that iwyu reports as (it should add or remove "input.h" or "input_context.h")
{
        add / remove "input.h" and "input_context.h" according to iwyu;
        remove everything iwyu reports to remove;
        while (doesn't compile) {add directly what needs to be added};
        /* note: thanks to indirect includes, we don't need to include most of what iwyu reports
        we obey iwyu only for "input.h" and "input_context.h", everything else is a suggestion
        if it doesn't compile without it */
}
2024-01-23 13:15:44 +01:00
Anton Simakov e1a15d9c60 remove TALK_TEST_ADJUST_VARS 2024-01-18 10:26:22 +01:00
Anton Simakov a80490e279 fight the old syntax 2024-01-17 23:00:31 +01:00
Anton Simakov 6fa0b0ed86 Arithmetic is dead. And compare_int. And compare_num. Kinda. Long live the math! (#70936)
* more math

* more math

* a bit more

* compare_int to be gone

* compare_int to be gone

* and more

* compare_num be gone

* arithmetic be gone

* lint

* fix stuff

* fix stuff

* revert u_val('power')

* jmathify and fix addictions

* Apply suggestions from code review

Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>

* migrate u_know_jaryi, mention talked_to_hub and know_jaryi should be ported to u_val

* revert item_rad RAD_DETECT

* replace the only place with spell level school; add to another place because i can

* "=" -> "=="

* Update data/json/npcs/TALK_TEST.json

Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>

* lint

* replace all addiction formulas to use same jmath

---------

Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>
2024-01-16 10:22:05 -06:00
I-am-Erk 924079e778 Many small logic adjustments and bugfixes for NPC targeting / threat assessment (#69840)
* Cleanup and small logic adjustments

rename memory function to match other caches
fix a small oversight with melee engagement
Adjust swarming range to use weapon ranges instead of arbitrary numbers

* missed a word

* astyle

* monster difficulty assessment adjustments

added armour calculations
added some special attack calculations

* fix? npc yo-yo behaviour when repositioning

* minor fix

* allow NPCs to pursue hit-and-run enemies

* astyle

* Change several NPC default settings

* don't pulp if far from player

* assstyle

* fix bugs, balance changes. The usual.

* pulping corpses seeks within engagement distance

* revert monster diff changes, for now

We can return here later but I want this PR done.

* update test

* fix two clang errors, one test left

* Update npc_talk_test.cpp

set tests to use a flag that's less likely to change. It is unlikely we'll set "forbid engagement" to default to on.

* Update npc_talk_test.cpp

* Update npc_talk_test.cpp

try disabling this line of the test because I have a headache

* Update npc_talk_test.cpp

* Update TALK_TEST.json

* Update data/json/npcs/TALK_TEST.json

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>
2023-12-02 11:25:53 -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
LISPCoC e0694d002c Add EOC condition: weapon category (#68044)
* weapon category condition

* add doc and test

* fix condition miss
2023-09-08 14:03:35 -05:00
Zhilkin Serg 7f91d0c939 Allow free selection of cataclysm and game start dates in new character menu (#67772)
* Added UI element to select and return time point

+ utilized it in debug menu

* Reworked scenario calendar

- removed `random` calendar entries from scenarion definitions
- allowed free selection of cataclysm and game start dates in new character menu
- updated UI in new character menu
- fixed start date related tests
- updated docs
2023-08-19 23:13:36 -07:00
LISPCoC 6ddada9273 Add some dialog function (#67120)
* add topic_item mutator, get hp_max

* format json

* doc update

* topic_item is string

* port hp_max to math
2023-07-26 14:19:55 -03:00
Dillon Matchett b3e4a9c90f embed context vars (#66321)
* embed context vars

* linting

* Additional stuff

* unit test
2023-06-21 07:48:43 -05:00