238 Commits

Author SHA1 Message Date
Fris0uman 06fbf8717c Obsolete and migrate cash cards (#89166)
* cash card empty, no money

remove money from cash cards in vanilla

* remove unused flags

* preserve cash card stacking test

* obsoletion and migration of cash cards

* Preserve money ammo type for aftershock

* no free threads sorry

* put money in the test data

* don't duplicate money ammo in aftershock

* fix unloading non empty components test

* fix for clang

---------

Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
2026-11-16 23:11:50 -06:00
ShnitzelX2 acf4fa9865 remove most uses of Character::get_item_position
including migration for longsalvage_activity_actor, modification of item_location_impl::item_on_person
2026-11-10 21:54:45 -05:00
dobbry-vechur 236d8fce0e An NPC that levels up while practicing says it stops
- message shows when the player can see the NPC
- empty practice craft disappears, same as for the player
2026-10-18 06:49:11 +04:00
dobbry-vechur cac1f2df7e Crafting helpers are announced once, when the craft starts
- working out success chance logs no helper message
- one helper check serves both message and success chance
2026-10-18 06:47:19 +04:00
Curtis Merrill 258b80d42b change visitable to item_location, remove item inheritance from visitable, and add item_location inheritance from visitable.
Co-Authored-By: dobbry-vechur <259678433+dobbry-vechur@users.noreply.github.com>
2026-09-30 21:34:09 -04:00
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
Curtis Merrill a9381f8785 move all crafting_inventory operations to temp_crafting_inventory class (#88606)
* move all crafting_inventory operations to temp_crafting_inventory class

* fix rebase errors

move some functions back to where they were

adjust operator=

use pseudo items and item_location in form_inventory

remove obsolete comment

* add pseudo item dedup

* check for empty item_location in visitable

* iterate over copies items as well

* pseudo item

* Update temp_crafting_inventory.cpp

* fix some compile errors

* Update craft_attention_test.cpp

* Update temp_crafting_inventory.cpp

* address clang_tidy

* dump non const

* Apply batched suggestions from code review

IWYU

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

* IWYU

* IWYU

* clang

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 22:09:02 -05:00
dobbry-vechur 054eb751eb Give every requirement check an explicit actor
- replaced the avatar fallback in quality_requirement::has with the passed actor
- gave can_make_with_inventory, check_enough_materials and the folded lists an actor
- classified the camp stock queries as actorless and the rest as actor-aware
- read the debug hammerspace trait from the actor rather than the player
- covered provider counting and intrinsic occurrences
2026-08-11 20:57:44 +04:00
RenechCDDA da2aaffffd Add quick setup option to clear map 2026-06-22 15:07:51 -04:00
dobbry-vechur 3085816323 Sweep step tools at completion via verifier
- add Character::verify_step_tools for non-charged step allocs
- hook activity_actor step boundary and pre-completion sweep
- hook craft_actualize_ready before passive charge debit
- drop active-step drift clause from consume_step_tool_targets
- redirect drift tests and add terminal completion case
2026-06-01 05:54:02 +04:00
dobbry-vechur c5a1b25679 Defer nearby-item inventory in craft step tool consume
- restrict active-step presence to bucket transitions and final drift
- lazy-build nearby inventory only when a map-sourced check needs it
- add mid-bucket and boundary-crossing test sections
2026-06-01 05:54:02 +04:00
dobbry-vechur da89c2734b Convert dry_meat to a stepped unattended recipe
- split dry_meat into active slice and unattended dehydrate steps
- move charged dehydrating_heat onto the dehydrate step
- set [67,5] batch savings per step
2026-05-23 16:21:26 +04:00
dobbry-vechur 632013cb2a Consume craft tools per recipe step
- store per-step tool allocations on the craft, serialized across save and load
- distribute root tools across active steps pro-rata by step time
- consume each step's tools over its progress, capped at the step total
- rewind the whole turn and abort start on a tool shortfall
- rebuild per-step allocations on continuation, preserving debited buckets
2026-05-22 22:19:04 +04:00
RenechCDDA cb924413e4 Move init_veh_status to an enum (oh god) 2026-05-17 23:11:41 -04:00
dumb-kevin d02ae80b5b Multimag: dedup shared external pool in inventory charges_of
- split charges_of_internal into scan + apply_external_pools
- apply_external_pools branches LEGACY vs MULTIMAG semantics
- multimag aggregate delegates per-tool feasibility to feasible_uses
- legacy aggregate sums local raw charges, adds UPS / bionic once
- multimag external pool routes via main, includes ground UPS
- inventory::charges_of scans every match into one entry list
- expose item::feasible_tool_uses for arbitrary external budgets
- add test_multimag_vehicle_welder TEST_DATA fixture
- cover multimag external pool routing, ground UPS, inventory dedup
- cover legacy USE_UPS dedup at charges_per_use 1 and 20
2026-05-05 12:21:19 +04:00
dumb-kevin aad1986200 Fix per-turn inventory rebuild for step recipe proficiency checks
Step recipes called proficiency_time_malus() every turn via
step_budget_moves(), which pulled book bonuses from
crafting_inventory(). The inventory cache was always stale
(invalidated by set_moves(0) earlier in the same do_turn call),
causing a full O(N^2) inventory rebuild per turn -- the same bug
pattern that was previously fixed for batch_time().

- Add crafting_cost_context struct bundling book_proficiency_bonuses
  and tool_speeds; require it on batch_time, time_to_craft_moves,
  step_budget_moves -- no implicit fallback, no hidden scans
- Add for_recipe() and for_proficiencies() factories so callers
  compute the context once at the evaluation boundary
- Add Character::book_bonuses_nearby() -- lightweight spatial query
  that walks map tiles and vehicle cargo in-place without copying
  items or running stacking logic
- Add map::for_each_reachable_item() as shared primitive for
  reachability/accessibility/ownership/vehicle-cargo iteration,
  eliminating semantic duplication with form_from_map()
- Thread required book_proficiency_bonuses through
  proficiency_time_malus, proficiency_skill_malus, and their
  wrappers so they cannot silently trigger inventory scans
- Cache crafting_cost_context in craft_activity_actor, recomputed
  only on speed/assistant/proficiency changes (5% boundaries)
- Precompute context in crafting GUI paths (availability cache,
  step display, recipe sort) to avoid redundant per-recipe scans
2026-04-06 03:31:23 +04:00
dumb-kevin 2209a4f7bb Add recipe steps and convert bread
Recipes can now define per-step time, proficiencies, tools,
qualities, batch savings, and activity level. Step recipes
enforce strict schema separation from root-level fields.

Bread split into mix / rise / bake with per-step proficiency
scope and exertion levels.
2026-03-17 21:43:31 +04:00
thaelina 5d867a29f8 Update crafting test to remove survival mess kit (#85570) 2026-02-28 10:48:06 +01:00
Maleclypse 361eedcd97 Merge pull request #85542 from dumb-kevin/feature/parabolic-solar-cooker
Add parabolic solar cooker (deployable, fuel-free heat source)
2026-02-27 21:30:55 -06:00
dumb-kevin c87d83dada Refactor solar cooker: realistic recipe, threshold, weight, deploy time
- Bump irradiance threshold from low (422 W/m2) to high (707 W/m2)
  to match real-world minimum useful cooking irradiance
- Split into two crafting recipes: mirror-panel variant (6h, fab 6,
  56 hand mirrors or 2 standing mirrors) and polished-metal variant
  (10h, fab 6, requires GRIND 2 from polisher/angle grinder)
- Both recipes require drill, more pipes (6), and fasteners (scrap 6)
- Switch from instant deploy_furn to construction recipe (20 min setup)
  matching the solar panel deployment pattern
- Adjust item stats: 5 kg -> 14 kg, 15 L -> 30 L, 80 cm -> 120 cm
  to match mid-range commercial parabolic cookers (SK-14 class)
- Update descriptions to say "faceted reflector panels"
- Add cloudy weather test, fix missing map_iterator.h include
2026-02-26 13:22:12 +04:00
dumb-kevin 479ef2a5a2 Add parabolic solar cooker -- deployable, fuel-free heat source
New NEEDS_SUNLIGHT item flag gates pseudo-item injection on solar
irradiance. Deployable furniture, vehicle part, recipe, and tests.
2026-02-26 13:01:40 +04:00
dumb-kevin e4bb943d3b Fix CI skip-detection job refs, Makefile parallel safety, and test tag syntax
- matrix.yml SKIP condition referenced non-existent job names
  (skip-duplicates, skip-duplicates-mods); corrected to match declared
  jobs (skip-duplicates-code, skip-duplicates-data). Same fix for the
  commented emscripten block.
- tests/Makefile batch runs now use --user-dir with a unique PID-based
  path so parallel shard execution doesn't collide on filesystem state.
- Normalized comma-separated TEST_CASE tags to space-separated across
  9 test files (25 declarations). Comma syntax is deprecated in Catch2
  v2 and removed in v3. Also fixed a missing space between adjacent
  tags in throwing_test.cpp.
2026-02-24 21:24:24 +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
Holli 202be00278 Remove some old armor (#83590)
* Remove some old armor

* fix tests maybe

* fix recipe maychance

* fix times

* Update crafting_test.cpp

* Update crafting_test.cpp
2025-11-06 06:51:08 -06:00
Holli 43bfdcc9f6 Merge pull request #82186 from Holli-Git/chitin_scale_mail
Chitin armor overhaul
2025-08-09 00:46:41 -05:00
Holli c867026db6 Audit minor crafting recipes existence (#81147)
* Remove a few silly recipes

* Fix error

* fix error
2025-06-03 15:25:22 -05: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
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
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08:00
moxian 73ec6e4584 Merge branch 'master' into iwyu-l-27 2025-02-11 10:40:53 -08:00
PatrikLundell 0ac675121c mapified a little item prompting a lot of vehicle 2025-02-11 15:10:00 +01:00
PatrikLundell 470e1312ee mapified a lot of vehicle stuff (#79611)
* mapified a lot of vehicle stuff

* fixed complaint, but properly
2025-02-10 17:25:39 -06: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 4fb5f14234 make some vehicle operations map aware (#79599)
* make some vehicle operations map aware

* hid names of unused parameters

* Update src/vehicle.h

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

* equality, not assignment

* demanded change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-08 22:06:31 -06:00
Procyonae 2a922a6c59 Appease our clang overlords
Failing to remember Z before a strikes again
2025-01-10 20:14:36 +00: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 046339a0ff Merge branch 'master' into typify 2025-01-07 15:57:25 +01:00
PatrikLundell 82d5b2d5d8 typified 2025-01-07 15:35:14 +01:00
Maleclypse 5278f1be19 Start making debug recipes for tests that can use them (#77749)
* Start making debug recipes for tests that can use them

* Fix maybe?

* fix the lack of id_suffix

* change EOL

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
2025-01-07 06:30:29 +01:00
PatrikLundell befd4486d1 sundry typification (#78985)
* sundry typification

* demanded work around
2025-01-06 22:26:26 -06:00
PatrikLundell fbbb1c8fe1 sundry typification 2025-01-06 15:20:14 +01:00
moxian 046dca5051 Add recipe name tests (+astyle) 2025-01-02 00:16:27 -08: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
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
Zhilkin Serg 3c8ec03bbe Remove thousands separators 2024-11-15 12:09:13 +03:00
PatrikLundell afb794bbc5 typified a bit of vehicle.h and dependents 2024-11-03 15:08:15 +01:00
Clarence "Sparr" Risher 1f96679fb7 Set owner for new appliances (#77211) 2024-10-29 12:11:39 -07:00
PatrikLundell 5648f805dc typified a bit of map.cpp + dependents 2024-10-12 13:12:23 +02:00