Bottles break when thrown and spill their contents on the ground.

Fixes #2918
This commit is contained in:
Vera Aguilera Puerto
2021-01-10 16:10:28 +01:00
parent 654cca13bf
commit 3157da2db7
3 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
#nullable enable
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Fluids;
using Content.Server.GameObjects.EntitySystems;
using JetBrains.Annotations;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
{
[UsedImplicitly]
public class SpillBehavior : IThresholdBehavior
{
public void ExposeData(ObjectSerializer serializer) { }
public void Trigger(IEntity owner, DestructibleSystem system)
{
if (!owner.TryGetComponent(out SolutionContainerComponent? solutionContainer))
return;
solutionContainer.Solution.SpillAt(owner.Transform.Coordinates, "PuddleSmear", false);
}
}
}