From a6cdeee95cf7c5e30593bb0ef427ce2db9948442 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Tue, 1 Sep 2015 23:37:56 +0100 Subject: [PATCH] Add autohiss/purr on a per-client toggle --- baystation12.dme | 1 + code/modules/mob/living/autohiss.dm | 89 +++++++++++++++++++++++++++++ code/modules/mob/living/say.dm | 2 + 3 files changed, 92 insertions(+) create mode 100644 code/modules/mob/living/autohiss.dm diff --git a/baystation12.dme b/baystation12.dme index 32628ed0ae..3b9e19da44 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1206,6 +1206,7 @@ #include "code\modules\mob\language\outsider.dm" #include "code\modules\mob\language\station.dm" #include "code\modules\mob\language\synthetic.dm" +#include "code\modules\mob\living\autohiss.dm" #include "code\modules\mob\living\damage_procs.dm" #include "code\modules\mob\living\default_language.dm" #include "code\modules\mob\living\life.dm" diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm new file mode 100644 index 0000000000..f3f3989b37 --- /dev/null +++ b/code/modules/mob/living/autohiss.dm @@ -0,0 +1,89 @@ + +#define AUTOHISS_OFF 0 +#define AUTOHISS_SR 1 +#define AUTOHISS_SRX 2 + +#define AUTOHISS_NUM 3 + + +/mob/living/proc/handle_autohiss(message, datum/language/L) + return message // no autohiss at this level + +/mob/living/carbon/human/handle_autohiss(message, datum/language/L) + if(!client || client.autohiss_mode == AUTOHISS_OFF) // no need to process if there's no client or they have autohiss off + return message + return species.handle_autohiss(message, L, client.autohiss_mode) + +/client + var/autohiss_mode = 0 + +/client/verb/toggle_autohiss() + set name = "Toggle Auto-Hiss" + set desc = "Toggle automatic hissing as Unathi and r-rolling as Taj" + set category = "OOC" + + autohiss_mode = (autohiss_mode + 1) % AUTOHISS_NUM + switch(autohiss_mode) + if(AUTOHISS_OFF) + src << "Auto-hiss is now OFF." + if(AUTOHISS_SR) + src << "Auto-hiss is now ON for 's' (Unathi) and 'r' (Tajara)." + if(AUTOHISS_SRX) + src << "Auto-hiss is now ON for 's', 'x' (Unathi) and 'r' (Tajara)." + else + soft_assert(0, "invalid autohiss value [autohiss_mode]") + autohiss_mode = AUTOHISS_OFF + src << "Auto-hiss is now OFF." + +/datum/species/proc/handle_autohiss(message, datum/language/lang, mode) + return message + +/datum/species/unathi/handle_autohiss(message, datum/language/lang, mode) + if(lang.name == "Sinta'unathi") // Sinta'unathi has no autohiss + return message + + . = list() + while(length(message)) + var/i = findtext(message, "s") + var/j = findtext(message, "x") + if(!i && !j) + . += message + break + if(!j || (i && j && i