Skip to content

Commit

Permalink
Improves Anomaly Logging (#26526)
Browse files Browse the repository at this point in the history
* Adjusts logging for anoms

* Cleans up game log messages

* Adds logging for more anoms

* DGamerL Review

Co-authored-by: DGamerL <[email protected]>
Signed-off-by: Burzah <[email protected]>

* Lewc Review

Co-authored-by: Luc <[email protected]>
Signed-off-by: Burzah <[email protected]>

* Added Blackbox Logging

* Fixes and Adjusts Blackbox Logging

* Line spacing

* Blackbox ledger addition

* Fixes blackbox logging

---------

Signed-off-by: Burzah <[email protected]>
Co-authored-by: DGamerL <[email protected]>
Co-authored-by: Luc <[email protected]>
  • Loading branch information
3 people authored Oct 7, 2024
1 parent bcd5b0b commit 9c74bd1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions code/game/objects/effects/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
countdown.color = countdown_colour
countdown.start()

// Only log an anomaly if it drops a core. Prevents logging of SM events and Vetus.
if(drops_core)
message_admins("\A [name] has spawned at [impact_area][ADMIN_COORDJMP(impact_area)]")
log_admin("\A [name] has spawned at [impact_area]")

/obj/effect/anomaly/Destroy()
GLOB.poi_list.Remove(src)
STOP_PROCESSING(SSobj, src)
Expand Down Expand Up @@ -82,17 +87,17 @@
if(drops_core)
aSignal.forceMove(drop_location())
aSignal = null
// else, anomaly core gets deleted by qdel(src).
// Subtracts the time remaining from lifespan to get defuse time, converts it to seconds
var/defuse_time = round((lifespan - (death_time - world.time)) / 10)
SSblackbox.record_feedback("ledger", "anomaly_defuse_time", "[defuse_time]", "[type]")

// Else, anomaly core gets deleted by qdel(src).
qdel(src)


/obj/effect/anomaly/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/analyzer))
to_chat(user, "<span class='notice'>Analyzing... [src]'s unstable field is fluctuating along frequency [format_frequency(aSignal.frequency)], code [aSignal.code].</span>")

///////////////////////

/obj/effect/anomaly/grav
name = "gravitational anomaly"
icon_state = "shield2"
Expand Down Expand Up @@ -169,8 +174,7 @@
if(T && length(GLOB.gravity_generators["[T.z]"]))
var/obj/machinery/gravity_generator/main/G = pick(GLOB.gravity_generators["[T.z]"])
G.set_broken() //Requires engineering to fix the gravity generator, as it gets overloaded by the anomaly.

/////////////////////
log_and_message_admins("A [name] has detonated a gravity generator")

/obj/effect/anomaly/flux
name = "flux wave anomaly"
Expand Down Expand Up @@ -222,12 +226,12 @@

/obj/effect/anomaly/flux/detonate()
if(explosive)
explosion(src, 1, 4, 16, 18) //Low devastation, but hits a lot of stuff.
explosion(src, 1, 4, 16, 18, FALSE) // Set adminlog to FALSE for custom logging
message_admins("\A [name] has detonated at [impact_area][ADMIN_COORDJMP(impact_area)]")
log_admin("\A [name] has detonated at [impact_area]")
else
new /obj/effect/particle_effect/sparks(loc)

/////////////////////

/obj/effect/anomaly/bluespace
name = "bluespace anomaly"
icon = 'icons/obj/projectiles.dmi'
Expand Down Expand Up @@ -328,9 +332,6 @@
M.client.screen -= blueeffect
qdel(blueeffect)


/////////////////////

/obj/effect/anomaly/pyro
name = "pyroclastic anomaly"
icon_state = "mustard"
Expand Down Expand Up @@ -365,6 +366,9 @@
/obj/effect/anomaly/pyro/detonate()
if(produces_slime)
INVOKE_ASYNC(src, PROC_REF(makepyroslime))
if(drops_core)
message_admins("\A [name] has detonated at [impact_area][ADMIN_COORDJMP(impact_area)]")
log_admin("\A [name] has detonated at [impact_area]")

/obj/effect/anomaly/pyro/proc/makepyroslime()
var/turf/simulated/T = get_turf(src)
Expand All @@ -391,8 +395,6 @@
dust_if_respawnable(chosen)
log_game("[key_name(S.key)] was made into a slime by pyroclastic anomaly at [AREACOORD(T)].")

/////////////////////

/obj/effect/anomaly/cryo
name = "cryogenic anomaly"
desc = "Hope you brought a jacket!"
Expand Down Expand Up @@ -466,8 +468,8 @@
air.set_sleeping_agent(3000)
air.set_carbon_dioxide(3000)
T.blind_release_air(air)

/////////////////////
message_admins("\A [name] has detonated at [impact_area][ADMIN_COORDJMP(impact_area)]")
log_admin("\A [name] has detonated at [impact_area]")

/obj/effect/anomaly/bhole
name = "vortex anomaly"
Expand Down

0 comments on commit 9c74bd1

Please sign in to comment.