From d14b6cc849e725437e2a09d7f9377e7d9aabdf0e Mon Sep 17 00:00:00 2001 From: Timberpoes Date: Sat, 18 Sep 2021 18:13:16 +0100 Subject: [PATCH] Radically improves explosion logging. (#61419) Adds some extra vars and logic to explosion code to make powerful logging entries that should help admins narrow down when explosives get misused. Records this new info in the feedback database and bumps the explosion version +1 as a result of this. --- code/__DEFINES/dcs/signals.dm | 6 +- code/__DEFINES/explosions.dm | 2 + code/controllers/subsystem/blackbox.dm | 2 +- code/controllers/subsystem/explosions.dm | 98 +++++++++++++++---- code/datums/diseases/advance/symptoms/fire.dm | 4 +- code/datums/diseases/rhumba_beat.dm | 2 +- code/datums/elements/volatile_gas_storage.dm | 2 +- code/datums/martial/plasma_fist.dm | 2 +- code/datums/mutations/body.dm | 2 +- .../effects/effect_system/effects_other.dm | 13 ++- code/game/objects/items/cigs_lighters.dm | 6 +- code/game/objects/items/granters.dm | 2 +- code/game/objects/items/grenades/plastic.dm | 6 +- .../items/implants/implant_explosive.dm | 4 +- code/game/objects/items/tools/weldingtool.dm | 2 +- code/game/turfs/closed/minerals.dm | 4 +- code/modules/admin/admin_verbs.dm | 10 +- code/modules/admin/smites/bsa.dm | 2 +- code/modules/admin/verbs/adminfun.dm | 2 +- .../antagonists/changeling/powers/headcrab.dm | 2 +- .../eldritch_cult/eldritch_effects.dm | 2 +- code/modules/assembly/bomb.dm | 14 +-- .../binary_devices/thermomachine.dm | 4 +- .../awaymissions/bluespaceartillery.dm | 2 +- .../awaymissions/mission_code/Academy.dm | 2 +- .../awaymissions/mission_code/wildwest.dm | 2 +- code/modules/cargo/supplypod.dm | 2 +- code/modules/events/processor_overload.dm | 2 +- .../carbon/human/species_types/golems.dm | 2 +- code/modules/projectiles/guns/magic/wand.dm | 2 +- .../projectiles/guns/special/medbeam.dm | 4 +- .../projectile/bullets/cannonball.dm | 4 +- .../projectiles/projectile/bullets/grenade.dm | 2 +- .../projectiles/projectile/bullets/shotgun.dm | 2 +- code/modules/projectiles/projectile/magic.dm | 2 +- .../projectiles/projectile/special/rocket.dm | 12 +-- .../impure_medicine_reagents.dm | 4 +- .../reagents/pyrotechnic_reagents.dm | 2 +- code/modules/reagents/chemistry/recipes.dm | 4 +- .../reagents/chemistry/recipes/drugs.dm | 2 +- .../chemistry/recipes/slime_extracts.dm | 2 +- .../crossbreeding/_status_effects.dm | 2 +- .../xenobiology/crossbreeding/charged.dm | 2 +- .../xenobiology/crossbreeding/chilling.dm | 2 +- .../research/xenobiology/xenobiology.dm | 2 +- code/modules/spells/spell_types/explosion.dm | 2 +- code/modules/station_goals/bsa.dm | 2 +- .../mecha/equipment/weapons/weapons.dm | 10 +- 48 files changed, 168 insertions(+), 101 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 404e146e589..87b63eda36f 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -196,11 +196,11 @@ ///prevents the "you cannot move while buckled! message" #define COMSIG_BLOCK_RELAYMOVE (1<<0) -///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke)) +///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) #define COMSIG_ATOM_EXPLODE "atom_explode" -///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke)) +///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) #define COMSIG_ATOM_INTERNAL_EXPLOSION "atom_internal_explosion" -///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke)) +///from [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) #define COMSIG_AREA_INTERNAL_EXPLOSION "area_internal_explosion" /// When returned on a signal hooked to [COMSIG_ATOM_EXPLODE], [COMSIG_ATOM_INTERNAL_EXPLOSION], or [COMSIG_AREA_INTERNAL_EXPLOSION] it prevents the explosion from being propagated further. #define COMSIG_CANCEL_EXPLOSION (1<<0) diff --git a/code/__DEFINES/explosions.dm b/code/__DEFINES/explosions.dm index a05e3bd33c7..b5d4c8b6b2c 100644 --- a/code/__DEFINES/explosions.dm +++ b/code/__DEFINES/explosions.dm @@ -12,6 +12,8 @@ // Must match the arguments to [/datum/controller/subsystem/explosions/proc/propagate_blastwave] /// The origin atom of the explosion. #define EXARG_KEY_ORIGIN "origin" +/// The potential cause of the explosion, if different to origin. +#define EXARG_KEY_EXPLOSION_CAUSE STRINGIFY(explosion_cause) /// The devastation range of the explosion. #define EXARG_KEY_DEV_RANGE STRINGIFY(devastation_range) /// The heavy impact range of the explosion. diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 3e7fc9574e0..e3ec6774675 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -10,7 +10,7 @@ SUBSYSTEM_DEF(blackbox) var/sealed = FALSE //time to stop tracking stats? var/list/versions = list("antagonists" = 3, "admin_secrets_fun_used" = 2, - "explosion" = 2, + "explosion" = 3, "time_dilation_current" = 3, "science_techweb_unlock" = 2, "round_end_stats" = 2, diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm index 68107254428..df9923a678e 100644 --- a/code/controllers/subsystem/explosions.dm +++ b/code/controllers/subsystem/explosions.dm @@ -153,21 +153,37 @@ SUBSYSTEM_DEF(explosions) A.color = null A.maptext = "" -/proc/dyn_explosion(turf/epicenter, power, flame_range = 0, flash_range = null, adminlog = TRUE, ignorecap = TRUE, silent = FALSE, smoke = TRUE) +/** + * Using default dyn_ex scale: + * + * 100 explosion power is a (5, 10, 20) explosion. + * 75 explosion power is a (4, 8, 17) explosion. + * 50 explosion power is a (3, 7, 14) explosion. + * 25 explosion power is a (2, 5, 10) explosion. + * 10 explosion power is a (1, 3, 6) explosion. + * 5 explosion power is a (0, 1, 3) explosion. + * 1 explosion power is a (0, 0, 1) explosion. + * + * Arguments: + * * epicenter: Turf the explosion is centered at. + * * power - Dyn explosion power. See reference above. + * * flame_range: Flame range. Equal to the equivalent of the light impact range multiplied by this value. + * * flash_range: The range at which the explosion flashes people. Equal to the equivalent of the light impact range multiplied by this value. + * * adminlog: Whether to log the explosion/report it to the administration. + * * ignorecap: Whether to ignore the relevant bombcap. Defaults to FALSE. + * * flame_range: The range at which the explosion should produce hotspots. + * * silent: Whether to generate/execute sound effects. + * * smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it. + * * explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging. + */ +/proc/dyn_explosion(turf/epicenter, power, flame_range = 0, flash_range = null, adminlog = TRUE, ignorecap = TRUE, silent = FALSE, smoke = TRUE, atom/explosion_cause = null) if(!power) return var/range = 0 range = round((2 * power)**GLOB.DYN_EX_SCALE) - explosion(epicenter, devastation_range = round(range * 0.25), heavy_impact_range = round(range * 0.5), light_impact_range = round(range), flame_range = flame_range*range, flash_range = flash_range*range, adminlog = adminlog, ignorecap = ignorecap, silent = silent, smoke = smoke) + explosion(epicenter, devastation_range = round(range * 0.25), heavy_impact_range = round(range * 0.5), light_impact_range = round(range), flame_range = flame_range*range, flash_range = flash_range*range, adminlog = adminlog, ignorecap = ignorecap, silent = silent, smoke = smoke, explosion_cause = explosion_cause) + -// Using default dyn_ex scale: -// 100 explosion power is a (5, 10, 20) explosion. -// 75 explosion power is a (4, 8, 17) explosion. -// 50 explosion power is a (3, 7, 14) explosion. -// 25 explosion power is a (2, 5, 10) explosion. -// 10 explosion power is a (1, 3, 6) explosion. -// 5 explosion power is a (0, 1, 3) explosion. -// 1 explosion power is a (0, 0, 1) explosion. /** * Makes a given atom explode. @@ -183,8 +199,9 @@ SUBSYSTEM_DEF(explosions) * - flame_range: The range at which the explosion should produce hotspots. * - silent: Whether to generate/execute sound effects. * - smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it. + * - explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging. */ -/proc/explosion(atom/origin, devastation_range = 0, heavy_impact_range = 0, light_impact_range = 0, flame_range = 0, flash_range = 0, adminlog = TRUE, ignorecap = FALSE, silent = FALSE, smoke = FALSE) +/proc/explosion(atom/origin, devastation_range = 0, heavy_impact_range = 0, light_impact_range = 0, flame_range = 0, flash_range = 0, adminlog = TRUE, ignorecap = FALSE, silent = FALSE, smoke = FALSE, atom/explosion_cause = null) . = SSexplosions.explode(arglist(args)) @@ -202,9 +219,22 @@ SUBSYSTEM_DEF(explosions) * - flame_range: The range at which the explosion should produce hotspots. * - silent: Whether to generate/execute sound effects. * - smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it. + * - explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging. */ -/datum/controller/subsystem/explosions/proc/explode(atom/origin, devastation_range = 0, heavy_impact_range = 0, light_impact_range = 0, flame_range = 0, flash_range = 0, adminlog = TRUE, ignorecap = FALSE, silent = FALSE, smoke = FALSE) - var/list/arguments = list(EXARG_KEY_ORIGIN = origin, EXARG_KEY_DEV_RANGE = devastation_range, EXARG_KEY_HEAVY_RANGE = heavy_impact_range, EXARG_KEY_LIGHT_RANGE = light_impact_range, EXARG_KEY_FLAME_RANGE = flame_range, EXARG_KEY_FLASH_RANGE = flash_range, EXARG_KEY_ADMIN_LOG = adminlog, EXARG_KEY_IGNORE_CAP = ignorecap, EXARG_KEY_SILENT = silent, EXARG_KEY_SMOKE = smoke) +/datum/controller/subsystem/explosions/proc/explode(atom/origin, devastation_range = 0, heavy_impact_range = 0, light_impact_range = 0, flame_range = 0, flash_range = 0, adminlog = TRUE, ignorecap = FALSE, silent = FALSE, smoke = FALSE, atom/explosion_cause = null) + var/list/arguments = list( + EXARG_KEY_ORIGIN = origin, + EXARG_KEY_DEV_RANGE = devastation_range, + EXARG_KEY_HEAVY_RANGE = heavy_impact_range, + EXARG_KEY_LIGHT_RANGE = light_impact_range, + EXARG_KEY_FLAME_RANGE = flame_range, + EXARG_KEY_FLASH_RANGE = flash_range, + EXARG_KEY_ADMIN_LOG = adminlog, + EXARG_KEY_IGNORE_CAP = ignorecap, + EXARG_KEY_SILENT = silent, + EXARG_KEY_SMOKE = smoke, + EXARG_KEY_EXPLOSION_CAUSE = explosion_cause ? explosion_cause : origin, + ) var/atom/location = isturf(origin) ? origin : origin.loc if(SEND_SIGNAL(origin, COMSIG_ATOM_EXPLODE, arguments) & COMSIG_CANCEL_EXPLOSION) return // Signals are incompatible with `arglist(...)` so we can't actually use that for these. Additionally, @@ -225,8 +255,8 @@ SUBSYSTEM_DEF(explosions) return arguments -= EXARG_KEY_ORIGIN - propagate_blastwave(arglist(list(location) + arguments)) + propagate_blastwave(arglist(list(location) + arguments)) /** * Handles the effects of an explosion originating from a given point. @@ -247,8 +277,9 @@ SUBSYSTEM_DEF(explosions) * - flame_range: The range at which the explosion should produce hotspots. * - silent: Whether to generate/execute sound effects. * - smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it. + * - explosion_cause: The atom that caused the explosion. Used for logging. */ -/datum/controller/subsystem/explosions/proc/propagate_blastwave(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke) +/datum/controller/subsystem/explosions/proc/propagate_blastwave(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, atom/explosion_cause) epicenter = get_turf(epicenter) if(!epicenter) return @@ -279,15 +310,46 @@ SUBSYSTEM_DEF(explosions) var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range) var/started_at = REALTIMEOFDAY + + // Now begins a bit of a logic train to find out whodunnit. + var/who_did_it = "N/A" + var/who_did_it_game_log = "N/A" + + // Projectiles have special handling. They rely on a firer var and not fingerprints. Check special cases for firer being + // mecha, mob or an object such as the gun itself. Handle each uniquely. + if(isprojectile(explosion_cause)) + var/obj/projectile/fired_projectile = explosion_cause + if(ismecha(fired_projectile.firer)) + var/obj/vehicle/sealed/mecha/firing_mecha = fired_projectile.firer + var/list/mob/drivers = firing_mecha.return_occupants() + if(length(drivers)) + who_did_it = "\[Mecha drivers:" + who_did_it_game_log = "\[Mecha drivers:" + for(var/mob/driver in drivers) + who_did_it += " [ADMIN_LOOKUPFLW(driver)]" + who_did_it_game_log = " [key_name(driver)]" + who_did_it += "\]" + who_did_it_game_log += "\]" + else if(ismob(fired_projectile.firer)) + who_did_it = "\[Projectile firer: [ADMIN_LOOKUPFLW(fired_projectile.firer)]\]" + who_did_it_game_log = "\[Projectile firer: [key_name(fired_projectile.firer)]\]" + else + who_did_it = "\[Projectile firer: [ADMIN_LOOKUPFLW(fired_projectile.firer.fingerprintslast)]\]" + who_did_it_game_log = "\[Projectile firer: [key_name(fired_projectile.firer.fingerprintslast)]\]" + // Otherwise if the explosion cause is an atom, try get the fingerprints. + else if(istype(explosion_cause)) + who_did_it = ADMIN_LOOKUPFLW(explosion_cause.fingerprintslast) + who_did_it_game_log = key_name(explosion_cause.fingerprintslast) + 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)]") + message_admins("Explosion with size (Devast: [devastation_range], Heavy: [heavy_impact_range], Light: [light_impact_range], Flame: [flame_range]) in [ADMIN_VERBOSEJMP(epicenter)]. Possible cause: [explosion_cause]. Last fingerprints: [who_did_it].") + log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [loc_name(epicenter)]. Possible cause: [explosion_cause]. Last fingerprints: [who_did_it_game_log].") var/x0 = epicenter.x var/y0 = epicenter.y var/z0 = epicenter.z var/area/areatype = get_area(epicenter) - SSblackbox.record_feedback("associative", "explosion", 1, list("dev" = devastation_range, "heavy" = heavy_impact_range, "light" = light_impact_range, "flame" = flame_range, "flash" = flash_range, "orig_dev" = orig_dev_range, "orig_heavy" = orig_heavy_range, "orig_light" = orig_light_range, "x" = x0, "y" = y0, "z" = z0, "area" = areatype.type, "time" = time_stamp("YYYY-MM-DD hh:mm:ss", 1))) + SSblackbox.record_feedback("associative", "explosion", 1, list("dev" = devastation_range, "heavy" = heavy_impact_range, "light" = light_impact_range, "flame" = flame_range, "flash" = flash_range, "orig_dev" = orig_dev_range, "orig_heavy" = orig_heavy_range, "orig_light" = orig_light_range, "x" = x0, "y" = y0, "z" = z0, "area" = areatype.type, "time" = time_stamp("YYYY-MM-DD hh:mm:ss", 1), "possible_cause" = explosion_cause, "possible_suspect" = who_did_it_game_log)) // Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves. // Stereo users will also hear the direction of the explosion! diff --git a/code/datums/diseases/advance/symptoms/fire.dm b/code/datums/diseases/advance/symptoms/fire.dm index efd82519b5b..240abf84603 100644 --- a/code/datums/diseases/advance/symptoms/fire.dm +++ b/code/datums/diseases/advance/symptoms/fire.dm @@ -147,7 +147,7 @@ Bonus if(4) if(M.fire_stacks < 0) M.visible_message(span_warning("[M]'s sweat sizzles and pops on contact with water!")) - explosion(M, devastation_range = -1, heavy_impact_range = (-1 + explosion_power), light_impact_range = (2 * explosion_power)) + explosion(M, devastation_range = -1, heavy_impact_range = (-1 + explosion_power), light_impact_range = (2 * explosion_power), explosion_cause = src) Alkali_fire_stage_4(M, A) M.IgniteMob() to_chat(M, span_userdanger("Your sweat bursts into flames!")) @@ -155,7 +155,7 @@ Bonus if(5) if(M.fire_stacks < 0) M.visible_message(span_warning("[M]'s sweat sizzles and pops on contact with water!")) - explosion(M, devastation_range = -1, heavy_impact_range = (-1 + explosion_power), light_impact_range = (2 * explosion_power)) + explosion(M, devastation_range = -1, heavy_impact_range = (-1 + explosion_power), light_impact_range = (2 * explosion_power), explosion_cause = src) Alkali_fire_stage_5(M, A) M.IgniteMob() to_chat(M, span_userdanger("Your skin erupts into an inferno!")) diff --git a/code/datums/diseases/rhumba_beat.dm b/code/datums/diseases/rhumba_beat.dm index 76b6941ad9e..f6ffe59ecc0 100644 --- a/code/datums/diseases/rhumba_beat.dm +++ b/code/datums/diseases/rhumba_beat.dm @@ -39,4 +39,4 @@ if(5) to_chat(affected_mob, span_danger("Your body is unable to contain the Rhumba Beat...")) if(DT_PROB(29, delta_time)) - explosion(affected_mob, devastation_range = -1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE) // This is equivalent to a lvl 1 fireball + explosion(affected_mob, devastation_range = -1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE, explosion_cause = src) // This is equivalent to a lvl 1 fireball diff --git a/code/datums/elements/volatile_gas_storage.dm b/code/datums/elements/volatile_gas_storage.dm index 7b79bdbdf56..9ef28b04a37 100644 --- a/code/datums/elements/volatile_gas_storage.dm +++ b/code/datums/elements/volatile_gas_storage.dm @@ -36,7 +36,7 @@ var/explosive_force = CEILING((expelled_pressure / max_explosive_pressure) * max_explosive_force , 1) // This is supposed to represent only shrapnel and no fire // Maybe one day we'll get something a bit better - explosion(get_turf(origin), light_impact_range=explosive_force, smoke=FALSE) + explosion(get_turf(origin), light_impact_range=explosive_force, smoke=FALSE, explosion_cause = origin) /datum/element/volatile_gas_storage/proc/AtmosComponentBreak(obj/machinery/atmospherics/components/owner) SIGNAL_HANDLER diff --git a/code/datums/martial/plasma_fist.dm b/code/datums/martial/plasma_fist.dm index 82a92658d14..5f3733c9be3 100644 --- a/code/datums/martial/plasma_fist.dm +++ b/code/datums/martial/plasma_fist.dm @@ -108,7 +108,7 @@ addtimer(CALLBACK(src,.proc/Apotheosis_end, user), 6 SECONDS) playsound(boomspot, 'sound/weapons/punch1.ogg', 50, TRUE, -1) - explosion(user, devastation_range = plasma_power, heavy_impact_range = plasma_power*2, light_impact_range = plasma_power*4, ignorecap = TRUE) + explosion(user, devastation_range = plasma_power, heavy_impact_range = plasma_power*2, light_impact_range = plasma_power*4, ignorecap = TRUE, explosion_cause = src) plasma_power = 1 //just in case there is any clever way to cause it to happen again /datum/martial_art/plasma_fist/proc/Apotheosis_end(mob/living/dying) diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index 5c28eec9e0d..644972127c6 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -454,7 +454,7 @@ for(var/obj/item/organ/I in organs) qdel(I) - explosion(owner, light_impact_range = 2, adminlog = TRUE) + explosion(owner, light_impact_range = 2, adminlog = TRUE, explosion_cause = src) for(var/mob/living/carbon/human/H in view(2,owner)) var/obj/item/organ/eyes/eyes = H.getorganslot(ORGAN_SLOT_EYES) if(eyes) diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm index 10dc848279a..d9018c50271 100644 --- a/code/game/objects/effects/effect_system/effects_other.dm +++ b/code/game/objects/effects/effect_system/effects_other.dm @@ -100,9 +100,12 @@ flashing = flash flashing_factor = flash_fact -/datum/effect_system/reagents_explosion/start() - if(explosion_message) - location.visible_message(span_danger("The solution violently explodes!"), \ - span_hear("You hear an explosion!")) +/// Starts the explosion. The explosion_source is as part of logging and identifying the source of the explosion for logs. +/datum/effect_system/reagents_explosion/start(atom/explosion_source = null) + if(!explosion_source) + stack_trace("Reagent explosion triggered without a source atom. This explosion may have incomplete logging.") - dyn_explosion(location, amount, flash_range = flashing_factor) + if(explosion_message) + location.visible_message(span_danger("The solution violently explodes!"), span_hear("You hear an explosion!")) + + dyn_explosion(location, amount, flash_range = flashing_factor, explosion_cause = explosion_source) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index d2423a2bd30..66690b4774b 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -225,13 +225,13 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire var/datum/effect_system/reagents_explosion/e = new() e.set_up(round(reagents.get_reagent_amount(/datum/reagent/toxin/plasma) / 2.5, 1), get_turf(src), 0, 0) - e.start() + e.start(src) qdel(src) return if(reagents.get_reagent_amount(/datum/reagent/fuel)) // the fuel explodes, too, but much less violently var/datum/effect_system/reagents_explosion/e = new() e.set_up(round(reagents.get_reagent_amount(/datum/reagent/fuel) / 5, 1), get_turf(src), 0, 0) - e.start() + e.start(src) qdel(src) return // allowing reagents to react after being lit @@ -1042,7 +1042,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire var/datum/effect_system/reagents_explosion/e = new() e.set_up(round(reagents.get_reagent_amount(/datum/reagent/toxin/plasma) / 2.5, 1), get_turf(src), 0, 0) - e.start() + e.start(src) qdel(src) if(!reagents.trans_to(vaper, REAGENTS_METABOLISM, methods = INGEST, ignore_stomach = TRUE)) diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index 5e8976e58df..9554f19582d 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -159,7 +159,7 @@ /obj/item/book/granter/spell/fireball/recoil(mob/user) ..() - explosion(user, devastation_range = 1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE) + explosion(user, devastation_range = 1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE, explosion_cause = src) qdel(src) /obj/item/book/granter/spell/sacredflame diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 813da6c2313..668f00827e1 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -59,9 +59,9 @@ if(location) if(directional && target?.density) var/turf/turf = get_step(location, aim_dir) - explosion(get_step(turf, aim_dir), devastation_range = boom_sizes[1], heavy_impact_range = boom_sizes[2], light_impact_range = boom_sizes[3]) + explosion(get_step(turf, aim_dir), devastation_range = boom_sizes[1], heavy_impact_range = boom_sizes[2], light_impact_range = boom_sizes[3], explosion_cause = src) else - explosion(location, devastation_range = boom_sizes[1], heavy_impact_range = boom_sizes[2], light_impact_range = boom_sizes[3]) + explosion(location, devastation_range = boom_sizes[1], heavy_impact_range = boom_sizes[2], light_impact_range = boom_sizes[3], explosion_cause = src) qdel(src) //assembly stuff @@ -133,7 +133,7 @@ log_game("[key_name(user)] suicided with [src] at [AREACOORD(user)]") user.visible_message(span_suicide("[user] activates [src] and holds it above [user.p_their()] head! It looks like [user.p_theyre()] going out with a bang!")) shout_syndicate_crap(user) - explosion(user, heavy_impact_range = 2) //Cheap explosion imitation because putting detonate() here causes runtimes + explosion(user, heavy_impact_range = 2, explosion_cause = src) //Cheap explosion imitation because putting detonate() here causes runtimes user.gib(1, 1) qdel(src) diff --git a/code/game/objects/items/implants/implant_explosive.dm b/code/game/objects/items/implants/implant_explosive.dm index e04a35e57f2..6e227fd8a30 100644 --- a/code/game/objects/items/implants/implant_explosive.dm +++ b/code/game/objects/items/implants/implant_explosive.dm @@ -51,7 +51,7 @@ message_admins("[ADMIN_LOOKUPFLW(imp_in)] has activated their [name] at [ADMIN_VERBOSEJMP(boomturf)], with cause of [cause].") //If the delay is short, just blow up already jeez if(delay <= 7) - explosion(src, devastation_range = heavy, heavy_impact_range = medium, light_impact_range = weak, flame_range = weak, flash_range = weak) + explosion(src, devastation_range = heavy, heavy_impact_range = medium, light_impact_range = weak, flame_range = weak, flash_range = weak, explosion_cause = src) if(imp_in) imp_in.gib(1) qdel(src) @@ -86,7 +86,7 @@ sleep(delay*0.25) playsound(loc, 'sound/items/timer.ogg', 30, FALSE) sleep(delay*0.25) - explosion(src, devastation_range = heavy, heavy_impact_range = medium, light_impact_range = weak, flame_range = weak, flash_range = weak) + explosion(src, devastation_range = heavy, heavy_impact_range = medium, light_impact_range = weak, flame_range = weak, flash_range = weak, explosion_cause = src) if(imp_in) imp_in.gib(1) qdel(src) diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index d63721d9dad..509c364c0bf 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -110,7 +110,7 @@ /obj/item/weldingtool/proc/explode() var/plasmaAmount = reagents.get_reagent_amount(/datum/reagent/toxin/plasma) - dyn_explosion(src, plasmaAmount/5)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder + dyn_explosion(src, plasmaAmount/5, explosion_cause = src)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder qdel(src) /obj/item/weldingtool/attack(mob/living/carbon/human/H, mob/living/user) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index 5137709da65..e448631cd20 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -572,7 +572,7 @@ var/turf/bombturf = get_turf(src) mineralAmt = 0 stage = GIBTONITE_DETONATE - explosion(bombturf, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 5, adminlog = notify_admins) + explosion(bombturf, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 5, adminlog = notify_admins, explosion_cause = src) /turf/closed/mineral/gibtonite/proc/defuse() if(stage == GIBTONITE_ACTIVE) @@ -594,7 +594,7 @@ var/turf/bombturf = get_turf(src) mineralAmt = 0 stage = GIBTONITE_DETONATE - explosion(bombturf, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 5, adminlog = FALSE) + explosion(bombturf, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 5, adminlog = FALSE, explosion_cause = src) if(stage == GIBTONITE_STABLE) //Gibtonite deposit is now benign and extractable. Depending on how close you were to it blowing up before defusing, you get better quality ore. var/obj/item/gibtonite/G = new (src) if(det_time <= 0) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index e82e12379c6..00230b9e12a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -491,13 +491,13 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(null) return if("Small Bomb (1, 2, 3, 3)") - explosion(epicenter, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flash_range = 3, adminlog = TRUE, ignorecap = TRUE) + explosion(epicenter, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flash_range = 3, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) if("Medium Bomb (2, 3, 4, 4)") - explosion(epicenter, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, flash_range = 4, adminlog = TRUE, ignorecap = TRUE) + explosion(epicenter, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, flash_range = 4, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) if("Big Bomb (3, 5, 7, 5)") - explosion(epicenter, devastation_range = 3, heavy_impact_range = 5, light_impact_range = 7, flash_range = 5, adminlog = TRUE, ignorecap = TRUE) + explosion(epicenter, devastation_range = 3, heavy_impact_range = 5, light_impact_range = 7, flash_range = 5, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) if("Maxcap") - explosion(epicenter, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, adminlog = TRUE, ignorecap = TRUE) + explosion(epicenter, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) if("Custom Bomb") var/range_devastation = input("Devastation range (in tiles):") as null|num if(range_devastation == null) @@ -515,7 +515,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(tgui_alert(usr, "Bomb is bigger than the maxcap. Continue?",,list("Yes","No")) != "Yes") return epicenter = mob.loc //We need to reupdate as they may have moved again - explosion(epicenter, devastation_range = range_devastation, heavy_impact_range = range_heavy, light_impact_range = range_light, flash_range = range_flash, adminlog = TRUE, ignorecap = TRUE) + explosion(epicenter, devastation_range = range_devastation, heavy_impact_range = range_heavy, light_impact_range = range_light, flash_range = range_flash, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].") log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].") SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Bomb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/smites/bsa.dm b/code/modules/admin/smites/bsa.dm index d8ba8e3e771..d737c711ef9 100644 --- a/code/modules/admin/smites/bsa.dm +++ b/code/modules/admin/smites/bsa.dm @@ -10,7 +10,7 @@ /datum/smite/bsa/effect(client/user, mob/living/target) . = ..() - explosion(target.loc) + explosion(target.loc, explosion_cause = src) var/turf/open/floor/target_turf = get_turf(target) if (istype(target_turf)) diff --git a/code/modules/admin/verbs/adminfun.dm b/code/modules/admin/verbs/adminfun.dm index b2a87a2796f..e6d26ed2099 100644 --- a/code/modules/admin/verbs/adminfun.dm +++ b/code/modules/admin/verbs/adminfun.dm @@ -28,7 +28,7 @@ if (tgui_alert(usr, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") return - explosion(O, devastation, heavy, light, flames, flash) + explosion(O, devastation, heavy, light, flames, flash, explosion_cause = mob) log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") SSblackbox.record_feedback("tally", "admin_verb", 1, "Explosion") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm index 90ecd5db78b..8e686a9b6f0 100644 --- a/code/modules/antagonists/changeling/powers/headcrab.dm +++ b/code/modules/antagonists/changeling/powers/headcrab.dm @@ -18,7 +18,7 @@ for(var/obj/item/organ/I in organs) I.Remove(user, 1) - explosion(user, light_impact_range = 2, adminlog = TRUE) + explosion(user, light_impact_range = 2, adminlog = TRUE, explosion_cause = src) for(var/mob/living/carbon/human/H in range(2,user)) var/obj/item/organ/eyes/eyes = H.getorganslot(ORGAN_SLOT_EYES) to_chat(H, span_userdanger("You are blinded by a shower of blood!")) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index c922e850be5..95136e80a73 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -246,7 +246,7 @@ var/datum/effect_system/reagents_explosion/explosion = new() explosion.set_up(1, get_turf(human_user), TRUE, 0) - explosion.start() + explosion.start(src) /obj/effect/broken_illusion/examine(mob/user) diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 081fd7794d7..a4f5da815d8 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -154,13 +154,13 @@ strength = (fuel_moles/15) if(strength >=2) - explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*3,1), flash_range = round(strength*4,1)) + explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*3,1), flash_range = round(strength*4,1), explosion_cause = src) else if(strength >=1) - explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1)) + explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1), explosion_cause = src) else if(strength >=0.5) - explosion(ground_zero, heavy_impact_range = 1, light_impact_range = 2, flash_range = 4) + explosion(ground_zero, heavy_impact_range = 1, light_impact_range = 2, flash_range = 4, explosion_cause = src) else if(strength >=0.2) - explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2) + explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2, explosion_cause = src) else ground_zero.assume_air(bomb_mixture) ground_zero.hotspot_expose(1000, 125) @@ -169,9 +169,9 @@ strength = (fuel_moles/20) if(strength >=1) - explosion(ground_zero, heavy_impact_range = round(strength,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1)) + explosion(ground_zero, heavy_impact_range = round(strength,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1), explosion_cause = src) else if(strength >=0.5) - explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2) + explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2, explosion_cause = src) else ground_zero.assume_air(bomb_mixture) ground_zero.hotspot_expose(1000, 125) @@ -180,7 +180,7 @@ strength = (fuel_moles/25) if(strength >=1) - explosion(ground_zero, devastation_range = -1, light_impact_range = round(strength,1), flash_range = round(strength*3,1)) + explosion(ground_zero, devastation_range = -1, light_impact_range = round(strength,1), flash_range = round(strength*3,1), explosion_cause = src) else ground_zero.assume_air(bomb_mixture) ground_zero.hotspot_expose(1000, 125) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/binary_devices/thermomachine.dm index 07570fb5305..470f3acc08e 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/thermomachine.dm @@ -228,7 +228,7 @@ efficiency *= clamp(log(1.55, exchange_target.total_moles()) * 0.15, 0.65, 1) efficiency *= mole_efficiency - efficiency = max(efficiency, parts_efficiency) + efficiency = max(efficiency, parts_efficiency) if (exchange_target.temperature > THERMOMACHINE_SAFE_TEMPERATURE && safeties) on = FALSE @@ -387,7 +387,7 @@ return TRUE /obj/machinery/atmospherics/components/binary/thermomachine/proc/explode() - explosion(loc, 0, 0, 3, 3, TRUE) + explosion(loc, 0, 0, 3, 3, TRUE, explosion_cause = src) var/datum/gas_mixture/main_port = airs[1] var/datum/gas_mixture/exchange_target = airs[2] if(main_port) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 2c1e30ba56d..a080e2f287e 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -51,5 +51,5 @@ for(var/turf/T in get_area_turfs(thearea.type)) L+=T var/loc = pick(L) - explosion(loc, explosiondev, explosionmed, explosionlight) + explosion(loc, explosiondev, explosionmed, explosionlight, explosion_cause = src) reload = 0 diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm index 24f8ef0d5a4..4414fbd9359 100644 --- a/code/modules/awaymissions/mission_code/Academy.dm +++ b/code/modules/awaymissions/mission_code/Academy.dm @@ -271,7 +271,7 @@ if(8) //Fuel tank Explosion T.visible_message(span_userdanger("An explosion bursts into existence around [user]!")) - explosion(get_turf(user), devastation_range = -1, light_impact_range = 2, flame_range = 2) + explosion(get_turf(user), devastation_range = -1, light_impact_range = 2, flame_range = 2, explosion_cause = src) if(9) //Cold var/datum/disease/D = new /datum/disease/cold() diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 7f2e9dbae05..055543e0d12 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -153,7 +153,7 @@ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(3, 1, src) s.start() - explosion(src, devastation_range = 1) + explosion(src, devastation_range = 1, explosion_cause = src) qdel(src) /////For the Wishgranter/////////// diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index cd4be6ab750..0afefcf3a74 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -268,7 +268,7 @@ target_living.adjustBruteLoss(damage) var/explosion_sum = B[1] + B[2] + B[3] + B[4] if (explosion_sum != 0) //If the explosion list isn't all zeroes, call an explosion - explosion(turf_underneath, B[1], B[2], B[3], flame_range = B[4], silent = effectQuiet, ignorecap = istype(src, /obj/structure/closet/supplypod/centcompod)) //less advanced equipment than bluespace pod, so larger explosion when landing + explosion(turf_underneath, B[1], B[2], B[3], flame_range = B[4], silent = effectQuiet, ignorecap = istype(src, /obj/structure/closet/supplypod/centcompod), explosion_cause = src) //less advanced equipment than bluespace pod, so larger explosion when landing else if (!effectQuiet && !(pod_flags & FIRST_SOUNDS)) //If our explosion list IS all zeroes, we still make a nice explosion sound (unless the effectQuiet var is true) playsound(src, "explosion", landingSound ? soundVolume * 0.25 : soundVolume, TRUE) if (landingSound) diff --git a/code/modules/events/processor_overload.dm b/code/modules/events/processor_overload.dm index 777dabf91ad..d05badb8656 100644 --- a/code/modules/events/processor_overload.dm +++ b/code/modules/events/processor_overload.dm @@ -31,7 +31,7 @@ if(prob(10)) announce_to_ghosts(P) // Damage the surrounding area to indicate that it popped - explosion(P, light_impact_range = 2) + explosion(P, light_impact_range = 2, explosion_cause = src) // Only a level 1 explosion actually damages the machine // at all SSexplosions.high_mov_atom += P diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index def3a390503..6de22b627be 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -134,7 +134,7 @@ boom_warning = FALSE if(H.bodytemperature > 850 && H.on_fire && prob(25)) - explosion(H, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5) + explosion(H, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5, explosion_cause = src) if(H) H.gib() if(H.fire_stacks < 2) //flammable diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index b154630051d..0b27b83ff9e 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -241,7 +241,7 @@ /obj/item/gun/magic/wand/fireball/zap_self(mob/living/user) ..() - explosion(user, devastation_range = -1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE) + explosion(user, devastation_range = -1, light_impact_range = 2, flame_range = 2, flash_range = 3, adminlog = FALSE, explosion_cause = src) charges-- ///////////////////////////////////// diff --git a/code/modules/projectiles/guns/special/medbeam.dm b/code/modules/projectiles/guns/special/medbeam.dm index 4e6f3194032..f8ccb2aafe0 100644 --- a/code/modules/projectiles/guns/special/medbeam.dm +++ b/code/modules/projectiles/guns/special/medbeam.dm @@ -113,7 +113,7 @@ return FALSE // Could not leave the first turf. first_step = FALSE if(mounted && next_step == user_turf) - + continue //Mechs are dense and thus fail the check if(next_step.density) qdel(dummy) @@ -124,7 +124,7 @@ return FALSE for(var/obj/effect/ebeam/medical/B in next_step)// Don't cross the str-beams! if(B.owner.origin != current_beam.origin) - explosion(B.loc, heavy_impact_range = 3, light_impact_range = 5, flash_range = 8) + explosion(B.loc, heavy_impact_range = 3, light_impact_range = 5, flash_range = 8, explosion_cause = src) qdel(dummy) return FALSE previous_step = next_step diff --git a/code/modules/projectiles/projectile/bullets/cannonball.dm b/code/modules/projectiles/projectile/bullets/cannonball.dm index 9ee931e7f1f..3fe2761b391 100644 --- a/code/modules/projectiles/projectile/bullets/cannonball.dm +++ b/code/modules/projectiles/projectile/bullets/cannonball.dm @@ -35,7 +35,7 @@ damage = 40 //set to 30 before first mob impact, but they're gonna be gibbed by the explosion /obj/projectile/bullet/cannonball/explosive/on_hit(atom/target, blocked = FALSE) - explosion(target, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4) + explosion(target, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, explosion_cause = src) . = ..() /obj/projectile/bullet/cannonball/emp @@ -55,7 +55,7 @@ /obj/projectile/bullet/cannonball/biggest_one/on_hit(atom/target, blocked = FALSE) if(projectile_piercing == NONE) - explosion(target, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE) + explosion(target, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, explosion_cause = src) . = ..() /obj/projectile/bullet/cannonball/trashball diff --git a/code/modules/projectiles/projectile/bullets/grenade.dm b/code/modules/projectiles/projectile/bullets/grenade.dm index bb9071a6ca3..b1d7278228f 100644 --- a/code/modules/projectiles/projectile/bullets/grenade.dm +++ b/code/modules/projectiles/projectile/bullets/grenade.dm @@ -10,5 +10,5 @@ /obj/projectile/bullet/a40mm/on_hit(atom/target, blocked = FALSE) ..() - explosion(target, devastation_range = -1, light_impact_range = 2, flame_range = 3, flash_range = 1, adminlog = FALSE) + explosion(target, devastation_range = -1, light_impact_range = 2, flame_range = 3, flash_range = 1, adminlog = FALSE, explosion_cause = src) return BULLET_ACT_HIT diff --git a/code/modules/projectiles/projectile/bullets/shotgun.dm b/code/modules/projectiles/projectile/bullets/shotgun.dm index b66509ddace..0bc3c162654 100644 --- a/code/modules/projectiles/projectile/bullets/shotgun.dm +++ b/code/modules/projectiles/projectile/bullets/shotgun.dm @@ -68,7 +68,7 @@ /obj/projectile/bullet/shotgun_frag12/on_hit(atom/target, blocked = FALSE) ..() - explosion(target, devastation_range = -1, light_impact_range = 1) + explosion(target, devastation_range = -1, light_impact_range = 1, explosion_cause = src) return BULLET_ACT_HIT /obj/projectile/bullet/pellet diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 1296d8934bb..9836aead654 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -530,7 +530,7 @@ return BULLET_ACT_BLOCK M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately var/turf/T = get_turf(target) - explosion(T, devastation_range = -1, heavy_impact_range = exp_heavy, light_impact_range = exp_light, flame_range = exp_fire, flash_range = exp_flash, adminlog = FALSE) + explosion(T, devastation_range = -1, heavy_impact_range = exp_heavy, light_impact_range = exp_light, flame_range = exp_fire, flash_range = exp_flash, adminlog = FALSE, explosion_cause = src) //still magic related, but a different path diff --git a/code/modules/projectiles/projectile/special/rocket.dm b/code/modules/projectiles/projectile/special/rocket.dm index c41137beb65..838fcb396ed 100644 --- a/code/modules/projectiles/projectile/special/rocket.dm +++ b/code/modules/projectiles/projectile/special/rocket.dm @@ -7,7 +7,7 @@ /obj/projectile/bullet/gyro/on_hit(atom/target, blocked = FALSE) ..() - explosion(target, devastation_range = -1, light_impact_range = 2) + explosion(target, devastation_range = -1, light_impact_range = 2, explosion_cause = src) return BULLET_ACT_HIT /// PM9 HEDP rocket @@ -53,9 +53,9 @@ /obj/projectile/bullet/a84mm/he/do_boom(atom/target, blocked=0) if(!isliving(target)) //if the target isn't alive, so is a wall or something - explosion(target, heavy_impact_range = 1, light_impact_range = 2, flame_range = 3, flash_range = 4) + explosion(target, heavy_impact_range = 1, light_impact_range = 2, flame_range = 3, flash_range = 4, explosion_cause = src) else - explosion(target, light_impact_range = 2, flame_range = 3, flash_range = 4) + explosion(target, light_impact_range = 2, flame_range = 3, flash_range = 4, explosion_cause = src) /// PM9 weak rocket /obj/projectile/bullet/a84mm/weak @@ -66,9 +66,9 @@ /obj/projectile/bullet/a84mm/weak/do_boom(atom/target, blocked=0) if(!isliving(target)) //if the target isn't alive, so is a wall or something - explosion(target, heavy_impact_range = 1, light_impact_range = 2, flame_range = 3, flash_range = 4) + explosion(target, heavy_impact_range = 1, light_impact_range = 2, flame_range = 3, flash_range = 4, explosion_cause = src) else - explosion(target, light_impact_range = 2, flame_range = 3, flash_range = 4) + explosion(target, light_impact_range = 2, flame_range = 3, flash_range = 4, explosion_cause = src) /// Mech BRM-6 missile /obj/projectile/bullet/a84mm_br @@ -99,7 +99,7 @@ ..() for(var/i in sturdy) if(istype(target, i)) - explosion(target, heavy_impact_range = 1, light_impact_range = 1, flash_range = 2) + explosion(target, heavy_impact_range = 1, light_impact_range = 1, flash_range = 2, explosion_cause = src) return BULLET_ACT_HIT //if(istype(target, /turf/closed) || ismecha(target)) new /obj/item/broken_missile(get_turf(src), 1) diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm index 666a4b14647..cc7a0d9413b 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm @@ -544,7 +544,7 @@ Basically, we fill the time between now and 2s from now with hands based off the remove_buffs(owner) var/obj/item/organ/heart/heart = owner.getorganslot(ORGAN_SLOT_HEART) if(owner.health < -500 || heart.organ_flags & ORGAN_FAILING)//Honestly commendable if you get -500 - explosion(owner, light_impact_range = 1) + explosion(owner, light_impact_range = 1, explosion_cause = src) qdel(heart) owner.visible_message(span_boldwarning("[owner]'s heart explodes!")) return ..() @@ -557,7 +557,7 @@ Basically, we fill the time between now and 2s from now with hands based off the REMOVE_TRAIT(owner, TRAIT_NODEATH, type) owner.stat = DEAD return ..() - explosion(owner, light_impact_range = 1) + explosion(owner, light_impact_range = 1, explosion_cause = src) qdel(heart) owner.visible_message(span_boldwarning("[owner]'s heart explodes!")) return..() diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm index adf181e4c7e..dc9c839d5cc 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm @@ -116,7 +116,7 @@ var/location = get_turf(holder.my_atom) var/datum/effect_system/reagents_explosion/e = new() e.set_up(1 + round(volume/6, 1), location, 0, 0, message = 0) - e.start() + e.start(holder.my_atom) holder.clear_reagents() /datum/reagent/rdx diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index 2dac1db55b3..79aa424e62a 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -326,7 +326,7 @@ log_game("Reagent explosion reaction occurred at [AREACOORD(T)]. Last Fingerprint: [lastkey ? lastkey : "N/A"]." ) var/datum/effect_system/reagents_explosion/e = new() e.set_up(power , T, 0, 0) - e.start() + e.start(holder.my_atom) holder.clear_reagents() /* @@ -440,7 +440,7 @@ //Calls the default explosion subsystem handiler to explode with fire (random firespots and noise) /datum/chemical_reaction/proc/explode_fire(datum/reagents/holder, datum/equilibrium/equilibrium, range = 3) - explosion(holder.my_atom, flame_range = range) + explosion(holder.my_atom, flame_range = range, explosion_cause = src) holder.my_atom.audible_message("The [holder.my_atom] suddenly errupts in flames!") //Creates a ring of fire in a set range around the beaker location diff --git a/code/modules/reagents/chemistry/recipes/drugs.dm b/code/modules/reagents/chemistry/recipes/drugs.dm index d973f853424..f5bafbd5560 100644 --- a/code/modules/reagents/chemistry/recipes/drugs.dm +++ b/code/modules/reagents/chemistry/recipes/drugs.dm @@ -73,7 +73,7 @@ log_game("Reagent explosion reaction occurred at [AREACOORD(T)]. Last Fingerprint: [lastkey ? lastkey : "N/A"]." ) var/datum/effect_system/reagents_explosion/e = new() e.set_up(power, T, 0, 0) - e.start() + e.start(holder.my_atom) holder.clear_reagents() /datum/chemical_reaction/bath_salts diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 0d37e63c62f..21953536545 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -392,7 +392,7 @@ /datum/chemical_reaction/slime/slimeexplosion/proc/boom(datum/reagents/holder) if(holder?.my_atom) - explosion(holder.my_atom, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 6) + explosion(holder.my_atom, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 6, explosion_cause = src) /datum/chemical_reaction/slime/slimecornoil diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 906ade0b1f7..5c8c7671f4c 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -864,7 +864,7 @@ /datum/status_effect/stabilized/oil/tick() if(owner.stat == DEAD) - explosion(owner, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5) + explosion(owner, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5, explosion_cause = src) return ..() /datum/status_effect/stabilized/black diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index 4bd4c2d574d..d244495449f 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -224,7 +224,7 @@ Charged extracts: addtimer(CALLBACK(src, .proc/boom), 50) /obj/item/slimecross/charged/oil/proc/boom() - explosion(src, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4) //Much smaller effect than normal oils, but devastatingly strong where it does hit. + explosion(src, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, explosion_cause = src) //Much smaller effect than normal oils, but devastatingly strong where it does hit. qdel(src) /obj/item/slimecross/charged/black diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm index 60e5278156d..54fc76b3e32 100644 --- a/code/modules/research/xenobiology/crossbreeding/chilling.dm +++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm @@ -290,7 +290,7 @@ Chilling extracts: addtimer(CALLBACK(src, .proc/boom), 50) /obj/item/slimecross/chilling/oil/proc/boom() - explosion(src, devastation_range = -1, heavy_impact_range = -1, light_impact_range = 10) //Large radius, but mostly light damage, and no flash. + explosion(src, devastation_range = -1, heavy_impact_range = -1, light_impact_range = 10, explosion_cause = src) //Large radius, but mostly light damage, and no flash. qdel(src) /obj/item/slimecross/chilling/black diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 50858b60e22..8ab1bc9e296 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -457,7 +457,7 @@ user.visible_message(span_warning("[user]'s skin starts pulsing and glowing ominously..."), span_userdanger("You feel unstable...")) if(do_after(user, 60, target = user)) to_chat(user, span_userdanger("You explode!")) - explosion(user, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 6) + explosion(user, devastation_range = 1, heavy_impact_range = 3, light_impact_range = 6, explosion_cause = src) user.gib() return to_chat(user, span_notice("You stop feeding [src], and the feeling passes.")) diff --git a/code/modules/spells/spell_types/explosion.dm b/code/modules/spells/spell_types/explosion.dm index a0878826f97..a37f185e786 100644 --- a/code/modules/spells/spell_types/explosion.dm +++ b/code/modules/spells/spell_types/explosion.dm @@ -17,6 +17,6 @@ for(var/mob/living/target in targets) if(target.anti_magic_check()) continue - explosion(target, devastation_range = ex_severe, heavy_impact_range = ex_heavy, light_impact_range = ex_light, flash_range = ex_flash) + explosion(target, devastation_range = ex_severe, heavy_impact_range = ex_heavy, light_impact_range = ex_light, flash_range = ex_flash, explosion_cause = src) return diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 887feca67bd..da3d93c45a1 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -215,7 +215,7 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) if(!blocker) message_admins("[ADMIN_LOOKUPFLW(user)] has launched an artillery strike targeting [ADMIN_VERBOSEJMP(bullseye)].") log_game("[key_name(user)] has launched an artillery strike targeting [AREACOORD(bullseye)].") - explosion(bullseye, devastation_range = ex_power, heavy_impact_range = ex_power*2, light_impact_range = ex_power*4) + explosion(bullseye, devastation_range = ex_power, heavy_impact_range = ex_power*2, light_impact_range = ex_power*4, explosion_cause = src) else message_admins("[ADMIN_LOOKUPFLW(user)] has launched an artillery strike targeting [ADMIN_VERBOSEJMP(bullseye)] but it was blocked by [blocker] at [ADMIN_VERBOSEJMP(target)].") log_game("[key_name(user)] has launched an artillery strike targeting [AREACOORD(bullseye)] but it was blocked by [blocker] at [AREACOORD(target)].") diff --git a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm index caff508ee13..402a25aed53 100644 --- a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm +++ b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm @@ -36,13 +36,13 @@ else spread = round((i / projectiles_per_shot - 0.5) * variance) - var/obj/projectile/A = new projectile(get_turf(src)) + var/obj/projectile/projectile_obj = new projectile(get_turf(src)) var/modifiers = params2list(params) - A.firer = chassis - A.preparePixelProjectile(target, source, modifiers, spread) + projectile_obj.firer = chassis + projectile_obj.preparePixelProjectile(target, source, modifiers, spread) - A.fire() - if(!A.suppressed && firing_effect_type) + projectile_obj.fire() + if(!projectile_obj.suppressed && firing_effect_type) new firing_effect_type(get_turf(src), chassis.dir) playsound(chassis, fire_sound, 50, TRUE)