mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-27 01:51:50 +00:00
* AI improvements regarding taming and riding! (#69247) * Cow AI improvevments and fixes for tamability and riding, no longer allowing you to grab the cow you're riding, and stopping AI cows from moving while being ridden. * AI improvements regarding taming and riding! Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
26 lines
715 B
Plaintext
26 lines
715 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
|
|
|
|
/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic/basic_mob)
|
|
SIGNAL_HANDLER
|
|
movement_delay = basic_mob.cached_multiplicative_slowdown
|