* Station event refactor * Remove clientside `IStationEventManager` we can just use prototypes * Basic API idea * Cruft * first attempt at epicness * okay yeah this shit is really clean * sort out minor stuff * Convert `BreakerFlip` * `BureaucraticError` + general cleanup * `DiseaseOutbreak` * `FalseAlarm` * `GasLeak` * `KudzuGrowth` * `MeteorSwarm` * `MouseMigration` * misc errors * `PowerGridCheck` * `RandomSentience` * `VentClog` * `VentCritters` * `ZombieOutbreak` * Rewrite basic event scheduler * Minor fixes and logging * ooooops * errors + fix * linter * completions, `RuleStarted` property, update loop fixes * Tweaks * Fix #9462 * Basic scheduler update fix, and fixes #8174 * Add test * UI cleanup * really this was just for testing
34 lines
1002 B
C#
34 lines
1002 B
C#
using Content.Server.GameTicking.Rules.Configurations;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Server.StationEvents.Events
|
|
{
|
|
[UsedImplicitly]
|
|
public sealed class FalseAlarm : StationEventSystem
|
|
{
|
|
public override string Prototype => "FalseAlarm";
|
|
|
|
public override void Started()
|
|
{
|
|
base.Started();
|
|
|
|
var ev = GetRandomEventUnweighted(PrototypeManager, RobustRandom);
|
|
|
|
if (ev.Configuration is not StationEventRuleConfiguration cfg)
|
|
return;
|
|
|
|
if (cfg.StartAnnouncement != null)
|
|
{
|
|
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(cfg.StartAnnouncement), playDefaultSound: false, colorOverride: Color.Gold);
|
|
}
|
|
|
|
if (cfg.StartAudio != null)
|
|
{
|
|
SoundSystem.Play(cfg.StartAudio.GetSound(), Filter.Broadcast(), cfg.StartAudio.Params);
|
|
}
|
|
}
|
|
}
|
|
}
|