Files
VOREStation/code/datums/components/disabilities/epilepsy.dm
T
Cameron Lennox 656597529b Fixes some places that paralyze should KO as well (#18973)
* Fixes some places that paralyze should KO as well

* this too
2026-01-04 15:46:03 +01:00

36 lines
927 B
Plaintext

/datum/component/epilepsy_disability
var/mob/living/owner
/datum/component/epilepsy_disability/Initialize()
if (!isliving(parent))
return COMPONENT_INCOMPATIBLE
owner = parent
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))
return
if(owner.stat != CONSCIOUS)
return
if(owner.transforming)
return
if((prob(1) && prob(1) && owner.paralysis < 1))
to_chat(owner, span_red("You have a seizure!"))
for(var/mob/O in viewers(owner, null))
if(O == owner)
continue
O.show_message(span_danger("[owner] starts having a seizure!"), 1)
owner.Paralyse(10)
owner.Sleeping(10)
owner.make_jittery(1000)
/datum/component/epilepsy_disability/Destroy(force = FALSE)
UnregisterSignal(owner, COMSIG_HANDLE_DISABILITIES)
owner = null
. = ..()