Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent Station Events #8938

Merged
merged 26 commits into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c46b73
Merge branch 'space-wizards-master'
EmoGarbage404 Apr 25, 2022
404cb6d
Merge branch 'space-wizards:master' into master
EmoGarbage404 Apr 27, 2022
bc28856
Merge branch 'space-wizards:master' into master
EmoGarbage404 Apr 28, 2022
b78709a
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 1, 2022
c8f849f
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 5, 2022
6ba6110
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 7, 2022
968f756
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 9, 2022
52cca51
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 11, 2022
71d3cb9
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 12, 2022
0a39235
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 13, 2022
f240894
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 13, 2022
df20146
Merge branch 'master' of https://github.com/space-wizards/space-stati…
EmoGarbage404 May 27, 2022
1442766
Merge branch 'space-wizards-master'
EmoGarbage404 May 27, 2022
fa7b5dd
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 29, 2022
9e8e4f8
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 29, 2022
63178a8
Merge branch 'space-wizards:master' into master
EmoGarbage404 May 30, 2022
0188a18
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 1, 2022
7afc2d0
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 2, 2022
78ec269
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 4, 2022
5b6f1b4
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 5, 2022
4abc44a
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 7, 2022
431e114
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 9, 2022
288a562
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 12, 2022
06edbd1
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 15, 2022
3b8f2cb
Merge branch 'space-wizards:master' into master
EmoGarbage404 Jun 17, 2022
c93bab0
silento
EmoGarbage404 Jun 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Server/StationEvents/Events/DiseaseOutbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -79,6 +81,8 @@ public override void Startup()
stationsToNotify.Add((EntityUid) station);
}

if (!AnnounceEvent)
return;
foreach (var station in stationsToNotify)
{
chatSystem.DispatchStationAnnouncement(station, Loc.GetString("station-event-disease-outbreak-announcement"),
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/StationEvents/Events/KudzuGrowth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/StationEvents/Events/MouseMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 9 additions & 4 deletions Content.Server/StationEvents/Events/StationEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public abstract class StationEvent
/// </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>
Expand Down Expand Up @@ -139,13 +144,13 @@ public virtual void Announce()
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);
}
Expand All @@ -162,13 +167,13 @@ public virtual void Shutdown()
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);
}
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/StationEvents/Events/VentCritters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 4 additions & 2 deletions Content.Server/StationEvents/Events/ZombieOutbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ public sealed class ZombieOutbreak : StationEvent
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
Expand Down Expand Up @@ -61,6 +60,9 @@ public override void Startup()
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"),
Expand Down