Drink fixes part 2 eclectic boogaloo (#1052)

* Drink fixes part 2 eclectic boogaloo

* NOT THE NNEWLINES

* oops

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
FL-OZ
2020-05-31 12:47:46 -05:00
committed by GitHub
parent d68d71807d
commit a295d205b1
4 changed files with 285 additions and 322 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
@@ -28,10 +29,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
#pragma warning disable 649
[Dependency] private readonly IPrototypeManager _prototypeManager;
[Dependency] private readonly IRobustRandom _random;
[Dependency] private readonly IEntitySystemManager _entitySystem;
#pragma warning restore 649
private AudioSystem _audioSystem;
public override string Name => "Drink";
[ViewVariables]
@@ -94,8 +92,8 @@ namespace Content.Server.GameObjects.Components.Nutrition
//Do the opening stuff like playing the sounds.
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollection);
var file = _random.Pick(soundCollection.PickFiles);
_audioSystem = _entitySystem.GetEntitySystem<AudioSystem>();
_audioSystem.Play(file, Owner, AudioParams.Default);
EntitySystem.Get<AudioSystem>().Play(file, args.User, AudioParams.Default);
_opened = true;
return false;
}
@@ -148,7 +146,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (stomachComponent.TryTransferSolution(split))
{
if (_useSound == null) return false;
_audioSystem.Play(_useSound, Owner, AudioParams.Default.WithVolume(-2f));
EntitySystem.Get<AudioSystem>().Play(_useSound, target, AudioParams.Default.WithVolume(-2f));
target.PopupMessage(target, Loc.GetString("Slurp"));
UpdateAppearance();
return true;