using Content.Server.GameTicking.Rules;
using Content.Shared.NukeOps;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.NukeOps;
///
/// Used with NukeOps game rule to send war declaration announcement
///
[RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(WarDeclaratorSystem), typeof(NukeopsRuleSystem))]
public sealed partial class WarDeclaratorComponent : Component
{
///
/// Custom war declaration message. If empty, use default.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public string Message;
///
/// Permission to customize message text
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool AllowEditingMessage = true;
///
/// War declaration text color
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public Color Color = Color.Red;
///
/// War declaration sound file path
///
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/war.ogg");
///
/// Fluent ID for the declaration sender title
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public LocId SenderTitle = "comms-console-announcement-title-nukie";
///
/// Time allowed for declaration of war
///
[DataField]
public float WarDeclarationDelay = 6.0f;
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan DisableAt;
///
/// How long the shuttle will be disabled for
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan ShuttleDisabledTime;
[DataField]
public WarConditionStatus? CurrentStatus;
}
[ByRefEvent]
public record struct WarDeclaredEvent(WarConditionStatus? Status, Entity DeclaratorEntity);