Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,42 @@
using Content.Shared.Audio;
using Content.Shared.Throwing;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Throwing
{
/// <summary>
/// Simple sound emitter that emits sound on use in hand
/// </summary>
[RegisterComponent]
public class EmitSoundOnThrowComponent : Component, ILand
{
/// <inheritdoc />
///
public override string Name => "EmitSoundOnThrow";
[DataField("sound")]
public string? _soundName;
[DataField("variation")]
public float _pitchVariation;
public void PlaySoundEffect()
{
if (!string.IsNullOrWhiteSpace(_soundName))
{
if (_pitchVariation > 0.0)
{
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
}
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioParams.Default.WithVolume(-2f));
}
}
void ILand.Land(LandEventArgs eventArgs)
{
PlaySoundEffect();
}
}
}