From 33b212411219d0d63f3cd8a9acc1f13072bdda53 Mon Sep 17 00:00:00 2001 From: DATAxPUNGED <44149906+DATA-xPUNGED@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:44:17 -0300 Subject: [PATCH] You can now pick the limb you want replaced with the Prosthetic Limb Quirk. (#78517) ## About The Pull Request The Prosthetic Limb quirk allows you to pick the limb you want. The default is still random ## Why It's Good For The Game Good for character customization, which is always nice. Statics who got a specific limb replaced can now represent that properly in-game. Also, this makes the quirk show up on the dummy on the character customization again. This *does* cause a slight issue where when you switch to another character, it keeps the previous' skin color, but it's minor enough that i think the benefits are worth the drawback. If asked i will make it not appear on the dummy though. ## Changelog DATA_, with great help from Kapu:cl: add: You can now choose the prosthetic you want with the Prosthetic Limb quirk. /:cl: --- code/_globalvars/lists/quirks.dm | 8 +++++ .../quirks/negative_quirks/prosthetic_limb.dm | 31 +++++++------------ code/modules/client/preferences/prosthetic.dm | 17 ++++++++++ tgstation.dme | 1 + .../character_preferences/prosthetic.tsx | 6 ++++ 5 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 code/modules/client/preferences/prosthetic.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prosthetic.tsx diff --git a/code/_globalvars/lists/quirks.dm b/code/_globalvars/lists/quirks.dm index 8838ce69ab7..30fce3e295b 100644 --- a/code/_globalvars/lists/quirks.dm +++ b/code/_globalvars/lists/quirks.dm @@ -9,3 +9,11 @@ GLOBAL_LIST_INIT(nearsighted_glasses, list( "Jamjar" = /obj/item/clothing/glasses/regular/jamjar, "Binoclard" = /obj/item/clothing/glasses/regular/kim, )) + +///Options for the prothetic limb quirk to choose from +GLOBAL_LIST_INIT(limb_choice, list( + "Left Arm" = /obj/item/bodypart/arm/left/robot/surplus, + "Right Arm" = /obj/item/bodypart/arm/right/robot/surplus, + "Left Leg" = /obj/item/bodypart/leg/left/robot/surplus, + "Right Leg" = /obj/item/bodypart/leg/right/robot/surplus, +)) diff --git a/code/datums/quirks/negative_quirks/prosthetic_limb.dm b/code/datums/quirks/negative_quirks/prosthetic_limb.dm index f6f0e304a6d..e7ea4d75788 100644 --- a/code/datums/quirks/negative_quirks/prosthetic_limb.dm +++ b/code/datums/quirks/negative_quirks/prosthetic_limb.dm @@ -3,9 +3,8 @@ desc = "An accident caused you to lose one of your limbs. Because of this, you now have a surplus prosthetic!" icon = "tg-prosthetic-leg" value = -3 - medical_record_text = "During physical examination, patient was found to have a low-budget prosthetic limb." hardcore_value = 3 - quirk_flags = QUIRK_HUMAN_ONLY // while this technically changes appearance, we don't want it to be shown on the dummy because it's randomized at roundstart + quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_CHANGES_APPEARANCE mail_goodies = list(/obj/item/weldingtool/mini, /obj/item/stack/cable_coil/five) /// The slot to replace, in string form var/slot_string = "limb" @@ -13,28 +12,20 @@ var/obj/item/bodypart/old_limb /datum/quirk/prosthetic_limb/add_unique(client/client_source) - var/limb_slot = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) + var/limb_type = GLOB.limb_choice[client_source?.prefs?.read_preference(/datum/preference/choiced/prosthetic)] + if(isnull(limb_type)) //Client gone or they chose a random prosthetic + limb_type = GLOB.limb_choice[pick(GLOB.limb_choice)] + var/mob/living/carbon/human/human_holder = quirk_holder - var/obj/item/bodypart/prosthetic - switch(limb_slot) - if(BODY_ZONE_L_ARM) - prosthetic = new /obj/item/bodypart/arm/left/robot/surplus - slot_string = "left arm" - if(BODY_ZONE_R_ARM) - prosthetic = new /obj/item/bodypart/arm/right/robot/surplus - slot_string = "right arm" - if(BODY_ZONE_L_LEG) - prosthetic = new /obj/item/bodypart/leg/left/robot/surplus - slot_string = "left leg" - if(BODY_ZONE_R_LEG) - prosthetic = new /obj/item/bodypart/leg/right/robot/surplus - slot_string = "right leg" - medical_record_text = "During physical examination, patient was found to have a low-budget prosthetic [slot_string]." - old_limb = human_holder.return_and_replace_bodypart(prosthetic, special = TRUE) + var/obj/item/bodypart/surplus = new limb_type() + slot_string = "[surplus.plaintext_zone]" + + medical_record_text = "Patient uses a low-budget prosthetic on the [slot_string]." + old_limb = human_holder.return_and_replace_bodypart(surplus, special = TRUE) /datum/quirk/prosthetic_limb/post_add() to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a surplus prosthetic. It is fragile and will easily come apart under duress. Additionally, \ - you need to use a welding tool and cables to repair it, instead of bruise packs and ointment.")) + you need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes.")) /datum/quirk/prosthetic_limb/remove() var/mob/living/carbon/human/human_holder = quirk_holder diff --git a/code/modules/client/preferences/prosthetic.dm b/code/modules/client/preferences/prosthetic.dm new file mode 100644 index 00000000000..f66f1278c48 --- /dev/null +++ b/code/modules/client/preferences/prosthetic.dm @@ -0,0 +1,17 @@ +/datum/preference/choiced/prosthetic + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_key = "prosthetic" + savefile_identifier = PREFERENCE_CHARACTER + +/datum/preference/choiced/prosthetic/init_possible_values() + return list("Random") + GLOB.limb_choice + +/datum/preference/choiced/prosthetic/is_accessible(datum/preferences/preferences) + . = ..() + if (!.) + return FALSE + + return "Prosthetic Limb" in preferences.all_quirks + +/datum/preference/choiced/prosthetic/apply_to_human(mob/living/carbon/human/target, value) + return diff --git a/tgstation.dme b/tgstation.dme index 9cd7325ba7c..3ce8071ab9c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3419,6 +3419,7 @@ #include "code\modules\client\preferences\preferred_map.dm" #include "code\modules\client\preferences\pride_pin.dm" #include "code\modules\client\preferences\prisoner_crime.dm" +#include "code\modules\client\preferences\prosthetic.dm" #include "code\modules\client\preferences\random.dm" #include "code\modules\client\preferences\runechat.dm" #include "code\modules\client\preferences\scaling_method.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prosthetic.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prosthetic.tsx new file mode 100644 index 00000000000..adbaefe90c8 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/prosthetic.tsx @@ -0,0 +1,6 @@ +import { FeatureChoiced, FeatureDropdownInput } from '../base'; + +export const prosthetic: FeatureChoiced = { + name: 'Prosthetic', + component: FeatureDropdownInput, +};