- fire goes only in a hearth: fireplace, stove, brazier, fire ring or clay oven
- fuel is the NPC's own burnable firewood, or firewood or tinder in the hearth it may use
- a hearth that is a firewood pile, busy, off-limits, unburnable or full is skipped
- removed XOR practice factor from trap move cost
- moved trap move cost into place_trap_actor::data::move_cost
- added move cost test for practice, skill and proficiencies
- invalidate carrier inventory after countdown_action fires
- drop_invalid_inventory then walks parent pockets via overflow
- result moves to first fitting ancestor pocket or to the ground
- added countdown-transform test item in TEST_DATA
- regression test covers spill to ground and stay-in-place
- gate iuse_transform::can_use on parent-pocket fit for the new item
- check character, map, and vehicle parents via try_form_loc helper
- propagate weight/volume/length with multiplier and rigid-pocket rules
- use replacement semantics: credit existing item footprint at each level
- regression test covers baton in 30 cm pocket and 60 cm pocket
* sanify electronic
* more
* more
* fix few errors
* fix itemgroups after changes, fix battery test
* more test fixes
* add missed comment on heavy flashlight
* add shoulder strap because it's cool and it's part of irl item
* more test fixes
* Update tests/item_autopickup_test.cpp
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* and more
* and more
* more
* more
* more
* further tweaks of heavy-duty flashlight
* more
* more
* more
* more
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* 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)
ret_val<T> is supossed to be a T value *and also* a bool (and optionally
a string message). However, all uses of ret_val<bool> were setting the
two bool values to the same thing. Really they wanted ret_val<void>,
but that didn't compile.
Make it so that ret_val<void> does work, and replace all uses of
ret_val<bool> with it. I found zero instances of 'true' ret_val<bool>
where a bool was being conveyed in addition to the success/failure info.
* Refactor cut_up
Move mat_set outside of the loop
Invert if
Remove useless braces
* Move uniform distribution into own function
* Refactor into lambdas
Efficiency is calculated once and assigned to a const
The recipe is found in a separate function, more clearly separating that
functionality from what should be done if no recipe is found
* Move find_recipe into own function
* Commenting + renaming
* Hide cut_up and unify try_to_cut and valid_to_cut
* Remove cutter item from cut_up
* Remove one const from function declaration
* Rebalance fab skill, update comments
Fab skill now has a more severe effect but is completely eliminated at
lvl 5
* Unsalvageable or count_by_charges items unsalavgeable
* Check uncraft before crafting recipes
* Limit mass returned from cut up
* Combine num, efficiency into num_adjusted
* cut_up_comp handles eff, remove extra loop
* Add chance to always salvage smth
* Use items count_by_charges instead of discarding
* Formatting
* Check for salvageable before count_by_charges
* Fix error and always round yields down
* Fix usage of get_wielded_item
* use item instead of item_id
* watertight containers are reloadable
* mods are reloadable, same_contents checks contents of contents
* add large number of new tests
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.
* Read "material" as string tags or portioned objects
* Proportional damage resistance per material
* Use the highest "portion" material as the base
* Track insertion order for std::map
* Fix materials being accessed before loading mods
* Additional proportional effects for materials
Take the proportion of certain materials into account for:
- Glass breaking (from smashing, striking, throwing, etc.)
- Weapons can have up to 20% glass before not being able to counter
- Magnetic pull is less effective for items with lower metal content
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.
* 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++
Resolves a TODO on that constructor, and one more TODO elsewhere due to
the resulting refactoring.
time_point was implicitly convertible from int. This led to unclear
code. In particular, the item constructor took a time_point and a
quantity, and these two ints appeared adjacent with no obvious way to
see what they meant at call sites.
Make the constructor explicit, so the conversion is no longer implicit.
Update the rest of the code accordingly.
In most cases switched from 0 to calendar::turn_zero, which is
equivalent. In a couple of places, used start_of_cataclysm instead,
when it seemed more appropriate (such as birthday of toilet water).
It's possible there are more cases which should have been something
other than turn_zero.