Skip to content

Commit

Permalink
A bunch of quirk refactors + improvements (Monkestation#4642)
Browse files Browse the repository at this point in the history
* A bunch of quirk refactors + improvements

* Fix a runtime with the heterochromatic quirk (usually during credits)

* properly clone heterochromatic and phobia, dont clone junkie/smoker, prevent runtimes in bilingual

* fix test failures related to clown disbelief

* Add some medical record text, exclude some others from scans, and sort variables

* okay this ain't needed

* ???

* okay im just trying to see wtf is going on with CI now

* lmao of fucking course

* yeah fuck it lets visually align all of those bc why not

* Fix invalid args being passed to `on_clone`

* move sign language to `add()`

* fix clowns not believing in themselves

* get rid of `QUIRK_BRIGHT_EYES`

* change filename to avoid conflict with Monkestation#4140 hopefully??
  • Loading branch information
Absolucy authored and Gw0sty committed Jan 9, 2025
1 parent fdc6c83 commit e38dc7a
Show file tree
Hide file tree
Showing 72 changed files with 871 additions and 849 deletions.
12 changes: 7 additions & 5 deletions code/__DEFINES/quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
#define CAT_QUIRK_MAJOR_DISABILITY 3

/// This quirk can only be applied to humans
#define QUIRK_HUMAN_ONLY (1<<0)
#define QUIRK_HUMAN_ONLY (1 << 0)
/// This quirk processes on SSquirks (and should implement quirk process)
#define QUIRK_PROCESSES (1<<1)
#define QUIRK_PROCESSES (1 << 1)
/// This quirk is has a visual aspect in that it changes how the player looks. Used in generating dummies.
#define QUIRK_CHANGES_APPEARANCE (1<<2)
#define QUIRK_CHANGES_APPEARANCE (1 << 2)
/// The only thing this quirk effects is mood so it should be disabled if mood is
#define QUIRK_MOODLET_BASED (1<<3)
#define QUIRK_MOODLET_BASED (1 << 3)
/// This quirk shouldn't be shown by health analyzers and hud, perhaps as considering it medical condition is a far stretch.
#define QUIRK_HIDE_FROM_SCAN (1<<4)
#define QUIRK_HIDE_FROM_SCAN (1 << 4)
/// Cloning should never carry this quirk over (monkestation addition)
#define QUIRK_DONT_CLONE (1 << 5)
4 changes: 2 additions & 2 deletions code/__DEFINES/traits/_traits.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define SIGNAL_ADDTRAIT(trait_ref) "addtrait [trait_ref]"
#define SIGNAL_REMOVETRAIT(trait_ref) "removetrait [trait_ref]"
#define SIGNAL_ADDTRAIT(trait_ref) ("addtrait " + trait_ref)
#define SIGNAL_REMOVETRAIT(trait_ref) ("removetrait " + trait_ref)

// trait accessor defines
#define ADD_TRAIT(target, trait, source) \
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/traits/monkestation/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#define TRAIT_CAT "cat"
#define TRAIT_FEEBLE "feeble"
#define TRAIT_GOURMAND "gourmand"
#define TRAIT_HIDDEN_CLOWN "clown_disbelief"
#define TRAIT_CLOWN_DISBELIEVER "clown_disbeliever"
#define TRAIT_HIDDEN_IMAGE "generic-hidden-image"
#define TRAIT_JAILBIRD "jailbird"
#define TRAIT_LOUD_ASS "loud_ass"
Expand Down
12 changes: 12 additions & 0 deletions code/__HELPERS/~monkestation-helpers/game.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// Used to get a random closed and non-secure locker on the station z-level, created for the Stowaway trait.
/proc/get_unlocked_closed_locker()
var/list/eligible_lockers = list()
for(var/obj/structure/closet/closet as anything in GLOB.closets)
if(QDELETED(closet) || closet.opened || istype(closet, /obj/structure/closet/secure_closet))
continue
var/turf/closet_turf = get_turf(closet)
if(!closet_turf || !is_station_level(closet_turf.z) || !is_safe_turf(closet_turf, dense_atoms = TRUE))
continue
eligible_lockers += closet
if(length(eligible_lockers))
return pick(eligible_lockers)
16 changes: 16 additions & 0 deletions code/__HELPERS/~monkestation-helpers/uwuify.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define UWUIFY_ACREPLACE_KEY "uwuify"

/// uwuifies text, used by fluffy tongue quirk and the cyborg UwU-speak "upgrade"
/proc/uwuify_text(text)
var/static/acreplace_setup = FALSE
if(!acreplace_setup)
//yeah i just precalculated all combinations
rustg_setup_acreplace( \
UWUIFY_ACREPLACE_KEY, \
list( "ne", "Ne", "nE", "NE", "nu", "Nu", "nU", "NU", "na", "Na", "nA", "NA", "no", "No", "nO", "NO", "ove", "Ove", "oVe", "OVe", "ovE", "OvE", "oVE", "OVE", "r", "R", "l", "L"), \
list("nye", "Nye", "nYe", "NYe", "nyu", "Nyu", "nYu", "NYu", "nya", "Nya", "nYa", "NYa", "nyo", "Nyo", "nYo", "NYo", "uv", "Uv", "uV", "UV", "uv", "Uv", "uV", "UV", "w", "W", "w", "W") \
)
acreplace_setup = TRUE
return rustg_acreplace(UWUIFY_ACREPLACE_KEY, "[text]")

#undef UWUIFY_ACREPLACE_KEY
12 changes: 6 additions & 6 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CHUUNIBYOU" = TRAIT_CHUUNIBYOU,
"TRAIT_CLEANBOT_WHISPERER" = TRAIT_CLEANBOT_WHISPERER,
"TRAIT_CLIFF_WALKER" = TRAIT_CLIFF_WALKER,
"TRAIT_CLOWN_DISBELIEVER" = TRAIT_CLOWN_DISBELIEVER,
"TRAIT_CLOWN_ENJOYER" = TRAIT_CLOWN_ENJOYER,
"TRAIT_CLUMSY" = TRAIT_CLUMSY,
"TRAIT_COAGULATING" = TRAIT_COAGULATING,
Expand Down Expand Up @@ -247,6 +248,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_FREE_HYPERSPACE_SOFTCORDON_MOVEMENT" = TRAIT_FREE_HYPERSPACE_SOFTCORDON_MOVEMENT,
"TRAIT_FRIENDLY" = TRAIT_FRIENDLY,
"TRAIT_FUGU_GLANDED" = TRAIT_FUGU_GLANDED,
"TRAIT_FUR_COLORS" = TRAIT_FUR_COLORS,
"TRAIT_GAMER" = TRAIT_GAMER,
"TRAIT_GAMERGOD" = TRAIT_GAMERGOD,
"TRAIT_GARLIC_BREATH" = TRAIT_GARLIC_BREATH,
Expand All @@ -263,13 +265,13 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_HARDLY_WOUNDED" = TRAIT_HARDLY_WOUNDED,
"TRAIT_HARD_SOLES" = TRAIT_HARD_SOLES,
"TRAIT_HAS_BEEN_KIDNAPPED" = TRAIT_HAS_BEEN_KIDNAPPED,
"TRAIT_HAS_MARKINGS" = TRAIT_HAS_MARKINGS,
"TRAIT_HATED_BY_DOGS" = TRAIT_HATED_BY_DOGS,
"TRAIT_HEALS_FROM_CARP_RIFTS" = TRAIT_HEALS_FROM_CARP_RIFTS,
"TRAIT_HEALS_FROM_CULT_PYLONS" = TRAIT_HEALS_FROM_CULT_PYLONS,
"TRAIT_HEAR_THROUGH_DARKNESS" = TRAIT_HEAR_THROUGH_DARKNESS,
"TRAIT_HEAVY_SLEEPER" = TRAIT_HEAVY_SLEEPER,
"TRAIT_HELIUM" = TRAIT_HELIUM,
"TRAIT_HIDDEN_CLOWN" = TRAIT_HIDDEN_CLOWN,
"TRAIT_HIDDEN_IMAGE" = TRAIT_HIDDEN_IMAGE,
"TRAIT_HIDE_EXTERNAL_ORGANS" = TRAIT_HIDE_EXTERNAL_ORGANS,
"TRAIT_HOLY" = TRAIT_HOLY,
Expand All @@ -291,7 +293,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_JAILBIRD" = TRAIT_JAILBIRD,
"TRAIT_JOLLY" = TRAIT_JOLLY,
"TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH,
"TRAIT_SYNDIE_KISS" = TRAIT_SYNDIE_KISS,
"TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT,
"TRAIT_KNOW_ENGI_WIRES" = TRAIT_KNOW_ENGI_WIRES,
"TRAIT_KNOW_ROBO_WIRES" = TRAIT_KNOW_ROBO_WIRES,
Expand Down Expand Up @@ -321,10 +322,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_MUSICIAN" = TRAIT_MUSICIAN,
"TRAIT_MUTANT_COLORS" = TRAIT_MUTANT_COLORS,
"TRAIT_MUTANT_COLORS_SECONDARY" = TRAIT_MUTANT_COLORS_SECONDARY,
"TRAIT_FUR_COLORS" = TRAIT_FUR_COLORS,
"TRAIT_NO_TRANSFORMATION_STING" = TRAIT_NO_TRANSFORMATION_STING,
"TRAIT_NO_HUSK" = TRAIT_NO_HUSK,
"TRAIT_HAS_MARKINGS" = TRAIT_HAS_MARKINGS,
"TRAIT_MUTE" = TRAIT_MUTE,
"TRAIT_NAIVE" = TRAIT_NAIVE,
"TRAIT_NANITE_MONITORING" = TRAIT_NANITE_MONITORING,
Expand Down Expand Up @@ -358,6 +355,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_EXTINGUISH" = TRAIT_NO_EXTINGUISH,
"TRAIT_NO_FLOATING_ANIM" = TRAIT_NO_FLOATING_ANIM,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_HUSK" = TRAIT_NO_HUSK,
"TRAIT_NO_IMMOBILIZE" = TRAIT_NO_IMMOBILIZE,
"TRAIT_NO_JUMPSUIT" = TRAIT_NO_JUMPSUIT,
"TRAIT_NO_MINDSWAP" = TRAIT_NO_MINDSWAP,
Expand All @@ -371,6 +369,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_SPRINT" = TRAIT_NO_SPRINT,
"TRAIT_NO_STRIP" = TRAIT_NO_STRIP,
"TRAIT_NO_TRANSFORM" = TRAIT_NO_TRANSFORM,
"TRAIT_NO_TRANSFORMATION_STING" = TRAIT_NO_TRANSFORMATION_STING,
"TRAIT_NO_UNDERWEAR" = TRAIT_NO_UNDERWEAR,
"TRAIT_NO_ZOMBIFY" = TRAIT_NO_ZOMBIFY,
"TRAIT_NUKEIMMUNE" = TRAIT_NUKEIMMUNE,
Expand All @@ -385,6 +384,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CANT_ATTACK" = TRAIT_CANT_ATTACK,
"TRAIT_PARALYSIS_L_ARM" = TRAIT_PARALYSIS_L_ARM,
"TRAIT_PARALYSIS_L_LEG" = TRAIT_PARALYSIS_L_LEG,
"TRAIT_SYNDIE_KISS" = TRAIT_SYNDIE_KISS,
"TRAIT_PARALYSIS_R_ARM" = TRAIT_PARALYSIS_R_ARM,
"TRAIT_PARALYSIS_R_LEG" = TRAIT_PARALYSIS_R_LEG,
"TRAIT_PARANOIA" = TRAIT_PARANOIA,
Expand Down
49 changes: 35 additions & 14 deletions code/datums/quirks/_quirk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@
/// The base weight for the each quirk's mail goodies list to be selected is 5
/// then the item selected is determined by pick(selected_quirk.mail_goodies)
var/list/mail_goodies = list() //Monkestation Edit BLOOD_DATUM: Why? this is already a list all this does is mess confuse us.
/// The minimum stat where this quirk can process (if it has QUIRK_PROCESSES)
var/minimum_process_stat = HARD_CRIT
/// A list of additional signals to register with update_process()
var/list/process_update_signals

/datum/quirk/Destroy()
if(quirk_holder)
remove_from_current_holder()

return ..()

/// Called when quirk_holder is qdeleting. Simply qdels this datum and lets Destroy() handle the rest.
Expand Down Expand Up @@ -78,7 +81,11 @@
add(client_source)

if(quirk_flags & QUIRK_PROCESSES)
START_PROCESSING(SSquirks, src)
RegisterSignal(quirk_holder, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed))
if(process_update_signals)
RegisterSignals(quirk_holder, process_update_signals, PROC_REF(update_process))
if(should_process())
START_PROCESSING(SSquirks, src)

