Add attention.ogg and soundspecifiers for events (#7977)

This commit is contained in:
metalgearsloth
2022-05-07 15:41:15 +10:00
committed by GitHub
parent 5a9fff34d0
commit c95bf87e74
12 changed files with 24 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Disease.Components;
using Content.Server.Disease;
using Content.Shared.Disease;
using Content.Shared.MobState.Components;
using Content.Shared.Sound;
using Robust.Shared.Random;
using Robust.Shared.Prototypes;
@@ -32,7 +33,7 @@ public sealed class DiseaseOutbreak : StationEvent
public override string Name => "DiseaseOutbreak";
public override float Weight => WeightNormal;
public override string? StartAudio => "/Audio/Announcements/outbreak7.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/outbreak7.ogg");
protected override float EndAfter => 1.0f;
/// <summary>
/// Finds 2-5 random, alive entities that can host diseases

View File

@@ -1,5 +1,6 @@
using Content.Server.Atmos.EntitySystems;
using Content.Shared.Atmos;
using Content.Shared.Sound;
using Content.Shared.Station;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;

View File

@@ -1,9 +1,5 @@
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Content.Shared.Sound;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Random;
namespace Content.Server.StationEvents.Events;

View File

@@ -2,6 +2,7 @@ using System;
using System.Linq;
using Content.Server.GameTicking;
using Content.Server.Projectiles.Components;
using Content.Shared.Sound;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
@@ -27,7 +28,7 @@ namespace Content.Server.StationEvents.Events
public override string StartAnnouncement => Loc.GetString("station-event-meteor-swarm-start-announcement");
protected override string EndAnnouncement => Loc.GetString("station-event-meteor-swarm-ebd-announcement");
public override string? StartAudio => "/Audio/Announcements/meteors.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/meteors.ogg");
protected override float StartAfter => 30f;
protected override float EndAfter => float.MaxValue;

View File

@@ -1,5 +1,6 @@
using System.Threading;
using Content.Server.Power.Components;
using Content.Shared.Sound;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Player;
@@ -20,7 +21,7 @@ namespace Content.Server.StationEvents.Events
public override int? MaxOccurrences => 3;
public override string StartAnnouncement => Loc.GetString("station-event-power-grid-check-start-announcement");
protected override string EndAnnouncement => Loc.GetString("station-event-power-grid-check-end-announcement");
public override string? StartAudio => "/Audio/Announcements/power_off.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/power_off.ogg");
// If you need EndAudio it's down below. Not set here because we can't play it at the normal time without spamming sounds.

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Server.Radiation;
using Content.Server.Station;
using Content.Shared.Coordinates;
using Content.Shared.Sound;
using Content.Shared.Station;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
@@ -24,7 +25,7 @@ namespace Content.Server.StationEvents.Events
public override string Name => "RadiationStorm";
public override string StartAnnouncement => Loc.GetString("station-event-radiation-storm-start-announcement");
protected override string EndAnnouncement => Loc.GetString("station-event-radiation-storm-end-announcement");
public override string StartAudio => "/Audio/Announcements/radiation.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/radiation.ogg");
protected override float StartAfter => 10.0f;
// Event specific details

View File

@@ -4,6 +4,7 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Managers;
using Content.Server.Station;
using Content.Shared.Database;
using Content.Shared.Sound;
using Content.Shared.Station;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
@@ -51,12 +52,12 @@ namespace Content.Server.StationEvents.Events
/// <summary>
/// Starting audio of the event.
/// </summary>
public virtual string? StartAudio { get; set; } = null;
public virtual SoundSpecifier? StartAudio { get; set; } = new SoundPathSpecifier("/Audio/Announcements/attention.ogg");
/// <summary>
/// Ending audio of the event.
/// </summary>
public virtual string? EndAudio { get; } = null;
public virtual SoundSpecifier? EndAudio { get; } = null;
public virtual AudioParams AudioParams { get; } = AudioParams.Default.WithVolume(-10f);
@@ -137,7 +138,7 @@ namespace Content.Server.StationEvents.Events
if (StartAudio != null)
{
SoundSystem.Play(Filter.Broadcast(), StartAudio, AudioParams);
SoundSystem.Play(Filter.Broadcast(), StartAudio.GetSound(), AudioParams);
}
Announced = true;
@@ -160,7 +161,7 @@ namespace Content.Server.StationEvents.Events
if (EndAudio != null)
{
SoundSystem.Play(Filter.Broadcast(), EndAudio, AudioParams);
SoundSystem.Play(Filter.Broadcast(), EndAudio.GetSound(), AudioParams);
}
Started = false;

View File

@@ -1,5 +1,6 @@
using System.Linq;
using Content.Server.StationEvents.Components;
using Content.Shared.Sound;
using Robust.Shared.Random;
namespace Content.Server.StationEvents.Events;
@@ -17,7 +18,7 @@ public sealed class VentCritters : StationEvent
public override string? StartAnnouncement =>
Loc.GetString("station-event-vent-spiders-start-announcement", ("data", Loc.GetString(Loc.GetString($"random-sentience-event-data-{_random.Next(1, 6)}"))));
public override string? StartAudio => "/Audio/Announcements/aliens.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/aliens.ogg");
public override int EarliestStart => 15;

View File

@@ -2,6 +2,7 @@ using Robust.Shared.Random;
using Content.Server.Chat.Managers;
using Content.Server.Disease.Zombie.Components;
using Content.Shared.MobState.Components;
using Content.Shared.Sound;
namespace Content.Server.StationEvents.Events
{
@@ -18,7 +19,7 @@ namespace Content.Server.StationEvents.Events
public override int EarliestStart => 50;
public override float Weight => WeightLow / 2;
public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/bloblarm.ogg");
protected override float EndAfter => 1.0f;
public override int? MaxOccurrences => 1;