Files
tbd-station-14/Content.Server/Chemistry/Components/VaporComponent.cs
ArtisticRoomba 44925b9be7 Fix spray nozzle not cleaning reagents properly (#35950)
* init, god help us all

* further refining

* final round of bugfixes

* whoopsies

* To file scoped namespace

* first review

* oopsie

* oopsie woopsie

* pie is on my face

* persistence

* datafieldn't

* make PreviousTileRef nullable

* change component to file scoped namespace

* Minor tweaks:

- We clamp the reaction amount to a minimum value because when working with percentages and dividing, we approach numbers like 0.01 and never actually properly delete the entity (because we check for zero). This allows us to react with a minimum amount and cleans things up nicely.
- Minor clarification to comments.
- Rebalancing of the spray nozzle projectile.

* the scug lies!!!!

* undo file scoped namespace in system

* kid named warning

---------

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
2025-04-19 22:41:24 -04:00

38 lines
1.2 KiB
C#

using Robust.Shared.Map;
namespace Content.Server.Chemistry.Components
{
[RegisterComponent]
public sealed partial class VaporComponent : Component
{
public const string SolutionName = "vapor";
/// <summary>
/// Stores data on the previously reacted tile. We only want to do reaction checks once per tile.
/// </summary>
[DataField]
public TileRef? PreviousTileRef;
/// <summary>
/// Percentage of the reagent that is reacted with the TileReaction.
/// <example>
/// 0.5 = 50% of the reagent is reacted.
/// </example>
/// </summary>
[DataField]
public float TransferAmountPercentage;
/// <summary>
/// The minimum amount of the reagent that will be reacted with the TileReaction.
/// We do this to prevent floating point issues. A reagent with a low percentage transfer amount will
/// transfer 0.01~ forever and never get deleted.
/// <remarks>Defaults to 0.05 if not defined, a good general value.</remarks>
/// </summary>
[DataField]
public float MinimumTransferAmount = 0.05f;
[DataField]
public bool Active;
}
}