Basic Mobs: the cooler simple mobs that run on datum AI. (With reworked cockroach AI as proof of concept) (#7867)

Co-authored-by: AMonkeyThatCodes <20987591+AMonkeyThatCodes@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-09-01 17:47:39 +02:00
committed by GitHub
parent 9fd2679667
commit 02ad59791b
59 changed files with 28993 additions and 27639 deletions
@@ -0,0 +1,26 @@
/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