Skip to content

Commit

Permalink
[MIRROR] Allow hemiplegic users to pick which side is disabled (#1541)
Browse files Browse the repository at this point in the history
* Allow hemiplegic users to pick which side is disabled (#81992)

## About The Pull Request

Broadly this code is copied over from the preference code used for
picking prosthetic limbs, with a few changes to make it fit.
It also changes how the quirk displays in the medical records, now
mentioning which side is disabled instead of just half their body.
## Why It's Good For The Game

So of course, first and foremost, I want it personally.
I'm now running a hemiplegic character on Manuel, and I want to able to
pick which side is hemiplegic to match me using heterochromatic eyes to
make it look like they're missing an eye. It's minor, but I think it'd
be nice.

Then, because of that, I think it'd be nice to have for posterity. If I
want it, and I can code it, then the next person who wants it doesn't
have to, y'know?

Lastly, gameplay-wise, it doesn't really matter which side is
hemiplegic, you're permanently missing an arm and a leg either way. So I
feel there's practically no 'powergaming concerns' to be had when it's
this utter shitass to use regardless and the benefits to be gained would
be infinitesimally small in comparison.
## Changelog
:cl:
add: Hemiplegic now lets you pick which side is disabled.
add: The medical records text for hemiplegics now shows which side is
disabled.
/:cl:

* Allow hemiplegic users to pick which side is disabled

---------

Co-authored-by: _0Steven <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Mar 20, 2024
1 parent 8c02f0d commit 372720e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
5 changes: 5 additions & 0 deletions code/_globalvars/lists/quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ GLOBAL_LIST_INIT(limb_choice_transhuman, list(
"Left Leg" = /obj/item/bodypart/leg/left/robot,
"Right Leg" = /obj/item/bodypart/leg/right/robot,
))

GLOBAL_LIST_INIT(side_choice_hemiplegic, list(
"Left Side" = /datum/brain_trauma/severe/paralysis/hemiplegic/left,
"Right Side" = /datum/brain_trauma/severe/paralysis/hemiplegic/right,
))
15 changes: 12 additions & 3 deletions code/datums/quirks/negative_quirks/hemiplegic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@
/obj/item/reagent_containers/cup/glass/drinkingglass/filled/half_full,
)

/datum/quirk/hemiplegic/add(client/client_source)
/datum/quirk_constant_data/hemiplegic
associated_typepath = /datum/quirk/hemiplegic
customization_options = list(/datum/preference/choiced/hemiplegic)

/datum/quirk/hemiplegic/add_unique(client/client_source)
var/datum/brain_trauma/severe/paralysis/hemiplegic/side_choice = GLOB.side_choice_hemiplegic[client_source?.prefs?.read_preference(/datum/preference/choiced/hemiplegic)]
if(isnull(side_choice)) // Client gone or they chose a random side
side_choice = GLOB.side_choice_hemiplegic[pick(GLOB.side_choice_hemiplegic)]

var/mob/living/carbon/human/human_holder = quirk_holder
var/trauma_type = pick(/datum/brain_trauma/severe/paralysis/hemiplegic/left, /datum/brain_trauma/severe/paralysis/hemiplegic/right)
human_holder.gain_trauma(trauma_type, TRAUMA_RESILIENCE_ABSOLUTE)

medical_record_text = "Patient has an untreatable impairment in motor function on the [side_choice::paralysis_type] half of their body."
human_holder.gain_trauma(side_choice, TRAUMA_RESILIENCE_ABSOLUTE)

/datum/quirk/hemiplegic/remove()
var/mob/living/carbon/human/human_holder = quirk_holder
Expand Down
17 changes: 17 additions & 0 deletions code/modules/client/preferences/hemiplegic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/preference/choiced/hemiplegic
category = PREFERENCE_CATEGORY_MANUALLY_RENDERED
savefile_key = "hemiplegic"
savefile_identifier = PREFERENCE_CHARACTER

/datum/preference/choiced/hemiplegic/init_possible_values()
return list("Random") + GLOB.side_choice_hemiplegic

/datum/preference/choiced/hemiplegic/is_accessible(datum/preferences/preferences)
. = ..()
if (!.)
return FALSE

return "Hemiplegic" in preferences.all_quirks

/datum/preference/choiced/hemiplegic/apply_to_human(mob/living/carbon/human/target, value)
return
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,7 @@
#include "code\modules\client\preferences\ghost.dm"
#include "code\modules\client\preferences\ghost_lighting.dm"
#include "code\modules\client\preferences\glasses.dm"
#include "code\modules\client\preferences\hemiplegic.dm"
#include "code\modules\client\preferences\heterochromatic.dm"
#include "code\modules\client\preferences\hotkeys.dm"
#include "code\modules\client\preferences\item_outlines.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { FeatureChoiced, FeatureDropdownInput } from '../base';

export const hemiplegic: FeatureChoiced = {
name: 'Hemiplegic',
component: FeatureDropdownInput,
};

0 comments on commit 372720e

Please sign in to comment.