From 39ee8538015dc84aab976e0e8f6276844f71ae42 Mon Sep 17 00:00:00 2001 From: Dylan Hunter Whittingham <45404433+DylanWhittingham@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:46:13 +0000 Subject: [PATCH] Added pricegun sound (#34119) added pricegun sound Co-authored-by: dylanhunter --- .../Cargo/Systems/ClientPriceGunSystem.cs | 5 +++-- Content.Server/Cargo/Systems/PriceGunSystem.cs | 17 ++++++++++++----- .../Cargo/Components/PriceGunComponent.cs | 6 ++++++ Content.Shared/Cargo/SharedPriceGunSystem.cs | 4 ++-- Resources/Audio/Items/appraiser.ogg | Bin 0 -> 7049 bytes Resources/Audio/Items/attributions.yml | 7 ++++++- 6 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 Resources/Audio/Items/appraiser.ogg diff --git a/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs b/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs index f173932478..35fb2112c0 100644 --- a/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs +++ b/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Cargo.Components; using Content.Shared.Timing; using Content.Shared.Cargo.Systems; @@ -10,9 +11,9 @@ public sealed class ClientPriceGunSystem : SharedPriceGunSystem { [Dependency] private readonly UseDelaySystem _useDelay = default!; - protected override bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user) + protected override bool GetPriceOrBounty(Entity entity, EntityUid target, EntityUid user) { - if (!TryComp(priceGunUid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((priceGunUid, useDelay))) + if (!TryComp(entity, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((entity, useDelay))) return false; // It feels worse if the cooldown is predicted but the popup isn't! So only do the cooldown reset on the server. diff --git a/Content.Server/Cargo/Systems/PriceGunSystem.cs b/Content.Server/Cargo/Systems/PriceGunSystem.cs index 94f9f9cba9..5e7ab23060 100644 --- a/Content.Server/Cargo/Systems/PriceGunSystem.cs +++ b/Content.Server/Cargo/Systems/PriceGunSystem.cs @@ -1,7 +1,9 @@ using Content.Server.Popups; +using Content.Shared.Cargo.Components; using Content.Shared.IdentityManagement; using Content.Shared.Timing; using Content.Shared.Cargo.Systems; +using Robust.Shared.Audio.Systems; namespace Content.Server.Cargo.Systems; @@ -11,12 +13,12 @@ public sealed class PriceGunSystem : SharedPriceGunSystem [Dependency] private readonly PricingSystem _pricingSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly CargoSystem _bountySystem = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; - protected override bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user) + protected override bool GetPriceOrBounty(Entity entity, EntityUid target, EntityUid user) { - if (!TryComp(priceGunUid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((priceGunUid, useDelay))) + if (!TryComp(entity.Owner, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((entity.Owner, useDelay))) return false; - // Check if we're scanning a bounty crate if (_bountySystem.IsBountyComplete(target, out _)) { @@ -25,10 +27,15 @@ public sealed class PriceGunSystem : SharedPriceGunSystem else // Otherwise appraise the price { var price = _pricingSystem.GetPrice(target); - _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(target, EntityManager)), ("price", $"{price:F2}")), user, user); + _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", + ("object", Identity.Entity(target, EntityManager)), + ("price", $"{price:F2}")), + user, + user); } - _useDelay.TryResetDelay((priceGunUid, useDelay)); + _audio.PlayPvs(entity.Comp.AppraisalSound, entity.Owner); + _useDelay.TryResetDelay((entity.Owner, useDelay)); return true; } } diff --git a/Content.Shared/Cargo/Components/PriceGunComponent.cs b/Content.Shared/Cargo/Components/PriceGunComponent.cs index 7024f1195a..6577c52c1e 100644 --- a/Content.Shared/Cargo/Components/PriceGunComponent.cs +++ b/Content.Shared/Cargo/Components/PriceGunComponent.cs @@ -1,3 +1,4 @@ +using Robust.Shared.Audio; using Robust.Shared.GameStates; namespace Content.Shared.Cargo.Components; @@ -8,4 +9,9 @@ namespace Content.Shared.Cargo.Components; [RegisterComponent, NetworkedComponent] public sealed partial class PriceGunComponent : Component { + /// + /// The sound that plays when the price gun appraises an object. + /// + [DataField] + public SoundSpecifier AppraisalSound = new SoundPathSpecifier("/Audio/Items/appraiser.ogg"); } diff --git a/Content.Shared/Cargo/SharedPriceGunSystem.cs b/Content.Shared/Cargo/SharedPriceGunSystem.cs index 779d55055a..b5e312772b 100644 --- a/Content.Shared/Cargo/SharedPriceGunSystem.cs +++ b/Content.Shared/Cargo/SharedPriceGunSystem.cs @@ -26,7 +26,7 @@ public abstract class SharedPriceGunSystem : EntitySystem { Act = () => { - GetPriceOrBounty(uid, args.Target, args.User); + GetPriceOrBounty((uid, component), args.Target, args.User); }, Text = Loc.GetString("price-gun-verb-text"), Message = Loc.GetString("price-gun-verb-message", ("object", Identity.Entity(args.Target, EntityManager))) @@ -51,5 +51,5 @@ public abstract class SharedPriceGunSystem : EntitySystem /// This is abstract for prediction. When the bounty system / cargo systems that are necessary are moved to shared, /// combine all the server, client, and shared stuff into one non abstract file. /// - protected abstract bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user); + protected abstract bool GetPriceOrBounty(Entity entity, EntityUid target, EntityUid user); } diff --git a/Resources/Audio/Items/appraiser.ogg b/Resources/Audio/Items/appraiser.ogg new file mode 100644 index 0000000000000000000000000000000000000000..18c0a83b7fa39693d2ac920e003aa0e975ab846d GIT binary patch literal 7049 zcmai22V9fOvj0L&Xa<4^3L20Wngl`#ic%E<2n2!F+^ z5Ct0t4PZb(I--IiAkBuo@iyU{d(XS?{qFsKn`OV9-I<-4|I9awqrblk#0UNPyw_YG z{JeT)KWr;3Hk?WcjN(qgtZM#Taty{B+<-Z9cmDI??&MM`R_@gykFNc%=K=pZBOIW+ z2Sxu;1 z7v>Z0>qj-U_m1^3#OmnlV0Cr5eAc+N0UDfh-a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