Puddles & spreader refactor (#15191)

This commit is contained in:
metalgearsloth
2023-04-10 15:37:03 +10:00
committed by GitHub
parent 3178ab83f6
commit 317a4013eb
141 changed files with 3046 additions and 3201 deletions

View File

@@ -0,0 +1,40 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Fluids.Components;
[RegisterComponent, NetworkedComponent]
public sealed class DrainComponent : Component
{
public const string SolutionName = "drainBuffer";
[DataField("accumulator")]
public float Accumulator = 0f;
/// <summary>
/// How many units per second the drain can absorb from the surrounding puddles.
/// Divided by puddles, so if there are 5 puddles this will take 1/5 from each puddle.
/// This will stay fixed to 1 second no matter what DrainFrequency is.
/// </summary>
[DataField("unitsPerSecond")]
public float UnitsPerSecond = 6f;
/// <summary>
/// How many units are ejected from the buffer per second.
/// </summary>
[DataField("unitsDestroyedPerSecond")]
public float UnitsDestroyedPerSecond = 1f;
/// <summary>
/// How many (unobstructed) tiles away the drain will
/// drain puddles from.
/// </summary>
[DataField("range")]
public float Range = 2f;
/// <summary>
/// How often in seconds the drain checks for puddles around it.
/// If the EntityQuery seems a bit unperformant this can be increased.
/// </summary>
[DataField("drainFrequency")]
public float DrainFrequency = 1f;
}

View File

@@ -0,0 +1,21 @@
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Fluids.Components
{
/// <summary>
/// Puddle on a floor
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedPuddleSystem))]
public sealed class PuddleComponent : Component
{
[DataField("spillSound")]
public SoundSpecifier SpillSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg");
[DataField("overflowVolume")]
public FixedPoint2 OverflowVolume = FixedPoint2.New(20);
[DataField("solution")] public string SolutionName = "puddle";
}
}