Files
Bubberstation/code/modules/events/communications_blackout.dm
LemonInTheDark ed6405829e Updates individual telecomm machines to autolink/operate properly cross zs (#90747)
## About The Pull Request

I thought I fixed this a while back with changes to signals and such
(#76360), but I failed to handle machine to machine interaction and
autolinking properly which broke behavior. Mildly hard to test but it...
should? work better now. I don't think I've missed something but it is
possible.

[Unfucks telecomms_list, mild code quality
stuff](https://github.com/tgstation/tgstation/pull/90747/commits/cc8316d523b31a15d665a15def63e18318320e8f)

[cc8316d](https://github.com/tgstation/tgstation/pull/90747/commits/cc8316d523b31a15d665a15def63e18318320e8f)

GLOB.telecomms_list proported to hold just /telecomms machines but it
WASN'T, we stuffed message computers in there too to make references a
bit easier to clean.

This fixes that, handling them instead with a one to many pattern. I've
also renamed a few things (most prominently GLOB.telecomms_list ->
GLOB.telecomm_machines), and unindented an if check that was essentially
dead code. Also killed a really messy define and replaced it with a
proc.

## Why It's Good For The Game

Mapper asked for it, really should have done this years ago but we
didn't have a usecase for it.

## Changelog
🆑
fix: Tcomms machines will interoperate across z levels in the same
"stack" as expected now
/🆑
2025-04-29 18:33:34 -06:00

37 lines
1.9 KiB
Plaintext

/datum/round_event_control/communications_blackout
name = "Communications Blackout"
typepath = /datum/round_event/communications_blackout
weight = 30
category = EVENT_CATEGORY_ENGINEERING
description = "Heavily EMPs all telecommunication machines, blocking all communication for a while."
min_wizard_trigger_potency = 0
max_wizard_trigger_potency = 3
/datum/round_event/communications_blackout
announce_when = 1
/datum/round_event/communications_blackout/announce(fake)
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",
)
for(var/mob/living/silicon/ai/A in GLOB.ai_list) //AIs are always aware of communication blackouts.
to_chat(A, "<br>[span_warning("<b>[alert]</b>")]<br>")
to_chat(A, span_notice("Remember, you can transmit over holopads by right clicking on them, and can speak through them with \".[/datum/saymode/holopad::key]\"."))
if(prob(30) || fake) //most of the time, we don't want an announcement, so as to allow AIs to fake blackouts.
priority_announce(alert, "Anomaly Alert", sound = ANNOUNCER_COMMSBLACKOUT) //SKYRAT EDIT CHANGE - ORIGINAL: priority_announce(alert, "Anomaly Alert")
/datum/round_event/communications_blackout/start()
for(var/obj/machinery/telecomms/shhh as anything in GLOB.telecomm_machines)
shhh.emp_act(EMP_HEAVY)
for(var/datum/transport_controller/linear/tram/transport as anything in SStransport.transports_by_type[TRANSPORT_TYPE_TRAM])
if(!isnull(transport.home_controller))
var/obj/machinery/transport/tram_controller/tcomms/controller = transport.home_controller
controller.emp_act(EMP_HEAVY)