Skip to content

Commit

Permalink
Expedition music (#4)
Browse files Browse the repository at this point in the history
# Description

- [x] Expedition music
#2
  • Loading branch information
OCOtheOmega authored Oct 29, 2023
1 parent 0a10839 commit 90d716c
Show file tree
Hide file tree
Showing 5 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,9 +45,6 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
/// <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
}
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 @@ -153,7 +155,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(uid, comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
Expand Down
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 90d716c

Please sign in to comment.