]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add salvage song (#15580)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 21 Apr 2023 05:06:35 +0000 (15:06 +1000)
committerGitHub <noreply@github.com>
Fri, 21 Apr 2023 05:06:35 +0000 (15:06 +1000)
Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs
Content.Server/Salvage/SalvageSystem.Expeditions.cs
Content.Server/Salvage/SalvageSystem.Runner.cs
Content.Server/Salvage/SalvageSystem.cs
Resources/Audio/Misc/attributions.yml
Resources/Audio/Misc/salvage.ogg [new file with mode: 0644]

index 452ac9d7a2a01317189745dee5c4f99756eceef4..eeb737f90b64e7cd192523fd4706f7ca70528b73 100644 (file)
@@ -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;
+
+    /// <summary>
+    /// Countdown audio stream.
+    /// </summary>
+    public IPlayingAudioStream? Stream = null;
 }
 
 public enum ExpeditionStage : byte
index 467f7535904335c6ae870b0bd0d41cfd884a9d72..2362331d3ff46981ef69bd99050a884d8d260c9a 100644 (file)
@@ -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)
index 19c4a3dcad82bf6c5628b98a0ecf46f4e21f902c..a1be3e4838e0289c5c79cd77f83e780ed97b3784 100644 (file)
@@ -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<MapComponent>(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)));
             }
index 60023b7f9ef2c4fff405b449ed44813cb92a2d8a..d5ac0ab79892be31111c475f5d0cf400eaafc1da 100644 (file)
@@ -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!;
index 1ab305412cf16c4fc0cd3e2398dbadeee597b8fd..9753d6c1267da83b6201024b7706a4a23a6a6949 100644 (file)
@@ -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 (file)
index 0000000..db5167b
Binary files /dev/null and b/Resources/Audio/Misc/salvage.ogg differ