adds processing_quirk to control if a quirk should start processing or not

This commit is contained in:
Timothy Teakettle
2022-05-28 21:05:51 +01:00
parent c50746354f
commit 3f260298e7
3 changed files with 13 additions and 2 deletions
+5 -2
View File
@@ -14,6 +14,7 @@
/// should we immediately call on_spawn or add a timer to trigger
var/on_spawn_immediate = TRUE
var/mob/living/quirk_holder
var/processing_quirk = FALSE
/datum/quirk/New(mob/living/quirk_mob, spawn_effects)
if(!quirk_mob || (human_only && !ishuman(quirk_mob)) || quirk_mob.has_quirk(type))
@@ -25,7 +26,8 @@
quirk_holder.roundstart_quirks += src
if(mob_trait)
ADD_TRAIT(quirk_holder, mob_trait, ROUNDSTART_TRAIT)
START_PROCESSING(SSquirks, src)
if(processing_quirk)
START_PROCESSING(SSquirks, src)
add()
if(spawn_effects)
if(on_spawn_immediate)
@@ -35,7 +37,8 @@
addtimer(CALLBACK(src, .proc/post_add), 30)
/datum/quirk/Destroy()
STOP_PROCESSING(SSquirks, src)
if(processing_quirk)
STOP_PROCESSING(SSquirks, src)
remove()
if(quirk_holder)
to_chat(quirk_holder, lose_text)
+1
View File
@@ -72,6 +72,7 @@
mob_trait = TRAIT_JOLLY
mood_quirk = TRUE
medical_record_text = "Patient demonstrates constant euthymia irregular for environment. It's a bit much, to be honest."
processing_quirk = TRUE
/datum/quirk/jolly/on_process()
if(prob(0.05))
+7
View File
@@ -25,6 +25,7 @@
lose_text = "<span class='notice'>You no longer feel depressed.</span>" //if only it were that easy!
medical_record_text = "Patient has a severe mood disorder, causing them to experience acute episodes of depression."
mood_quirk = TRUE
processing_quirk = TRUE
/datum/quirk/depression/on_process()
if(prob(0.05))
@@ -38,6 +39,7 @@
medical_record_text = "Patient demonstrates an unnatural attachment to a family heirloom."
var/obj/item/heirloom
var/where
processing_quirk = TRUE
GLOBAL_LIST_EMPTY(family_heirlooms)
@@ -102,6 +104,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
gain_text = "<span class='danger'>You feel smooth.</span>"
lose_text = "<span class='notice'>You feel wrinkled again.</span>"
medical_record_text = "Patient has a tumor in their brain that is slowly driving them to brain death."
processing_quirk = TRUE
/datum/quirk/brainproblems/on_process()
quirk_holder.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2)
@@ -128,6 +131,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
desc = "As far as you can remember, you've always been afraid of the dark. While in the dark without a light source, you instinctually act careful, and constantly feel a sense of dread."
value = -1
medical_record_text = "Patient demonstrates a fear of the dark. (Seriously?)"
processing_quirk = TRUE
/datum/quirk/nyctophobia/on_process()
var/mob/living/carbon/human/H = quirk_holder
@@ -156,6 +160,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
gain_text = "<span class='danger'>Bright lights seem irritating.</span>"
lose_text = "<span class='notice'>Enlightening.</span>"
medical_record_text = "Despite my warnings, the patient refuses turn on the lights, only to end up rolling down a full flight of stairs and into the cellar."
processing_quirk = TRUE
/datum/quirk/lightless/on_process()
var/turf/T = get_turf(quirk_holder)
@@ -236,6 +241,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
gain_text = "<span class='userdanger'>...</span>"
lose_text = "<span class='notice'>You feel in tune with the world again.</span>"
medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations."
processing_quirk = TRUE
/datum/quirk/insanity/on_process()
if(quirk_holder.reagents.has_reagent(/datum/reagent/toxin/mindbreaker))
@@ -261,6 +267,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
lose_text = "<span class='notice'>You feel easier about talking again.</span>" //if only it were that easy!
medical_record_text = "Patient is usually anxious in social encounters and prefers to avoid them."
var/dumb_thing = TRUE
processing_quirk = TRUE
/datum/quirk/social_anxiety/add()
RegisterSignal(quirk_holder, COMSIG_MOB_EYECONTACT, .proc/eye_contact)