From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 21 Apr 2023 05:06:35 +0000 (+1000) Subject: Add salvage song (#15580) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=8c0d7cfa9ff2cb202fd73f2ea4541af1ff0998e3;p=space-station-14.git Add salvage song (#15580) --- diff --git a/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs b/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs index 452ac9d7a2..eeb737f90b 100644 --- a/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs +++ b/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Salvage; +using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Salvage.Expeditions; @@ -33,6 +34,11 @@ public sealed class SalvageExpeditionComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("stage")] public ExpeditionStage Stage = ExpeditionStage.Added; + + /// + /// Countdown audio stream. + /// + public IPlayingAudioStream? Stream = null; } public enum ExpeditionStage : byte diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index 467f753590..2362331d3f 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -84,6 +84,8 @@ public sealed partial class SalvageSystem private void OnExpeditionShutdown(EntityUid uid, SalvageExpeditionComponent component, ComponentShutdown args) { + component.Stream?.Stop(); + foreach (var (job, cancelToken) in _salvageJobs.ToArray()) { if (job.Station == component.Station) diff --git a/Content.Server/Salvage/SalvageSystem.Runner.cs b/Content.Server/Salvage/SalvageSystem.Runner.cs index 19c4a3dcad..a1be3e4838 100644 --- a/Content.Server/Salvage/SalvageSystem.Runner.cs +++ b/Content.Server/Salvage/SalvageSystem.Runner.cs @@ -6,6 +6,7 @@ using Content.Server.Shuttles.Systems; using Content.Server.Station.Components; using Content.Shared.Chat; using Content.Shared.Salvage; +using Robust.Shared.Audio; using Robust.Shared.Map.Components; using Robust.Shared.Player; using Robust.Shared.Utility; @@ -125,9 +126,11 @@ public sealed partial class SalvageSystem comp.Stage = ExpeditionStage.FinalCountdown; Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-seconds", ("duration", TimeSpan.FromSeconds(30).Seconds))); } - // TODO: Play song. else if (comp.Stage < ExpeditionStage.Countdown && remaining < TimeSpan.FromMinutes(2)) { + // TODO: Some way to play audio attached to a map for players. + comp.Stream = _audio.PlayGlobal(new SoundPathSpecifier("/Audio/Misc/salvage.ogg"), + Filter.BroadcastMap(Comp(uid).MapId), true, AudioParams.Default.WithVolume(-7)); comp.Stage = ExpeditionStage.Countdown; Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes))); } diff --git a/Content.Server/Salvage/SalvageSystem.cs b/Content.Server/Salvage/SalvageSystem.cs index 60023b7f9e..d5ac0ab798 100644 --- a/Content.Server/Salvage/SalvageSystem.cs +++ b/Content.Server/Salvage/SalvageSystem.cs @@ -41,6 +41,7 @@ namespace Content.Server.Salvage [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly RadioSystem _radioSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ShuttleSystem _shuttle = default!; [Dependency] private readonly ShuttleConsoleSystem _shuttleConsoles = default!; diff --git a/Resources/Audio/Misc/attributions.yml b/Resources/Audio/Misc/attributions.yml index 1ab305412c..9753d6c126 100644 --- a/Resources/Audio/Misc/attributions.yml +++ b/Resources/Audio/Misc/attributions.yml @@ -2,3 +2,8 @@ license: "CC-BY-NC-SA-3.0" copyright: "Taken from TG station." source: "https://github.com/tgstation/tgstation/commit/97945e7d08d1457ffc27e46526a48c0453cc95e4" + +- files: ["salvage.ogg"] + license: "CC-BY-3.0" + copyright: "Created by qwertyquerty / discord coconatsu#4342" + source: "https://www.example.com/wagoogus" # It was sent via DM what do you want diff --git a/Resources/Audio/Misc/salvage.ogg b/Resources/Audio/Misc/salvage.ogg new file mode 100644 index 0000000000..db5167bfc1 Binary files /dev/null and b/Resources/Audio/Misc/salvage.ogg differ