Silent Station Events (#8938)
This commit is contained in:
parent
cbfcdde8bd
commit
d3926b7c4b
|
|
@ -37,6 +37,8 @@ public sealed class DiseaseOutbreak : StationEvent
|
|||
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/outbreak7.ogg");
|
||||
protected override float EndAfter => 1.0f;
|
||||
|
||||
public override bool AnnounceEvent => false;
|
||||
|
||||
/// <summary>
|
||||
/// Finds 2-5 random, alive entities that can host diseases
|
||||
/// and gives them a randomly selected disease.
|
||||
|
|
@ -79,6 +81,8 @@ public sealed class DiseaseOutbreak : StationEvent
|
|||
stationsToNotify.Add((EntityUid) station);
|
||||
}
|
||||
|
||||
if (!AnnounceEvent)
|
||||
return;
|
||||
foreach (var station in stationsToNotify)
|
||||
{
|
||||
chatSystem.DispatchStationAnnouncement(station, Loc.GetString("station-event-disease-outbreak-announcement"),
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public sealed class KudzuGrowth : StationEvent
|
|||
// Give crew at least 9 minutes to either have it gone, or to suffer another event. Kudzu is not actually required to be dead for another event to roll.
|
||||
protected override float EndAfter => 60*4;
|
||||
|
||||
public override bool AnnounceEvent => false;
|
||||
|
||||
private EntityUid _targetGrid;
|
||||
|
||||
private Vector2i _targetTile;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ public sealed class MouseMigration : StationEvent
|
|||
|
||||
public override int? MaxOccurrences => 1;
|
||||
|
||||
public override bool AnnounceEvent => false;
|
||||
|
||||
protected override float StartAfter => 30f;
|
||||
|
||||
protected override float EndAfter => 60;
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ namespace Content.Server.StationEvents.Events
|
|||
/// </summary>
|
||||
public virtual int? MaxOccurrences { get; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the event is announced when it is run
|
||||
/// </summary>
|
||||
public virtual bool AnnounceEvent { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Has the startup time elapsed?
|
||||
/// </summary>
|
||||
|
|
@ -139,13 +144,13 @@ namespace Content.Server.StationEvents.Events
|
|||
IoCManager.Resolve<IAdminLogManager>()
|
||||
.Add(LogType.EventAnnounced, $"Event announce: {Name}");
|
||||
|
||||
if (StartAnnouncement != null)
|
||||
if (AnnounceEvent && StartAnnouncement != null)
|
||||
{
|
||||
var chatSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>();
|
||||
chatSystem.DispatchGlobalStationAnnouncement(StartAnnouncement, playDefaultSound: false, colorOverride: Color.Gold);
|
||||
}
|
||||
|
||||
if (StartAudio != null)
|
||||
if (AnnounceEvent && StartAudio != null)
|
||||
{
|
||||
SoundSystem.Play(StartAudio.GetSound(), Filter.Broadcast(), AudioParams);
|
||||
}
|
||||
|
|
@ -162,13 +167,13 @@ namespace Content.Server.StationEvents.Events
|
|||
IoCManager.Resolve<IAdminLogManager>()
|
||||
.Add(LogType.EventStopped, $"Event shutdown: {Name}");
|
||||
|
||||
if (EndAnnouncement != null)
|
||||
if (AnnounceEvent && EndAnnouncement != null)
|
||||
{
|
||||
var chatSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>();
|
||||
chatSystem.DispatchGlobalStationAnnouncement(EndAnnouncement, playDefaultSound: false, colorOverride: Color.Gold);
|
||||
}
|
||||
|
||||
if (EndAudio != null)
|
||||
if (AnnounceEvent && EndAudio != null)
|
||||
{
|
||||
SoundSystem.Play(EndAudio.GetSound(), Filter.Broadcast(), AudioParams);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public sealed class VentCritters : StationEvent
|
|||
|
||||
protected override float EndAfter => 60;
|
||||
|
||||
public override bool AnnounceEvent => false;
|
||||
|
||||
public override void Startup()
|
||||
{
|
||||
base.Startup();
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@ namespace Content.Server.StationEvents.Events
|
|||
public override string Name => "ZombieOutbreak";
|
||||
public override int EarliestStart => 50;
|
||||
public override float Weight => WeightLow / 2;
|
||||
|
||||
public override SoundSpecifier? StartAudio => new SoundPathSpecifier("/Audio/Announcements/bloblarm.ogg");
|
||||
protected override float EndAfter => 1.0f;
|
||||
|
||||
public override int? MaxOccurrences => 1;
|
||||
public override bool AnnounceEvent => false;
|
||||
|
||||
/// <summary>
|
||||
/// Finds 1-3 random, dead entities accross the station
|
||||
|
|
@ -61,6 +60,9 @@ namespace Content.Server.StationEvents.Events
|
|||
if(station == null) continue;
|
||||
stationsToNotify.Add((EntityUid) station);
|
||||
}
|
||||
|
||||
if (!AnnounceEvent)
|
||||
return;
|
||||
foreach (var station in stationsToNotify)
|
||||
{
|
||||
chatSystem.DispatchStationAnnouncement((EntityUid) station, Loc.GetString("station-event-zombie-outbreak-announcement"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue