diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs index 84a2307f58..6905b38b43 100644 --- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs @@ -174,7 +174,7 @@ namespace Content.Server.Singularity.EntitySystems return; } - AlertRadio((uid, component), "unpowered"); + AlertRadio((uid, component), component.LocUnpowered); component.IsPowered = false; @@ -302,22 +302,23 @@ namespace Content.Server.Singularity.EntitySystems // warn engineering their containment engine needs IMMEDIATE repairs // this doesn't change much for natural loosing through emitter destruction given any meteor warning serves the same purpose // can also be used to scare engineering though given it broadcasts its location you need a renamed station beacon to really scare them - AlertRadio(ent, "destroyed"); + AlertRadio(ent, ent.Comp.LocDestroyed); } private void OnDeconstructed(Entity ent, ref MachineDeconstructedEvent args) { // right now you don't even need to unlock the emitter to deconstruct it. that's almost certainly a bug but even without it it probably still needs an alert - AlertRadio(ent, "deconstructed"); + AlertRadio(ent, ent.Comp.LocDeconstructed); } - private void AlertRadio(Entity ent, string type) + private void AlertRadio(Entity ent, string locString) { if (!ent.Comp.AlertRadio || !ent.Comp.IsOn || !ent.Comp.IsPowered) return; // APEs do not need to scream over engineering radio, and an emitter that is off is probably not going to be alerting radios - var message = Loc.GetString("emitter-" + type + "-broadcast", - ("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString(ent.Owner))) + var message = Loc.GetString( + locString, + ("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString(ent.Owner))) ); _radio.SendRadioMessage(ent.Owner, message, ent.Comp.RadioChannel, ent.Owner); } @@ -327,7 +328,7 @@ namespace Content.Server.Singularity.EntitySystems if (args.Locked) return; - AlertRadio(ent, "unlocked"); + AlertRadio(ent, ent.Comp.LocUnlocked); } } } diff --git a/Content.Shared/Singularity/Components/SharedEmitterComponent.cs b/Content.Shared/Singularity/Components/SharedEmitterComponent.cs index b3ea3a644f..7a2bc24a95 100644 --- a/Content.Shared/Singularity/Components/SharedEmitterComponent.cs +++ b/Content.Shared/Singularity/Components/SharedEmitterComponent.cs @@ -98,11 +98,41 @@ public sealed partial class EmitterComponent : Component [DataField] public Dictionary, EntProtoId> SetTypePorts = new(); + /// + /// The radio channel to broadcast on when something happens to this emitter + /// [DataField] public ProtoId RadioChannel = "Engineering"; + /// + /// Whether a radio channel should be alerted if anything happens to this emitter (i.e. emitters near singularity/tesla containment) + /// [DataField] - public bool AlertRadio = false; // is this emitter critical to the station to the point a radio channel should be alerted if anything happens to it (i.e. emitters near singularity/tesla containment) + public bool AlertRadio = false; + + /// + /// Localized string to use when this emitter is destroyed and AlertRadio is set to true + /// + [DataField] + public LocId LocDestroyed = "emitter-destroyed-broadcast"; + + /// + /// Localized string to use when this emitter is deconstructed and AlertRadio is set to true + /// + [DataField] + public LocId LocDeconstructed = "emitter-deconstructed-broadcast"; + + /// + /// Localized string to use when this emitter is unlocked and AlertRadio is set to true + /// + [DataField] + public LocId LocUnlocked = "emitter-unlocked-broadcast"; + + /// + /// Localized string to use when this emitter is unpowered and AlertRadio is set to true + /// + [DataField] + public LocId LocUnpowered = "emitter-unpowered-broadcast"; } [NetSerializable, Serializable] diff --git a/Resources/Locale/en-US/singularity/components/emitter-component.ftl b/Resources/Locale/en-US/singularity/components/emitter-component.ftl index b077c63d0f..24b98b6c59 100644 --- a/Resources/Locale/en-US/singularity/components/emitter-component.ftl +++ b/Resources/Locale/en-US/singularity/components/emitter-component.ftl @@ -15,6 +15,6 @@ emitter-component-current-type = The current selected type is: [color=yellow]{$t emitter-component-type-set = Type set to: {$type} emitter-destroyed-broadcast = A powered emitter {$location} has been destroyed. -emitter-deconstructed-broadcast = A powered {$location} has been deconstructed. -emitter-unlocked-broadcast = A powered {$location} has been unlocked. -emitter-unpowered-broadcast = A powered {$location} has lost power. +emitter-deconstructed-broadcast = A powered emitter {$location} has been deconstructed. +emitter-unlocked-broadcast = A powered emitter {$location} has been unlocked. +emitter-unpowered-broadcast = A powered emitter {$location} has lost power.