if(!quirk_transfer)
if(gain_text)
Expand All @@ -99,7 +106,9 @@
if(!quirk_holder)
CRASH("Attempted to remove quirk from the current holder when it has no current holder.")

UnregisterSignal(quirk_holder, list(COMSIG_MOB_LOGIN, COMSIG_QDELETING))
UnregisterSignal(quirk_holder, list(COMSIG_MOB_STATCHANGE, COMSIG_MOB_LOGIN, COMSIG_QDELETING))
if(process_update_signals)
UnregisterSignal(quirk_holder, process_update_signals)

quirk_holder.quirks -= src

Expand All @@ -124,10 +133,10 @@
* Used when the quirk has been gained and no client is attached to the mob.
*/
/datum/quirk/proc/on_quirk_holder_first_login(mob/living/source)
SIGNAL_HANDLER
SIGNAL_HANDLER

UnregisterSignal(source, COMSIG_MOB_LOGIN)
post_add()
UnregisterSignal(source, COMSIG_MOB_LOGIN)
post_add()

/// Any effect that should be applied every single time the quirk is added to any mob, even when transferred.
/datum/quirk/proc/add(client/client_source)
Expand All @@ -148,13 +157,25 @@
/datum/quirk/proc/post_add()
return

/// return additional data that should be remembered by cloning
/datum/quirk/proc/clone_data()
return
/// Returns if the quirk holder should process currently or not.
/datum/quirk/proc/should_process()
SHOULD_CALL_PARENT(TRUE)
SHOULD_BE_PURE(TRUE)
return (quirk_flags & QUIRK_PROCESSES) && !QDELETED(quirk_holder) && quirk_holder.stat <= minimum_process_stat

