Emergent Sanitation Gameplay (#1378)

* Emergent Sanitation Gameplay

* Fix the map

* Address review

* Mention if it's slippery in the description
This commit is contained in:
ike709
2020-07-11 16:49:54 -05:00
committed by GitHub
parent 531d9626ad
commit 203a835264
20 changed files with 1011 additions and 45 deletions

View File

@@ -65,17 +65,16 @@ namespace Content.Server.GameObjects.Components.Fluids
{
if (!InteractionChecks.InRangeUnobstructed(eventArgs)) return;
Solution solution;
if (CurrentVolume <= 0)
{
return;
}
//Solution solution;
if (eventArgs.Target == null)
{
if (CurrentVolume <= 0)
{
return;
}
// Drop the liquid on the mop on to the ground I guess? Potentially change by design
// Maybe even use a toggle mode instead of "Pickup" and "dropoff"
solution = _contents.SplitSolution(CurrentVolume);
SpillHelper.SpillAt(eventArgs.ClickLocation, solution, "PuddleSmear");
// Drop the liquid on the mop on to the ground
SpillHelper.SpillAt(eventArgs.ClickLocation, _contents.SplitSolution(CurrentVolume), "PuddleSmear");
return;
}
@@ -88,18 +87,34 @@ namespace Content.Server.GameObjects.Components.Fluids
// - _pickupAmount,
// - whatever's left in the puddle, or
// - whatever we can still hold (whichever's smallest)
var transferAmount = ReagentUnit.Min(ReagentUnit.New(5), puddleComponent.CurrentVolume, MaxVolume - CurrentVolume);
var transferAmount = ReagentUnit.Min(ReagentUnit.New(5), puddleComponent.CurrentVolume, CurrentVolume);
bool puddleCleaned = puddleComponent.CurrentVolume - transferAmount <= 0;
if (transferAmount == 0)
{
return;
if(puddleComponent.EmptyHolder) //The puddle doesn't actually *have* reagents, for example vomit because there's no "vomit" reagent.
{
puddleComponent.Owner.Delete();
transferAmount = ReagentUnit.Min(ReagentUnit.New(5), CurrentVolume);
puddleCleaned = true;
}
else
{
return;
}
}
else
{
puddleComponent.SplitSolution(transferAmount);
}
solution = puddleComponent.SplitSolution(transferAmount);
// Probably don't recolor a mop? Could work, if we layered it maybe
if (!_contents.TryAddSolution(solution, false, true))
if (puddleCleaned) //After cleaning the puddle, make a new puddle with solution from the mop as a "wet floor". Then evaporate it slowly.
{
// I can't imagine why this would happen
throw new InvalidOperationException();
SpillHelper.SpillAt(eventArgs.ClickLocation, _contents.SplitSolution(transferAmount), "PuddleSmear");
}
else
{
_contents.SplitSolution(transferAmount);
}
// Give some visual feedback shit's happening (for anyone who can't hear sound)