From 2ba2ca95d64c502335407bf54adcea8aded302cc Mon Sep 17 00:00:00 2001 From: KnigTheThrasher <152086196+KnigTheThrasher@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:58:29 +0200 Subject: [PATCH] [PORT] Lets Lizards Customize Hiss Length (#2380) * hisssss * marks non modular shit (i forgor lol) * makes it look better --------- Co-authored-by: KnighTheThrasher --- code/modules/surgery/organs/tongue.dm | 25 ++++++++++++++----- .../preferences/species_features/lizard.dm | 20 +++++++++++++++ tgstation.dme | 1 + .../features/_modular_species_features.tsx | 7 ++++++ 4 files changed, 47 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 4da000fedf91..f5359a46b6cc 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -128,6 +128,17 @@ modifies_speech = TRUE languages_native = list(/datum/language/draconic, /datum/language/ashtongue) + //MONKESTATION EDIT START + + /// 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,14 +148,16 @@ 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 + //MONKESTATION EDIT END + /obj/item/organ/internal/tongue/lizard/silver name = "silver tongue" desc = "A genetic branch of the high society Silver Scales that gives them their silverizing properties. To them, it is everything, and society traitors have their tongue forcibly revoked. Oddly enough, it itself is just blue." 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 6d41d04ef858..3079c0c83335 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6559,6 +6559,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, +};