using Content.Shared.FixedPoint;
using Content.Shared.Inventory;
namespace Content.Server.Chemistry.Components;
///
/// Base class for components that inject a solution into a target's bloodstream in response to an event.
///
public abstract partial class BaseSolutionInjectOnEventComponent : Component
{
///
/// How much solution to remove from this entity per target when transferring.
///
///
/// Note that this amount is per target, so the total amount removed will be
/// multiplied by the number of targets hit.
///
[DataField]
public FixedPoint2 TransferAmount = FixedPoint2.New(1);
[ViewVariables(VVAccess.ReadWrite)]
public float TransferEfficiency { get => _transferEfficiency; set => _transferEfficiency = Math.Clamp(value, 0, 1); }
///
/// Proportion of the that will actually be injected
/// into the target's bloodstream. The rest is lost.
/// 0 means none of the transferred solution will enter the bloodstream.
/// 1 means the entire amount will enter the bloodstream.
///
[DataField("transferEfficiency")]
private float _transferEfficiency = 1f;
///
/// Solution to inject from.
///
[DataField]
public string Solution = "default";
///
/// Whether this will inject through hardsuits or not.
///
[DataField]
public bool PierceArmor = true;
///
/// Contents of popup message to display to the attacker when injection
/// fails due to the target wearing a hardsuit.
///
///
/// Passed values: $weapon and $target
///
[DataField]
public LocId BlockedByHardsuitPopupMessage = "melee-inject-failed-hardsuit";
///
/// If anything covers any of these slots then the injection fails.
///
[DataField]
public SlotFlags BlockSlots = SlotFlags.NONE;
}