Puddle refactor 2: Spillastic boogaloo (#4784)

* Refactor PuddleComponent

* Move puddle effects into separate RSIs

Basically egg/tomato/powder puddle will be moved into separate
/Textures/Fluids RSIs

* Fix YAML for puddles

* Fix issues sloth pointed out.

* Ensure Puddle Component are properly added when spawned

* Remove unnecessary method init puddle with starting maxVolume

* Addressed ElectroSr comments

* Add Resolves

* Try fix error in ensureSolution

* Puddle unanchoring

* Address some issues with puddles

* Fix continue -> return
This commit is contained in:
Ygg01
2021-10-27 09:24:18 +01:00
committed by GitHub
parent 03b1fed47d
commit 14b401f9b3
30 changed files with 753 additions and 564 deletions

View File

@@ -0,0 +1,46 @@
using Content.Server.Fluids.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Fluids.Components
{
[RegisterComponent]
[Friend(typeof(EvaporationSystem))]
public sealed class EvaporationComponent : Component
{
public override string Name => "Evaporation";
/// <summary>
/// The time that it will take this puddle to lose one reagent unit of solution, in seconds.
/// </summary>
[DataField("evaporateTime")]
public float EvaporateTime { get; set; } = 5f;
/// <summary>
/// Name of referenced solution. Defaults to <see cref="PuddleComponent.DefaultSolutionName"/>
/// </summary>
[DataField("solution")]
public string SolutionName { get; set; } = PuddleComponent.DefaultSolutionName;
/// <summary>
/// Lower limit below which puddle won't evaporate. Useful when wanting to leave a stain.
/// Defaults to evaporate completely.
/// </summary>
[DataField("lowerLimit")]
public ReagentUnit LowerLimit = ReagentUnit.Zero;
/// <summary>
/// Upper limit below which puddle won't evaporate. Useful when wanting to make sure large puddle will
/// remain forever. Defaults to <see cref="PuddleComponent.DefaultOverflowVolume"/>.
/// </summary>
[DataField("upperLimit")]
public ReagentUnit UpperLimit = PuddleComponent.DefaultOverflowVolume;
/// <summary>
/// The time accumulated since the start.
/// </summary>
public float Accumulator = 0f;
}
}