using Content.Shared.Chemistry.Components; using Content.Shared.Construction.Prototypes; using Content.Shared.Whitelist; 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.Materials; /// /// This is a machine that handles converting entities /// into the raw materials and chemicals that make them up. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(SharedMaterialReclaimerSystem))] public sealed partial class MaterialReclaimerComponent : Component { /// /// Whether or not the machine has power. We put it here /// so we can network and predict it. /// [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)] public bool Powered; /// /// An "enable" toggle for things like interfacing with machine linking /// [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)] public bool Enabled = true; /// /// How efficiently the materials are reclaimed. /// In practice, a multiplier per material when calculating the output of the reclaimer. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float Efficiency = 1f; /// /// Whether or not the process /// speed scales with the amount of materials being processed /// or if it's just /// [DataField] public bool ScaleProcessSpeed = true; /// /// How quickly it takes to consume X amount of materials per second. /// For example, with a rate of 50, an entity with 100 total material takes 2 seconds to process. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float BaseMaterialProcessRate = 100f; /// /// How quickly it takes to consume X amount of materials per second. /// For example, with a rate of 50, an entity with 100 total material takes 2 seconds to process. /// [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)] public float MaterialProcessRate = 100f; /// /// Machine part whose rating modifies /// [DataField, ViewVariables(VVAccess.ReadWrite)] public ProtoId MachinePartProcessRate = "Manipulator"; /// /// How much the machine part quality affects the /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float PartRatingProcessRateMultiplier = 1.5f; /// /// The minimum amount fo time it can take to process an entity. /// this value supercedes the calculated one using /// [DataField, ViewVariables(VVAccess.ReadWrite)] public TimeSpan MinimumProcessDuration = TimeSpan.FromSeconds(0.5f); /// /// The id of our output solution /// [DataField, ViewVariables(VVAccess.ReadWrite)] public string SolutionContainerId = "output"; /// /// The solution itself. /// [ViewVariables(VVAccess.ReadWrite)] public Solution OutputSolution = default!; /// /// a whitelist for what entities can be inserted into this reclaimer /// [DataField] public EntityWhitelist? Whitelist; /// /// a blacklist for what entities cannot be inserted into this reclaimer /// [DataField] public EntityWhitelist? Blacklist; /// /// The sound played when something is being processed. /// [DataField] public SoundSpecifier? Sound; /// /// whether or not we cut off the sound early when the reclaiming ends. /// [DataField] public bool CutOffSound = true; /// /// When the next sound will be allowed to be played. Used to prevent spam. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextSound; /// /// Minimum time inbetween each /// [DataField] public TimeSpan SoundCooldown = TimeSpan.FromSeconds(0.8f); public IPlayingAudioStream? Stream; /// /// A counter of how many items have been processed /// /// /// I saw this on the recycler and i'm porting it because it's cute af /// [DataField, AutoNetworkedField] public int ItemsProcessed; } [NetSerializable, Serializable] public enum RecyclerVisuals { Bloody } public enum RecyclerVisualLayers : byte { Main, Bloody }