Generalizes solution overflow & slightly increases space lube yield (#21094)
* generalize SolutionSpikeOverflowEvent * let reactions overflow * spacelube: 3 -> 5 * restore TryMixAndOverflow threshold cap
This commit is contained in:
@@ -61,35 +61,11 @@ public sealed class SolutionSpikableSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (_solutionSystem.TryMixAndOverflow(target,
|
||||
targetSolution,
|
||||
sourceSolution,
|
||||
targetSolution.MaxVolume,
|
||||
out var overflow))
|
||||
{
|
||||
if (overflow.Volume > 0)
|
||||
{
|
||||
RaiseLocalEvent(target, new SolutionSpikeOverflowEvent(overflow));
|
||||
}
|
||||
if (!_solutionSystem.ForceAddSolution(target, targetSolution, sourceSolution))
|
||||
return;
|
||||
|
||||
_popupSystem.PopupEntity(Loc.GetString(spikableSource.Popup, ("spiked-entity", target), ("spike-entity", source)), user, user);
|
||||
|
||||
sourceSolution.RemoveAllSolution();
|
||||
|
||||
_triggerSystem.Trigger(source, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SolutionSpikeOverflowEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The solution that's been overflowed from the spike.
|
||||
/// </summary>
|
||||
public Solution Overflow { get; }
|
||||
|
||||
public SolutionSpikeOverflowEvent(Solution overflow)
|
||||
{
|
||||
Overflow = overflow;
|
||||
_popupSystem.PopupEntity(Loc.GetString(spikableSource.Popup, ("spiked-entity", target), ("spike-entity", source)), user, user);
|
||||
sourceSolution.RemoveAllSolution();
|
||||
_triggerSystem.Trigger(source, user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user