- start the close-door activity on the left tile only when it holds a door or vehicle part to close
- a builder shoved off plain ground keeps its build and its construction task in the backlog
- -30_C negates an absolute temperature and gives -303.15 K, far below minus thirty Celsius
- use units::from_celsius( -30 ) in the behavior tree score test and four preemption sections
- run npc::check_fire_spot for an NPC in fire_start_activity_actor::finish before lighting
- end the activity unlit on a failed hearth check and tell a player who sees the NPC
- store the harvest target as an absolute position and save it under a new key
- read a bubble position from older harvest saves against the map loaded at its origin
- food options judged against obligations when found and when started
- an NPC that overrides its obligations for food says why
- a hungry follower whose obligations keep it from food says it is hungry
- food scans and the meal that takes an item share one filter and one access check
- a faction that shares public goods lets others pour a drink from its containers
- meal checked against NPC diet before it starts
- every intake stops at a full stomach, food also at a meal already eaten
- drinks stop at the full line, before the engorged one
- a harvest is eaten later, like carried food
- 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
- a hungry NPC at a healthy weight gets a routine camp meal
- a camp meal the NPC would refuse is never served
- camp food and camp water take the time eating and drinking them takes
- an activity picked up during a walk runs before the walk goes on
- the walk and the task at its end resume after that activity
- a walking NPC shows its task again after a picked-up activity ends or is cancelled
- 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
- an owner sharing its stuff with the NPC, or hostile, may be taken from
- the rule covers the item, its containers and its carrying vehicle
- same rule applies to pickup, food, clothing searches
- guard on a player's task is off duty until the task ends
- NPC whose task is cancelled gets its mission and attitude back at once
- guard stays a guard when its task ends
- 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
- can_sleep predicate checks CANNOT_SLEEP instead of meth only
- sleep executor, address_needs() and sleep resume in move() skip it too
- a settling NPC gets up when CANNOT_SLEEP appears
- awake sleepiness caps at DEAD_TIRED - 1 instead of TIRED
- sleep deprivation stays at zero without needs
- added no_npc_food_sleepiness_stops_short_of_dead_tired
- an NPC lying down awake ignored everything until it fell asleep
- each turn it gets up for a hostile in view, a stronger need or an order
- one that keeps lying down past an obligation says so
- added sleep and settling cases to the NPC trip bench
- sleep search stays inside the reach and skips spots the NPC may not use
- the npc_sleep action asks the same permission as the behavior tree
- an NPC that sleeps past an obligation says so
- a failed sleep search pauses sleep a minute unless something changes
- added npc_intention, adopted before every dispatch
- goal commitment uses should_interrupt and end_need_pursuit
- water candidates filtered by need_view
- address_needs walks and forage/harvest gated by obligations
- added water_out_of_reach complaint and override speech
- idle followers call complain()
- 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
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>
- Replace src/third-party/plf/{colony,list}.h with upstream verbatim
- Add cata:: index<->iterator free helpers (plf removed members)
- Rename plf-facing get_iterator_from_pointer to get_iterator
- Switch deallocating clear() calls to reset() in map and item_wakeup
- Drop const from local map_stack in pickup autopickup
- Migrate colony_test and list_test for reshape, splice, ADL friends
- Add IWYU mapping for plf::void_cast in list.h and colony.h
- replace should_follow_close with can_follow_player_now and desired_follow_radius
- gate on_shift, displaced_from_post, duty_urgency on is_walking_with
- drop guard_post early-return from npc_is_following
- pause under hold_position and guarding-idle when address_needs undecided
- update tests for new follower-vs-duty arbitration
- assess_danger() uses guaranteed_hostile() instead of is_enemy()
- Re-run regen_ai_cache() after attitude flip in move()
- Added two tests for faction-hostile NPC threat detection