/// create the quirk from clone data
/datum/quirk/proc/on_clone(data)
return
/// Checks to see if the quirk should be processing, and starts/stops it.
/datum/quirk/proc/update_process()
SIGNAL_HANDLER
SHOULD_NOT_OVERRIDE(TRUE)
if(should_process())
START_PROCESSING(SSquirks, src)
else
STOP_PROCESSING(SSquirks, src)

/// Updates processing status whenever the mob's stat changes.
/datum/quirk/proc/on_stat_changed(mob/living/source, new_stat)
SIGNAL_HANDLER
update_process()

/// Subtype quirk that has some bonus logic to spawn items for the player.
/datum/quirk/item_quirk
Expand Down Expand Up @@ -212,7 +233,7 @@
/mob/living/proc/get_quirk_string(medical = FALSE, category = CAT_QUIRK_ALL, from_scan = FALSE)
var/list/dat = list()
for(var/datum/quirk/candidate as anything in quirks)
if(from_scan & candidate.quirk_flags & QUIRK_HIDE_FROM_SCAN)
if((from_scan && (candidate.quirk_flags & QUIRK_HIDE_FROM_SCAN)) || (medical && !candidate.medical_record_text))
continue
switch(category)
if(CAT_QUIRK_MAJOR_DISABILITY)
Expand All @@ -226,7 +247,7 @@
continue
dat += medical ? candidate.medical_record_text : candidate.name

