Files
Bubberstation/code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm
SkyratBot 815644afb7 [MIRROR] adds sheep [MDB IGNORE] (#15826)
* adds sheep (#69318)

* adds funny sheep (need non-placeholder sprites still)

* indent this

* code suggestions

* components all the way down

* async

* sprites + reference

* think i did this right

* Update code/datums/components/mob_harvest.dm

Co-authored-by: san7890 <the@ san7890.com>

* steal shiz's suggestion pt1

Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>

* steal's shiz's suggestion pt2

Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>

* steal's shiz's suggestion pt3

Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>

* adds sheep

Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
2022-08-25 14:45:43 +01:00

64 lines
2.2 KiB
Plaintext

/datum/ai_planning_subtree/random_speech
//The chance of an emote occuring each second
var/speech_chance = 0
///Hearable emotes
var/list/emote_hear = list()
///Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
var/list/emote_see = list()
///Possible lines of speech the AI can have
var/list/speak = list()
/datum/ai_planning_subtree/random_speech/New()
. = ..()
if(speak)
speak = string_list(speak)
if(emote_hear)
emote_hear = string_list(emote_hear)
if(emote_see)
emote_see = string_list(emote_see)
/datum/ai_planning_subtree/random_speech/SelectBehaviors(datum/ai_controller/controller, delta_time)
if(DT_PROB(speech_chance, delta_time))
var/audible_emotes_length = emote_hear?.len
var/non_audible_emotes_length = emote_see?.len
var/speak_lines_length = speak?.len
var/total_choices_length = audible_emotes_length + non_audible_emotes_length + speak_lines_length
var/random_number_in_range = rand(1, total_choices_length)
if(random_number_in_range <= audible_emotes_length)
controller.queue_behavior(/datum/ai_behavior/perform_emote, pick(emote_hear))
else if(random_number_in_range <= (audible_emotes_length + non_audible_emotes_length))
controller.queue_behavior(/datum/ai_behavior/perform_emote, pick(emote_see))
else
controller.queue_behavior(/datum/ai_behavior/perform_speech, pick(speak))
/datum/ai_planning_subtree/random_speech/cockroach
speech_chance = 5
emote_hear = list("chitters")
/datum/ai_planning_subtree/random_speech/mothroach
speech_chance = 15
emote_hear = list("flutters.")
/datum/ai_planning_subtree/random_speech/sheep
speech_chance = 5
speak = list("baaa","baaaAAAAAH!","baaah")
emote_hear = list("bleats.")
emote_see = list("shakes her head.", "stares into the distance.")
/datum/ai_planning_subtree/random_speech/cow
speech_chance = 1
speak = list("moo?","moo","MOOOOOO")
emote_hear = list("brays.")
emote_see = list("shakes her head.")
///unlike normal cows, wisdom cows speak of wisdom and won't shut the fuck up
/datum/ai_planning_subtree/random_speech/cow/wisdom
speech_chance = 15
/datum/ai_planning_subtree/random_speech/cow/wisdom/New()
. = ..()
speak = GLOB.wisdoms //Done here so it's setup properly