115 Commits

Author SHA1 Message Date
ShnitzelX2 b1f8d667ca remove Character+outfit::i_at(int)
along with Character::use(int), Character::takeoff(int), Character::wear(int)
2026-11-10 21:54:47 -05:00
dobbry-vechur 2d2dfcb788 Wearing a garment survives an event that removes it
- wear skips on-wear effects for a garment an event removed
- wear reports success when event removes the garment
2026-10-17 21:18:11 +04:00
Curtis Merrill f6a37c3d41 add additional avatar inventory checks in eoc test 2026-10-15 16:14:56 -04:00
Kai Maier 8baf4ada8a Removed the dead MARLOSS and MYCUS flag from the docs
The tests `repeat_marloss_consumption` and `marloss_consume_dispatches_repeat_consumption` should cover the new EOC's
2026-09-24 19:10:29 +02:00
Kai Maier 57d2a3a010 - Moved the marloss and mycus stuff to EOC's
- Since the marloss stuff did a lot of stuff i had to add a few new affects to not change the old logic
- These include: u_add_addiction, u_lose_addiction, u_vomit (that one is evil :o ), u_fall_asleep, u_heal_all, u_hurt_all, u_set_hunger, u_mod_healthy, u_fil_stomach, u_marlossify (i went of the name already existing for that) and u_add_memorial
- I also added what they do to the documentation EFFECT_ON_CONDITION.md

- The reason for that is that the callback functions that triggered the effect on eating a seed or beery were not called anymore aka dead code

- I also saw that the EOC's for the addictions already existed and used those.
- This allowed me to remove the old / dead code from the iuse.h and iuse.cpp. Same thing in the item_factory.cpp

- The f_map_is_passible function in condition.cpp is supposed to make the spores skip walls like the old code does

- Ah yes and a few tests so i dont go insane testing it manually

- I am also very thankful (!) to the Magiclism and Mind over Matter people since i was able to use that as a reference
- Also whoever made the Docs is amazing too!

This took in fact 9 hours of my life... just for anyone wondering

Changes after feedback:

