mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Photophobia quirk [MDB IGNORE] (#22721)
* Photophobia quirk * Update quirks.dm --------- Co-authored-by: Alexis <catmc8565@gmail.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
committed by
nevimer
co-authored by
Alexis
Bloop
parent
67edd9d218
commit
a86658796a
@@ -35,6 +35,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
list("Stormtrooper Aim", "Big Hands"),
|
||||
list("Bilingual", "Foreigner"),
|
||||
list("Spacer", "Paraplegic"),
|
||||
list("Photophobia", "Nyctophobia"),
|
||||
//SKYRAT EDIT ADDITION BEGIN
|
||||
list("Nerve Stapled", "Pacifist"),
|
||||
list("Nerve Stapled", "Nearsighted"),
|
||||
|
||||
@@ -128,6 +128,10 @@
|
||||
mood_change = -3
|
||||
timeout = 5 MINUTES
|
||||
|
||||
/datum/mood_event/photophobia
|
||||
description = "The lights are too bright..."
|
||||
mood_change = -3
|
||||
|
||||
/datum/mood_event/nyctophobia
|
||||
description = "It sure is dark around here..."
|
||||
mood_change = -3
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//predominantly negative traits
|
||||
|
||||
/datum/quirk/badback
|
||||
name = "Bad Back"
|
||||
desc = "Thanks to your poor posture, backpacks and other bags never sit right on your back. More evenly weighted objects are fine, though."
|
||||
@@ -367,6 +366,7 @@
|
||||
hardcore_value = 3
|
||||
mail_goodies = list(/obj/item/reagent_containers/cup/glass/waterbottle)
|
||||
|
||||
|
||||
/datum/quirk/item_quirk/nearsighted
|
||||
name = "Nearsighted"
|
||||
desc = "You are nearsighted without prescription glasses, but spawn with a pair."
|
||||
@@ -445,6 +445,78 @@
|
||||
quirk_holder.toggle_move_intent()
|
||||
quirk_holder.add_mood_event("nyctophobia", /datum/mood_event/nyctophobia)
|
||||
|
||||
#define MOOD_CATEGORY_PHOTOPHOBIA "photophobia"
|
||||
|
||||
/datum/quirk/photophobia
|
||||
name = "Photophobia"
|
||||
desc = "Bright lights seem to bother you more than others. Maybe it's a medical condition."
|
||||
icon = FA_ICON_ARROWS_TO_EYE
|
||||
value = -4
|
||||
gain_text = span_danger("The safety of light feels off...")
|
||||
lose_text = span_notice("Enlightening.")
|
||||
medical_record_text = "Patient has acute phobia of light, and insists it is physically harmful."
|
||||
hardcore_value = 4
|
||||
mail_goodies = list(
|
||||
/obj/item/flashlight/flashdark,
|
||||
/obj/item/food/grown/mushroom/glowshroom/shadowshroom,
|
||||
/obj/item/skillchip/light_remover,
|
||||
)
|
||||
|
||||
/datum/quirk/photophobia/add(client/client_source)
|
||||
RegisterSignal(quirk_holder, COMSIG_CARBON_GAIN_ORGAN, PROC_REF(check_eyes))
|
||||
RegisterSignal(quirk_holder, COMSIG_CARBON_LOSE_ORGAN, PROC_REF(restore_eyes))
|
||||
RegisterSignal(quirk_holder, COMSIG_MOVABLE_MOVED, PROC_REF(on_holder_moved))
|
||||
update_eyes(quirk_holder.get_organ_slot(ORGAN_SLOT_EYES))
|
||||
|
||||
UnregisterSignal(quirk_holder, list(
|
||||
COMSIG_CARBON_GAIN_ORGAN,
|
||||
COMSIG_CARBON_LOSE_ORGAN,
|
||||
COMSIG_MOVABLE_MOVED,))
|
||||
quirk_holder.clear_mood_event(MOOD_CATEGORY_PHOTOPHOBIA)
|
||||
|
||||
/datum/quirk/photophobia/proc/check_eyes(obj/item/organ/internal/eyes/sensitive_eyes)
|
||||
SIGNAL_HANDLER
|
||||
if(!istype(sensitive_eyes))
|
||||
return
|
||||
update_eyes(sensitive_eyes)
|
||||
|
||||
/datum/quirk/photophobia/proc/update_eyes(obj/item/organ/internal/eyes/target_eyes)
|
||||
if(!istype(target_eyes))
|
||||
return
|
||||
target_eyes.flash_protect = max(target_eyes.flash_protect - 1, FLASH_PROTECTION_HYPER_SENSITIVE)
|
||||
|
||||
/datum/quirk/photophobia/proc/restore_eyes(obj/item/organ/internal/eyes/normal_eyes)
|
||||
SIGNAL_HANDLER
|
||||
if(!istype(normal_eyes))
|
||||
return
|
||||
normal_eyes.flash_protect = initial(normal_eyes.flash_protect)
|
||||
|
||||
/datum/quirk/photophobia/proc/on_holder_moved(mob/living/source, atom/old_loc, dir, forced)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(quirk_holder.stat != CONSCIOUS || quirk_holder.IsSleeping() || quirk_holder.IsUnconscious())
|
||||
return
|
||||
|
||||
if(HAS_TRAIT(quirk_holder, TRAIT_FEARLESS))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/human_holder = quirk_holder
|
||||
|
||||
if(human_holder.sight & SEE_TURFS)
|
||||
return
|
||||
|
||||
var/turf/holder_turf = get_turf(quirk_holder)
|
||||
|
||||
var/lums = holder_turf.get_lumcount()
|
||||
|
||||
var/eye_protection = quirk_holder.get_eye_protection()
|
||||
if(lums < LIGHTING_TILE_IS_DARK || eye_protection >= FLASH_PROTECTION_NONE)
|
||||
quirk_holder.clear_mood_event(MOOD_CATEGORY_PHOTOPHOBIA)
|
||||
return
|
||||
quirk_holder.add_mood_event(MOOD_CATEGORY_PHOTOPHOBIA, /datum/mood_event/photophobia)
|
||||
|
||||
#undef MOOD_CATEGORY_PHOTOPHOBIA
|
||||
|
||||
/datum/quirk/softspoken
|
||||
name = "Soft-Spoken"
|
||||
desc = "You are soft-spoken, and your voice is hard to hear."
|
||||
|
||||
Reference in New Issue
Block a user