Files
tbd-station-14/Content.Server/Chemistry/Components/SolutionInjectOnCollideComponent.cs
nikthechampiongr ef132c8a7b Fix tranquiliser shells not working (#23886)
* Fix tranquiliser darts not working

Fixes a bug introduced by 9f47079d02 which
was made to stop the fly-by fixture from triggering the system. This was
done by checking whether the fixture was hard. Apparently the
projectile's fixture is never hard as well. The change just makes it so
that check only succeeds when the fixture is a fly-by fixture.

* Remove something that I think is redundant

* Remove random using directive that somehow appeared.

* Address Review

* Adress Review 2

* Put the appropriate fixture ids
2024-01-10 18:02:37 -05:00

32 lines
1.0 KiB
C#

using Content.Shared.FixedPoint;
using Content.Shared.Inventory;
using Content.Shared.Projectiles;
namespace Content.Server.Chemistry.Components;
/// <summary>
/// On colliding with an entity that has a bloodstream will dump its solution onto them.
/// </summary>
[RegisterComponent]
public sealed partial class SolutionInjectOnCollideComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("transferAmount")]
public FixedPoint2 TransferAmount = FixedPoint2.New(1);
[ViewVariables(VVAccess.ReadWrite)]
public float TransferEfficiency { get => _transferEfficiency; set => _transferEfficiency = Math.Clamp(value, 0, 1); }
[DataField("transferEfficiency")]
private float _transferEfficiency = 1f;
/// <summary>
/// If anything covers any of these slots then the injection fails.
/// </summary>
[DataField("blockSlots"), ViewVariables(VVAccess.ReadWrite)]
public SlotFlags BlockSlots = SlotFlags.MASK;
[DataField]
public string FixtureId = SharedProjectileSystem.ProjectileFixture;
}