diff --git a/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs b/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs index 2d35ae59731..2a61f9b5238 100644 --- a/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs +++ b/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs @@ -16,6 +16,9 @@ using Robust.Shared.Timing; using System.Diagnostics.CodeAnalysis; using System.Linq; +using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Player; namespace Content.Server.Atmos.Monitor.Systems; @@ -31,6 +34,7 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem [Dependency] private readonly NavMapSystem _navMapSystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly DeviceListSystem _deviceListSystem = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; private const float UpdateTime = 1.0f; @@ -54,7 +58,7 @@ public override void Initialize() SubscribeLocalEvent(OnDeviceAnchorChanged); } - #region Event handling + #region Event handling private void OnConsoleInit(EntityUid uid, AtmosAlertsComputerComponent component, ComponentInit args) { @@ -194,6 +198,14 @@ public override void Update(float frameTime) if (TryComp(ent, out var entAppearance)) _appearance.SetData(ent, AtmosAlertsComputerVisuals.ComputerLayerScreen, (int) highestAlert, entAppearance); + // Sunrise-start + if (entConsole.NextBeep < _gameTiming.CurTime && highestAlert == AtmosAlarmType.Danger && entConsole.BeepSound != null) + { + _audio.PlayPvs(entConsole.BeepSound, ent); + entConsole.NextBeep = _gameTiming.CurTime + entConsole.Timer; + } + // Sunrise-end + // If the console UI is open, send UI data to each subscribed session UpdateUIState(ent, airAlarmEntries, fireAlarmEntries, entConsole, entXform); } diff --git a/Content.Shared/Atmos/Consoles/Components/AtmosAlertsComputerComponent.cs b/Content.Shared/Atmos/Consoles/Components/AtmosAlertsComputerComponent.cs index d64c8907afb..c949ea26f6a 100644 --- a/Content.Shared/Atmos/Consoles/Components/AtmosAlertsComputerComponent.cs +++ b/Content.Shared/Atmos/Consoles/Components/AtmosAlertsComputerComponent.cs @@ -1,5 +1,6 @@ using Content.Shared.Atmos.Consoles; using Content.Shared.Atmos.Monitor; +using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Serialization; @@ -27,6 +28,17 @@ public sealed partial class AtmosAlertsComputerComponent : Component /// [ViewVariables, AutoNetworkedField] public HashSet SilencedDevices = new(); + + // Sunrise-start + [DataField] + public SoundSpecifier? BeepSound; + + [DataField] + public TimeSpan Timer = TimeSpan.FromSeconds(5); + + [DataField] + public TimeSpan NextBeep = TimeSpan.Zero; + // Sunrise-end } [Serializable, NetSerializable] @@ -77,7 +89,7 @@ public struct AtmosAlertsFocusDeviceData public (float, AtmosAlarmType) PressureData; /// - /// Moles, percentage, and related alert state, for all detected gases + /// Moles, percentage, and related alert state, for all detected gases /// public Dictionary GasData; @@ -200,7 +212,7 @@ public sealed class AtmosAlertsComputerDeviceSilencedMessage : BoundUserInterfac public bool SilenceDevice = true; /// - /// Used to inform the server that the client has silenced alerts from the specified device to this atmos monitoring console + /// Used to inform the server that the client has silenced alerts from the specified device to this atmos monitoring console /// public AtmosAlertsComputerDeviceSilencedMessage(NetEntity atmosDevice, bool silenceDevice = true) { diff --git a/Resources/Audio/_Sunrise/Effects/beeps.ogg b/Resources/Audio/_Sunrise/Effects/beeps.ogg new file mode 100644 index 00000000000..6f14eb22d9f Binary files /dev/null and b/Resources/Audio/_Sunrise/Effects/beeps.ogg differ diff --git a/Resources/Locale/en-US/_strings/_sunrise/preferences/loadout-groups.ftl b/Resources/Locale/en-US/_strings/_sunrise/preferences/loadout-groups.ftl index dfb9f400e89..750d78db3c0 100644 --- a/Resources/Locale/en-US/_strings/_sunrise/preferences/loadout-groups.ftl +++ b/Resources/Locale/en-US/_strings/_sunrise/preferences/loadout-groups.ftl @@ -32,3 +32,4 @@ loadout-group-adj-jumpsuit = Адъютант, комбинезон loadout-group-adj-backpack = Адъютант, рюкзак loadout-group-adj-head = Адъютант, головной убор loadout-group-adj-outerClothing = Адъютант, верхняя одежда +loadout-group-atmos-console = Атмос консоль diff --git a/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl b/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl index 19465b93f48..5de3875d79c 100644 --- a/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl +++ b/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl @@ -47,3 +47,14 @@ ent-BaseHandheldCamera = бодикамера ent-HandheldCamera = { ent-BaseHandheldCamera } .desc = { ent-BaseHandheldCamera.desc } .suffix = Камера +ent-BaseAtmosAlertsMonitor = портативная консоль атмосферных угроз + .desc = Позволяет вам в любом месте смотреть за атмосферными угрозами. +ent-AtmosAlertsMonitor = { ent-BaseAtmosAlertsMonitor } + .desc = { ent-BaseAtmosAlertsMonitor.desc } + .suffix = Переносной, Требует энергию +ent-AtmosAlertsMonitorEmpty = { ent-BaseAtmosAlertsMonitor } + .desc = { ent-BaseAtmosAlertsMonitor.desc } + .suffix = Переносной, Пустой +ent-AtmosAlertsMonitorUnpowered = { ent-BaseAtmosAlertsMonitor } + .desc = { ent-BaseAtmosAlertsMonitor.desc } + .suffix = Переносной, Не требует энергии diff --git a/Resources/Locale/ru-RU/_strings/_sunrise/preferences/loadout-groups.ftl b/Resources/Locale/ru-RU/_strings/_sunrise/preferences/loadout-groups.ftl index 4077ee717c7..4717cec8849 100644 --- a/Resources/Locale/ru-RU/_strings/_sunrise/preferences/loadout-groups.ftl +++ b/Resources/Locale/ru-RU/_strings/_sunrise/preferences/loadout-groups.ftl @@ -33,3 +33,4 @@ loadout-group-adj-jumpsuit = Адъютант, комбинезон loadout-group-adj-backpack = Адъютант, рюкзак loadout-group-adj-head = Адъютант, головной убор loadout-group-adj-outerClothing = Адъютант, верхняя одежда +loadout-group-atmos-console = Атмос консоль diff --git a/Resources/Prototypes/Loadouts/role_loadouts.yml b/Resources/Prototypes/Loadouts/role_loadouts.yml index ac66ac1a32f..9a9e94e864c 100644 --- a/Resources/Prototypes/Loadouts/role_loadouts.yml +++ b/Resources/Prototypes/Loadouts/role_loadouts.yml @@ -333,6 +333,7 @@ - Trinkets - GroupSpeciesBreathTool # Sunrise-start + - AtmosphericsConsole - Bra - Pants - Socks @@ -367,6 +368,7 @@ - Trinkets - GroupSpeciesBreathTool # Sunrise-start + - AtmosphericsConsole - Bra - Pants - Socks @@ -384,6 +386,7 @@ - Trinkets - GroupSpeciesBreathTool # Sunrise-start + - AtmosphericsConsole - Bra - Pants - Socks diff --git a/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml b/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml index d681ca5c239..992cacb966e 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml @@ -46,21 +46,21 @@ enum.PowerDeviceVisualLayers.Powered: True: { visible: true } False: { visible: false } - + - type: entity id: PortableSurveillanceCameraMonitor - parent: + parent: - BasePortableSurveillanceCameraMonitor - BaseHandheldComputer suffix: Handheld, Powered - + - type: entity id: PortableSurveillanceCameraMonitorEmpty parent: PortableSurveillanceCameraMonitor suffix: Handheld, Empty components: - type: Sprite - sprite: _Sunrise/Objects/Devices/portable_camera_viewer.rsi + sprite: _Sunrise/Objects/Devices/portable_camera_viewer.rsi # TODO: sprite state: icon layers: - state: icon @@ -72,7 +72,7 @@ slots: cell_slot: name: power-cell-slot-component-slot-name-default - + - type: entity id: PortableSurveillanceCameraMonitorUnpowered parent: BasePortableSurveillanceCameraMonitor @@ -118,10 +118,10 @@ enum.PowerDeviceVisualLayers.Powered: True: { visible: true } False: { visible: false } - + - type: entity id: HandheldCriminalRecordsMonitor - parent: + parent: - BaseHandheldCriminalRecordsMonitor - BaseHandheldComputer suffix: HandHeld, Powered @@ -144,12 +144,12 @@ slots: cell_slot: name: power-cell-slot-component-slot-name-default - + - type: entity id: HandheldCriminalRecordsMonitorUnpowered parent: BaseHandheldCriminalRecordsMonitor suffix: Handheld, Unpowered - + # Handheld RoboAnalyzer - type: entity @@ -195,14 +195,14 @@ - type: GuideHelp guides: - Robotics - + - type: entity id: HandheldRoboAnalyzer - parent: + parent: - BaseHandheldRoboAnalyzer - BaseHandheldComputer suffix: HandHeld, Powered - + - type: entity id: HandheldRoboAnalyzerEmpty parent: HandheldRoboAnalyzer @@ -221,12 +221,12 @@ slots: cell_slot: name: power-cell-slot-component-slot-name-default - + - type: entity id: HandheldRoboAnalyzerUnpowered parent: BaseHandheldRoboAnalyzer suffix: Handheld, Unpowered - + # Handheld Mech Analyzer - type: entity @@ -271,14 +271,14 @@ - type: GuideHelp guides: - Robotics - + - type: entity id: HandheldMechAnalyzer - parent: + parent: - BaseHandheldMechAnalyzer - BaseHandheldComputer suffix: HandHeld, Powered - + - type: entity id: HandheldMechAnalyzerEmpty parent: HandheldMechAnalyzer @@ -297,12 +297,12 @@ slots: cell_slot: name: power-cell-slot-component-slot-name-default - + - type: entity id: HandheldMechAnalyzerUnpowered parent: BaseHandheldMechAnalyzer suffix: Handheld, Unpowered - + # Handheld Camera - type: entity @@ -346,8 +346,80 @@ volume: -8 maxDistance: 10 variation: 0.05 - + - type: entity id: HandheldCamera parent: BaseHandheldCamera - suffix: HandHeld \ No newline at end of file + suffix: HandHeld + +# Atmos alerts console + +- type: entity + name: handheld atmos console + parent: BaseItem + id: BaseAtmosAlertsMonitor + description: A hand-held crew monitor displaying the status of wanted persons on station. + abstract: true + components: + - type: Sprite + sprite: _Sunrise/Objects/Devices/handheld_atmos_console.rsi + state: icon + layers: + - state: icon + - state: scanner + shader: unshaded + visible: true + map: [ "enum.PowerDeviceVisualLayers.Powered" ] + - type: AtmosAlertsComputer + beepSound: + path: /Audio/_Sunrise/Effects/beeps.ogg + - type: ActivatableUI + singleUser: true + key: enum.AtmosAlertsComputerUiKey.Key + - type: UserInterface + interfaces: + enum.AtmosAlertsComputerUiKey.Key: + type: AtmosAlertsComputerBoundUserInterface + enum.WiresUiKey.Key: + type: WiresBoundUserInterface + - type: WirelessNetworkConnection + range: 500 + - type: StationLimitedNetwork + - type: Appearance + - type: GenericVisualizer + visuals: + enum.PowerCellSlotVisuals.Enabled: + enum.PowerDeviceVisualLayers.Powered: + True: { visible: true } + False: { visible: false } + +- type: entity + id: AtmosAlertsMonitor + parent: + - BaseAtmosAlertsMonitor + - BaseHandheldComputer + suffix: HandHeld, Powered + +- type: entity + id: AtmosAlertsMonitorEmpty + parent: AtmosAlertsMonitor + suffix: HandHeld, Empty + components: + - type: Sprite + sprite: _Sunrise/Objects/Devices/handheld_atmos_console.rsi + state: icon + layers: + - state: icon + - state: scanner + shader: unshaded + visible: false + map: [ "enum.PowerDeviceVisualLayers.Powered" ] + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default + +- type: entity + id: AtmosAlertsMonitorUnpowered + parent: BaseAtmosAlertsMonitor + suffix: Handheld, Unpowered diff --git a/Resources/Prototypes/_Sunrise/Loadouts/Miscellaneous/engineering.yml b/Resources/Prototypes/_Sunrise/Loadouts/Miscellaneous/engineering.yml new file mode 100644 index 00000000000..c82fe3eb15c --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Loadouts/Miscellaneous/engineering.yml @@ -0,0 +1,5 @@ +- type: loadout + id: AtmosphericsConsole + storage: + back: + - AtmosAlertsMonitor diff --git a/Resources/Prototypes/_Sunrise/Loadouts/loadout_groups.yml b/Resources/Prototypes/_Sunrise/Loadouts/loadout_groups.yml index a8d1acc5d35..393b4471e60 100644 --- a/Resources/Prototypes/_Sunrise/Loadouts/loadout_groups.yml +++ b/Resources/Prototypes/_Sunrise/Loadouts/loadout_groups.yml @@ -309,3 +309,8 @@ loadouts: - AdjutantCoat +- type: loadoutGroup + id: AtmosphericsConsole + name: loadout-group-atmos-console + loadouts: + - AtmosphericsConsole diff --git a/Resources/Prototypes/_Sunrise/Loadouts/role_loadouts.yml b/Resources/Prototypes/_Sunrise/Loadouts/role_loadouts.yml index 146ddf3e7e5..4c693622822 100644 --- a/Resources/Prototypes/_Sunrise/Loadouts/role_loadouts.yml +++ b/Resources/Prototypes/_Sunrise/Loadouts/role_loadouts.yml @@ -126,6 +126,7 @@ - StationEngineerBackpack - StationEngineerOuterClothing - StationEngineerShoes + - AtmosphericsConsole - SurvivalExtended - Trinkets - GroupSpeciesBreathTool @@ -157,6 +158,7 @@ - StationEngineerBackpack - StationEngineerOuterClothing - StationEngineerShoes + - AtmosphericsConsole - Trinkets - SurvivalExtended - GroupSpeciesBreathTool diff --git a/Resources/Prototypes/borg_types.yml b/Resources/Prototypes/borg_types.yml index a5f3464c4f5..59f7d14a079 100644 --- a/Resources/Prototypes/borg_types.yml +++ b/Resources/Prototypes/borg_types.yml @@ -74,6 +74,10 @@ collection: FootstepCyborgSpider params: volume: -15 + addComponents: + - type: InnateItem + instantActions: + - AtmosAlertsMonitor # Sunrise-End # Visual diff --git a/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/icon.png b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/icon.png new file mode 100644 index 00000000000..8e80e254cd0 Binary files /dev/null and b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/icon.png differ diff --git a/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/meta.json b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/meta.json new file mode 100644 index 00000000000..9ad617c1f26 --- /dev/null +++ b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/meta.json @@ -0,0 +1,27 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "made by averystarbits on github or azazelstarbits on discord", + "states": [ + { + "name": "scanner", + "directions": 1, + "delays": [ + [ + 0.4, + 0.4, + 0.4, + 0.4 + ] + ] + }, + { + "name": "icon", + "directions": 1 + } + ] +} diff --git a/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/scanner.png b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/scanner.png new file mode 100644 index 00000000000..a69bfae2173 Binary files /dev/null and b/Resources/Textures/_Sunrise/Objects/Devices/handheld_atmos_console.rsi/scanner.png differ