From 7c1445dbf2b5371eafdff92ba30c6b18aa7a70a7 Mon Sep 17 00:00:00 2001 From: 4dplanner <3combined@gmail.com> Date: Fri, 18 Jan 2019 09:43:34 +0000 Subject: [PATCH] Hierophant burst is async (#42290) I noticed that I had 4 hierophant kills logged on the stats hub, which is off by about an order of magnitude. What happens is that on death hierophant releases an expanding square, which you're meant to run from - this puts you out of range for the medal. --- .../simple_animal/hostile/megafauna/hierophant.dm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 6a47bf00c84..9bfea62e912 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -108,10 +108,9 @@ Difficulty: Hard else stat = DEAD blinking = TRUE //we do a fancy animation, release a huge burst(), and leave our staff. - burst_range = 10 visible_message("\"Mrmxmexmrk wipj-hiwxvygx wiuyirgi...\"") visible_message("[src] shrinks, releasing a massive burst of energy!") - burst(get_turf(src)) + INVOKE_ASYNC(GLOBAL_PROC, .proc/hierophant_burst, null, get_turf(src), 10) ..() /mob/living/simple_animal/hostile/megafauna/hierophant/Destroy() @@ -423,7 +422,8 @@ Difficulty: Hard for(var/t in RANGE_TURFS(1, T)) new /obj/effect/temp_visual/hierophant/blast(t, src, FALSE) -/mob/living/simple_animal/hostile/megafauna/hierophant/proc/burst(turf/original, spread_speed = 0.5) //release a wave of blasts +//expanding square +/proc/hierophant_burst(mob/caster, turf/original, burst_range, spread_speed = 0.5) playsound(original,'sound/machines/airlockopen.ogg', 200, 1) var/last_dist = 0 for(var/t in spiral_range_turfs(burst_range, original)) @@ -434,7 +434,10 @@ Difficulty: Hard if(dist > last_dist) last_dist = dist sleep(1 + min(burst_range - last_dist, 12) * spread_speed) //gets faster as it gets further out - new /obj/effect/temp_visual/hierophant/blast(T, src, FALSE) + new /obj/effect/temp_visual/hierophant/blast(T, caster, FALSE) + +/mob/living/simple_animal/hostile/megafauna/hierophant/proc/burst(turf/original, spread_speed) + hierophant_burst(src, original, burst_range, spread_speed) /mob/living/simple_animal/hostile/megafauna/hierophant/AltClickOn(atom/A) //player control handler(don't give this to a player holy fuck) if(!istype(A) || get_dist(A, src) <= 2) @@ -641,7 +644,8 @@ Difficulty: Hard H.Goto(get_turf(caster), H.move_to_delay, 3) if(monster_damage_boost && (ismegafauna(L) || istype(L, /mob/living/simple_animal/hostile/asteroid))) L.adjustBruteLoss(damage) - log_combat(caster, L, "struck with a [name]") + if(caster) + log_combat(caster, L, "struck with a [name]") for(var/obj/mecha/M in T.contents - hit_things) //also damage mechs. hit_things += M if(M.occupant)