From f436e7edb1191cd8fe11eee4d6aa1833635baef9 Mon Sep 17 00:00:00 2001 From: KnighTheThrasher Date: Sun, 23 Jun 2024 20:44:26 +0200 Subject: [PATCH] hisssss --- code/modules/surgery/organs/tongue.dm | 21 +++++++++++++------ .../preferences/species_features/lizard.dm | 20 ++++++++++++++++++ tgstation.dme | 1 + .../features/_modular_species_features.tsx | 7 +++++++ 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 monkestation/code/modules/client/preferences/species_features/lizard.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 49ae8b937a48..bbb4403bfb7b 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -128,6 +128,15 @@ modifies_speech = TRUE languages_native = list(/datum/language/draconic) + /// How long is our hissssssss? + var/draw_length = 3 + +/obj/item/organ/internal/tongue/lizard/Initialize(mapload) + . = ..() + draw_length = rand(2, 6) + if(prob(10)) + draw_length += 2 + /obj/item/organ/internal/tongue/lizard/modify_speech(datum/source, list/speech_args) var/static/regex/lizard_hiss = new("s+", "g") var/static/regex/lizard_hiSS = new("S+", "g") @@ -137,12 +146,12 @@ var/static/regex/lizard_eckS = new(@"\bX([\-|r|R]|\b)", "g") var/message = speech_args[SPEECH_MESSAGE] if(message[1] != "*") - message = lizard_hiss.Replace(message, "sss") - message = lizard_hiSS.Replace(message, "SSS") - message = lizard_kss.Replace(message, "$1kss") - message = lizard_kSS.Replace(message, "$1KSS") - message = lizard_ecks.Replace(message, "ecks$1") - message = lizard_eckS.Replace(message, "ECKS$1") + message = lizard_hiss.Replace(message, repeat_string(draw_length, "s")) + message = lizard_hiSS.Replace(message, repeat_string(draw_length, "S")) + message = lizard_kss.Replace(message, "$1k[repeat_string(max(draw_length - 1, 1), "s")]") + message = lizard_kSS.Replace(message, "$1K[repeat_string(max(draw_length - 1, 1), "S")]") + message = lizard_ecks.Replace(message, "eck[repeat_string(max(draw_length - 2, 1), "s")]$1") + message = lizard_eckS.Replace(message, "ECK[repeat_string(max(draw_length - 2, 1), "S")]$1") speech_args[SPEECH_MESSAGE] = message /obj/item/organ/internal/tongue/lizard/silver diff --git a/monkestation/code/modules/client/preferences/species_features/lizard.dm b/monkestation/code/modules/client/preferences/species_features/lizard.dm new file mode 100644 index 000000000000..972a622f805c --- /dev/null +++ b/monkestation/code/modules/client/preferences/species_features/lizard.dm @@ -0,0 +1,20 @@ +/datum/preference/numeric/hiss_length + savefile_key = "hiss_length" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + priority = PREFERENCE_PRIORITY_NAMES + can_randomize = FALSE + minimum = 2 + maximum = 6 + +/datum/preference/numeric/hiss_length/create_default_value() + return 3 + +/datum/preference/numeric/hiss_length/is_accessible(datum/preferences/preferences) + return ..() && ispath(preferences.read_preference(/datum/preference/choiced/species), /datum/species/lizard) + +/datum/preference/numeric/hiss_length/apply_to_human(mob/living/carbon/human/target, value) + var/obj/item/organ/internal/tongue/lizard/tongue = target.get_organ_slot(ORGAN_SLOT_TONGUE) + if(!istype(tongue)) + return + tongue.draw_length = value diff --git a/tgstation.dme b/tgstation.dme index 86d1803b041b..fc646bd4566b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6332,6 +6332,7 @@ #include "monkestation\code\modules\client\preferences\species_features\floran.dm" #include "monkestation\code\modules\client\preferences\species_features\goblin.dm" #include "monkestation\code\modules\client\preferences\species_features\ipc.dm" +#include "monkestation\code\modules\client\preferences\species_features\lizard.dm" #include "monkestation\code\modules\client\preferences\species_features\secondary_mut_color.dm" #include "monkestation\code\modules\client\preferences\species_features\simians.dm" #include "monkestation\code\modules\client\verbs\looc.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx new file mode 100644 index 000000000000..14f2eb9fa096 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx @@ -0,0 +1,7 @@ +import { FeatureNumberInput, FeatureNumeric } from './base'; + +export const hiss_length: FeatureNumeric = { + name: 'Hiss Length', + description: 'How long do you hissssss for?', + component: FeatureNumberInput, +};