mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 09:03:23 +01:00
Basic mobs core implementation and cow migration. (#28667)
* Basic mobs core implementation and cow migration. * fix whitespace * uncomfortable fix for null weirdness * update updatepaths script number * lewc review 1 * fix delta * Update code/datums/ai/basic_mobs/basic_ai_behaviors/tipped_reaction.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: warriorstar-orion <orion@snowfrost.garden> --------- Signed-off-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b012f18d9a
commit
c820499f90
@@ -0,0 +1,19 @@
|
||||
/datum/ai_controller/basic_controller
|
||||
movement_delay = 0.4 SECONDS
|
||||
|
||||
/datum/ai_controller/basic_controller/try_possess_pawn(atom/new_pawn)
|
||||
if(!isliving(new_pawn))
|
||||
return AI_CONTROLLER_INCOMPATIBLE
|
||||
var/mob/living/basic/basic_mob = new_pawn
|
||||
|
||||
update_speed(basic_mob)
|
||||
RegisterSignal(basic_mob, COMSIG_MOB_ATE, PROC_REF(on_mob_eat))
|
||||
return ..()
|
||||
|
||||
/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic_mob)
|
||||
movement_delay = basic_mob.movement_delay()
|
||||
|
||||
/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)
|
||||
Reference in New Issue
Block a user