Skip to content

Commit

Permalink
Add attention.ogg and soundspecifiers for events (#7977)
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth authored May 7, 2022
1 parent 5a9fff3 commit c95bf87
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/DiseaseOutbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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;

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Content.Server/StationEvents/Events/GasLeak.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 1 addition & 5 deletions Content.Server/StationEvents/Events/KudzuGrowth.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/MeteorSwarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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;
Expand All @@ -27,7 +28,7 @@ public sealed class MeteorSwarm : StationEvent
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;
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/PowerGridCheck.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -20,7 +21,7 @@ public sealed class PowerGridCheck : StationEvent
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.

Expand Down
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/RadiationStorm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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;
Expand All @@ -24,7 +25,7 @@ public sealed class RadiationStorm : StationEvent
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
Expand Down
9 changes: 5 additions & 4 deletions Content.Server/StationEvents/Events/StationEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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;
Expand Down Expand Up @@ -51,12 +52,12 @@ public abstract class StationEvent
/// <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);

Expand Down Expand Up @@ -137,7 +138,7 @@ public virtual void Announce()

if (StartAudio != null)
{
SoundSystem.Play(Filter.Broadcast(), StartAudio, AudioParams);
SoundSystem.Play(Filter.Broadcast(), StartAudio.GetSound(), AudioParams);
}

Announced = true;
Expand All @@ -160,7 +161,7 @@ public virtual void Shutdown()

if (EndAudio != null)
{
SoundSystem.Play(Filter.Broadcast(), EndAudio, AudioParams);
SoundSystem.Play(Filter.Broadcast(), EndAudio.GetSound(), AudioParams);
}

Started = false;
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/VentCritters.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion Content.Server/StationEvents/Events/ZombieOutbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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
{
Expand All @@ -18,7 +19,7 @@ public sealed class ZombieOutbreak : StationEvent
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;
Expand Down
Binary file added Resources/Audio/Announcements/attention.ogg
Binary file not shown.
6 changes: 4 additions & 2 deletions Resources/Audio/Announcements/license.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
outbreak7.ogg taken from /tg/station at commit https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a used under CC-BY-SA-3.0
meteors.ogg taken from https://github.com/tgstation/tgstation/blob/95731342b97167d7883ff091d389f79c36442ee6/sound/ai/default/meteors.ogg used under CC-BY-SA-3.0
aliens.ogg taken from https://github.com/tgstation/tgstation/blob/95731342b97167d7883ff091d389f79c36442ee6/sound/ai/default/aliens.ogg used under CC-BY-SA-3.0
attention.ogg taken from /tg/station at commit https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a used under CC-BY-SA-3.0
meteors.ogg taken from https://github.com/tgstation/tgstation/blob/95731342b97167d7883ff091d389f79c36442ee6/sound/ai/default/meteors.ogg used under CC-BY-SA-3.0
outbreak7.ogg taken from /tg/station at commit https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a used under CC-BY-SA-3.0

2 changes: 1 addition & 1 deletion Resources/Audio/Items/license.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pill.ogg contains audio from '437480__ruanza__swallowing.wav' by user RuanZA, used under CC BY-NC 3.0 (https://freesound.org/people/RuanZA/sounds/437480/), as well as part of '330657__diniunicorn__popping-pills.wav' by user diniunicorn, used under CC0 1.0 (https://freesound.org/people/diniunicorn/sounds/330657/). ring.ogg used udner CC-BY-SA-3.0, taken from /tg/station commit https://github.com/tgstation/tgstation/commit/c61c452d78425d89920b41ed5f95fd190e733a3c.
pill.ogg contains audio from '437480__ruanza__swallowing.wav' by user RuanZA, used under CC BY-NC 3.0 (https://freesound.org/people/RuanZA/sounds/437480/), as well as part of '330657__diniunicorn__popping-pills.wav' by user diniunicorn, used under CC0 1.0 (https://freesound.org/people/diniunicorn/sounds/330657/). ring.ogg used under CC-BY-SA-3.0, taken from /tg/station commit https://github.com/tgstation/tgstation/commit/c61c452d78425d89920b41ed5f95fd190e733a3c.

0 comments on commit c95bf87

Please sign in to comment.