Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 14599d1

Browse files
committed
Blindness preference
1 parent e205931 commit 14599d1

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

code/datums/traits/negative.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
job_blacklist = list("Captain", "Head of Personnel", "Research Director", "Chief Medical Officer", "Chief Engineer", "Head of Security", "Security Officer", "Warden")
5656

5757
/datum/quirk/blindness/add()
58+
var/blindness_preference = quirk_holder.client.prefs.read_preference(/datum/preference/choiced/blindness_choice)
5859
quirk_holder.become_blind(ROUNDSTART_TRAIT)
59-
quirk_holder.AddComponent(/datum/component/echolocation) //add when echolocation is fixed
60+
if(blindness_preference == "Echolocation")
61+
quirk_holder.AddComponent(/datum/component/echolocation) //add when echolocation is fixed
6062

6163
/datum/quirk/blindness/on_spawn()
6264
var/mob/living/carbon/human/H = quirk_holder
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/datum/preference/choiced/blindness_choice
2+
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
3+
savefile_key = "blindness"
4+
savefile_identifier = PREFERENCE_CHARACTER
5+
6+
/datum/preference/choiced/blindness_choice/create_default_value()
7+
return "Echolocation"
8+
9+
/datum/preference/choiced/blindness_choice/init_possible_values()
10+
return list(
11+
"Echolocation",
12+
"Complete blindness",
13+
"Random",
14+
)
15+
16+
/datum/preference/choiced/blindness_choice/is_accessible(datum/preferences/preferences)
17+
if(!..(preferences))
18+
return FALSE
19+
return preferences.all_quirks.Find("Blind")
20+
21+
/datum/preference/choiced/blindness_choice/apply_to_human(mob/living/carbon/human/target, value)
22+
return
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { FeatureChoiced, FeatureDropdownInput } from "../base";
2+
3+
export const blindness_choice: FeatureChoiced = {
4+
name: "Blindness",
5+
component: FeatureDropdownInput,
6+
};

yogstation.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,7 @@
22452245
#include "code\modules\client\preferences\assets.dm"
22462246
#include "code\modules\client\preferences\auto_fit_viewport.dm"
22472247
#include "code\modules\client\preferences\balloon_alerts.dm"
2248+
#include "code\modules\client\preferences\blindness_choice.dm"
22482249
#include "code\modules\client\preferences\chapel_choice.dm"
22492250
#include "code\modules\client\preferences\clerk_choice.dm"
22502251
#include "code\modules\client\preferences\clothing.dm"

0 commit comments

Comments
 (0)