Refactored CollidedWith (#19541)

Refactored CollidedWith()
This commit is contained in:
Fluffy
2024-06-29 10:01:18 +00:00
committed by GitHub
parent d63d63d78c
commit d8d67ebd3a
31 changed files with 317 additions and 183 deletions
+10 -8
View File
@@ -405,22 +405,24 @@
living_user.apply_damage(150, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
/obj/machinery/power/supermatter/CollidedWith(atom/AM as mob|obj)
if(!AM.simulated)
/obj/machinery/power/supermatter/CollidedWith(atom/bumped_atom)
. = ..()
if(!bumped_atom.simulated)
return
if(istype(AM, /obj/effect))
if(istype(bumped_atom, /obj/effect))
return
if(isprojectile(AM))
if(isprojectile(bumped_atom))
return
if(istype(AM, /mob/living))
AM.visible_message("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... [AM.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.</span>",\
if(istype(bumped_atom, /mob/living))
bumped_atom.visible_message("<span class=\"warning\">\The [bumped_atom] slams into \the [src] inducing a resonance... [bumped_atom.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.</span>",\
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
else if(!grav_pulling) //To prevent spam, detonating supermatter does not indicate non-mobs being destroyed
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
bumped_atom.visible_message("<span class=\"warning\">\The [bumped_atom] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
Consume(AM)
Consume(bumped_atom)
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
if(istype(user))