mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 04:02:31 +00:00
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
33 lines
889 B
Plaintext
33 lines
889 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()
|
|
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.make_jittery(1000)
|
|
|
|
/datum/component/epilepsy_disability/Destroy(force = FALSE)
|
|
UnregisterSignal(owner, COMSIG_HANDLE_DISABILITIES)
|
|
owner = null
|
|
. = ..()
|