19 Commits

Author SHA1 Message Date
dobbry-vechur 19a0792a38 Camp item collection leaves the items it does not take
- erase only the items the chance roll takes in om_harvest_itm
- declare om_harvest_itm and mass_volume in faction_camp.h under talk_function
2026-10-31 02:09:36 +04:00
dobbry-vechur 07910a5d8c Meals take real time and give way to harm and orders
- a decision that acted keeps its move surplus or debt into the next turn
- dropped meals are never resumed
- a meal or fire cut short by harm or an order hands back to its task
2026-10-25 10:58:47 +04:00
dobbry-vechur 703084385f A task survives the NPC resting
- a task NPC lying down to rest keeps its task and backlog for afterwards
- stopping task in dialogue drops the one put aside
- a camp mission keeps the task a forage interrupted, not the forage
2026-10-23 18:25:20 +04:00
dobbry-vechur 9da01473ab A camp mission puts the worker's craft aside until it ends
- worker's task, or the task it walks to, waits while the worker is away
- mission hours count as neither moves nor task progress
- task put aside is saved with the NPC and dropped on import
2026-10-18 06:49:11 +04:00
dobbry-vechur aaf1aefa11 Camp meals give the calories they take from the larder
- camp meal gives the eater the calories and vitamins it takes from the larder
- refused personal meal goes back to the larder stock it came from
- food paid for a mission stays spent, eaten or not
2026-10-18 06:47:19 +04:00
dobbry-vechur 473a24966e Cache crafting inventory queries while listing camp upgrades
- opened query_cache_scope around the upgrade block
- added camp storage upgrade availability test
2026-10-03 22:24:22 +04:00
dobbry-vechur 2b5a0794b8 Name camp upgrade missions without recomputing upgrades
- added upgrade_mission_name helper
- name_display_of uses it for upgrade missions
- upgrade loop passes the known upgrade name
- added camp upgrade naming test
2026-10-03 21:15:08 +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
Procyonae 2711f5b105 Merge pull request #81506 from Procyonae/ParseTagsOnOmtAndCampNames
Basecamp fixes/refactor and allow tags/snippets in camp labels
2025-08-10 22:18:09 -05:00
ehughsbaird d9df73e19f Faction food supply can expire over time
Convert faction food supply tracking from a single set of nutrients to a
list of pairs of time_point, nutrients - this is the nutrients, and what
time they expire that. When evaluating food supply, discard any
nutrients that are expired. non-perishable nutrients use the special
case of calendar::turn_zero.

Food is consumed first from the soonest to expire entry, and only
consumed from the non-perishable stockpile once all perishable entries
have been consumed.

For simplicity, rot points are truncated to the most recent time point
that is zero mod 1_days (the nearest day), and all added foods with that
rot point are counted together.

Convert basecamp::camp_food_supply to simply supply calories from store,
addition must be done through the faction or by distributing through the
camp.

The impact of the "pantry" basecamp feature on food supply is no longer
counted, because rot is no longer being used to reduce calories added to
a permanent non-perishable store.

Dialogue can no longer modify faction camp food or vitamin stores
because there are no use cases. Because of the higher degree of
complication now, it would be better to be implement once a use case
emerges.

Faction templates can be defined with the full features, but it's very
opaque. This could be improved in the future.
2025-06-01 13:44:39 +00: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 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 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 1bdfcd014e made zones typed 2024-12-20 11:35:56 +01:00
PatrikLundell 5648f805dc typified a bit of map.cpp + dependents 2024-10-12 13:12:23 +02:00
RenechCDDA c5a6436b5d Set camp's owner during test 2024-02-24 02:18:01 -05:00
RenechCDDA 1b817a03a1 Faction camps store, track, and consume vitamins (#71546)
* Move to nutrients struct

* Placeholder default struct constructor

* et me compile for a moment

* Distribute food distributes vitamins

* Do better math with struct operators

* camp_food_supply returns a nutrient struct

* Move camp food supply functions to header

* PCs eating from the camp normally also consume vitamins

* Even better-er handling of food supply

* Oops, subtract calories when NPCs eat don't add

* Debug menu can see/modify vitamins in larder

* Reimplement saving/loading for camp larder

* better-er (de)serialization

* Squash compiler warnings for nutrients *= operator

* Remove accidental debugmsg

* Tests for camp vitamins (sorted declarations)

* Various clang fixes

* Factions load food_supply struct
2024-02-10 20:47:42 -06:00
RenechCDDA 614dd4122c [CR] Camp calorie test (#68127)
* Camp calorie test

* Pare it down and just access the item's components directly
---------
Co-authored-by: ehughsbaird <44244083+ehughsbaird@users.noreply.github.com>
Co-authored-by: David Seguin <davidseguin@live.ca>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2023-10-25 23:05:12 -07:00