Turns Deer into Basic Mob - They Freeze At The Sight of Vehicles (#74784)

## About The Pull Request

deers only show up in the BEPIS but i decided that they would be easy
enough to turn into a basic mob (they were). it was so easy in fact that
i decided to dip my toes into coding AI behavior, and made them freeze
up whenever they see a vehicle. this required a lot of code in a bunch
of places that i was quite unfamiliar with before starting this project,
so do let me know if i glonked up anywhere and i can work on smoothing
it out.
## Why It's Good For The Game

one less simple animal on the list. deers staring at headlights is
pretty cool i think, neato interaction for when you do get them beyond
the joke the bepis makes

i'm also amenable to dropping the whole "deer in headlights" code if you
don't like that for w/e reason- just wanted to make them basic at the
very least
## Changelog
🆑
add: If you ever happen upon a wild deer, try not to ride your fancy
vehicles too close to it as it'll freeze up like a... you know where I'm
going with this.
/🆑

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
san7890
2023-04-23 11:31:03 -04:00
committed by GitHub
co-authored by Mothblocks
parent 2756965944
commit 43473a4dac
12 changed files with 151 additions and 32 deletions
@@ -0,0 +1,49 @@
/mob/living/basic/deer
name = "doe"
desc = "A gentle, peaceful forest animal. How did this get into space?"
icon_state = "deer-doe"
icon_living = "deer-doe"
icon_dead = "deer-doe-dead"
gender = FEMALE
mob_biotypes = MOB_ORGANIC|MOB_BEAST
speak_emote = list("grunts", "grunts lowly")
butcher_results = list(/obj/item/food/meat/slab = 3)
response_help_continuous = "pets"
response_help_simple = "pet"
response_disarm_continuous = "gently nudges"
response_disarm_simple = "gently nudges aside"
response_harm_continuous = "kicks"
response_harm_simple = "kick"
attack_verb_continuous = "bucks"
attack_verb_simple = "buck"
attack_sound = 'sound/weapons/punch1.ogg'
health = 75
maxHealth = 75
blood_volume = BLOOD_VOLUME_NORMAL
ai_controller = /datum/ai_controller/basic_controller/deer
/// Things that will scare us into being stationary. Vehicles are scary to deers because they might have headlights.
var/static/list/stationary_scary_things = list(/obj/vehicle)
/mob/living/basic/deer/Initialize(mapload)
. = ..()
AddElement(/datum/element/footstep, footstep_type = FOOTSTEP_MOB_SHOE)
var/time_to_freeze_for = (rand(5, 10) SECONDS)
ai_controller.blackboard[BB_STATIONARY_SECONDS] = time_to_freeze_for
ai_controller.blackboard[BB_STATIONARY_COOLDOWN] = (time_to_freeze_for * (rand(3, 5)))
ai_controller.blackboard[BB_STATIONARY_TARGETS] = stationary_scary_things
/datum/ai_controller/basic_controller/deer
blackboard = list(
BB_BASIC_MOB_FLEEING = TRUE,
BB_STATIONARY_MOVE_TO_TARGET = TRUE,
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction,
)
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/deer,
/datum/ai_planning_subtree/stare_at_thing,
/datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee,
/datum/ai_planning_subtree/flee_target,
)