From 71fc63d2c71feb9b34ba066069d544cf16342986 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Sat, 13 Jun 2020 11:50:41 +0200 Subject: [PATCH] Fixes an air damage runtime and whisper verb printing (#9110) --- code/ZAS/Airflow.dm | 6 +-- code/game/objects/structures/window.dm | 2 +- .../mob/living/carbon/human/whisper.dm | 24 +++++------ code/modules/organs/blood.dm | 9 ++-- html/changelogs/mattatlas-whisper.yml | 41 +++++++++++++++++++ 5 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 html/changelogs/mattatlas-whisper.yml diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index 4fb32e22492..7e204048880 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -118,13 +118,13 @@ mob/living/carbon/human/airflow_hit(atom/A) var/b_loss = airflow_speed * vsc.airflow_damage var/blocked = run_armor_check(BP_HEAD,"melee") - apply_damage(b_loss/3, BRUTE, BP_HEAD, blocked, 0, "Airflow") + apply_damage(b_loss/3, BRUTE, BP_HEAD, blocked, "Airflow") blocked = run_armor_check(BP_CHEST,"melee") - apply_damage(b_loss/3, BRUTE, BP_CHEST, blocked, 0, "Airflow") + apply_damage(b_loss/3, BRUTE, BP_CHEST, blocked, "Airflow") blocked = run_armor_check(BP_GROIN,"melee") - apply_damage(b_loss/3, BRUTE, BP_GROIN, blocked, 0, "Airflow") + apply_damage(b_loss/3, BRUTE, BP_GROIN, blocked, "Airflow") if(airflow_speed > 10) Paralyse(round(airflow_speed * vsc.airflow_stun)) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 4de9055af70..227845d2f73 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -147,7 +147,7 @@ return 1 -/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target as turf) +/obj/structure/window/CheckExit(atom/movable/O, turf/target) if(istype(O) && O.checkpass(PASSGLASS)) return 1 if(get_dir(O.loc, target) == dir) diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 0e5513347f6..98d1f72f482 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -29,7 +29,7 @@ //This is used by both the whisper verb and human/say() to handle whispering -/mob/living/carbon/human/proc/whisper_say(var/message, var/datum/language/speaking = null, var/alt_name="", var/verb="whispers") +/mob/living/carbon/human/proc/whisper_say(var/message, var/datum/language/speaking = null, var/alt_name="", var/whisper_text = "whispers") if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) to_chat(src, "You're muzzled and cannot speak!") @@ -41,25 +41,25 @@ var/italics = 1 var/not_heard //the message displayed to people who could not hear the whispering - if (speaking) - if (speaking.whisper_verb) - verb = speaking.whisper_verb - not_heard = "[verb] something" + if(speaking) + if(speaking.whisper_verb) + whisper_text = speaking.whisper_verb + not_heard = "[whisper_text] something" else var/adverb = pick("quietly", "softly") - verb = "[speaking.speech_verb] [adverb]" + whisper_text = "[speaking.speech_verb] [adverb]" not_heard = "[speaking.speech_verb] something [adverb]" else - not_heard = "[verb] something" //TODO get rid of the null language and just prevent speech if language is null + not_heard = "[whisper_text] something" //TODO get rid of the null language and just prevent speech if language is null message = capitalize(trim(message)) if(speech_problem_flag) var/list/handle_r = handle_speech_problems(message) message = handle_r[1] - verb = handle_r[2] + whisper_text = handle_r[2] var/adverb = pick("quietly", "softly") - verb = "[verb] [adverb]" + whisper_text = "[whisper_text] [adverb]" speech_problem_flag = handle_r[3] @@ -122,7 +122,7 @@ for (var/obj/O in view(message_range, src)) spawn (0) if (O) - O.hear_talk(src, message, verb, speaking) + O.hear_talk(src, message, whisper_text, speaking) var/list/eavesdropping = hearers(eavesdropping_range, src) eavesdropping -= src @@ -138,14 +138,14 @@ var/list/listening_clients = list() // The clients we're going to show the speech bubble to. for(var/mob/M in listening) - M.hear_say(message, verb, speaking, alt_name, italics, src) + M.hear_say(message, whisper_text, speaking, alt_name, italics, src) if (M.client) listening_clients += M.client if (eavesdropping.len) var/new_message = stars(message) //hopefully passing the message twice through stars() won't hurt... I guess if you already don't understand the language, when they speak it too quietly to hear normally you would be able to catch even less. for(var/mob/M in eavesdropping) - M.hear_say(new_message, verb, speaking, alt_name, italics, src) + M.hear_say(new_message, whisper_text, speaking, alt_name, italics, src) if (M.client) listening_clients += M.client diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 47896ec174e..f1e1bf19882 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -68,7 +68,7 @@ H.bloody_body(src) H.bloody_hands(src) var/blinding = FALSE - if(ran_zone("head", 75)) + if(ran_zone(BP_HEAD, 75)) blinding = TRUE for(var/obj/item/I in list(H.head, H.glasses, H.wear_mask)) if(I && (I.body_parts_covered & EYES)) @@ -82,10 +82,13 @@ to_chat(H, "You are hit by a spray of blood!") hit_mob = TRUE - if(hit_mob || !A.CanPass(src, sprayloc)) - break + if(!(A.CanPass(src, sprayloc)) || hit_mob) + continue + drip(amt, sprayloc, spraydir) bled += amt + if(hit_mob) + break return bled #undef BLOOD_SPRAY_DISTANCE diff --git a/html/changelogs/mattatlas-whisper.yml b/html/changelogs/mattatlas-whisper.yml new file mode 100644 index 00000000000..6011f14c86e --- /dev/null +++ b/html/changelogs/mattatlas-whisper.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: + - bugfix: "Whispers no longer put blank text in place of the whisper verb."