if(!dat.len)
if(!length(dat))
return medical ? "No issues have been declared." : "None"
return medical ? dat.Join("<br>") : dat.Join(", ")

Expand Down
20 changes: 9 additions & 11 deletions code/datums/quirks/negative_quirks/allergic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
lose_text = span_notice("You feel your immune system phase back into perfect shape.")
medical_record_text = "Patient's immune system responds violently to certain chemicals."
hardcore_value = 3
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_PROCESSES
mail_goodies = list(/obj/item/reagent_containers/hypospray/medipen) // epinephrine medipen stops allergic reactions
process_update_signals = list(
SIGNAL_ADDTRAIT(TRAIT_STASIS),
SIGNAL_REMOVETRAIT(TRAIT_STASIS),
)
var/list/allergies = list()
var/list/blacklist = list(
/datum/reagent/medicine/c2,
Expand All @@ -20,7 +24,7 @@
/datum/reagent/medicine/diphenhydramine,
/datum/reagent/medicine/changelingadrenaline,
/datum/reagent/medicine/spaceacillin
)
)
var/allergy_string

/datum/quirk/item_quirk/allergic/add_unique(client/client_source)
Expand All @@ -45,15 +49,6 @@
to_chat(quirk_holder, span_boldnotice("You are allergic to [allergy_string], make sure not to consume any of these!"))

