Refactors datum AI idle behaviors into datums (#61455)

Co-authored-by: MonkeyThatCodes <monkey>
This commit is contained in:
AMonkeyThatCodes
2021-09-18 23:00:17 -07:00
committed by GitHub
co-authored by MonkeyThatCodes <monkey>
parent 28ba8ee9a0
commit f2b6fcb253
14 changed files with 81 additions and 77 deletions
@@ -51,21 +51,12 @@
ai_traits = STOP_MOVING_WHEN_PULLED
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk
planning_subtrees = list(
/datum/ai_planning_subtree/random_speech/cockroach,
/datum/ai_planning_subtree/find_and_hunt_target
)
/datum/ai_controller/basic_controller/cockroach/PerformIdleBehavior(delta_time)
. = ..()
var/mob/living/living_pawn = pawn
if(DT_PROB(25, delta_time) && (living_pawn.mobility_flags & MOBILITY_MOVE) && isturf(living_pawn.loc) && !living_pawn.pulledby)
var/move_dir = pick(GLOB.alldirs)
living_pawn.Move(get_step(living_pawn, move_dir), move_dir)
/obj/projectile/glockroachbullet
damage = 10 //same damage as a hivebot
damage_type = BRUTE