slightly redoes how animals hunt for food (#87166)

## About The Pull Request
before, if u wanted to make ur animal hunt for food, u had to give them
the find food subtree, the attacking subtree, and had to edit their
targeting stratedgy to include items. this makes it so u only have to
give them just 1 subtree which will handle everything it needs to. also
makes it alot more customizable, u can now set a hunger cooldown for ur
animals, and cute emotes for them to play after eating food

## Why It's Good For The Game
makes it more convenient for future devs to include food hunting
behaviors to their animals, while also making it more customizable

## Changelog
🆑
code: animals' food hunting behavior has been refactored, please report
any bugs
/🆑
This commit is contained in:
Ben10Omintrix
2024-10-15 03:18:37 +03:00
committed by GitHub
parent 3b6305acee
commit a99a1e6383
18 changed files with 96 additions and 60 deletions

View File

@@ -9,6 +9,7 @@
update_speed(basic_mob)
RegisterSignals(basic_mob, list(POST_BASIC_MOB_UPDATE_VARSPEED, COMSIG_MOB_MOVESPEED_UPDATED), PROC_REF(update_speed))
RegisterSignal(basic_mob, COMSIG_MOB_ATE, PROC_REF(on_mob_eat))
return ..() //Run parent at end
@@ -44,3 +45,8 @@
/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic/basic_mob)
SIGNAL_HANDLER
movement_delay = basic_mob.cached_multiplicative_slowdown
/datum/ai_controller/basic_controller/proc/on_mob_eat()
SIGNAL_HANDLER
var/food_cooldown = blackboard[BB_EAT_FOOD_COOLDOWN] || EAT_FOOD_COOLDOWN
set_blackboard_key(BB_NEXT_FOOD_EAT, world.time + food_cooldown)