From 46704a436bec3495e7b6c4e5f59bf1ba0e21bce0 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Tue, 8 Apr 2014 21:50:01 -0500 Subject: [PATCH] Saycode rewrite: Add support for speech_problem_flag Ready for Dev --- code/modules/mob/living/carbon/human/human_damage.dm | 2 ++ code/modules/mob/living/carbon/human/life.dm | 8 +++++++- code/modules/mob/living/carbon/human/say.dm | 10 +++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 3996467013..d685e512cc 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -142,6 +142,7 @@ UpdateDamageIcon() hud_updateflag |= 1 << HEALTH_HUD updatehealth() + speech_problem_flag = 1 //Heal MANY external organs, in random order @@ -163,6 +164,7 @@ parts -= picked updatehealth() hud_updateflag |= 1 << HEALTH_HUD + speech_problem_flag = 1 if(update) UpdateDamageIcon() // damage MANY external organs, in random order diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 46cafd27d1..3f51ca218c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -142,7 +142,6 @@ return ONE_ATMOSPHERE - pressure_difference /mob/living/carbon/human - proc/handle_disabilities() if (disabilities & EPILEPSY) if ((prob(1) && paralysis < 1)) @@ -160,6 +159,7 @@ emote("cough") return if (disabilities & TOURETTES) + speech_problem_flag = 1 if ((prob(10) && paralysis <= 1)) Stun(10) spawn( 0 ) @@ -177,6 +177,7 @@ pixel_y = old_y return if (disabilities & NERVOUS) + speech_problem_flag = 1 if (prob(10)) stuttering = max(10, stuttering) // No. -- cib @@ -231,6 +232,7 @@ if(!gene.block) continue if(gene.is_active(src)) + speech_problem_flag = 1 gene.OnMobLife(src) if (radiation) @@ -1053,6 +1055,7 @@ if(halloss > 0) adjustHalLoss(-3) else if(sleeping) + speech_problem_flag = 1 handle_dreams() adjustHalLoss(-3) if (mind) @@ -1104,16 +1107,19 @@ //Other if(stunned) + speech_problem_flag = 1 AdjustStunned(-1) if(weakened) weakened = max(weakened-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times if(stuttering) + speech_problem_flag = 1 stuttering = max(stuttering-1, 0) if (src.slurring) slurring = max(slurring-1, 0) if(silent) + speech_problem_flag = 1 silent = max(silent-1, 0) if(druggy) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index e436414390..f426d494ce 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -4,6 +4,11 @@ var/message_range = world.view var/italics = 0 + if(client) + if(client.prefs.muted & MUTE_IC) + src << "\red You cannot speak in IC (Muted)." + return + if(stat == 2) return say_dead(message) @@ -161,11 +166,6 @@ if(silent) message = "" handled = 1 - if(client) - if(client.prefs.muted & MUTE_IC) - src << "\red You cannot speak in IC (Muted)." - message = "" - handled = 1 if(sdisabilities & MUTE) message = "" handled = 1