Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expedition music #4

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading