feat: allow mopping evaporating puddles (#38743)
This commit is contained in:
@@ -277,17 +277,22 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
|
|||||||
if (!_solutionContainerSystem.ResolveSolution(target, puddle.SolutionName, ref puddle.Solution, out var puddleSolution) || puddleSolution.Volume <= 0)
|
if (!_solutionContainerSystem.ResolveSolution(target, puddle.SolutionName, ref puddle.Solution, out var puddleSolution) || puddleSolution.Volume <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check if the puddle has any non-evaporative reagents
|
|
||||||
if (_puddleSystem.CanFullyEvaporate(puddleSolution))
|
|
||||||
{
|
|
||||||
_popups.PopupEntity(Loc.GetString("mopping-system-puddle-evaporate", ("target", target)), user, user);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Solution puddleSplit;
|
Solution puddleSplit;
|
||||||
var isRemoved = false;
|
var isRemoved = false;
|
||||||
if (absorber.UseAbsorberSolution)
|
if (absorber.UseAbsorberSolution)
|
||||||
{
|
{
|
||||||
|
// No reason to mop something that 1) can evaporate, 2) is an absorber, and 3) is being mopped with
|
||||||
|
// something that uses absorbers.
|
||||||
|
var puddleAbsorberVolume =
|
||||||
|
puddleSolution.GetTotalPrototypeQuantity(_puddleSystem.GetAbsorbentReagents(puddleSolution));
|
||||||
|
if (puddleAbsorberVolume == puddleSolution.Volume)
|
||||||
|
{
|
||||||
|
_popups.PopupEntity(Loc.GetString("mopping-system-puddle-already-mopped", ("target", target)),
|
||||||
|
user,
|
||||||
|
user);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we have any evaporative reagents on our absorber to transfer
|
// Check if we have any evaporative reagents on our absorber to transfer
|
||||||
var absorberSolution = absorberSoln.Comp.Solution;
|
var absorberSolution = absorberSoln.Comp.Solution;
|
||||||
var available = absorberSolution.GetTotalPrototypeQuantity(_puddleSystem.GetAbsorbentReagents(absorberSolution));
|
var available = absorberSolution.GetTotalPrototypeQuantity(_puddleSystem.GetAbsorbentReagents(absorberSolution));
|
||||||
@@ -317,6 +322,7 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Note: arguably shouldn't this get all solutions?
|
||||||
puddleSplit = puddleSolution.SplitSolutionWithout(absorber.PickupAmount, _puddleSystem.GetAbsorbentReagents(puddleSolution));
|
puddleSplit = puddleSolution.SplitSolutionWithout(absorber.PickupAmount, _puddleSystem.GetAbsorbentReagents(puddleSolution));
|
||||||
// Despawn if we're done
|
// Despawn if we're done
|
||||||
if (puddleSolution.Volume == FixedPoint2.Zero)
|
if (puddleSolution.Volume == FixedPoint2.Zero)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public sealed partial class PuddleSystem
|
|||||||
if (!_solutionContainerSystem.ResolveSolution(uid, puddle.SolutionName, ref puddle.Solution, out var puddleSolution))
|
if (!_solutionContainerSystem.ResolveSolution(uid, puddle.SolutionName, ref puddle.Solution, out var puddleSolution))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Yes, this means that 50u water + 50u holy water evaporates twice as fast as 100u water.
|
||||||
foreach ((string evaporatingReagent, FixedPoint2 evaporatingSpeed) in GetEvaporationSpeeds(puddleSolution))
|
foreach ((string evaporatingReagent, FixedPoint2 evaporatingSpeed) in GetEvaporationSpeeds(puddleSolution))
|
||||||
{
|
{
|
||||||
var reagentTick = evaporation.EvaporationAmount * EvaporationCooldown.TotalSeconds * evaporatingSpeed;
|
var reagentTick = evaporation.EvaporationAmount * EvaporationCooldown.TotalSeconds * evaporatingSpeed;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
mopping-system-target-container-empty = { CAPITALIZE(THE($target)) } is empty!
|
mopping-system-target-container-empty = { CAPITALIZE(THE($target)) } is empty!
|
||||||
mopping-system-target-container-empty-water = { CAPITALIZE(THE($target)) } has no water!
|
mopping-system-target-container-empty-water = { CAPITALIZE(THE($target)) } has no water!
|
||||||
mopping-system-puddle-space = { CAPITALIZE(THE($used)) } is full of water
|
mopping-system-puddle-space = { CAPITALIZE(THE($used)) } is full of water.
|
||||||
mopping-system-puddle-evaporate = { CAPITALIZE(THE($target)) } is evaporating
|
mopping-system-puddle-already-mopped = { CAPITALIZE(THE($target)) } is already mopped.
|
||||||
mopping-system-no-water = { CAPITALIZE(THE($used)) } has no water!
|
mopping-system-no-water = { CAPITALIZE(THE($used)) } has no water!
|
||||||
mopping-system-no-hands = You have no hands!
|
mopping-system-no-hands = You have no hands!
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user