Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Allow hemiplegic users to pick which side is disabled #2488

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};
Loading