@@ -9,9 +9,6 @@ using Content.Shared.Nutrition.AnimalHusbandry;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -35,7 +32,6 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
private readonly HashSet<EntityUid> _failedAttempts = new();
|
||||
private readonly HashSet<EntityUid> _birthQueue = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -226,7 +222,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
_birthQueue.Clear();
|
||||
HashSet<EntityUid> birthQueue = new();
|
||||
_failedAttempts.Clear();
|
||||
|
||||
var query = EntityQueryEnumerator<ReproductiveComponent>();
|
||||
@@ -234,7 +230,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
{
|
||||
if (reproductive.GestationEndTime != null && _timing.CurTime >= reproductive.GestationEndTime)
|
||||
{
|
||||
_birthQueue.Add(uid);
|
||||
birthQueue.Add(uid);
|
||||
}
|
||||
|
||||
if (_timing.CurTime < reproductive.NextBreedAttempt)
|
||||
@@ -248,7 +244,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
TryReproduceNearby(uid, reproductive);
|
||||
}
|
||||
|
||||
foreach (var queued in _birthQueue)
|
||||
foreach (var queued in birthQueue)
|
||||
{
|
||||
Birth(queued);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ using Content.Shared.Throwing;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems
|
||||
@@ -38,7 +37,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
protected override void SplattedCreamPie(EntityUid uid, CreamPieComponent creamPie)
|
||||
{
|
||||
_audio.PlayPvs(_audio.GetSound(creamPie.Sound), uid, AudioParams.Default.WithVariation(0.125f));
|
||||
_audio.Play(_audio.GetSound(creamPie.Sound), Filter.Pvs(uid), uid, false, new AudioParams().WithVariation(0.125f));
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp))
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -10,8 +10,6 @@ using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems;
|
||||
@@ -92,7 +90,7 @@ public sealed class FatExtractorSystem : EntitySystem
|
||||
|
||||
component.Processing = true;
|
||||
_appearance.SetData(uid, FatExtractorVisuals.Processing, true);
|
||||
component.Stream = _audio.PlayPvs(component.ProcessSound, uid)?.Entity;
|
||||
component.Stream = _audio.PlayPvs(component.ProcessSound, uid);
|
||||
component.NextUpdate = _timing.CurTime + component.UpdateTime;
|
||||
}
|
||||
|
||||
@@ -106,7 +104,7 @@ public sealed class FatExtractorSystem : EntitySystem
|
||||
|
||||
component.Processing = false;
|
||||
_appearance.SetData(uid, FatExtractorVisuals.Processing, false);
|
||||
component.Stream = _audio.Stop(component.Stream);
|
||||
component.Stream?.Stop();
|
||||
}
|
||||
|
||||
public bool TryGetValidOccupant(EntityUid uid, [NotNullWhen(true)] out EntityUid? occupant, FatExtractorComponent? component = null, EntityStorageComponent? storage = null)
|
||||
|
||||
@@ -28,9 +28,6 @@ using Content.Shared.Verbs;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems;
|
||||
|
||||
@@ -281,7 +278,7 @@ public sealed class FoodSystem : EntitySystem
|
||||
_adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(uid):food}");
|
||||
}
|
||||
|
||||
_audio.PlayPvs(component.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-1f));
|
||||
_audio.Play(component.UseSound, Filter.Pvs(args.Target.Value), args.Target.Value, true, AudioParams.Default.WithVolume(-1f));
|
||||
|
||||
// Try to break all used utensils
|
||||
foreach (var utensil in utensils)
|
||||
|
||||
@@ -7,8 +7,6 @@ using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems;
|
||||
|
||||
@@ -7,18 +7,16 @@ using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems
|
||||
{
|
||||
public sealed class SliceableFoodSystem : EntitySystem
|
||||
internal sealed class SliceableFoodSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -77,7 +75,8 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
xform.LocalRotation = 0;
|
||||
}
|
||||
|
||||
_audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2));
|
||||
SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid),
|
||||
transform.Coordinates, AudioParams.Default.WithVolume(-2));
|
||||
|
||||
// Decrease size of item based on count - Could implement in the future
|
||||
// Bug with this currently is the size in a container is not updated
|
||||
|
||||
@@ -2,7 +2,6 @@ using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -16,7 +15,6 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly FoodSystem _foodSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -68,8 +66,8 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
if (_robustRandom.Prob(component.BreakChance))
|
||||
{
|
||||
_audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f));
|
||||
EntityManager.DeleteEntity(uid);
|
||||
SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f));
|
||||
EntityManager.DeleteEntity(component.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user