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,4 +1,5 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids.Components;
@@ -20,7 +21,7 @@ public sealed partial class PuddleSystem
return;
}
if (solution.GetTotalPrototypeQuantity(EvaporationReagents) > FixedPoint2.Zero)
if (solution.GetTotalPrototypeQuantity(GetEvaporatingReagents(solution)) > FixedPoint2.Zero)
{
var evaporation = AddComp<EvaporationComponent>(uid);
evaporation.NextTick = _timing.CurTime + EvaporationCooldown;
@@ -45,8 +46,11 @@ public sealed partial class PuddleSystem
if (!_solutionContainerSystem.ResolveSolution(uid, puddle.SolutionName, ref puddle.Solution, out var puddleSolution))
continue;
var reagentTick = evaporation.EvaporationAmount * EvaporationCooldown.TotalSeconds;
puddleSolution.SplitSolutionWithOnly(reagentTick, EvaporationReagents);
foreach ((string evaporatingReagent, FixedPoint2 evaporatingSpeed) in GetEvaporationSpeeds(puddleSolution))
{
var reagentTick = evaporation.EvaporationAmount * EvaporationCooldown.TotalSeconds * evaporatingSpeed;
puddleSolution.SplitSolutionWithOnly(reagentTick, evaporatingReagent);
}
// Despawn if we're done
if (puddleSolution.Volume == FixedPoint2.Zero)