From acb0315c5b8355fd1ae392b777cd62ebaa771d36 Mon Sep 17 00:00:00 2001 From: EgorDinamit Date: Sat, 30 Sep 2023 23:52:54 +0300 Subject: [PATCH] Fix veil of shadows --- .../modules/spells/general/veil_of_shadows.dm | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/code/modules/spells/general/veil_of_shadows.dm b/code/modules/spells/general/veil_of_shadows.dm index 57d18e7544d..db645c8b0c5 100644 --- a/code/modules/spells/general/veil_of_shadows.dm +++ b/code/modules/spells/general/veil_of_shadows.dm @@ -2,6 +2,7 @@ name = "Veil of Shadows" desc = "Become intangable, invisible. Like a ghost." charge_max = 400 + spell_flags = NEEDSCLOTHES | Z2NOCAST invocation_type = INVOKE_EMOTE invocation = "flickers out of existance" spell_flags = 0 @@ -14,9 +15,14 @@ spell_cost = 3 mana_cost = 20 +/datum/spell/veil_of_shadows/cast_check(skipcharge = FALSE, mob/user = usr, list/targets) + if(!ishuman(user)) + return FALSE + if(user.GetMovementHandler(/datum/movement_handler/mob/incorporeal)) + return FALSE + return ..() + /datum/spell/veil_of_shadows/choose_targets(mob/user = usr) - if(!timer_id && istype(holder, /mob/living/carbon/human)) - perform(user, list(holder)) perform(user, null) /datum/spell/veil_of_shadows/cast(list/targets, mob/user) @@ -24,8 +30,8 @@ H.AddMovementHandler(/datum/movement_handler/mob/incorporeal) if(H.add_cloaking_source(src)) H.visible_message("\The [H] shrinks from view!") - GLOB.moved_event.register(H,src,.proc/check_light) - timer_id = addtimer(CALLBACK(src,.proc/cancel_veil),duration, TIMER_STOPPABLE) + GLOB.moved_event.register(H, src,.proc/check_light) + timer_id = addtimer(CALLBACK(src, .proc/cancel_veil), duration, TIMER_STOPPABLE) /datum/spell/veil_of_shadows/proc/cancel_veil() var/mob/living/carbon/human/H = holder @@ -36,8 +42,8 @@ if(T.get_lumcount() > 0.1) //If we're somewhere somewhat shadowy we can stay invis as long as we stand still drop_cloak() else - GLOB.moved_event.unregister(H,src) - GLOB.moved_event.register(H,src,.proc/drop_cloak) + GLOB.moved_event.unregister(H, src) + GLOB.moved_event.register(H, src, .proc/drop_cloak) /datum/spell/veil_of_shadows/proc/drop_cloak() var/mob/living/carbon/human/H = holder @@ -56,4 +62,4 @@ /datum/spell/veil_of_shadows/Destroy() deltimer(timer_id) cancel_veil() - .= ..() + return ..()