From f6eca7afad08724f4b25e386075dc15dae1730f0 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 20 Jan 2021 15:06:53 -0700
Subject: [PATCH] hugboxy shit
---
code/datums/explosion.dm | 15 ++++++++++-----
code/game/atoms.dm | 2 +-
code/modules/mob/death.dm | 2 +-
code/modules/mob/living/carbon/death.dm | 13 +++++++++----
code/modules/mob/living/death.dm | 12 ++++++------
5 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm
index ca65186063..24cc29fa54 100644
--- a/code/datums/explosion.dm
+++ b/code/datums/explosion.dm
@@ -89,7 +89,7 @@ GLOBAL_LIST_EMPTY(explosions)
if(adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [ADMIN_VERBOSEJMP(epicenter)]")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [loc_name(epicenter)]")
-
+
deadchat_broadcast("An explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) has occured at ([get_area(epicenter)])", turf_target = get_turf(epicenter))
var/x0 = epicenter.x
@@ -115,7 +115,7 @@ GLOBAL_LIST_EMPTY(explosions)
var/sound/creaking_explosion_sound = sound(get_sfx("explosion_creaking"))
var/sound/hull_creaking_sound = sound(get_sfx("hull_creaking"))
var/sound/explosion_echo_sound = sound('sound/effects/explosion_distant.ogg')
- var/on_station = SSmapping.level_trait(epicenter.z, ZTRAIT_STATION)
+ var/on_station = SSmapping.level_trait(epicenter.z, ZTRAIT_STATION)
var/creaking_explosion = FALSE
if(prob(devastation_range*30+heavy_impact_range*5) && on_station) // Huge explosions are near guaranteed to make the station creak and whine, smaller ones might.
@@ -148,7 +148,7 @@ GLOBAL_LIST_EMPTY(explosions)
if(!baseshakeamount) // Devastating explosions rock the station and ground
baseshakeamount = devastation_range*3
shake_camera(M, 10, clamp(baseshakeamount*0.25, 0, 2.5))
-
+
else if(M.can_hear() && !isspaceturf(get_turf(M)) && heavy_impact_range) // Big enough explosions echo throughout the hull
var/echo_volume = 40
if(devastation_range)
@@ -230,8 +230,13 @@ GLOBAL_LIST_EMPTY(explosions)
atoms += A
for(var/i in atoms)
var/atom/A = i
- if(!QDELETED(A))
- A.ex_act(dist)
+ if(QDELETED(A))
+ continue
+ A.ex_act(dist, null, src)
+ if(QDELETED(A) || !ismovable(A))
+ continue
+ var/atom/movable/AM = A
+ LAZYADD(AM.acted_explosions, explosion_id)
if(flame_dist && prob(40) && !isspaceturf(T) && !T.density)
new /obj/effect/hotspot(T) //Mostly for ambience!
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 7fbfe48f4e..be1ef4833a 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -429,7 +429,7 @@
/atom/proc/contents_explosion(severity, target)
return //For handling the effects of explosions on contents that would not normally be effected
-/atom/proc/ex_act(severity, target)
+/atom/proc/ex_act(severity, target, datum/explosion/E)
set waitfor = FALSE
contents_explosion(severity, target)
SEND_SIGNAL(src, COMSIG_ATOM_EX_ACT, severity, target)
diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm
index 09336d2fea..476bddded3 100644
--- a/code/modules/mob/death.dm
+++ b/code/modules/mob/death.dm
@@ -1,6 +1,6 @@
//This is the proc for gibbing a mob. Cannot gib ghosts.
//added different sort of gibs and animations. N
-/mob/proc/gib()
+/mob/proc/gib(no_brain, no_organs, no_bodyparts, datum/explosion/was_explosion)
return
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm
index ee2f945b65..528848fb14 100644
--- a/code/modules/mob/living/carbon/death.dm
+++ b/code/modules/mob/living/carbon/death.dm
@@ -17,7 +17,7 @@
if(SSticker.mode)
SSticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
-/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts)
+/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts, datum/explosion/was_explosion)
var/atom/Tsec = drop_location()
for(var/mob/M in src)
if(M in stomach_contents)
@@ -27,7 +27,7 @@
"You burst out of [src]!")
..()
-/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
+/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts, datum/explosion/was_explosion)
var/atom/Tsec = drop_location()
if(!no_bodyparts)
if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
@@ -41,6 +41,8 @@
qdel(O) //so the brain isn't transfered to the head when the head drops.
continue
if(!(O.organ_flags & ORGAN_NO_DISMEMBERMENT) && check_zone(O.zone) == BODY_ZONE_CHEST)
+ if(was_explosion)
+ LAZYADD(O.acted_explosions, was_explosion.explosion_id)
O.Remove()
O.forceMove(Tsec)
O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
@@ -50,13 +52,16 @@
if(I.organ_flags & ORGAN_NO_DISMEMBERMENT || (no_brain && istype(I, /obj/item/organ/brain)) || (no_organs && !istype(I, /obj/item/organ/brain)))
qdel(I)
continue
+ if(was_explosion)
+ LAZYADD(I.acted_explosions, was_explosion.explosion_id)
I.Remove()
I.forceMove(Tsec)
I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
-
-/mob/living/carbon/spread_bodyparts()
+/mob/living/carbon/spread_bodyparts(no_brain, no_organs, datum/explosion/was_explosion)
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
+ if(was_explosion)
+ LAZYADD(BP.acted_explosions, was_explosion.explosion_id)
BP.drop_limb()
BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index 688b0cf63e..be9cd0aabb 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -1,4 +1,4 @@
-/mob/living/gib(no_brain, no_organs, no_bodyparts)
+/mob/living/gib(no_brain, no_organs, no_bodyparts, datum/explosion/was_explosion)
var/prev_lying = lying
if(stat != DEAD)
death(1)
@@ -6,22 +6,22 @@
if(!prev_lying)
gib_animation()
- spill_organs(no_brain, no_organs, no_bodyparts)
+ spill_organs(no_brain, no_organs, no_bodyparts, was_explosion)
if(!no_bodyparts)
- spread_bodyparts(no_brain, no_organs)
+ spread_bodyparts(no_brain, no_organs, was_explosion)
for(var/X in implants)
var/obj/item/implant/I = X
qdel(I)
- spawn_gibs(no_bodyparts)
+ spawn_gibs(no_bodyparts, null, was_explosion)
qdel(src)
/mob/living/proc/gib_animation()
return
-/mob/living/proc/spawn_gibs(with_bodyparts, atom/loc_override)
+/mob/living/proc/spawn_gibs(with_bodyparts, atom/loc_override, datum/explosion/was_explosion)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(mob_biotypes & MOB_ROBOTIC)
new /obj/effect/gibspawner/robot(location, src, get_static_viruses())
@@ -31,7 +31,7 @@
/mob/living/proc/spill_organs()
return
-/mob/living/proc/spread_bodyparts()
+/mob/living/proc/spread_bodyparts(no_brain, no_organs, datum/explosion/was_explosion)
return
/mob/living/dust(just_ash, drop_items, force)