Files
Aurora.3/code/modules/events/communications_blackout.dm
Batrachophreno 4ecb0bc21c Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for
reviewers:** the only meaningful changed code exists within
**code/game/objects/structures.dm** and
**code/game/objects/structures/_machinery.dm**, largely concerning
damage procs. With the exception of moving airlock defines to their own
file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES.

Objects, _categorically_, are largely divided between those you can hold
in your hand/inventory and those you can't. Machinery objects are
already subtypes of Structures behaviorally, this PR just makes their
pathing reflect that, and allows for future work (tool actions, more
health/destruction functionality) to be developed without unnecessary
code duplication.

I have tested this PR by loading up the Horizon and dismantling various
machines and structures with tools, shooting guns of various types
throughout the ship, and detonating a bunch of explosions throughout the
ship.
2026-05-26 19:35:48 +00:00

40 lines
1.5 KiB
Plaintext

/datum/event/communications_blackout
no_fake = 1
var/damage_machinery = 0
/datum/event/communications_blackout/damage_machinery
damage_machinery = 1
/datum/event/communications_blackout/announce()
var/alert = pick( "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you*%fj00)`5vc-BZZT", \
"Ionospheric anomalies detected. Temporary telecommunication failu*3mga;b4;'1v-BZZZT", \
"Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \
"Ionospheric anomalies dete'fZ\\kg5_0-BZZZZZT", \
"Ionospheri:% MCayj^j<.3-BZZZZZZT", \
"#4nd%;f4y6,>%-BZZZZZZZT")
var/found_ai = FALSE
for(var/mob/living/silicon/ai/A in GLOB.player_list) //AIs are always aware of communication blackouts.
found_ai = TRUE
if(A.z in affecting_z)
to_chat(A, "<br>")
to_chat(A, SPAN_WARNING("<b>[alert]</b>"))
to_chat(A, "<br>")
// If there's no AI, just make the announcement.
if(!found_ai)
command_announcement.Announce(alert, zlevels = affecting_z)
// If there is an AI, then give them a chance to announce or not announce the blackout.
else if(prob(30))
command_announcement.Announce(alert, zlevels = affecting_z)
return 1
/datum/event/communications_blackout/start()
..()
for(var/obj/structure/machinery/telecomms/processor/T in SSmachinery.all_telecomms)
if(T.z in affecting_z)
T.ion_storm()
// 10% chance for a given machine to take damage: slight delays in transmission time or slight message garbling until repaired.
if(damage_machinery && prob(10))
T.ion_storm_damage()