using Content.Shared.Procedural; using Content.Shared.Salvage.Expeditions.Modifiers; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Salvage.Expeditions; [Serializable, NetSerializable] public sealed class SalvageExpeditionConsoleState : BoundUserInterfaceState { public TimeSpan NextOffer; public bool Claimed; public bool Cooldown; public ushort ActiveMission; public List Missions; public bool CanFinish; // Frontier public TimeSpan CooldownTime; // Frontier: separate fail vs. success time public SalvageExpeditionConsoleState(TimeSpan nextOffer, bool claimed, bool cooldown, ushort activeMission, List missions, bool canFinish, TimeSpan cooldownTime) // Frontier: add canFinish, cooldownTime { NextOffer = nextOffer; Claimed = claimed; Cooldown = cooldown; ActiveMission = activeMission; Missions = missions; CanFinish = canFinish; // Frontier CooldownTime = cooldownTime; // Frontier } } /// /// Used to interact with salvage expeditions and claim them. /// [RegisterComponent, NetworkedComponent] public sealed partial class SalvageExpeditionConsoleComponent : Component { /// /// The sound made when spawning a coordinates disk /// [DataField] public SoundSpecifier PrintSound = new SoundPathSpecifier("/Audio/Machines/terminal_insert_disc.ogg"); // Frontier: add error to FTL warning /// /// The sound made when an error happens. /// [DataField] public SoundSpecifier ErrorSound = new SoundPathSpecifier("/Audio/Effects/Cargo/buzz_sigh.ogg"); /// /// Debug mode: skips FTL proximity checks /// [DataField] public bool Debug = false; // End Frontier: } [Serializable, NetSerializable] public sealed class ClaimSalvageMessage : BoundUserInterfaceMessage { public ushort Index; } // Frontier: early expedition finish [Serializable, NetSerializable] public sealed class FinishSalvageMessage : BoundUserInterfaceMessage; // End Frontier: early expedition finish /// /// Added per station to store data on their available salvage missions. /// [RegisterComponent, AutoGenerateComponentPause] public sealed partial class SalvageExpeditionDataComponent : Component { /// /// Is there an active salvage expedition. /// [ViewVariables] public bool Claimed => ActiveMission != 0; /// /// Are we actively cooling down from the last salvage mission. /// [ViewVariables(VVAccess.ReadWrite), DataField("cooldown")] public bool Cooldown = false; // Frontier: early expedition finish // End Frontier: early expedition finish /// /// Nexy time salvage missions are offered. /// [ViewVariables(VVAccess.ReadWrite), DataField("nextOffer", customTypeSerializer:typeof(TimeOffsetSerializer))] [AutoPausedField] public TimeSpan NextOffer; [ViewVariables] public readonly Dictionary Missions = new(); [ViewVariables] public ushort ActiveMission; public ushort NextIndex = 1; // Frontier: early finish, failure vs. success cooldowns /// /// Allow early finish. /// [ViewVariables(VVAccess.ReadWrite), DataField] public bool CanFinish = false; /// /// The total cooldown time that we had to wait. /// [ViewVariables(VVAccess.ReadWrite), DataField] public TimeSpan CooldownTime; // End Frontier: early finish, failure vs. success cooldowns } [Serializable, NetSerializable] public sealed record SalvageMissionParams { [ViewVariables] public ushort Index; [ViewVariables(VVAccess.ReadWrite)] public int Seed; public string Difficulty = string.Empty; [ViewVariables(VVAccess.ReadWrite)] // Frontier public SalvageMissionType MissionType; // Frontier } /// /// Created from . Only needed for data the client also needs for mission /// display. /// public sealed record SalvageMission( int Seed, string Dungeon, string Faction, string Biome, string Air, float Temperature, Color? Color, TimeSpan Duration, List Modifiers, ProtoId Difficulty, // Frontier SalvageMissionType MissionType) // Frontier { /// /// Seed used for the mission. /// public readonly int Seed = Seed; /// /// to be used. /// public readonly string Dungeon = Dungeon; /// /// to be used. /// public readonly string Faction = Faction; /// /// Biome to be used for the mission. /// public readonly string Biome = Biome; /// /// Air mixture to be used for the mission's planet. /// public readonly string Air = Air; /// /// Temperature of the planet's atmosphere. /// public readonly float Temperature = Temperature; /// /// Lighting color to be used (AKA outdoor lighting). /// public readonly Color? Color = Color; /// /// Mission duration. /// public TimeSpan Duration = Duration; /// /// Modifiers (outside of the above) applied to the mission. /// public List Modifiers = Modifiers; // Frontier: additional parameters /// /// Difficulty rating. /// public readonly ProtoId Difficulty = Difficulty; /// /// Difficulty rating. /// public readonly SalvageMissionType MissionType = MissionType; // End Frontier: additional parameters } [Serializable, NetSerializable] public enum SalvageConsoleUiKey : byte { Expedition, }