Files
tbd-station-14/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs
2021-03-16 15:50:20 +01:00

35 lines
1021 B
C#

using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Fluids;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Nutrition
{
[RegisterComponent]
public class CreamPieComponent : Component, ILand
{
public override string Name => "CreamPie";
public void PlaySound()
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(AudioHelpers.GetRandomFileFromSoundCollection("desecration"), Owner,
AudioHelpers.WithVariation(0.125f));
}
void ILand.Land(LandEventArgs eventArgs)
{
PlaySound();
if (Owner.TryGetComponent(out SolutionContainerComponent? solution))
{
solution.Solution.SpillAt(Owner, "PuddleSmear", false);
}
Owner.Delete();
}
}
}