From c9d61d1413a9bb93d48d5ac0ca776dc2d58d22c5 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Wed, 22 Jun 2022 01:57:13 +0200 Subject: [PATCH] IPCs now stutter when below 50% health. (#14327) --- .../mob/living/carbon/human/human_helpers.dm | 3 ++ code/modules/mob/living/carbon/human/life.dm | 2 + .../living/carbon/human/species/species.dm | 2 + .../carbon/human/species/station/ipc/ipc.dm | 2 + code/modules/mob/living/say.dm | 5 ++- html/changelogs/mattatlas-ipcstutter.yml | 41 +++++++++++++++++++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/mattatlas-ipcstutter.yml diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index f6ec4d485c0..79262248358 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -378,3 +378,6 @@ if(!isnull(species.floating_chat_x_offset)) return species.floating_chat_x_offset return species.icon_x_offset + +/mob/living/carbon/human/get_stutter_verbs() + return species.stutter_verbs \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 935f4ec13be..d1361632d01 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1116,6 +1116,8 @@ Paralyse(3) return if(!can_feel_pain()) + if(isSynthetic() &&(get_total_health() < maxHealth * 0.5)) + stuttering = max(stuttering, 5) return if(is_asystole) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 91d0ba9423f..d7f4262caf4 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -122,6 +122,8 @@ var/organ_med_burn_message = "Your %PARTNAME% burns horribly!" var/organ_high_burn_message = "Your %PARTNAME% feels like it's on fire!" + var/list/stutter_verbs = list("stammers", "stutters") + // Environment tolerance/life processes vars. var/reagent_tag //Used for metabolizing reagents. var/breath_pressure = 16 // Minimum partial pressure safe for breathing, kPa diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm index 649107e5558..6fa2be5d7ee 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm @@ -53,6 +53,8 @@ halloss_message = "encounters a hardware fault and suddenly reboots." halloss_message_self = "ERROR: Unrecoverable machine check exception.
System halted, rebooting..." + stutter_verbs = list("sputters", "crackles", "stutters") + warning_low_pressure = 50 hazard_low_pressure = -1 diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 7afa7d4d73f..cfb7ff74879 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -105,7 +105,7 @@ proc/get_radio_key_from_channel(var/channel) speech_problem_flag = 1 if(stuttering) message = get_stuttered_message(message) - verb = pick("stammers","stutters") + verb = pick(get_stutter_verbs()) speech_problem_flag = 1 if(tarded) message = slur(message,100) @@ -126,6 +126,9 @@ proc/get_radio_key_from_channel(var/channel) returns[4] = world.view return returns +/mob/living/proc/get_stutter_verbs() + return list("stammers", "stutters") + /mob/living/proc/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name, successful_radio, whisper) if(message_mode == "intercom") for(var/obj/item/device/radio/intercom/I in view(1, null)) diff --git a/html/changelogs/mattatlas-ipcstutter.yml b/html/changelogs/mattatlas-ipcstutter.yml new file mode 100644 index 00000000000..9056fe609c3 --- /dev/null +++ b/html/changelogs/mattatlas-ipcstutter.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "IPCs now stutter when below half health."