From 497de6640bedc1f27f053a45500bdb8f8da79fc9 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+AnArgonianLizardThatStealsPRs@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:23:27 +0300 Subject: [PATCH] [MIRROR] You can't hurt yourself with your own brimdemon beam [MDB IGNORE] (#622) * You can't hurt yourself with your own brimdemon beam (#79688) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: Jacquerel --- .../mob/living/basic/lavaland/brimdemon/brimbeam.dm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/basic/lavaland/brimdemon/brimbeam.dm b/code/modules/mob/living/basic/lavaland/brimdemon/brimbeam.dm index b8e2bb68c69..21169ffd368 100644 --- a/code/modules/mob/living/basic/lavaland/brimdemon/brimbeam.dm +++ b/code/modules/mob/living/basic/lavaland/brimdemon/brimbeam.dm @@ -66,9 +66,10 @@ break if(blocked) break - var/atom/new_brimbeam = new /obj/effect/brimbeam(affected_turf) + var/obj/effect/brimbeam/new_brimbeam = new(affected_turf) new_brimbeam.dir = owner.dir beam_parts += new_brimbeam + new_brimbeam.assign_creator(owner) for(var/mob/living/hit_mob in affected_turf.contents) hit_mob.apply_damage(damage = 25, damagetype = BURN) to_chat(hit_mob, span_userdanger("You're blasted by [owner]'s brimbeam!")) @@ -101,6 +102,8 @@ light_color = LIGHT_COLOR_BLOOD_MAGIC light_power = 3 light_range = 2 + /// Who made us? + var/datum/weakref/creator /obj/effect/brimbeam/Initialize(mapload) . = ..() @@ -111,7 +114,10 @@ return ..() /obj/effect/brimbeam/process() + var/atom/ignore = creator?.resolve() for(var/mob/living/hit_mob in get_turf(src)) + if(hit_mob == ignore) + continue damage(hit_mob) /// Hurt the passed mob @@ -119,6 +125,10 @@ hit_mob.apply_damage(damage = 5, damagetype = BURN) to_chat(hit_mob, span_danger("You're damaged by [src]!")) +/// Ignore damage dealt to this mob +/obj/effect/brimbeam/proc/assign_creator(mob/living/maker) + creator = WEAKREF(maker) + /// Disappear /obj/effect/brimbeam/proc/disperse() animate(src, time = 0.5 SECONDS, alpha = 0)