Fixed the janky broken map logic i created to keep the iuse rng logic
Removed the boolean parameter for vomit and marlossify since it did nothing
Moved the daily_health and hunger assertions to math like suggested
Fixed the eating order issue and now it uses a MARLOSS guard in the can_eat function like suggested
Renamed the NPC_AUTOCONSUME flag to MARLOSS to better reflect the actual usage
Adjustd my existing tests and also added for the order of eating and blacking out. This now uses the time_in_future to keep it in a safe order
Also added a test for the marloss refusal
Added tests in for the new hunger and daily heath math parsers
2026-09-24 19:10:29 +02:00
RenechCDDA 8092790257 Move NPC spawntime to region settings 2026-09-11 19:45:25 -04: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
Fris0uman 8351742905 Disentangle activation and consumption (#76920)
Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
2026-01-05 00:26:13 +01:00
andrei 140271fd07 eoc: use typed variables in run_eocs 2025-09-03 16:13:13 +03: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
andrei 2cce541b4b math/tests: fix math tests for data types 2025-04-08 09:23:00 +03:00
andrei 6310f89df9 npctalk: fix run_eoc talker selection by location 2025-04-08 09:23:00 +03:00
andrei 6fab5638f1 eoc: replace u_loc_relative with u_location_variable 2025-04-04 20:03:31 +03:00
PatrikLundell eb510cc185 converted item_location and computer to use absolute coordinates (#79733)
* converted item_location and computer to use absolute coordinates

* demanded change

* demanded change
2025-02-20 07:48:00 +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 e2f7aaf95f Modernize c headers (stddef.h -> cstddef &co)
Code size:
includes:
$ cat obj/tiles/*.inc | wc
 278247  556494 17375710
$ cat tests/obj/tiles/*.inc | wc
 163745  327490 10307041

post-processed source (clang -E):
./make_preproc.sh src/
65903054 170378741 2049783477
./make_preproc.sh tests/
38434408 100326802 1215849078
2025-02-10 13:56:09 -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 278c26a11d Convert some vehicle operations to be map aware (#79477)
* Convert some vehicle operations to be map aware

* Oops, forgot to carry the parameter through

* removed unused operation
2025-02-03 07:54:29 +01: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
PatrikLundell af4d7228ad typified stuff 2024-12-24 12:32:43 +01:00
RenechCDDA 43c2abf54a Fix some tests that relied on previous ordering, maybe 2024-12-21 02:22:39 -05:00
PatrikLundell c380147ab2 typified creature.h and monster.h (#78565)
* typified creature.h and monster.h

* Update src/monmove.cpp

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

* Update src/monster.h

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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-16 22:16:00 -06:00
PatrikLundell fbf71a0f66 typified game.h and .cpp 2024-12-07 15:55:25 +01:00
PatrikLundell c4c4fea51c typified half of game.h (#78357) 2024-12-06 10:52:58 -08:00
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
Anton Burmistrov bb2c4ca9a7 Merge pull request #77941 from GuardianDll/more_eoc_fixes
mics eoc changes
2024-11-21 12:50:52 +04:00
andrei 2360b0f097 tests/eoc: use standard NPC 2024-11-20 16:03:26 +02:00
GuardianDll 538c5a438b please clang 2024-11-18 11:55:40 +01:00
GuardianDll 82dbe68d7e mics eoc changes 2024-11-17 15:32:54 +01: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
andrei 36e59beec3 eoc/run_eocs: add test for talker mixes 2024-10-27 08:25:49 +02:00
andrei b1797fec4e eoc/run_eocs: don't allow queue+loop in one invocation 2024-10-27 08:25:49 +02:00
Anton Simakov f633a1b9a9 Unify all run_eocs in a single eoc function (#77000)
* Unify all run_eocs in a single eoc function

* add test suite

* fix typo

* handle condition better

* Simplify code, move few big stuff into it's own functions

* fix incorrect return

* fix mistakes that prevent eoc from firing

* rename iteration to iterations

* reflect changes in documentation

* change iteration to iterations in json

* please clang
2024-10-24 23:15:46 -05:00
ShnitzelX2 d32b8382b8 eoc_test misusing name
-events use Character::get_name(), not Character::name
-this worked by coincidence; get_name() returned name OR play_name, but NPCs never have custom names
2024-10-18 11:42:50 -04:00
PatrikLundell 128e94132b typified a bit of map.h/cpp + dependencies (#76795)
* typified a bit of map.h/cpp + dependencies

* demanded changes

* sorted out merge mess
2024-10-06 22:42:35 -05:00
mqrause c8bf0e31f2 typed tripoints in iexamine functions 2024-10-03 13:50:01 +02: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
mqrause 4c69e47b2a change target_handler::trajectory to std::vector<tripoint_bub_ms> and then fix errors until it compiles again (#76671)
Co-authored-by: mqrause <martin@qrause.de>
2024-09-27 12:10:50 -07:00
Maleclypse 1b831d8b3d Merge pull request #76326 from PatrikLundell/WaterPurification
Code fix for #71971 Water purification tablets only purify up to 4 water each
2024-09-12 10:33:28 -05:00
PatrikLundell ab062c5e8b typified a bit of map.h/cpp + some dependents (#75125)
* typified a bit of map.h/cpp + some dependents

* Macro crasher found by one compiler!

* demanded changes

* stupid wokaround for demanded changes

* Sort out conflict mess
2024-09-10 09:42:54 -05:00
Maleclypse 927ac7ba50 Merge branch 'master' into WaterPurification 2024-09-06 13:27:28 -05:00
Anton Simakov 2db2a2ea19 Second nail into the battery coffin (#75865)
* update batteries

* migrate all removed batteries, clean up

* sprinkle occasional batteries in boxes around the world

* fix density test fail

* fix wrong chemistry on some batteries

* obsolete medium_disposable_cell, replace current medium_battery_cell(D battery) with modern 18650 battery

* fix redefinition of 'itype_medium_battery_cell'

* remove light_disposable_cell, change the names and descriptions of baterries to match what they are

* migrate light_disposable_cell, astyle battery density test

* fix test failures

* swap battery to please ups crafting test

* swap ids for tool batteries to make more sense (and not replace all ids in the entire game)

* migrate removed vehicle parts, fix unreachable cell recipe

* fix missed afs battery
2024-08-26 12:43:26 -07:00