/datum/quirk/item_quirk/allergic/process(seconds_per_tick)
if(!iscarbon(quirk_holder))
return

if(HAS_TRAIT(quirk_holder, TRAIT_STASIS))
return

if(quirk_holder.stat == DEAD)
return

var/mob/living/carbon/carbon_quirk_holder = quirk_holder
for(var/allergy in allergies)
var/datum/reagent/instantiated_med = carbon_quirk_holder.reagents.has_reagent(allergy)
Expand All @@ -69,3 +64,6 @@
if(SPT_PROB(10, seconds_per_tick))
carbon_quirk_holder.vomit()
carbon_quirk_holder.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN,ORGAN_SLOT_APPENDIX,ORGAN_SLOT_LUNGS,ORGAN_SLOT_HEART,ORGAN_SLOT_LIVER,ORGAN_SLOT_STOMACH),10)

/datum/quirk/item_quirk/allergic/should_process()
return iscarbon(quirk_holder) && ..() && !HAS_TRAIT(quirk_holder, TRAIT_STASIS)
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/bad_back.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = "Thanks to your poor posture, backpacks and other bags never sit right on your back. More evenly weighted objects are fine, though."
icon = FA_ICON_HIKING
value = -8
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_MOODLET_BASED
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_MOODLET_BASED
gain_text = span_danger("Your back REALLY hurts!")
lose_text = span_notice("Your back feels better.")
medical_record_text = "Patient scans indicate severe and chronic back pain."
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/bad_touch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gain_text = span_danger("You just want people to leave you alone.")
lose_text = span_notice("You could use a big hug.")
medical_record_text = "Patient has disdain for being touched. Potentially has undiagnosed haphephobia."
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_MOODLET_BASED
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_MOODLET_BASED
hardcore_value = 1
mail_goodies = list(/obj/item/reagent_containers/spray/pepper) // show me on the doll where the bad man touched you

Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/blindness.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
lose_text = span_notice("You miraculously gain back your vision.")
medical_record_text = "Patient has permanent blindness."
hardcore_value = 15
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_CHANGES_APPEARANCE
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_CHANGES_APPEARANCE
mail_goodies = list(/obj/item/clothing/glasses/sunglasses, /obj/item/cane/white)

