Fear and Phobias (#16220)

Added a new fear variable and fear overlay. When fear is over 30, you have a chance to make and feel fear related emotes, and your aim gets worse. At fear over 80, you make more emotes and you will sometimes drop your active item.

Added 8 new phobia neutral traits. These traits trigger a build up of fear under certain circumstances. These traits are:
This commit is contained in:
SatinIsle
2024-08-31 05:27:50 +10:00
committed by GitHub
parent 295ae0f235
commit 069f2e1b1b
13 changed files with 226 additions and 4 deletions
@@ -162,4 +162,6 @@
// Custom Species Name
var/custom_species
var/block_hud
var/block_hud
var/phobias //For holding a list of phobias
@@ -73,6 +73,8 @@
handle_heartbeat()
handle_nif() //VOREStation Addition
if(phobias)
handle_phobias()
if(!client)
species.handle_npc(src)
@@ -1244,6 +1246,27 @@
if(tiredness >= 100)
Sleeping(5)
if(fear)
fear = (fear - 1)
if(fear >= 80 && is_preference_enabled(/datum/client_preference/play_ambiance))
if(last_fear_sound + 51 SECONDS <= world.time)
src << sound('sound/effects/Heart Beat.ogg',0,0,0,25)
last_fear_sound = world.time
if(fear >= 80 && !isSynthetic())
if(prob(1) && get_active_hand())
var/stuff_to_drop = get_active_hand()
drop_item()
visible_message("<span class='notice'>\The [src] suddenly drops their [stuff_to_drop].</span>","<span class='warning'>You drop your [stuff_to_drop]!</span>")
if(prob(5))
var/fear_self = pick(fear_message_self)
var/fear_other = pick(fear_message_other)
visible_message("<span class='notice'>\The [src][fear_other]</span>","<span class='warning'>[fear_self]</span>")
else if(fear >= 30 && !isSynthetic())
if(prob(2))
var/fear_self = pick(fear_message_self)
var/fear_other = pick(fear_message_other)
visible_message("<span class='notice'>\The [src][fear_other]</span>","<span class='warning'>[fear_self]</span>")
if(paralysis || sleeping)
blinded = 1
set_stat(UNCONSCIOUS)
@@ -1442,6 +1465,19 @@
else
clear_fullscreen("tired")
if(fear)
var/severity = 0
switch(fear)
if(10 to 20) severity = 1
if(20 to 30) severity = 2
if(30 to 50) severity = 3
if(50 to 70) severity = 4
if(70 to 90) severity = 5
if(90 to INFINITY) severity = 6
overlay_fullscreen("fear", /obj/screen/fullscreen/fear, severity)
else
clear_fullscreen("fear")
if(healths)
if (chem_effects[CE_PAINKILLER] > 100)
healths.icon_state = "health_numb"
@@ -0,0 +1,58 @@
//Handling and defining of phobias and fears
#define NYCTOPHOBIA 1
#define ARACHNOPHOBIA 2
#define HEMOPHOBIA 4
#define THALASSOPHOBIA 8
#define CLAUSTROPHOBIA_MINOR 16
#define CLAUSTROPHOBIA_MAJOR 32
#define ANATIDAEPHOBIA 64
#define AGRAVIAPHOBIA 128
/mob/living/carbon/human/proc/handle_phobias()
if(phobias & NYCTOPHOBIA)
var/turf/T = get_turf(src)
var/brightness = T.get_lumcount()
if(brightness < 0.2)
fear = min((fear + 3), 102)
if(phobias & ARACHNOPHOBIA)
for (var/mob/living/simple_mob/animal/giant_spider/S in viewers(src, null))
if(!istype(S) || S.stat)
continue
fear = min((fear + 6), 102)
if(phobias & HEMOPHOBIA)
for(var/obj/effect/decal/cleanable/blood/B in view(7, src))
var/obj/effect/decal/cleanable/blood/oil/O = B
var/obj/effect/decal/cleanable/blood/tracks/T = B
if(istype(O) || istype(T))
continue
fear = min((fear + 2), 102)
for(var/turf/simulated/floor/water/blood/T in view(7, src))
fear = min((fear + 2), 102)
if(phobias & THALASSOPHOBIA)
var/turf/T = get_turf(src)
if(istype(T,/turf/simulated/floor/water/underwater) || istype(T,/turf/simulated/floor/water/deep))
fear = min((fear + 4), 102)
if(phobias & CLAUSTROPHOBIA_MINOR)
if(!isturf(loc))
if(!istype(loc,/obj/belly) && !istype(loc,/obj/item/weapon/holder/micro))
fear = min((fear + 3), 102)
if(phobias & CLAUSTROPHOBIA_MAJOR) //Also activated inside of a belly
if(!isturf(loc))
if(!istype(loc,/obj/item/weapon/holder/micro))
fear = min((fear + 3), 102)
if(phobias & ANATIDAEPHOBIA)
for (var/mob/living/simple_mob/animal/space/goose/G in viewers(src, null))
if(!istype(G) || G.stat)
continue
fear = min((fear + 3), 102)
for (var/mob/living/simple_mob/animal/sif/duck/D in viewers(src, null))
if(!istype(D) || D.stat)
continue
fear = min((fear + 3), 102)
for(var/obj/item/weapon/bikehorn/rubberducky/R in view(7, src))
if(!istype(R))
continue
fear = min((fear + 2), 102)
if(phobias & AGRAVIAPHOBIA)
if(is_floating)
fear = min((fear + 4), 102)
@@ -1088,3 +1088,86 @@
/datum/trait/neutral/food_pref/coffee
)
our_allergens = list(ALLERGEN_STIMULANT)
//////////////PHOBIAS/////////////////
/datum/trait/neutral/nyctophobia
name = "Phobia: Nyctophobia"
desc = "You are afraid of the dark. When in very dark conditions, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/nyctophobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= NYCTOPHOBIA
/datum/trait/neutral/arachnophobia
name = "Phobia: Arachnophobia"
desc = "You are afraid of spiders. When you can see a large spider, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/arachnophobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= ARACHNOPHOBIA
/datum/trait/neutral/hemophobia
name = "Phobia: Hemophobia"
desc = "You are afraid of blood. When you can see large amounts of blood, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/hemophobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= HEMOPHOBIA
/datum/trait/neutral/thalassophobia
name = "Phobia: Thalassophobia"
desc = "You are afraid of deep water. When in deep water, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/thalassophobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= THALASSOPHOBIA
/datum/trait/neutral/clasutrophobia_minor
name = "Phobia: Claustrophobia (non-vore)"
desc = "You are afraid of tight, enclosed spaces. When inside of another object, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/clasutrophobia_minor/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= CLAUSTROPHOBIA_MINOR
/datum/trait/neutral/clasutrophobia_major
name = "Phobia: Claustrophobia (vore)"
desc = "You are afraid of tight, enclosed spaces. When inside of another object, including vore bellies, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/clasutrophobia_major/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= CLAUSTROPHOBIA_MAJOR
/datum/trait/neutral/anatidaephobia
name = "Phobia: Anatidaephobia"
desc = "You are afraid of ducks. When you can see a duck (even rubber ones), you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/anatidaephobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= ANATIDAEPHOBIA
/datum/trait/neutral/agraviaphobia
name = "Phobia: Agraviaphobia"
desc = "You are afraid of a lack of gravity. When you find yourself floating, you will become afraid."
cost = 0
custom_only = FALSE
/datum/trait/neutral/agraviaphobia/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.phobias |= AGRAVIAPHOBIA
+23
View File
@@ -83,3 +83,26 @@
var/datum/inventory_panel/inventory_panel
var/last_resist_time = 0 // world.time of the most recent resist that wasn't on cooldown.
var/tiredness = 0 //For vore draining
var/fear = 0 //For fear effects and phobias
var/last_fear_sound = 0 //For making sure the heartbeats don't play over each other
var/list/fear_message_self = list(
"Your heart is racing, it feels like it's going burst from your chest.",
"Your stomach clenches and churns with anxiety.",
"It's getting hard to breathe, you're panting heavily.",
"You feel your eyes straining.",
"A sharp shiver runs down your spine.",
"You feel like you are drowning.",
"You feel your palms clamming up.",
"Your legs feel weak, you can barely control them.",
"You have difficulty even swallowing."
)
var/list/fear_message_other = list(
"'s eyes are darting around the room rapidly.",
" looks like they are shivering, literally shaking.",
" is breathing rapidly.",
" looks profoundly uncomfortable.",
"s literally trembling in front of you.",
"'s hands are shaking.",
" is rocking slightly from side to side."
)