Files
VOREStation/code/datums/components/disabilities/coughing.dm
T
Will 8b8b981515 Allergic Reaction Element (And direct_say proc) (#18131)
* new allergies

* Mushroom allergy actually works

* handle allergens

* rework into element

* improved pollen

* shroom tweaks

* Moved say to non blocking

* cleanup

* pollen chance tweak

* small fixes

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
2025-08-08 11:59:26 -04:00

31 lines
732 B
Plaintext

/datum/component/coughing_disability
var/mob/living/owner
var/cough_chance = 5
/datum/component/coughing_disability/Initialize()
if (!isliving(parent))
return COMPONENT_INCOMPATIBLE
owner = parent
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))
return
if(owner.stat != CONSCIOUS)
return
if(owner.transforming)
return
if((prob(cough_chance) && owner.paralysis <= 1))
owner.drop_item()
owner.emote("cough")
/datum/component/coughing_disability/Destroy(force = FALSE)
UnregisterSignal(owner, COMSIG_HANDLE_DISABILITIES)
owner = null
. = ..()