/datum/quirk/item_quirk/blindness/add_unique(client/client_source)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/body_purist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = "You believe your body is a temple and its natural form is an embodiment of perfection. Accordingly, you despise the idea of ever augmenting it with unnatural parts, cybernetic, prosthetic, or anything like it."
icon = FA_ICON_PERSON_RAYS
value = -2
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_MOODLET_BASED
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_MOODLET_BASED
gain_text = span_danger("You now begin to hate the idea of having cybernetic implants.")
lose_text = span_notice("Maybe cybernetics aren't so bad. You now feel okay with augmentations and prosthetics.")
medical_record_text = "This patient has disclosed an extreme hatred for unnatural bodyparts and augmentations."
Expand Down
15 changes: 8 additions & 7 deletions code/datums/quirks/negative_quirks/brain_problems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
lose_text = span_notice("You feel wrinkled again.")
medical_record_text = "Patient has a tumor in their brain that is slowly driving them to brain death."
hardcore_value = 12
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_PROCESSES | QUIRK_DONT_CLONE // monkestation edit: QUIRK_DONT_CLONE (the cloner isn't gonna clone ur tumor lol)
mail_goodies = list(/obj/item/storage/pill_bottle/mannitol/braintumor)
process_update_signals = list(
SIGNAL_ADDTRAIT(TRAIT_TUMOR_SUPPRESSED),
SIGNAL_REMOVETRAIT(TRAIT_TUMOR_SUPPRESSED),
)

/datum/quirk/item_quirk/brainproblems/add_unique(client/client_source)
give_item_to_holder(
Expand All @@ -28,10 +32,7 @@
)

/datum/quirk/item_quirk/brainproblems/process(seconds_per_tick)
if(quirk_holder.stat == DEAD)
return

if(HAS_TRAIT(quirk_holder, TRAIT_TUMOR_SUPPRESSED))
return

quirk_holder.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2 * seconds_per_tick)

/datum/quirk/item_quirk/brainproblems/should_process()
return ..() && !HAS_TRAIT(quirk_holder, TRAIT_TUMOR_SUPPRESSED)
18 changes: 10 additions & 8 deletions code/datums/quirks/negative_quirks/claustrophobia.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
value = -4
medical_record_text = "Patient demonstrates a fear of tight spaces."
hardcore_value = 5
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES
quirk_flags = QUIRK_HUMAN_ONLY | QUIRK_PROCESSES
minimum_process_stat = CONSCIOUS
mail_goodies = list(/obj/item/reagent_containers/syringe/convermol) // to help breathing
process_update_signals = list(
SIGNAL_ADDTRAIT(TRAIT_FEARLESS),
SIGNAL_REMOVETRAIT(TRAIT_FEARLESS),
)

/datum/quirk/claustrophobia/remove()
quirk_holder.clear_mood_event("claustrophobia")

/datum/quirk/claustrophobia/process(seconds_per_tick)
if(quirk_holder.stat != CONSCIOUS || quirk_holder.IsSleeping() || quirk_holder.IsUnconscious())
return

if(HAS_TRAIT(quirk_holder, TRAIT_FEARLESS))
return

var/nick_spotted = FALSE

for(var/mob/living/carbon/human/possible_claus in view(5, quirk_holder))
Expand All @@ -37,6 +36,9 @@
else
to_chat(quirk_holder, span_warning("You feel trapped! Must escape... can't breathe..."))

/datum/quirk/claustrophobia/should_process()
return ..() && !HAS_TRAIT(quirk_holder, TRAIT_FEARLESS)

///investigates whether possible_saint_nick possesses a high level of christmas cheer
/datum/quirk/claustrophobia/proc/evaluate_jolly_levels(mob/living/carbon/human/possible_saint_nick)
if(!istype(possible_saint_nick))
Expand All @@ -45,7 +47,7 @@
if(istype(possible_saint_nick.back, /obj/item/storage/backpack/santabag))
return TRUE

if(istype(possible_saint_nick.head, /obj/item/clothing/head/costume/santa) || istype(possible_saint_nick.head, /obj/item/clothing/head/helmet/space/santahat))
if(istype(possible_saint_nick.head, /obj/item/clothing/head/costume/santa) || istype(possible_saint_nick.head, /obj/item/clothing/head/helmet/space/santahat))
return TRUE

if(istype(possible_saint_nick.wear_suit, /obj/item/clothing/suit/space/santa))
Expand Down
Loading

0 comments on commit e38dc7a

Please # to comment.