From bac70978a8868de3ffb35617139ad1e10907487c Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Fri, 29 Dec 2023 11:30:30 +1100 Subject: [PATCH] Drakes and kururak will now threaten before attacking. --- code/modules/ai/ai_holder_communication.dm | 15 +++++++++++---- code/modules/ai/ai_holder_debug.dm | 1 - code/modules/ai/say_list.dm | 1 + .../animal/sif/grafadreka/grafadreka_ai.dm | 16 +++++++++------- .../animal/sif/grafadreka/grafadreka_misc.dm | 17 ++++++++++++++--- .../simple_mob/subtypes/animal/sif/kururak.dm | 19 ++++++++++++++----- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/code/modules/ai/ai_holder_communication.dm b/code/modules/ai/ai_holder_communication.dm index 1439e990ee..26392b3b5d 100644 --- a/code/modules/ai/ai_holder_communication.dm +++ b/code/modules/ai/ai_holder_communication.dm @@ -34,8 +34,9 @@ if(holder.say_list) holder.ISay(safepick(holder.say_list.say_threaten)) - playsound(holder, holder.say_list.threaten_sound, 50, 1) // We do this twice to make the sound -very- noticeable to the target. - playsound(target, holder.say_list.threaten_sound, 50, 1) // Actual aim-mode also does that so at least it's consistent. + if(holder.say_list.threaten_sound) + playsound(holder, holder.say_list.threaten_sound, 50, 1) // We do this twice to make the sound -very- noticeable to the target. + playsound(target, holder.say_list.threaten_sound, 50, 1) // Actual aim-mode also does that so at least it's consistent. else // Otherwise we are waiting for them to go away or to wait long enough for escalate. if(target in list_targets()) // Are they still visible? var/should_escalate = FALSE @@ -48,6 +49,10 @@ set_stance(STANCE_APPROACH) if(holder.say_list) holder.ISay(safepick(holder.say_list.say_escalate)) + if(holder.say_list.attack_sound) + // As per threaten_sound above. + playsound(holder, holder.say_list.attack_sound, 50, 1) + playsound(target, holder.say_list.attack_sound, 50, 1) else return // Wait a bit. @@ -57,8 +62,10 @@ set_stance(STANCE_IDLE) if(holder.say_list) holder.ISay(safepick(holder.say_list.say_stand_down)) - playsound(holder, holder.say_list.stand_down_sound, 50, 1) // We do this twice to make the sound -very- noticeable to the target. - playsound(target, holder.say_list.stand_down_sound, 50, 1) // Actual aim-mode also does that so at least it's consistent. + if(holder.say_list.stand_down_sound) + // As per threaten_sound above. + playsound(holder, holder.say_list.stand_down_sound, 50, 1) + playsound(target, holder.say_list.stand_down_sound, 50, 1) // Determines what is deserving of a warning when STANCE_ALERT is active. /datum/ai_holder/proc/will_threaten(mob/living/the_target) diff --git a/code/modules/ai/ai_holder_debug.dm b/code/modules/ai/ai_holder_debug.dm index d7e0866ea3..88b604b67a 100644 --- a/code/modules/ai/ai_holder_debug.dm +++ b/code/modules/ai/ai_holder_debug.dm @@ -86,4 +86,3 @@ path_display = TRUE last_turf_display = TRUE debug_ai = AI_LOG_INFO - diff --git a/code/modules/ai/say_list.dm b/code/modules/ai/say_list.dm index 8ba88640ec..5b5843049a 100644 --- a/code/modules/ai/say_list.dm +++ b/code/modules/ai/say_list.dm @@ -35,6 +35,7 @@ var/threaten_sound = null // Sound file played when the mob's AI calls threaten_target() for the first time. var/stand_down_sound = null // Sound file played when the mob's AI loses sight of the threatened target. + var/attack_sound = null // Sound file played when the mob's AI escalates to attacking from threatening. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_ai.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_ai.dm index 980d136e75..62e4b43e6b 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_ai.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_ai.dm @@ -52,14 +52,16 @@ ai_holder.hostile = TRUE /datum/ai_holder/simple_mob/intentional/grafadreka - hostile = TRUE - retaliate = TRUE - cooperative = TRUE - can_flee = TRUE - flee_when_dying = TRUE - home_low_priority = TRUE + intelligence_level = AI_SMART + hostile = TRUE + retaliate = TRUE + cooperative = TRUE + can_flee = TRUE + flee_when_dying = TRUE + home_low_priority = TRUE + threaten = TRUE var/next_food_check = 0 - var/next_sap_check = 0 + var/next_sap_check = 0 var/next_heal_check = 0 /datum/ai_holder/simple_mob/intentional/grafadreka/should_flee(force) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_misc.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_misc.dm index db1881acb5..8c52f3c68f 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_misc.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_misc.dm @@ -43,10 +43,21 @@ Field studies suggest analytical abilities on par with some species of cepholapo /datum/say_list/grafadreka - speak = list("Chff!", "Skhh.", "Rrrss...") - emote_see = list("scratches its ears","grooms its spines", "sways its tail", "claws at the ground") - emote_hear = list("hisses", "rattles", "rasps", "barks", "warbles") + speak = list("Chff!", "Skhh.", "Rrrss...") + emote_see = list("scratches its ears","grooms its spines", "sways its tail", "claws at the ground") + emote_hear = list("hisses", "rattles", "rasps", "barks", "warbles") + say_understood = list("Rrrn!", "Hsst!") + say_cannot = list("Gruwwrrn...") + say_maybe_target = list("Chh?") + say_got_target = list("RRSST!") + say_threaten = list("Rrrrnrrnnn...", "Chssshhhk...") + say_stand_down = list("Chff!") + say_escalate = list("SKHH!", "CHFF!") + say_retreat = list("Skhh!", "Chff!") + threaten_sound = 'sound/voice/drakes/drake_warn.ogg' + attack_sound = 'sound/voice/drakes/drake_rattle.ogg' + stand_down_sound = 'sound/voice/drakes/drake_grumble.ogg' /decl/mob_organ_names/grafadreka hit_zones = list( diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm index bf7fa0d36a..09b351d189 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm @@ -88,6 +88,15 @@ emote_see = list("scratches its ear","flutters its tails", "flicks an ear", "shakes out its hair") emote_hear = list("chirps", "clicks", "grumbles", "chitters") + say_understood = list("Kurr...", "Ksss...") + say_cannot = list("Kurr...", "Ksss...") + say_maybe_target = list("Kurr?", "Ksss?") + say_got_target = list("Kurr!", "Ksss!") + say_threaten = list("Kurr...", "Ksss...") + say_stand_down = list("Kurr!", "Ksss!") + say_escalate = list("KURR!", "KSSS!") + say_retreat = list("KURR!", "KSSS!") + /mob/living/simple_mob/animal/sif/kururak/leader // Going to be the starting leader. Has some base buffs to make it more likely to stay the leader. maxHealth = 250 health = 250 @@ -342,16 +351,16 @@ */ /datum/ai_holder/simple_mob/intentional/kururak - hostile = FALSE - retaliate = TRUE - cooperative = TRUE - can_flee = TRUE + hostile = FALSE + retaliate = TRUE + cooperative = TRUE + can_flee = TRUE flee_when_dying = TRUE + threaten = TRUE /datum/ai_holder/simple_mob/intentional/kururak/handle_special_strategical() follow_distance = rand(initial(follow_distance), initial(follow_distance) + 2) var/mob/living/simple_mob/animal/sif/kururak/K = holder - if(istype(K)) var/mob/living/simple_mob/animal/sif/kururak/highest_instinct = K.detect_instinct() if(highest_instinct == K)