using Content.Server.Atmos; using Content.Shared.Mech.Components; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Server.Mech.Components; /// [RegisterComponent, NetworkedComponent] [ComponentReference(typeof(SharedMechComponent))] public sealed class MechComponent : SharedMechComponent { /// /// How long it takes to enter the mech. /// [DataField("entryDelay")] public float EntryDelay = 3; /// /// How long it takes to pull *another person* /// outside of the mech. You can exit instantly yourself. /// [DataField("exitDelay")] public float ExitDelay = 3; /// /// How long it takes to pull out the battery. /// [DataField("batteryRemovalDelay")] public float BatteryRemovalDelay = 2; /// /// Whether or not the mech is airtight. /// /// /// This needs to be redone /// when mech internals are added /// [DataField("airtight"), ViewVariables(VVAccess.ReadWrite)] public bool Airtight; /// /// The equipment that the mech initially has when it spawns. /// Good for things like nukie mechs that start with guns. /// [DataField("startingEquipment", customTypeSerializer: typeof(PrototypeIdListSerializer))] public List StartingEquipment = new(); /// /// The battery the mech initially has when it spawns /// Good for admemes and nukie mechs. /// [DataField("startingBattery", customTypeSerializer: typeof(PrototypeIdSerializer))] public string? StartingBattery; //TODO: this doesn't support a tank implant for mechs or anything like that [ViewVariables(VVAccess.ReadWrite)] public GasMixture Air = new (GasMixVolume); public const float GasMixVolume = 70f; } /// /// Event raised when a person successfully enters a mech /// public sealed class MechEntryFinishedEvent : EntityEventArgs { public EntityUid User; public MechEntryFinishedEvent(EntityUid user) { User = user; } } /// /// Event raised when a person fails to enter a mech /// public sealed class MechEntryCanclledEvent : EntityEventArgs { } /// /// Event raised when a person successfully removes someone from a mech /// public sealed class MechExitFinishedEvent : EntityEventArgs { } /// /// Event raised when a person fails to remove someone from a mech /// public sealed class MechExitCanclledEvent : EntityEventArgs { } /// /// Event raised when the battery is successfully removed from the mech /// public sealed class MechRemoveBatteryFinishedEvent : EntityEventArgs { } /// /// Event raised when the battery fails to be removed from the mech /// public sealed class MechRemoveBatteryCancelledEvent : EntityEventArgs { }