using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reagent; using Content.Shared.DoAfter; using Content.Shared.FixedPoint; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.Chemistry.Components; [Serializable, NetSerializable] public sealed partial class InjectorDoAfterEvent : SimpleDoAfterEvent { } /// /// Implements draw/inject behavior for droppers and syringes. /// /// /// Can optionally support both /// injection and drawing or just injection. Can inject/draw reagents from solution /// containers, and can directly inject into a mobs bloodstream. /// /// /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class InjectorComponent : Component { [DataField] public string SolutionName = "injector"; /// /// Whether or not the injector is able to draw from containers or if it's a single use /// device that can only inject. /// [DataField] public bool InjectOnly; /// /// Whether or not the injector is able to draw from or inject from mobs /// /// /// for example: droppers would ignore mobs /// [DataField] public bool IgnoreMobs; /// /// Whether or not the injector is able to draw from or inject into containers that are closed/sealed /// /// /// for example: droppers can not inject into cans, but syringes can /// [DataField] public bool IgnoreClosed = true; /// /// The minimum amount of solution that can be transferred at once from this solution. /// [DataField("minTransferAmount")] public FixedPoint2 MinimumTransferAmount = FixedPoint2.New(5); /// /// The maximum amount of solution that can be transferred at once from this solution. /// [DataField("maxTransferAmount")] public FixedPoint2 MaximumTransferAmount = FixedPoint2.New(15); /// /// Amount to inject or draw on each usage. If the injector is inject only, it will /// attempt to inject it's entire contents upon use. /// [DataField] [AutoNetworkedField] public FixedPoint2 TransferAmount = FixedPoint2.New(5); /// /// Injection delay (seconds) when the target is a mob. /// /// /// The base delay has a minimum of 1 second, but this will still be modified if the target is incapacitated or /// in combat mode. /// [DataField] public TimeSpan Delay = TimeSpan.FromSeconds(5); /// /// Each additional 1u after first 5u increases the delay by X seconds. /// [DataField] public TimeSpan DelayPerVolume = TimeSpan.FromSeconds(0.1); /// /// The state of the injector. Determines it's attack behavior. Containers must have the /// right SolutionCaps to support injection/drawing. For InjectOnly injectors this should /// only ever be set to Inject /// [AutoNetworkedField] [DataField] public InjectorToggleMode ToggleState = InjectorToggleMode.Draw; /// /// Reagents that are allowed to be within this injector. /// If a solution has both allowed and non-allowed reagents, only allowed reagents will be drawn into this injector. /// A null ReagentWhitelist indicates all reagents are allowed. /// [DataField] public List>? ReagentWhitelist = null; #region Arguments for injection doafter /// [DataField] public bool NeedHand = true; /// [DataField] public bool BreakOnHandChange = true; /// [DataField] public float MovementThreshold = 0.1f; #endregion } /// /// Possible modes for an . /// public enum InjectorToggleMode : byte { /// /// The injector will try to inject reagent into things. /// Inject, /// /// The injector will try to draw reagent from things. /// Draw }