mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-29 11:37:24 +03:00
# Description Replaces every instance of station announcements with an announcer system meant to handle audio and messages for various announcers defined in prototypes instead of each server replacing the scattered files inconsistently with whatever singular thing they want to hear announce messages. # TODO - [x] Systems - [x] CVars - [x] Sounds - [x] Client volume slider - [x] Collections - [x] Prototypes - [x] Events - [x] Commands - [x] PR media - [x] Deglobalize - [x] Passthrough localization parameters to overrides - [x] Make every announcer follow the template - [x] Move sounds into subdirectories - [x] Make announcement IDs camelCased - [x] Test announcement localizations - [x] Weighted announcer lists --- <details><summary><h1>Media</h1></summary> <p> https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/caf5805d-acb0-4140-b344-875a8f79e5ee </p> </details> --- # Changelog 🆑 - add: Added 4 new announcers that will randomly be selected every shift
86 lines
2.4 KiB
C#
86 lines
2.4 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.StationEvents.Components;
|
|
|
|
/// <summary>
|
|
/// Defines basic data for a station event
|
|
/// </summary>
|
|
[RegisterComponent, AutoGenerateComponentPause]
|
|
public sealed partial class StationEventComponent : Component
|
|
{
|
|
public const float WeightVeryLow = 0.0f;
|
|
public const float WeightLow = 5.0f;
|
|
public const float WeightNormal = 10.0f;
|
|
public const float WeightHigh = 15.0f;
|
|
public const float WeightVeryHigh = 20.0f;
|
|
|
|
[DataField("weight")]
|
|
public float Weight = WeightNormal;
|
|
|
|
[DataField("startAnnouncement")]
|
|
public bool StartAnnouncement;
|
|
|
|
[DataField("endAnnouncement")]
|
|
public bool EndAnnouncement;
|
|
|
|
/// <summary>
|
|
/// In minutes, when is the first round time this event can start
|
|
/// </summary>
|
|
[DataField("earliestStart")]
|
|
public int EarliestStart = 5;
|
|
|
|
/// <summary>
|
|
/// In minutes, the amount of time before the same event can occur again
|
|
/// </summary>
|
|
[DataField("reoccurrenceDelay")]
|
|
public int ReoccurrenceDelay = 30;
|
|
|
|
/// <summary>
|
|
/// How long after being added does the event start
|
|
/// </summary>
|
|
[DataField("startDelay")]
|
|
public TimeSpan StartDelay = TimeSpan.Zero;
|
|
|
|
/// <summary>
|
|
/// How long the event lasts.
|
|
/// </summary>
|
|
[DataField("duration")]
|
|
public TimeSpan? Duration = TimeSpan.FromSeconds(1);
|
|
|
|
/// <summary>
|
|
/// The max amount of time the event lasts.
|
|
/// </summary>
|
|
[DataField("maxDuration")]
|
|
public TimeSpan? MaxDuration;
|
|
|
|
/// <summary>
|
|
/// How many players need to be present on station for the event to run
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// To avoid running deadly events with low-pop
|
|
/// </remarks>
|
|
[DataField("minimumPlayers")]
|
|
public int MinimumPlayers;
|
|
|
|
/// <summary>
|
|
/// How many times this even can occur in a single round
|
|
/// </summary>
|
|
[DataField("maxOccurrences")]
|
|
public int? MaxOccurrences;
|
|
|
|
/// <summary>
|
|
/// When the station event starts.
|
|
/// </summary>
|
|
[DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
[AutoPausedField]
|
|
public TimeSpan StartTime;
|
|
|
|
/// <summary>
|
|
/// When the station event ends.
|
|
/// </summary>
|
|
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
[AutoPausedField]
|
|
public TimeSpan? EndTime;
|
|
}
|