2021-10-27 09:24:18 +01:00
using Content.Server.Fluids.EntitySystems ;
2021-11-03 16:48:03 -07:00
using Content.Shared.FixedPoint ;
2022-07-29 14:13:12 +12:00
using Robust.Shared.Audio ;
2020-04-22 04:23:12 +10:00
2021-06-09 22:19:39 +02:00
namespace Content.Server.Fluids.Components
2020-04-22 04:23:12 +10:00
{
/// <summary>
/// Puddle on a floor
/// </summary>
[RegisterComponent]
2022-06-07 15:26:28 +02:00
[Access(typeof(PuddleSystem))]
2021-10-27 09:24:18 +01:00
public sealed class PuddleComponent : Component
2020-04-22 04:23:12 +10:00
{
2021-10-27 09:24:18 +01:00
public const string DefaultSolutionName = "puddle" ;
2022-12-19 20:40:53 -06:00
private static readonly FixedPoint2 DefaultSlipThreshold = FixedPoint2 . New ( - 1 ) ; //Not slippery by default. Set specific slipThresholds in YAML if you want your puddles to be slippery. Lower = more slippery, and zero means any volume can slip.
2021-11-03 16:48:03 -07:00
public static readonly FixedPoint2 DefaultOverflowVolume = FixedPoint2 . New ( 20 ) ;
2021-10-27 09:24:18 +01:00
2020-04-22 04:23:12 +10:00
// Current design: Something calls the SpillHelper.Spill, that will either
// A) Add to an existing puddle at the location (normalised to tile-center) or
// B) add a new one
// From this every time a puddle is spilt on it will try and overflow to its neighbours if possible,
// and also update its appearance based on volume level (opacity) and chemistry color
// Small puddles will evaporate after a set delay
// TODO: 'leaves fluidtracks', probably in a separate component for stuff like gibb chunks?;
// based on behaviour (e.g. someone being punched vs slashed with a sword would have different blood sprite)
// to check for low volumes for evaporation or whatever
2022-02-10 15:07:21 -06:00
/// <summary>
/// Puddles with volume above this threshold can slip players.
/// </summary>
[DataField("slipThreshold")]
public FixedPoint2 SlipThreshold = DefaultSlipThreshold ;
2021-09-06 15:49:44 +02:00
2021-10-27 09:24:18 +01:00
[DataField("spillSound")]
public SoundSpecifier SpillSound = new SoundPathSpecifier ( "/Audio/Effects/Fluids/splat.ogg" ) ;
2020-04-22 04:23:12 +10:00
2022-11-16 20:22:11 +01:00
[DataField("overflowVolume")]
2021-11-03 16:48:03 -07:00
public FixedPoint2 OverflowVolume = DefaultOverflowVolume ;
2020-04-22 04:23:12 +10:00
2022-02-20 17:18:24 -07:00
/// <summary>
/// How much should this puddle's opacity be multiplied by?
/// Useful for puddles that have a high overflow volume but still want to be mostly opaque.
/// </summary>
2022-11-15 12:30:59 +01:00
[DataField("opacityModifier")] public float OpacityModifier = 1.0f ;
2020-04-22 04:23:12 +10:00
2021-10-27 09:24:18 +01:00
[DataField("solution")] public string SolutionName { get ; set ; } = DefaultSolutionName ;
2020-04-22 04:23:12 +10:00
}
}