mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
[MIRROR] Allergic Reaction Element (And direct_say proc) (#11359)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
dd89859bba
commit
f94efe06a4
@@ -10,6 +10,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/coughing_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if (QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/epilepsy_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if (QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/gibbing_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/nervousness_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
|
||||
77
code/datums/components/disabilities/pollen.dm
Normal file
77
code/datums/components/disabilities/pollen.dm
Normal file
@@ -0,0 +1,77 @@
|
||||
/datum/component/pollen_disability
|
||||
var/mob/living/carbon/human/owner
|
||||
var/allergy_chance = 20
|
||||
|
||||
/datum/component/pollen_disability/Initialize()
|
||||
if (!ishuman(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
owner = parent
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/pollen_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(QDELETED(parent))
|
||||
return
|
||||
if(!prob(allergy_chance))
|
||||
return
|
||||
if(!isturf(owner.loc))
|
||||
return
|
||||
if(owner.stat != CONSCIOUS)
|
||||
return
|
||||
if(owner.transforming)
|
||||
return
|
||||
|
||||
// Check for masks or internals
|
||||
if(istype(owner.head,/obj/item/clothing/head/helmet/space) && owner.internal) // Hardsuits
|
||||
return
|
||||
if(owner.wear_mask) // masks block it entirely
|
||||
if(owner.wear_mask.item_flags & AIRTIGHT)
|
||||
if(owner.internal) // gas on
|
||||
return
|
||||
if(owner.wear_mask.item_flags & BLOCK_GAS_SMOKE_EFFECT)
|
||||
return
|
||||
|
||||
// Time to ENGAGE THE ALLERGY
|
||||
if(prob(5) && istype(owner.loc,/turf/simulated/floor/grass))
|
||||
trigger_allergy()
|
||||
return
|
||||
|
||||
// Hand check
|
||||
var/list/things = list()
|
||||
if(prob(32))
|
||||
if(!isnull(owner.r_hand))
|
||||
things += owner.r_hand
|
||||
if(!isnull(owner.l_hand))
|
||||
things += owner.l_hand
|
||||
|
||||
// terrain tests
|
||||
things += owner.loc.contents
|
||||
if(prob(25)) // ranged check
|
||||
things += orange(2,owner.loc)
|
||||
|
||||
// scan irritants!
|
||||
if(things.len)
|
||||
if(locate(/obj/structure/flora) in things)
|
||||
trigger_allergy()
|
||||
return
|
||||
if(locate(/obj/effect/plant) in things)
|
||||
trigger_allergy()
|
||||
return
|
||||
if(locate(/obj/item/toy/bouquet) in things)
|
||||
trigger_allergy()
|
||||
return
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/irritant_tray in things)
|
||||
if(!irritant_tray.dead && !isnull(irritant_tray.seed))
|
||||
trigger_allergy()
|
||||
return
|
||||
|
||||
/datum/component/pollen_disability/proc/trigger_allergy()
|
||||
to_chat(owner, span_danger("[pick("The air feels itchy!","Your face feels uncomfortable!","Your body tingles!")]"))
|
||||
owner.add_chemical_effect(CE_ALLERGEN, rand(5,20) * REM)
|
||||
|
||||
/datum/component/pollen_disability/Destroy(force = FALSE)
|
||||
UnregisterSignal(owner, COMSIG_HANDLE_DISABILITIES)
|
||||
owner = null
|
||||
. = ..()
|
||||
@@ -9,6 +9,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/rotting_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if (QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
RegisterSignal(owner, COMSIG_HANDLE_DISABILITIES, PROC_REF(process_component))
|
||||
|
||||
/datum/component/tourettes_disability/proc/process_component()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(QDELETED(parent))
|
||||
return
|
||||
if(isbelly(owner.loc))
|
||||
@@ -18,6 +20,8 @@
|
||||
return
|
||||
if(owner.transforming)
|
||||
return
|
||||
if(owner.client && (owner.client.prefs.muted & MUTE_IC))
|
||||
return
|
||||
if((prob(1) && prob(2) && owner.paralysis <= 1))
|
||||
owner.Stun(10)
|
||||
owner.make_jittery(100)
|
||||
@@ -25,7 +29,7 @@
|
||||
if(1)
|
||||
owner.emote("twitch")
|
||||
if(2 to 3)
|
||||
owner.say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
|
||||
owner.direct_say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
|
||||
|
||||
|
||||
/datum/component/tourettes_disability/Destroy(force = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user