From e2b0bac2b64732894d1e002dec394c663b8e1e02 Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:57:26 +0100 Subject: [PATCH] Proc to easy spawn in hallucinations (#27582) * Proc to easy spawn in hallucinations * Comment --- code/modules/mob/living/carbon/human/human_mob.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index 5f44270409e..f4b5626df38 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -2064,3 +2064,14 @@ Eyes need to have significantly high darksight to shine unless the mob has the X /mob/living/carbon/human/proc/check_brain_threshold(threshold_level) var/obj/item/organ/internal/brain/brain_organ = get_int_organ(/obj/item/organ/internal/brain) return brain_organ.damage >= (brain_organ.max_damage * threshold_level) + +/* + * Invokes a hallucination on the mob. Hallucination must be a path or a string of a path + */ +/mob/living/carbon/human/proc/invoke_hallucination(hallucination_to_make) + var/string_path = text2path(hallucination_to_make) + if(!ispath(hallucination_to_make)) + if(!string_path) + return + hallucination_to_make = string_path + new hallucination_to_make(get_turf(src), src)