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

🆑
admin: EMP logs are improved, additionally chemical EMP reactions are
now logged.
/🆑
This commit is contained in:
Aliceee2ch
2025-11-09 15:46:10 +02:00
committed by GitHub
parent aa5c38925d
commit 8ee1cd2474
21 changed files with 39 additions and 26 deletions
@@ -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)
+4 -4
View File
@@ -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)
@@ -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)
@@ -8,7 +8,6 @@
. = ..()
if(!.)
return
update_mob()
empulse(src, 4, 10)
empulse(src, 4, 10, emp_source = src)
qdel(src)
@@ -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)
@@ -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()
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
@@ -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
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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.
@@ -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
@@ -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"
@@ -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
@@ -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)
@@ -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
+1 -1
View File
@@ -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)
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -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
@@ -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"
@@ -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