Soapy Water & Edible Soap (#20364)

* soap reagent and soapy water

* make soapy water recognizable

* Fix tile cleaning bug

CleanDecalsReaction was able to take more than the reactVolume it was given.

* make soapy water an evaporating reagent

* Tile reactions when mopping

* Fix indescribably soap flavor

* Adjust soap flavours

Soap and soapy water now taste clean and syndie soap tastes like punishment.

* Better soap numbers & DeleteOnSolutionEmpty

* Changed TrashOnEmpty to TrashOnSolutionEmpty

* Last TrashOnSolutionEmpty change

* Fix merged code not compiling

* Requested changes.
This commit is contained in:
Psychpsyo
2023-10-31 21:39:12 +01:00
committed by GitHub
parent 672969b710
commit 6a18bdc023
57 changed files with 415 additions and 78 deletions

View File

@@ -11,7 +11,12 @@ public sealed partial class PuddleSystem
private static readonly TimeSpan EvaporationCooldown = TimeSpan.FromSeconds(1);
[ValidatePrototypeId<ReagentPrototype>]
public const string EvaporationReagent = "Water";
private const string Water = "Water";
[ValidatePrototypeId<ReagentPrototype>]
private const string SoapyWater = "SoapyWater";
public static string[] EvaporationReagents = new[] { Water, SoapyWater };
private void OnEvaporationMapInit(EntityUid uid, EvaporationComponent component, MapInitEvent args)
{
@@ -25,7 +30,7 @@ public sealed partial class PuddleSystem
return;
}
if (solution.ContainsPrototype(EvaporationReagent))
if (solution.GetTotalPrototypeQuantity(EvaporationReagents) > FixedPoint2.Zero)
{
var evaporation = AddComp<EvaporationComponent>(uid);
evaporation.NextTick = _timing.CurTime + EvaporationCooldown;
@@ -51,7 +56,7 @@ public sealed partial class PuddleSystem
continue;
var reagentTick = evaporation.EvaporationAmount * EvaporationCooldown.TotalSeconds;
_solutionContainerSystem.RemoveReagent(uid, puddleSolution, EvaporationReagent, reagentTick);
puddleSolution.SplitSolutionWithOnly(reagentTick, EvaporationReagents);
// Despawn if we're done
if (puddleSolution.Volume == FixedPoint2.Zero)
@@ -65,6 +70,6 @@ public sealed partial class PuddleSystem
public bool CanFullyEvaporate(Solution solution)
{
return solution.Contents.Count == 1 && solution.ContainsPrototype(EvaporationReagent);
return solution.GetTotalPrototypeQuantity(EvaporationReagents) == solution.Volume;
}
}