From 8ee1cd247403f0f39933fc7ebff5da35e66e9f32 Mon Sep 17 00:00:00 2001 From: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Date: Sun, 9 Nov 2025 15:46:10 +0200 Subject: [PATCH] Makes EMP logs less bad (#93841) ## About The Pull Request closes #93805 ## Why It's Good For The Game we actually have almost no emp logging at all lol, not even emp chem reaction, so you barely can track potential griefer? ## Changelog :cl: admin: EMP logs are improved, additionally chemical EMP reactions are now logged. /:cl: --- code/game/objects/effects/anomalies/anomalies_flux.dm | 4 ++-- code/game/objects/empulse.dm | 8 ++++---- code/game/objects/items/granters/magic/charge.dm | 3 ++- code/game/objects/items/grenades/emgrenade.dm | 3 +-- code/game/objects/items/implants/implant_misc.dm | 2 +- code/modules/antagonists/changeling/powers/shriek.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 2 +- code/modules/antagonists/cult/runes.dm | 2 +- .../antagonists/wizard/grand_ritual/grand_side_effect.dm | 2 +- .../machinery/components/fusion/hfr_procs.dm | 2 +- code/modules/meteors/meteor_types.dm | 2 +- code/modules/mod/modules/modules_ninja.dm | 2 +- .../modules/projectiles/projectile/bullets/cannonball.dm | 2 +- code/modules/projectiles/projectile/bullets/sniper.dm | 2 +- code/modules/projectiles/projectile/special/ion.dm | 2 +- code/modules/reagents/chemistry/recipes/pyrotechnics.dm | 9 ++++++++- .../modules/reagents/chemistry/recipes/slime_extracts.dm | 7 ++++++- code/modules/research/experimentor.dm | 2 +- code/modules/research/xenobiology/xenobiology.dm | 3 ++- code/modules/spells/spell_types/self/disable_tech.dm | 2 +- code/modules/vehicles/mecha/mecha_mob_interaction.dm | 2 +- 21 files changed, 39 insertions(+), 26 deletions(-) diff --git a/code/game/objects/effects/anomalies/anomalies_flux.dm b/code/game/objects/effects/anomalies/anomalies_flux.dm index 1d823d00b60..ddf7b036733 100644 --- a/code/game/objects/effects/anomalies/anomalies_flux.dm +++ b/code/game/objects/effects/anomalies/anomalies_flux.dm @@ -44,10 +44,10 @@ /obj/effect/anomaly/flux/detonate() switch(emp_zap) if(FLUX_EMP) - empulse(src, 4, 16) + empulse(src, 4, 16, emp_source = src) explosion(src, heavy_impact_range = 1, light_impact_range = 4, flash_range = 6) //Trashes the room a bit, might blow a small hole in the hull. if(FLUX_LIGHT_EMP) - empulse(src, 4, 6) + empulse(src, 4, 6, emp_source = src) explosion(src, light_impact_range = 3, flash_range = 6) if(FLUX_NO_EMP) new /obj/effect/particle_effect/sparks(loc) diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index e7246fd04ef..640e08da102 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -1,13 +1,13 @@ -/proc/empulse(turf/epicenter, heavy_range, light_range, log=0) +/proc/empulse(turf/epicenter, heavy_range, light_range, emp_source) if(!epicenter) return if(!isturf(epicenter)) epicenter = get_turf(epicenter.loc) - if(log) - message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ") - log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ") + if(emp_source) + message_admins("EMP with size ([heavy_range], [light_range]) in [ADMIN_VERBOSEJMP(epicenter)], caused by [emp_source] ") + log_game("EMP with size ([heavy_range], [light_range]) in [ADMIN_VERBOSEJMP(epicenter)], caused by [emp_source] ") if(heavy_range > 1) new /obj/effect/temp_visual/emp/pulse(epicenter) diff --git a/code/game/objects/items/granters/magic/charge.dm b/code/game/objects/items/granters/magic/charge.dm index 988d17aa13b..0210227d3b0 100644 --- a/code/game/objects/items/granters/magic/charge.dm +++ b/code/game/objects/items/granters/magic/charge.dm @@ -17,4 +17,5 @@ /obj/item/book/granter/action/spell/charge/recoil(mob/living/user) . = ..() to_chat(user,span_warning("[src] suddenly feels very warm!")) - empulse(src, 1, 1) + empulse(src, 1, 1, emp_source = src) + diff --git a/code/game/objects/items/grenades/emgrenade.dm b/code/game/objects/items/grenades/emgrenade.dm index 4f3b9d2e484..295faeb9809 100644 --- a/code/game/objects/items/grenades/emgrenade.dm +++ b/code/game/objects/items/grenades/emgrenade.dm @@ -8,7 +8,6 @@ . = ..() if(!.) return - update_mob() - empulse(src, 4, 10) + empulse(src, 4, 10, emp_source = src) qdel(src) diff --git a/code/game/objects/items/implants/implant_misc.dm b/code/game/objects/items/implants/implant_misc.dm index ceccbe1b729..6e053a1a44b 100644 --- a/code/game/objects/items/implants/implant_misc.dm +++ b/code/game/objects/items/implants/implant_misc.dm @@ -20,7 +20,7 @@ /obj/item/implant/emp/activate() . = ..() uses-- - empulse(imp_in, 3, 5) + empulse(imp_in, 3, 5, emp_source = src) if(!uses) qdel(src) diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm index 80ce0f232aa..6956a7d9dcf 100644 --- a/code/modules/antagonists/changeling/powers/shriek.dm +++ b/code/modules/antagonists/changeling/powers/shriek.dm @@ -44,7 +44,7 @@ if(user.movement_type & VENTCRAWLING) user.balloon_alert(user, "can't shriek in pipes!") return FALSE - empulse(get_turf(user), 2, 5, 1) + empulse(get_turf(user), 2, 5, 1, emp_source = src) for(var/obj/machinery/light/L in range(5, usr)) L.on = TRUE L.break_light_tube() diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 3ff5ccc9bdd..504b4519aba 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -183,7 +183,7 @@ owner.whisper(invocation, language = /datum/language/common, forced = "cult invocation") owner.visible_message(span_warning("[owner]'s hand flashes a bright blue!"), \ span_cult_italic("You speak the cursed words, emitting an EMP blast from your hand.")) - empulse(owner, 2, 5) + empulse(owner, 2, 5, emp_source = src) charges-- SSblackbox.record_feedback("tally", "cult_spell_invoke", 1, "[name]") if(charges <= 0) diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index c0ba25c2b6a..aa5b3ef3885 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -1148,7 +1148,7 @@ GLOBAL_VAR_INIT(narsie_summon_count, 0) for(var/mob/living/target in range(src, 3)) target.Paralyze(30) - empulse(T, 0.42*(intensity), 1) + empulse(T, 0.42*(intensity), 1, emp_source = src) var/list/images = list() for(var/mob/living/M in GLOB.alive_mob_list) diff --git a/code/modules/antagonists/wizard/grand_ritual/grand_side_effect.dm b/code/modules/antagonists/wizard/grand_ritual/grand_side_effect.dm index 8965d55b92d..594911c0d3d 100644 --- a/code/modules/antagonists/wizard/grand_ritual/grand_side_effect.dm +++ b/code/modules/antagonists/wizard/grand_ritual/grand_side_effect.dm @@ -123,7 +123,7 @@ /datum/grand_side_effect/emp/trigger(potency, turf/ritual_location, mob/invoker) var/heavy = LERP(0, 3, potency/GRAND_RITUAL_FINALE_COUNT) var/light = LERP(3, 6, potency/GRAND_RITUAL_FINALE_COUNT) - empulse(ritual_location, heavy, light) + empulse(ritual_location, heavy, light, emp_source = src) /// Swap locations of nearby mobs arbitrarily and confuse them /datum/grand_side_effect/translocate diff --git a/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm b/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm index 10f4b898029..f460ca127fb 100644 --- a/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm +++ b/code/modules/atmospherics/machinery/components/fusion/hfr_procs.dm @@ -560,7 +560,7 @@ epicenter = loc, heavy_range = critical ? emp_heavy_size * 2 : emp_heavy_size, light_range = critical ? emp_light_size * 2 : emp_heavy_size, - log = TRUE + emp_source = src ) qdel(src) diff --git a/code/modules/meteors/meteor_types.dm b/code/modules/meteors/meteor_types.dm index f632717000f..bdbdaf883d5 100644 --- a/code/modules/meteors/meteor_types.dm +++ b/code/modules/meteors/meteor_types.dm @@ -376,7 +376,7 @@ /obj/effect/meteor/emp/meteor_effect() ..() playsound(src, 'sound/items/weapons/zapbang.ogg', 100, TRUE, -1) - empulse(src, 3, 8) + empulse(src, 3, 8, emp_source = src) //Meaty Ore /obj/effect/meteor/meaty diff --git a/code/modules/mod/modules/modules_ninja.dm b/code/modules/mod/modules/modules_ninja.dm index e0674545004..31aecf9ba69 100644 --- a/code/modules/mod/modules/modules_ninja.dm +++ b/code/modules/mod/modules/modules_ninja.dm @@ -289,7 +289,7 @@ /obj/item/mod/module/emp_shield/pulse/on_use(mob/activator) playsound(src, 'sound/effects/empulse.ogg', 60, TRUE) - empulse(src, heavy_range = 4, light_range = 6) + empulse(src, heavy_range = 4, light_range = 6, emp_source = src) drain_power(use_energy_cost) /// Ninja Status Readout - Like the normal status display (see the base type), but with a clock. diff --git a/code/modules/projectiles/projectile/bullets/cannonball.dm b/code/modules/projectiles/projectile/bullets/cannonball.dm index 167f61dfa2c..30c95fdad6c 100644 --- a/code/modules/projectiles/projectile/bullets/cannonball.dm +++ b/code/modules/projectiles/projectile/bullets/cannonball.dm @@ -57,7 +57,7 @@ damage = 15 //very low /obj/projectile/bullet/cannonball/emp/on_hit(atom/target, blocked = 0, pierce_hit) - empulse(src, 4, 10) + empulse(src, 4, 10, emp_source = src) . = ..() /obj/projectile/bullet/cannonball/biggest_one diff --git a/code/modules/projectiles/projectile/bullets/sniper.dm b/code/modules/projectiles/projectile/bullets/sniper.dm index ce352fcd93a..0a13cbb9e84 100644 --- a/code/modules/projectiles/projectile/bullets/sniper.dm +++ b/code/modules/projectiles/projectile/bullets/sniper.dm @@ -50,7 +50,7 @@ if(issilicon(target)) //also especially good against borgs var/mob/living/silicon/borg_boy = target borg_boy.apply_damage(damage, BRUTE) - empulse(target, emp_radius, emp_radius) + empulse(target, emp_radius, emp_radius, emp_source = src) /obj/projectile/bullet/p50/incendiary name =".50 BMG incendiary bullet" diff --git a/code/modules/projectiles/projectile/special/ion.dm b/code/modules/projectiles/projectile/special/ion.dm index 9d25f1504cd..96dacf6305e 100644 --- a/code/modules/projectiles/projectile/special/ion.dm +++ b/code/modules/projectiles/projectile/special/ion.dm @@ -9,7 +9,7 @@ /obj/projectile/ion/on_hit(atom/target, blocked = 0, pierce_hit) ..() - empulse(target, emp_radius, emp_radius) + empulse(target, emp_radius, emp_radius, emp_source = src) return BULLET_ACT_HIT /obj/projectile/ion/weak diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index c891b012d56..fdeb4d111ac 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -212,12 +212,19 @@ /datum/chemical_reaction/emp_pulse/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) //pretending this reaction took two ingredients and not three for its effects + var/turf/turf = get_turf(holder.my_atom) var/two_thirds = created_volume / 1.5 var/location = get_turf(holder.my_atom) + var/lastkey = holder.my_atom.fingerprintslast // 100 created volume = 4 heavy range & 7 light range. A few tiles smaller than traitor EMP grandes. // 200 created volume = 8 heavy range & 14 light range. 4 tiles larger than traitor EMP grenades. - empulse(location, round(two_thirds / 12), round(two_thirds / 7), 1) + empulse(location, round(two_thirds / 12), round(two_thirds / 7), 1, emp_source = src) holder.clear_reagents() + if(lastkey) + var/mob/toucher = get_mob_by_key(lastkey) + toucher.log_message("triggered EMP reaction at [AREACOORD(turf)].", LOG_GAME, log_globally = FALSE) + ..() + /datum/chemical_reaction/beesplosion required_reagents = list(/datum/reagent/consumable/honey = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/uranium/radium = 1) diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 8299bcb5221..e7a0ede2234 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -264,7 +264,12 @@ reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimeoverload/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) - empulse(get_turf(holder.my_atom), 3, 5) + var/turf/turf = get_turf(holder.my_atom) + var/lastkey = holder.my_atom.fingerprintslast + empulse(get_turf(holder.my_atom), 3, 5, emp_source = src) + if(lastkey) + var/mob/toucher = get_mob_by_key(lastkey) + toucher.log_message("triggered EMP reaction at [AREACOORD(turf)].", LOG_GAME, log_globally = FALSE) ..() /datum/chemical_reaction/slime/slimecell diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 4d0e4537f52..e40bf4299c5 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -339,7 +339,7 @@ throwSmoke(loc) else if(prob(EFFECT_PROB_MEDIUM * (100 - malfunction_probability_coeff) * 0.01)) visible_message(span_warning("[src] melts [exp_on], ionizing the air around it!")) - empulse(loc, 4, 6) + empulse(loc, 4, 6, emp_source = src) investigate_log("Experimentor has generated an Electromagnetic Pulse.", INVESTIGATE_EXPERIMENTOR) ejectItem(TRUE) //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index e01e08f3373..38ae5ae2fb9 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -325,7 +325,8 @@ GLOBAL_LIST_INIT(slime_extract_auto_activate_reactions, init_slime_auto_activate if(SLIME_ACTIVATE_MAJOR) user.visible_message(span_warning("[user]'s skin starts flashing intermittently..."), span_warning("Your skin starts flashing intermittently...")) if(do_after(user, 2.5 SECONDS, target = user)) - empulse(user, 1, 2) + empulse(user, 1, 2, emp_source = src) + user.log_message("triggered EMP using [src] in [AREACOORD(src)]", LOG_GAME) user.visible_message(span_warning("[user]'s skin flashes!"), span_warning("Your skin flashes as you emit an electromagnetic pulse!")) return 600 diff --git a/code/modules/spells/spell_types/self/disable_tech.dm b/code/modules/spells/spell_types/self/disable_tech.dm index 6eea25d6638..bf0feb031ff 100644 --- a/code/modules/spells/spell_types/self/disable_tech.dm +++ b/code/modules/spells/spell_types/self/disable_tech.dm @@ -13,7 +13,7 @@ /datum/action/cooldown/spell/emp/cast(atom/cast_on) . = ..() - empulse(get_turf(cast_on), emp_heavy, emp_light) + empulse(get_turf(cast_on), emp_heavy, emp_light, emp_source = src) /datum/action/cooldown/spell/emp/disable_tech name = "Disable Tech" diff --git a/code/modules/vehicles/mecha/mecha_mob_interaction.dm b/code/modules/vehicles/mecha/mecha_mob_interaction.dm index f031e06ecf8..f5bf2fed81c 100644 --- a/code/modules/vehicles/mecha/mecha_mob_interaction.dm +++ b/code/modules/vehicles/mecha/mecha_mob_interaction.dm @@ -154,7 +154,7 @@ to_chat(AI, span_danger("ZZUZULU.ERR--ERRR-NEUROLOG-- PERCEP--- DIST-B**@")) for(var/count in 1 to 5) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(do_sparks), rand(10, 20), FALSE, AI), count SECONDS) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(empulse), get_turf(AI), /*heavy_range = */10, /*light_range = */20), 10 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(empulse), get_turf(AI), /*heavy_range = */10, /*light_range = */20, AI), 10 SECONDS) return ..() else if(isliving(M)) mob_container = M