using System.Threading; using Content.Shared.Storage; using Robust.Shared.Audio; using Robust.Shared.GameStates; namespace Content.Shared._DV.Mail; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedMailSystem))] public sealed partial class MailComponent : Component { /// /// The full name of the person who should receive this mail. /// [DataField, AutoNetworkedField] public string Recipient = "Unknown"; /// /// The job title of the person who should receive this mail. /// [DataField, AutoNetworkedField] public string RecipientJob = "Unknown"; /// /// Whether this mail is currently locked. /// /// /// Why do we not use LockComponent? /// Because this can't be locked again, /// and we have special conditions for unlocking, /// and we don't want to add a verb. /// [DataField, AutoNetworkedField] public bool IsLocked = true; /// /// Is this parcel profitable to deliver for the station? /// /// /// The station won't receive any award on delivery if this is false. /// This is useful for broken fragile packages and packages that were /// not delivered in time. /// [DataField, AutoNetworkedField] public bool IsProfitable = true; /// /// Is this package considered fragile? /// /// /// This can be set to true in the YAML files for a mail delivery to /// always be Fragile, despite its contents. /// [DataField, AutoNetworkedField] public bool IsFragile; /// /// Is this package considered priority mail? /// /// /// There will be a timer set for its successful delivery. The /// station's bank account will be penalized if it is not delivered on /// time. /// /// This is set to false on successful delivery. /// /// This can be set to true in the YAML files for a mail delivery to /// always be Priority. /// [DataField, AutoNetworkedField] public bool IsPriority; /// /// The time when this priority mail expires if Priority. /// [DataField, AutoNetworkedField] public TimeSpan? ExpiryTime; // Frontier Mail Port: large mail /// /// Whether this parcel is large. /// [DataField, AutoNetworkedField] public bool IsLarge; // End Frontier: large mail /// /// What will be packaged when the mail is spawned. /// [DataField] public List Contents = new(); /// /// The amount that cargo will be awarded for delivering this mail. /// [DataField, AutoNetworkedField] public int Bounty = 750; /// /// Penalty if the mail is destroyed. /// [DataField, AutoNetworkedField] public int Penalty = -250; /// /// The sound that's played when the mail's lock is broken. /// [DataField] public SoundSpecifier PenaltySound = new SoundPathSpecifier("/Audio/Machines/Nuke/angry_beep.ogg"); /// /// The sound that's played when the mail's opened. /// [DataField] public SoundSpecifier OpenSound = new SoundPathSpecifier("/Audio/Effects/packetrip.ogg"); /// /// The sound that's played when the mail's lock has been emagged. /// [DataField] public SoundSpecifier EmagSound = new SoundCollectionSpecifier("sparks"); /// /// Cancellation token for the priority mail timer. /// Used to cancel the penalty timer when priority mail is successfully delivered. /// public CancellationTokenSource? PriorityCancelToken; }