Files
Cameron Lennox 69d9e1bf43 Misc fixes (#19425)
* WIP swoopie fix

* no self suck

* Update vacpack.dm

* Update vacpack.dm

* Update vacpack.dm

* fixes CPR on self

* Fixes shoes

* Fixes leash issue

Fixes #18979

* Fixes looping sounds

Fixes it so that if a looping sound returns NULL or FALSE for its get_sound (i.e. geiger counters) they don't play(), meaning they don't send a sound that motion tracking can see.

* Makes paralysis and stunned count for incorp movement

* Fake flowers

* Fixes borg items turning brown

* Update industrial_reagent_waste.dm

* teshari rigfix

* Fixes urns and cyborgknives

* Update find_spawning.dm

* Makes telecube spawn mated

* Update inducer_vr.dm

* Update find_spawning.dm

* Fixes drop everything admin command

* Adds strip mine

* Update robot.dm

* typooo

* flarefix

* Update find_spawning.dm

* Makse archaeological_find abstract

This only spawns if a runtime occurs
2026-04-20 22:56:22 -04:00

80 lines
2.1 KiB
Plaintext

/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
for(var/obj/item/toy/bouquet/flowers in things)
if(istype(flowers, /obj/item/toy/bouquet/fake)) //Plastic doesn't trigger pollen.
continue
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
. = ..()