From f9cbe69b19685363ba5dc6a108127d92e215477a Mon Sep 17 00:00:00 2001 From: TheGreatKitsune <88862343+TheGreatKitsune@users.noreply.github.com> Date: Thu, 28 Nov 2024 04:58:53 -0500 Subject: [PATCH] Add permanent limp quirk (#2560) ## About The Pull Request Adds a permanent limp quirk, negative with a cost of -3. Allows adding a minor, moderate, or major limp to a characters leg that cannot be treated short of limb replacement. ## Why It's Good For The Game Requested by a player. Allows for players to have a character that limps naturally without having to dislocate a leg in round. ## Proof Of Testing
Screenshots/Videos ![perm_limp_1](https://github.com/user-attachments/assets/04293b1d-7879-4875-8f28-f6421c402707) ![perm_limp_2](https://github.com/user-attachments/assets/da3f34b3-2f5b-496c-b502-be72222fd3ca) ![perm_limp_3](https://github.com/user-attachments/assets/853f5fb1-2f75-48ac-8a53-3743403dc10f)
## Changelog :cl: Cerami add: Adds a new negative quirk: permanent limp /:cl: Edit: Changed cost to -3 Made incompatible with paraplegic and hemiplegic --- code/__DEFINES/wounds.dm | 4 ++ code/_globalvars/lists/quirks.dm | 10 +++ .../subsystem/processing/quirks.dm | 2 +- .../quirks/negative_quirks/permanent_limp.dm | 38 +++++++++++ code/datums/wounds/permanent_limp.dm | 64 +++++++++++++++++++ .../client/preferences/permanent_limp.dm | 20 ++++++ tgstation.dme | 3 + .../character_preferences/permanent_limp.tsx | 7 ++ 8 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 code/datums/quirks/negative_quirks/permanent_limp.dm create mode 100644 code/datums/wounds/permanent_limp.dm create mode 100644 code/modules/client/preferences/permanent_limp.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/permanent_limp.tsx diff --git a/code/__DEFINES/wounds.dm b/code/__DEFINES/wounds.dm index 678a3fa80b9..862cbd783dc 100644 --- a/code/__DEFINES/wounds.dm +++ b/code/__DEFINES/wounds.dm @@ -137,6 +137,10 @@ GLOBAL_LIST_INIT(bio_state_anatomy, list( #define WOUND_SERIES_WIRE_PIERCE_ELECTRICAL_DAMAGE "wound_series_metal_pierce_electrical_damage_basic" // SKYRAT EDIT ADDITION END +//Bubbers Edit addition begin - permanent limp quirk +#define WOUND_SERIES_PERM_LIMP_BASIC "b_wound_series_perm_limp" +//Bubbers Edit addition end + /// A assoc list of (wound typepath -> wound_pregen_data instance). Every wound should have a pregen data. GLOBAL_LIST_INIT_TYPED(all_wound_pregen_data, /datum/wound_pregen_data, generate_wound_static_data()) diff --git a/code/_globalvars/lists/quirks.dm b/code/_globalvars/lists/quirks.dm index 4b77618dfe5..6d2205f82ef 100644 --- a/code/_globalvars/lists/quirks.dm +++ b/code/_globalvars/lists/quirks.dm @@ -101,6 +101,16 @@ GLOBAL_LIST_INIT(paraplegic_choice, list( "Amputee" = TRUE, )) +//Permanent Limp Quirk +GLOBAL_LIST_INIT(permanent_limp_choice, list( + "Left, minor" = /datum/wound/perm_limp/left, + "Left, moderate" = /datum/wound/perm_limp/left/moderate, + "Left, major" = /datum/wound/perm_limp/left/major, + "Right, minor" = /datum/wound/perm_limp/right, + "Right, moderate" = /datum/wound/perm_limp/right/moderate, + "Right, major" = /datum/wound/perm_limp/right/major, +)) + ///chipped Quirk GLOBAL_LIST_INIT(quirk_chipped_choice, list( "Basketsoft 3000" = /obj/item/skillchip/basketweaving, diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index e12711f5a27..a228794095a 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -16,7 +16,7 @@ GLOBAL_LIST_INIT_TYPED(quirk_blacklist, /list/datum/quirk, list( list(/datum/quirk/prosthetic_limb, /datum/quirk/quadruple_amputee, /datum/quirk/body_purist), list(/datum/quirk/transhumanist, /datum/quirk/body_purist), list(/datum/quirk/prosthetic_organ, /datum/quirk/tin_man, /datum/quirk/body_purist), - list(/datum/quirk/quadruple_amputee, /datum/quirk/paraplegic, /datum/quirk/hemiplegic), + list(/datum/quirk/quadruple_amputee, /datum/quirk/paraplegic, /datum/quirk/hemiplegic, /datum/quirk/permanent_limp), //list(/datum/quirk/quadruple_amputee, /datum/quirk/frail), // SKYRAT EDIT REMOVAL- Since we have synth wounds now, frail has a large downside for prosthetics and such list(/datum/quirk/social_anxiety, /datum/quirk/mute), list(/datum/quirk/mute, /datum/quirk/softspoken), diff --git a/code/datums/quirks/negative_quirks/permanent_limp.dm b/code/datums/quirks/negative_quirks/permanent_limp.dm new file mode 100644 index 00000000000..307d8c68eae --- /dev/null +++ b/code/datums/quirks/negative_quirks/permanent_limp.dm @@ -0,0 +1,38 @@ +/datum/quirk/permanent_limp + name = "Permanent Limp" + desc = "One of your legs has a permanent limp." + icon = FA_ICON_PERSON_CANE + value = -3 + gain_text = "You start to walk with a limp" + lose_text = "Your limp is cured" + medical_record_text = "Patient has an untreatable impairment in motive capability in the lower extremities." + hardcore_value = 2 + mail_goodies = list(/obj/item/cane/crutch) + +/datum/quirk_constant_data/permanent_limp + associated_typepath = /datum/quirk/permanent_limp + customization_options = list(/datum/preference/choiced/permanent_limp) + +/datum/quirk/permanent_limp/add(client/client_source) + var/mob/living/carbon/human/human_holder = quirk_holder + var/limp_type = GLOB.permanent_limp_choice[client_source?.prefs?.read_preference(/datum/preference/choiced/permanent_limp)] + var/datum/wound/perm_limp/limp = new limp_type() + if(limp.limb_to_apply_to == "Right") + for(var/obj/item/bodypart/leg/right/right_leg in human_holder.bodyparts) + limp.apply_wound(right_leg, TRUE) + continue + if(limp.limb_to_apply_to == "Left") + for(var/obj/item/bodypart/leg/left/left_leg in human_holder.bodyparts) + limp.apply_wound(left_leg, TRUE) + continue + +/datum/quirk/permanent_limp/remove() + var/mob/living/carbon/human/human_holder = quirk_holder + for(var/obj/item/bodypart/leg/right/right_leg in human_holder.bodyparts) + var/datum/wound/perm_limp/limp = right_leg.get_wound_type(/datum/wound/perm_limp) + if(limp) + limp.remove_wound() + for(var/obj/item/bodypart/leg/left/left_leg in human_holder.bodyparts) + var/datum/wound/perm_limp/limp = left_leg.get_wound_type(/datum/wound/perm_limp) + if(limp) + limp.remove_wound() diff --git a/code/datums/wounds/permanent_limp.dm b/code/datums/wounds/permanent_limp.dm new file mode 100644 index 00000000000..37d5e577012 --- /dev/null +++ b/code/datums/wounds/permanent_limp.dm @@ -0,0 +1,64 @@ +/datum/wound/perm_limp + name = "Permanent Limp" + desc = "Whether from an improperly set bone, genetic disorder, or otherwise, this limb has developed a permanent limp." + treat_text = "Little short of full limb replacement will fix this." + + limp_slowdown = 3 + limp_chance = 50 + wound_flags = 0 + can_scar = FALSE + + var/limb_to_apply_to + +/datum/wound/perm_limp/right + limb_to_apply_to = "Right" + +/datum/wound/perm_limp/right/moderate + limp_slowdown = 6 + limp_chance = 60 + +/datum/wound/perm_limp/right/major + limp_slowdown = 7 + limp_chance = 70 + +/datum/wound/perm_limp/left + limb_to_apply_to = "Left" + +/datum/wound/perm_limp/left/moderate + limp_slowdown = 6 + limp_chance = 60 + +/datum/wound/perm_limp/left/major + limp_slowdown = 7 + limp_chance = 70 + +/datum/wound_pregen_data/perm_limp + abstract = TRUE + + wound_path_to_generate = /datum/wound/perm_limp + required_limb_biostate = BIO_BONE | BIO_METAL + require_any_biostate = TRUE + + required_wounding_types = list(WOUND_ALL) + + wound_series = WOUND_SERIES_PERM_LIMP_BASIC + +/datum/wound_pregen_data/perm_limp/right + abstract = FALSE + wound_path_to_generate = /datum/wound/perm_limp/right + +/datum/wound_pregen_data/perm_limp/right/moderate + wound_path_to_generate = /datum/wound/perm_limp/right/moderate + +/datum/wound_pregen_data/perm_limp/right/major + wound_path_to_generate = /datum/wound/perm_limp/right/major + +/datum/wound_pregen_data/perm_limp/left + abstract = FALSE + wound_path_to_generate = /datum/wound/perm_limp/left + +/datum/wound_pregen_data/perm_limp/left/moderate + wound_path_to_generate = /datum/wound/perm_limp/left/moderate + +/datum/wound_pregen_data/perm_limp/left/major + wound_path_to_generate = /datum/wound/perm_limp/left/major diff --git a/code/modules/client/preferences/permanent_limp.dm b/code/modules/client/preferences/permanent_limp.dm new file mode 100644 index 00000000000..a0d8ab076fb --- /dev/null +++ b/code/modules/client/preferences/permanent_limp.dm @@ -0,0 +1,20 @@ +/datum/preference/choiced/permanent_limp + category = PREFERENCE_CATEGORY_MANUALLY_RENDERED + savefile_key = "permanent_limp" + savefile_identifier = PREFERENCE_CHARACTER + +/datum/preference/choiced/permanent_limp/init_possible_values() + return GLOB.permanent_limp_choice + +/datum/preference/choiced/permanent_limp/create_default_value() + return "Left, minor" + +/datum/preference/choiced/permanent_limp/is_accessible(datum/preferences/preferences) + . = ..() + if (!.) + return FALSE + + return "Permanent Limp" in preferences.all_quirks + +/datum/preference/choiced/permanent_limp/apply_to_human(mob/living/carbon/human/target, value) + return diff --git a/tgstation.dme b/tgstation.dme index 343a0d07186..1a0c618a26d 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1884,6 +1884,7 @@ #include "code\datums\quirks\negative_quirks\numb.dm" #include "code\datums\quirks\negative_quirks\nyctophobia.dm" #include "code\datums\quirks\negative_quirks\paraplegic.dm" +#include "code\datums\quirks\negative_quirks\permanent_limp.dm" #include "code\datums\quirks\negative_quirks\photophobia.dm" #include "code\datums\quirks\negative_quirks\poor_aim.dm" #include "code\datums\quirks\negative_quirks\prosopagnosia.dm" @@ -2099,6 +2100,7 @@ #include "code\datums\wounds\burns.dm" #include "code\datums\wounds\cranial_fissure.dm" #include "code\datums\wounds\loss.dm" +#include "code\datums\wounds\permanent_limp.dm" #include "code\datums\wounds\pierce.dm" #include "code\datums\wounds\slash.dm" #include "code\datums\wounds\scars\_scars.dm" @@ -3926,6 +3928,7 @@ #include "code\modules\client\preferences\parallax.dm" #include "code\modules\client\preferences\paraplegic.dm" #include "code\modules\client\preferences\pda.dm" +#include "code\modules\client\preferences\permanent_limp.dm" #include "code\modules\client\preferences\persistent_scars.dm" #include "code\modules\client\preferences\phobia.dm" #include "code\modules\client\preferences\pixel_size.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/permanent_limp.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/permanent_limp.tsx new file mode 100644 index 00000000000..2d5fccdc2ad --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/permanent_limp.tsx @@ -0,0 +1,7 @@ +import { FeatureChoiced } from '../base'; +import { FeatureDropdownInput } from '../dropdowns'; + +export const permanent_limp: FeatureChoiced = { + name: 'Permanent Limp', + component: FeatureDropdownInput, +};