[MIRROR] Having very very low sanity will rarely cause hallucintions [MDB IGNORE] (#16775)

* Having very very low sanity will rarely cause hallucintions (#70311)

* Being insane now causes you hallucinations, and hallucination immune has been renamed to RDS immune, since it only works for the quirk.

* Having very very low sanity will rarely cause hallucintions

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-10-11 17:47:16 +01:00
committed by GitHub
co-authored by MrMelbert
parent 7947051eab
commit edf8846a50
7 changed files with 58 additions and 7 deletions
-1
View File
@@ -732,4 +732,3 @@
/// Checking flags for [/mob/proc/can_read()]
#define READING_CHECK_LITERACY (1<<0)
#define READING_CHECK_LIGHT (1<<1)
+1 -1
View File
@@ -320,7 +320,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// prevents the damage done by a brain tumor
#define TRAIT_TUMOR_SUPPRESSED "brain_tumor_suppressed"
/// Prevents hallucinations from the hallucination brain trauma (RDS)
#define TRAIT_HALLUCINATION_SUPPRESSED "hallucination_suppressed"
#define TRAIT_RDS_SUPPRESSED "rds_suppressed"
/// overrides the update_fire proc to always add fire (for lava)
#define TRAIT_PERMANENTLY_ONFIRE "permanently_onfire"
/// Galactic Common Sign Language
+1 -1
View File
@@ -14,7 +14,7 @@
/datum/brain_trauma/mild/hallucinations/on_life(delta_time, times_fired)
if(owner.stat != CONSCIOUS || owner.IsSleeping() || owner.IsUnconscious())
return
if(HAS_TRAIT(owner, TRAIT_HALLUCINATION_SUPPRESSED))
if(HAS_TRAIT(owner, TRAIT_RDS_SUPPRESSED))
return
owner.adjust_hallucinations_up_to(10 SECONDS * delta_time, 100 SECONDS)
+7
View File
@@ -499,6 +499,13 @@
mob_parent.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/high_sanity)
sanity_level = SANITY_LEVEL_GREAT
// Crazy or insane = add some uncommon hallucinations
if(sanity_level >= SANITY_CRAZY)
mob_parent.apply_status_effect(/datum/status_effect/hallucination/sanity)
else
mob_parent.remove_status_effect(/datum/status_effect/hallucination/sanity)
update_mood_icon()
/// Sets the insanity effect on the mob
+6
View File
@@ -525,6 +525,8 @@
medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations."
hardcore_value = 6
mail_goodies = list(/obj/item/storage/pill_bottle/lsdpsych)
/// Weakref to the trauma we give out
var/datum/weakref/added_trama_ref
/datum/quirk/insanity/add()
if(!iscarbon(quirk_holder))
@@ -543,6 +545,7 @@
added_trauma.lose_text = null
carbon_quirk_holder.gain_trauma(added_trauma)
added_trama_ref = WEAKREF(added_trauma)
/datum/quirk/insanity/post_add()
if(!quirk_holder.mind || quirk_holder.mind.special_role)
@@ -552,6 +555,9 @@
to_chat(quirk_holder, "<span class='big bold info'>Please note that your [lowertext(name)] does NOT give you the right to attack people or otherwise cause any interference to \
the round. You are not an antagonist, and the rules will treat you the same as other crewmembers.</span>")
/datum/quirk/insanity/remove()
QDEL_NULL(added_trama_ref)
/datum/quirk/social_anxiety
name = "Social Anxiety"
desc = "Talking to people is very difficult for you, and you often stutter or even lock up."
@@ -15,11 +15,12 @@
/datum/status_effect/hallucination/on_creation(
mob/living/new_owner,
duration = 10 SECONDS,
duration,
affects_silicons = FALSE,
)
src.duration = duration
if(isnum(duration))
src.duration = duration
src.affects_silicons = affects_silicons
return ..()
@@ -89,3 +90,41 @@
var/datum/hallucination/picked_hallucination = pick_weight(GLOB.random_hallucination_weighted_list)
owner.cause_hallucination(picked_hallucination, "[id] status effect")
COOLDOWN_START(src, hallucination_cooldown, rand(lower_tick_interval, upper_tick_interval))
// Sanity related hallucinations
/datum/status_effect/hallucination/sanity
id = "low sanity"
status_type = STATUS_EFFECT_REFRESH
duration = -1 // This lasts "forever", only goes away with sanity gain
/datum/status_effect/hallucination/sanity/on_apply()
if(!owner.mob_mood)
return FALSE
update_intervals()
return ..()
/datum/status_effect/hallucination/sanity/refresh(...)
update_intervals()
/datum/status_effect/hallucination/sanity/tick(delta_time, times_fired)
// Using psicodine / happiness / whatever to become fearless will stop sanity based hallucinations
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return
return ..()
/// Updates our upper and lower intervals based on our owner's current sanity level.
/datum/status_effect/hallucination/sanity/proc/update_intervals()
switch(owner.mob_mood.sanity_level)
if(SANITY_LEVEL_CRAZY)
upper_tick_interval = 8 MINUTES
lower_tick_interval = 4 MINUTES
if(SANITY_LEVEL_INSANE)
upper_tick_interval = 4 MINUTES
lower_tick_interval = 2 MINUTES
else
stack_trace("[type] was assigned a mob which was not crazy or insane. (was: [owner.mob_mood.sanity_level])")
qdel(src)
@@ -309,11 +309,11 @@
/datum/reagent/toxin/mindbreaker/on_mob_metabolize(mob/living/metabolizer)
. = ..()
ADD_TRAIT(metabolizer, TRAIT_HALLUCINATION_SUPPRESSED, type)
ADD_TRAIT(metabolizer, TRAIT_RDS_SUPPRESSED, type)
/datum/reagent/toxin/mindbreaker/on_mob_end_metabolize(mob/living/metabolizer)
. = ..()
REMOVE_TRAIT(metabolizer, TRAIT_HALLUCINATION_SUPPRESSED, type)
REMOVE_TRAIT(metabolizer, TRAIT_RDS_SUPPRESSED, type)
/datum/reagent/toxin/mindbreaker/on_mob_life(mob/living/carbon/metabolizer, delta_time, times_fired)
// mindbreaker toxin assuages hallucinations in those plagued with it, mentally