Skip to content

Commit

Permalink
[MIRROR] You can't hurt yourself with your own brimdemon beam [MDB IG…
Browse files Browse the repository at this point in the history
…NORE] (#622)

* You can't hurt yourself with your own brimdemon beam (#79688)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 31b0708 commit 497de66
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/modules/mob/living/basic/lavaland/brimdemon/brimbeam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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!"))
Expand Down Expand Up @@ -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)
. = ..()
Expand All @@ -111,14 +114,21 @@
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
/obj/effect/brimbeam/proc/damage(mob/living/hit_mob)
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)
Expand Down

0 comments on commit 497de66

Please sign in to comment.