Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
New Expedition Countdown Music (#213)
Browse files Browse the repository at this point in the history
# Changelog

:cl:
- add: Added a second music called Deadline that plays when 2 minutes
remain on a salvage expedition.

---------

Co-authored-by: Pspritechologist <[email protected]>
  • Loading branch information
DEATHB4DEFEAT and Pspritechologist authored Oct 11, 2023
1 parent b7ddf15 commit 4a5e85d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server.Salvage.Expeditions;
Expand Down Expand Up @@ -44,11 +45,8 @@ public sealed class SalvageExpeditionComponent : SharedSalvageExpeditionComponen
/// <summary>
/// Sound that plays when the mission end is imminent.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("sound")]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Misc/tension_session.ogg")
{
Params = AudioParams.Default.WithVolume(-5),
};
[ViewVariables(VVAccess.ReadWrite), DataField("sound", customTypeSerializer: typeof(PrototypeIdSerializer<SoundCollectionPrototype>))] // Parkstation-ExpeditionMusic
public string Sound = "ExpeditionCountdownDefault"; // Parkstation-ExpeditionMusic

/// <summary>
/// The difficulty this mission had or, in the future, was selected.
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Salvage/SalvageSystem.Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Salvage.Expeditions;
using Robust.Shared.Audio;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;

namespace Content.Server.Salvage;
Expand Down Expand Up @@ -164,7 +166,11 @@ private void UpdateRunner()
else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
{
// TODO: Some way to play audio attached to a map for players.
comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
// Parkstation-ExpeditionMusic Start
if (_prototypeManager.TryIndex<SoundCollectionPrototype>(comp.Sound, out var sound))
comp.Stream = _audio.PlayGlobal(new SoundPathSpecifier(_random.Pick(sound.PickFiles), AudioParams.Default.WithVolume(-6)),
Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
// Parkstation-ExpeditionMusic End
comp.Stage = ExpeditionStage.MusicCountdown;
Dirty(comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions Resources/Audio/SimpleStation14/Music/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["deadling.ogg"]
license: "CC-BY-3.0"
copyright: "Created by Bolgarich"
source: "https://youtu.be/q7_NFEeeEac"
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: soundCollection
id: ExpeditionCountdownDefault
files:
- /Audio/Misc/tension_session.ogg
- /Audio/SimpleStation14/Music/deadline.ogg

0 comments on commit 4a5e85d

Please sign in to comment.