From f5c51d3f376540ce8a531d3fd9ff7fd86ee8f6b5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 8 Dec 2020 02:05:57 +0100 Subject: [PATCH] [MIRROR] Fixes a consistency issue in which nightmares to heal faster while jaunting and moving (#2075) * Fixes a consistency issue in which nightmares to heal faster while jaunting and moving (#55134) So basically, shadow jaunt calls a proc to check the light level whenever the shadowing moves and normal processing. This proc forces the shadowing out of the jaunt if the light levels were too high BUT ALSO was the same proc used to heal them while in darkness. This means that the shadowing could heal extremely quickly by moving back and forth while in darkness but only healing at a meager rate whilst being motionless in the darkness. So I separated the proc in two and only called the part that heals on process() as well as upping the damage healed for consistency's sake. * Fixes a consistency issue in which nightmares to heal faster while jaunting and moving Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com> --- code/modules/spells/spell_types/shadow_walk.dm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/modules/spells/spell_types/shadow_walk.dm b/code/modules/spells/spell_types/shadow_walk.dm index 2959478fdd3..1256e460908 100644 --- a/code/modules/spells/spell_types/shadow_walk.dm +++ b/code/modules/spells/spell_types/shadow_walk.dm @@ -1,3 +1,5 @@ +#define SHADOW_REGEN_RATE 1.5 + /obj/effect/proc_holder/spell/targeted/shadowwalk name = "Shadow Walk" desc = "Grants unlimited movement in darkness." @@ -46,11 +48,16 @@ STOP_PROCESSING(SSobj, src) . = ..() -/obj/effect/dummy/phased_mob/shadow/process() +/obj/effect/dummy/phased_mob/shadow/process(delta_time) + var/turf/T = get_turf(src) + var/light_amount = T.get_lumcount() if(!jaunter || jaunter.loc != src) qdel(src) + if (light_amount < 0.2 && (!QDELETED(jaunter))) //heal in the dark + jaunter.heal_overall_damage((SHADOW_REGEN_RATE * delta_time), (SHADOW_REGEN_RATE * delta_time), 0, BODYPART_ORGANIC) check_light_level() + /obj/effect/dummy/phased_mob/shadow/relaymove(mob/living/user, direction) var/turf/oldloc = loc . = ..() @@ -68,8 +75,6 @@ var/light_amount = T.get_lumcount() if(light_amount > 0.2) // jaunt ends end_jaunt(TRUE) - else if (light_amount < 0.2 && (!QDELETED(jaunter))) //heal in the dark - jaunter.heal_overall_damage(1,1, 0, BODYPART_ORGANIC) /obj/effect/dummy/phased_mob/shadow/proc/end_jaunt(forced = FALSE) if(jaunter) @@ -79,3 +84,6 @@ visible_message("[jaunter] emerges from the darkness!") playsound(loc, 'sound/magic/ethereal_exit.ogg', 50, TRUE, -1) qdel(src) + + +#undef SHADOW_REGEN_RATE