2024-05-10 14:35:59 +03:00
|
|
|
using Robust.Shared.Audio;
|
2023-04-25 20:23:14 -04:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
2022-07-10 18:48:41 -07:00
|
|
|
|
2023-04-25 20:23:14 -04:00
|
|
|
namespace Content.Server.StationEvents.Components;
|
2022-07-10 18:48:41 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2023-04-25 20:23:14 -04:00
|
|
|
/// Defines basic data for a station event
|
2022-07-10 18:48:41 -07:00
|
|
|
/// </summary>
|
2024-02-26 04:36:19 +01:00
|
|
|
[RegisterComponent, AutoGenerateComponentPause]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class StationEventComponent : Component
|
2022-07-10 18:48:41 -07:00
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public float Weight = WeightNormal;
|
|
|
|
|
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public string? StartAnnouncement;
|
|
|
|
|
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public string? EndAnnouncement;
|
|
|
|
|
|
2024-06-01 23:34:58 +03:00
|
|
|
[DataField]
|
|
|
|
|
public Color StartAnnouncementColor = Color.Gold;
|
|
|
|
|
|
|
|
|
|
[DataField]
|
|
|
|
|
public Color EndAnnouncementColor = Color.Gold;
|
|
|
|
|
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public SoundSpecifier? StartAudio;
|
|
|
|
|
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public SoundSpecifier? EndAudio;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// In minutes, when is the first round time this event can start
|
|
|
|
|
/// </summary>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public int EarliestStart = 5;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// In minutes, the amount of time before the same event can occur again
|
|
|
|
|
/// </summary>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public int ReoccurrenceDelay = 30;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-04-25 20:23:14 -04:00
|
|
|
/// How long the event lasts.
|
2022-07-10 18:48:41 -07:00
|
|
|
/// </summary>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2023-04-28 23:15:06 -04:00
|
|
|
public TimeSpan? Duration = TimeSpan.FromSeconds(1);
|
2023-04-25 20:23:14 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The max amount of time the event lasts.
|
|
|
|
|
/// </summary>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2023-04-25 20:23:14 -04:00
|
|
|
public TimeSpan? MaxDuration;
|
2022-07-10 18:48:41 -07:00
|
|
|
|
|
|
|
|
/// <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>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public int MinimumPlayers;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How many times this even can occur in a single round
|
|
|
|
|
/// </summary>
|
2024-05-10 14:35:59 +03:00
|
|
|
[DataField]
|
2022-07-10 18:48:41 -07:00
|
|
|
public int? MaxOccurrences;
|
2023-04-25 20:23:14 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
2023-04-29 21:43:49 -04:00
|
|
|
/// When the station event ends.
|
2023-04-25 20:23:14 -04:00
|
|
|
/// </summary>
|
|
|
|
|
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2023-04-28 23:15:06 -04:00
|
|
|
public TimeSpan? EndTime;
|
2024-08-05 05:17:53 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If false, the event won't trigger during ongoing evacuation.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public bool OccursDuringRoundEnd = true;
|
2022-07-10 18:48:41 -07:00
|
|
|
}
|