Ambient music fixes (#17685)

This commit is contained in:
metalgearsloth
2023-06-27 21:28:51 +10:00
committed by GitHub
parent 46a0f178e5
commit 1485666a23
16 changed files with 456 additions and 362 deletions

View File

@@ -8,9 +8,7 @@ using Content.Shared.Chat;
using Content.Shared.Humanoid;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components;
using Robust.Shared.Audio;
using Content.Shared.Salvage.Expeditions;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
using Robust.Shared.Utility;
@@ -110,6 +108,7 @@ public sealed partial class SalvageSystem
Announce(args.MapUid, Loc.GetString("salvage-expedition-announcement-dungeon", ("direction", component.DungeonLocation.GetDir())));
component.Stage = ExpeditionStage.Running;
Dirty(component);
}
private void OnFTLStarted(ref FTLStartedEvent ev)
@@ -158,6 +157,7 @@ public sealed partial class SalvageSystem
if (comp.Stage < ExpeditionStage.FinalCountdown && remaining < TimeSpan.FromSeconds(30))
{
comp.Stage = ExpeditionStage.FinalCountdown;
Dirty(comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-seconds", ("duration", TimeSpan.FromSeconds(30).Seconds)));
}
else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
@@ -165,11 +165,13 @@ public sealed partial class SalvageSystem
// 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);
comp.Stage = ExpeditionStage.MusicCountdown;
Dirty(comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
}
else if (comp.Stage < ExpeditionStage.Countdown && remaining < TimeSpan.FromMinutes(5))
{
comp.Stage = ExpeditionStage.Countdown;
Dirty(comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(5).Minutes)));
}
// Auto-FTL out any shuttles