place_critter_around(radius=1) can offset the monster by a tile when
terrain is impassable, consuming the overmap entity. The post-walk
retry then has nothing to re-spawn. Search by type, verify proximity.
spawn_monster(tripoint_abs_sm) silently lost horde entities when
place_critter_around failed - clear_chunk wiped all data regardless
of placement success. Extract nodes before placement and re-insert
failures via horde_map::insert for retry on next load. Stable-sort
by position for deterministic order across compilers.
Refactor monsters_appear_on_map_as_expected: reduce from 16 to 8
walk variations, add clear_creatures between iterations to prevent
state coupling, add materialization retry after terrain wipe, remove
unused monster_location captures, split dormant sub-test into its
own TEST_CASE.
Add failed_horde_placement_preserves_entity regression test covering
both lightweight (impassable terrain) and heavyweight (occupied tile)
failure modes.
Co-authored-by: dumb-kevin <dumb-kevin@users.noreply.github.com>
* Test for mon_ prefix
* Replace LIXA_ with mon_
* deal with pseudo monsters
* Check for prefix in vanilla monster during data load
* better cpp
* fix hardcoded ids
---------
Co-authored-by: Fris0uman <fris0uman@users.noreply.github.com>
* Add clang-tidy check to ensure fs::u8path is used to construct path from utf-8 string
* Fix fs::u8path and nullptr warnings
* Print error instead of showing a popup in test mode in write_to_file
* Remove cata::fstream wrappers
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.
Change to tripoint_abs_ms:
- goal [was map-relative]
- wander_pos [was map-relative]
- patrol_route [was absolute but not typed]
Remove serialization for path.
Invalidate path on map shift.
Made goal optional, unset when reached.
Rename goal-related functions for consistency/readability.
* Help limit zombie_fuse size change
This prevents increases in the level of the grown_of_fuse effect if
the monster is already at huge. Some further work is needed, namely to
ensure get_size never returns anything outside of the tiny-huge range;
this could happen if the engulfed monster was so big as to pop by 2
size categories. Alternatives include limiting mod_size_bonus or,
for this particular case, an alternate grown_of_fuse effect with
either less size increase or lower maximum intensity, such that -
with a given type base size - it won't put it over huge.
* Attempting to use volume to help limit zombie_fuse
@Venera3 requested going off of volume for (most of?) zombie_fuse. This
should limit to the minimum of by max_hp and by volume * (80 / 62500 ml),
which work out to the same value for a standard zombie.
* Get units to work right for volume limit
Rearrange to mathematically equivalent formula to get units system to
work right.
* Adjust grown_of_fuse for max +2 size
The effect grown_of_fuse now increases size by a maximum of 2. In order
to minimize uncertainty about effects due to roundoff, all effects are
now proportional to changes of 50, not 48.
* Clamp mod_size_bonus to within enum limits
This should prevent any input to mod_size_bonus from causing it to
go outside of the enum limits. I wound up doing this in a slightly odd
fashion, since Creature::get_size() is virtual only (the Creature
structure does not itself include a size, AFAICT); instead of getting
a base size and preventing size_bonus from pushing it beyond tiny/huge,
I limited the adjustment to size_bonus so that it wouldn't push the
current result of get_size() beyond the limits.
* Hopefully satisfy JSON formatter test
* Fix accidental min/max reversal
* Try adding a test of mod_size_bonus
Adding a test to make sure mod_size_bonus will set the size correctly.
May be extended with a few more monsters of various sizes if desired.
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>