Skip to content

Commit

Permalink
Sound effect plays when an item is thrown (#2767)
Browse files Browse the repository at this point in the history
* Adds toss.ogg to the project's resources

* Thrown items will now play a sound effect
  • Loading branch information
RemberBM authored Dec 27, 2020
1 parent 78fdd64 commit be48a25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Shared.Damage;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.Physics;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.GameObjects.Components.Timers;
Expand Down Expand Up @@ -98,6 +99,9 @@ public void StartThrow(Vector2 direction, float speed)
var controller = comp.EnsureController<ThrownController>();
controller.Push(direction, speed);

EntitySystem.Get<AudioSystem>()
.PlayFromEntity("/Audio/Effects/toss.ogg", Owner);

StartStopTimer();
}

Expand Down
Binary file added Resources/Audio/Effects/toss.ogg
Binary file not shown.

0 comments on commit be48a25

Please sign in to comment.