Un-Hardcode water evaporation & mopping behavior (#33399)

* Un-harcode slipperiness

* Make it actually work

* Prettyfy

* Cleanup GetEvaporatingReagents

* Fix mopping with space lube + wrong solutions in absorbance

* Remove LINQ and rename parameters

* Change evaporation speed to fixedpoint2

* Add evaporating speed functionality

* Remove unused imports

* Swap around reagent evaporation speed and puddle evaporation speed.

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
Jajsha
2025-04-18 20:11:28 -04:00
committed by GitHub
parent 181bb27797
commit a6741e42c1
7 changed files with 76 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Frozen;
using System.Linq;
using Content.Shared.FixedPoint;
using System.Text.Json.Serialization;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Prototypes;
@@ -7,14 +8,12 @@ using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.EntityEffects;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Nutrition;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
using Robust.Shared.Utility;
@@ -105,6 +104,18 @@ namespace Content.Shared.Chemistry.Reagent
[DataField]
public bool Slippery;
/// <summary>
/// The speed at which the reagent evaporates over time.
/// </summary>
[DataField]
public FixedPoint2 EvaporationSpeed = FixedPoint2.Zero;
/// <summary>
/// If this reagent can be used to mop up other reagents.
/// </summary>
[DataField]
public bool Absorbent = false;
/// <summary>
/// How easily this reagent becomes fizzy when aggitated.
/// 0 - completely flat, 1 - fizzes up when nudged.
@@ -206,7 +217,7 @@ namespace Content.Shared.Chemistry.Reagent
.ToDictionary(x => x.Key, x => x.Item2);
if (proto.PlantMetabolisms.Count > 0)
{
PlantMetabolisms = new List<string> (proto.PlantMetabolisms
PlantMetabolisms = new List<string>(proto.PlantMetabolisms
.Select(x => x.GuidebookEffectDescription(prototype, entSys))
.Where(x => x is not null)
.Select(x => x!)