New sounds for diseases (#7250)
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
using Content.Shared.Disease;
|
||||
using JetBrains.Annotations;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Audio;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Disease
|
||||
{
|
||||
@@ -15,14 +19,22 @@ namespace Content.Server.Disease
|
||||
/// </summary>
|
||||
[DataField("snoughMessage")]
|
||||
public string SnoughMessage = "disease-sneeze";
|
||||
|
||||
/// </summary>
|
||||
/// Sound to play when snoughing
|
||||
/// <summary>
|
||||
/// Whether to spread the disease throught he air
|
||||
[DataField("snoughSound")]
|
||||
public SoundSpecifier? SnoughSound;
|
||||
/// <summary>
|
||||
/// Whether to spread the disease through the air
|
||||
/// </summary>
|
||||
[DataField("airTransmit")]
|
||||
public bool AirTransmit = true;
|
||||
|
||||
public override void Effect(DiseaseEffectArgs args)
|
||||
{
|
||||
if (SnoughSound != null)
|
||||
SoundSystem.Play(Filter.Pvs(args.DiseasedEntity), SnoughSound.GetSound(), args.DiseasedEntity, AudioHelpers.WithVariation(0.2f));
|
||||
EntitySystem.Get<DiseaseSystem>().SneezeCough(args.DiseasedEntity, args.Disease, SnoughMessage, AirTransmit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public sealed class DiseaseOutbreak : StationEvent
|
||||
};
|
||||
public override string Name => "DiseaseOutbreak";
|
||||
public override float Weight => WeightNormal;
|
||||
|
||||
public override string? StartAudio => "/Audio/Announcements/outbreak7.ogg";
|
||||
protected override float EndAfter => 1.0f;
|
||||
/// <summary>
|
||||
/// Finds 2-5 random, alive entities that can host diseases
|
||||
@@ -65,6 +67,7 @@ public sealed class DiseaseOutbreak : StationEvent
|
||||
|
||||
diseaseSystem.TryAddDisease(target.Owner, disease, target);
|
||||
}
|
||||
_chatManager.DispatchStationAnnouncement(Loc.GetString("station-event-disease-outbreak-announcement"));
|
||||
_chatManager.DispatchStationAnnouncement(Loc.GetString("station-event-disease-outbreak-announcement"),
|
||||
playDefaultSound: false, colorOverride: Color.YellowGreen);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user