Files
tbd-station-14/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs
Acruid 9459400002 SoundSystem Improvements (#3697)
* Refactor all audio to use the new SoundSystem.

* Update submodule

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-03-21 17:12:03 +01:00

35 lines
1012 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.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Nutrition
{
[RegisterComponent]
public class CreamPieComponent : Component, ILand
{
public override string Name => "CreamPie";
public void PlaySound()
{
SoundSystem.Play(Filter.Pvs(Owner), 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();
}
}
}