From ac9d6649533ec4dbc9de0dca3ac4a9b9641e12b2 Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Sun, 9 Mar 2025 15:04:42 -0400 Subject: [PATCH] Disabled legs trait (#17271) * spine disability trait * scanner shows it too, dna injector * proper path * synths don't count --------- Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com> --- code/__defines/dna.dm | 1 + code/game/machinery/adv_med.dm | 5 +++-- code/game/objects/items/weapons/dna_injector.dm | 4 ++++ .../mob/living/carbon/human/human_organs.dm | 5 +++-- .../species/station/traits_vr/negative_genes.dm | 14 ++++++++++++++ code/modules/organs/subtypes/standard.dm | 15 +++++++++++++++ .../BodyScanner/BodyScannerMainAbnormalities.tsx | 1 + .../tgui/interfaces/BodyScanner/constants.ts | 1 + .../packages/tgui/interfaces/BodyScanner/types.ts | 1 + 9 files changed, 43 insertions(+), 4 deletions(-) diff --git a/code/__defines/dna.dm b/code/__defines/dna.dm index 6140bf37bfb..9b3a0d51e38 100644 --- a/code/__defines/dna.dm +++ b/code/__defines/dna.dm @@ -49,6 +49,7 @@ #define BLIND 0x1 #define MUTE 0x2 #define DEAF 0x4 +#define SPINE 0x8 /* Traitgenes (Blocks have finally been retired, huzzah! // The way blocks are handled badly needs a rewrite, this is horrible. diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index f7fd35165b2..2e45631a760 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -333,8 +333,9 @@ occupantData["blind"] = (H.sdisabilities & BLIND) occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) - occupantData["husked"] = (HUSK in H.mutations) // VOREstation edit - occupantData = attempt_vr(src, "get_occupant_data_vr", list(occupantData, H)) //VOREStation Insert + occupantData["brokenspine"] = (H.disabilities & SPINE) + occupantData["husked"] = (HUSK in H.mutations) + occupantData = attempt_vr(src, "get_occupant_data_vr", list(occupantData, H)) data["occupant"] = occupantData return data diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index d4ab738be9a..e6e7aafffee 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -350,3 +350,7 @@ /obj/item/dnainjector/set_trait/nonconduct/disable disabling = TRUE */ +/obj/item/dnainjector/set_trait/damagedspine // brokenspine + trait_path = /datum/trait/negative/disability_damagedspine +/obj/item/dnainjector/set_trait/damagedspine/disable + disabling = TRUE diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 58d44a1aaba..7eb1e01b454 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -73,7 +73,7 @@ if (istype(buckled, /obj/structure/bed)) return - var/limb_pain + var/limb_pain = FALSE for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot")) var/obj/item/organ/external/E = organs_by_name[limb_tag] if(!E || !E.is_usable()) @@ -111,7 +111,8 @@ if(limb_pain) emote("scream") custom_emote(1, "collapses!") - Weaken(5) //can't emote while weakened, apparently. + if(!(lying || resting)) // stops permastun with SPINE sdisability + Weaken(5) //can't emote while weakened, apparently. /mob/living/carbon/human/proc/handle_grasp() if(!l_hand && !r_hand) diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative_genes.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative_genes.dm index 5b58c77fdba..1134aa6b143 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative_genes.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative_genes.dm @@ -207,3 +207,17 @@ disability=CENSORED activation_message="You feel less rude..." primitive_expression_messages=list("BEEPS!") + +/datum/trait/negative/disability_damagedspine + name = "Lumbar Impairment" + desc = "Due to neurological damage, you are unable to use your legs. Collapsing to the ground as soon as you try to stand. You should check the loadout menu for something to assist you." + cost = -3 + custom_only = FALSE + can_take = ORGANICS + + is_genetrait = TRUE + hidden = FALSE + activity_bounds = DNA_HARDER_BOUNDS // Shouldn't be easy for genetics to find this + + sdisability=SPINE + activation_message="Your legs shake..." diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 40f58100444..d7be162527b 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -151,6 +151,16 @@ owner.custom_pain("Your [name] burns like it's on fire!",15) owner.Weaken(5) +/obj/item/organ/external/leg/is_usable() // We only do legs, otherwise the stance_damage will be 8 instead of 4, meaning crutches do nothing as they only negate 4 + if(robotic == ORGAN_FLESH && owner.sdisabilities & SPINE) + return FALSE + . = ..() + +/obj/item/organ/external/leg/organ_can_feel_pain() + if(robotic < ORGAN_ROBOT && owner.sdisabilities & SPINE) + return FALSE + . = ..() + /obj/item/organ/external/leg/right organ_tag = BP_R_LEG name = "right leg" @@ -194,6 +204,11 @@ owner.custom_pain("Your [name] burns like it's on fire!",15) owner.Weaken(5) +/obj/item/organ/external/foot/organ_can_feel_pain() + if(robotic < ORGAN_ROBOT && owner.sdisabilities & SPINE) + return FALSE + . = ..() + /obj/item/organ/external/foot/right organ_tag = BP_R_FOOT name = "right foot" diff --git a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainAbnormalities.tsx b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainAbnormalities.tsx index 0822ed78305..08faf4ee7ee 100644 --- a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainAbnormalities.tsx +++ b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainAbnormalities.tsx @@ -11,6 +11,7 @@ export const BodyScannerMainAbnormalities = (props: { occupant: occupant }) => { occupant.blind || occupant.colourblind || occupant.nearsighted || + occupant.brokenspine || occupant.hasVirus || occupant.husked; diff --git a/tgui/packages/tgui/interfaces/BodyScanner/constants.ts b/tgui/packages/tgui/interfaces/BodyScanner/constants.ts index 39b64a25948..3d156c5ad5d 100644 --- a/tgui/packages/tgui/interfaces/BodyScanner/constants.ts +++ b/tgui/packages/tgui/interfaces/BodyScanner/constants.ts @@ -22,6 +22,7 @@ export const abnormalities: (string | ((occupant: occupant) => string))[][] = [ (occupant) => 'Photoreceptor abnormalities detected.', ], ['nearsighted', 'average', (occupant) => 'Retinal misalignment detected.'], + ['brokenspine', 'average', (occupant) => 'Lumbar spine impairement.'], [ 'humanPrey', 'average', diff --git a/tgui/packages/tgui/interfaces/BodyScanner/types.ts b/tgui/packages/tgui/interfaces/BodyScanner/types.ts index 4ea5a70ab81..1e5dc730454 100644 --- a/tgui/packages/tgui/interfaces/BodyScanner/types.ts +++ b/tgui/packages/tgui/interfaces/BodyScanner/types.ts @@ -31,6 +31,7 @@ export type occupant = { intOrgan: internalOrgan[]; blind: BooleanLike; nearsighted: BooleanLike; + brokenspine: BooleanLike; livingPrey: number; humanPrey: number; objectPrey: number;