mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
Co-authored-by: AMonkeyThatCodes <20987591+AMonkeyThatCodes@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
27 lines
728 B
Plaintext
27 lines
728 B
Plaintext
/datum/ai_controller/basic_controller
|
|
movement_delay = 0.4 SECONDS
|
|
|
|
/datum/ai_controller/basic_controller/TryPossessPawn(atom/new_pawn)
|
|
if(!isbasicmob(new_pawn))
|
|
return AI_CONTROLLER_INCOMPATIBLE
|
|
var/mob/living/basic/basic_mob = new_pawn
|
|
|
|
update_speed(basic_mob)
|
|
|
|
RegisterSignal(basic_mob, POST_BASIC_MOB_UPDATE_VARSPEED, .proc/update_speed)
|
|
|
|
return ..() //Run parent at end
|
|
|
|
|
|
/datum/ai_controller/basic_controller/able_to_run()
|
|
. = ..()
|
|
if(isliving(pawn))
|
|
var/mob/living/living_pawn = pawn
|
|
if(IS_DEAD_OR_INCAP(living_pawn))
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic/basic_mob)
|
|
SIGNAL_HANDLER
|
|
movement_delay = basic_mob.cached_multiplicative_slowdown
|