diff --git a/Content.Server/Medical/Components/HealthAnalyzerComponent.cs b/Content.Server/Medical/Components/HealthAnalyzerComponent.cs index bef0e9122f..237cd4b4ff 100644 --- a/Content.Server/Medical/Components/HealthAnalyzerComponent.cs +++ b/Content.Server/Medical/Components/HealthAnalyzerComponent.cs @@ -3,6 +3,7 @@ using Content.Server.UserInterface; using Content.Shared.Disease; using Content.Shared.MedicalScanner; using Robust.Server.GameObjects; +using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.Medical.Components @@ -25,6 +26,18 @@ namespace Content.Server.Medical.Components public CancellationTokenSource? CancelToken; public BoundUserInterface? UserInterface => Owner.GetUIOrNull(HealthAnalyzerUiKey.Key); + /// + /// Sound played on scanning begin + /// + [DataField("scanningBeginSound")] + public SoundSpecifier? ScanningBeginSound = null; + + /// + /// Sound played on scanning end + /// + [DataField("scanningEndSound")] + public SoundSpecifier? ScanningEndSound = null; + /// /// The disease this will give people. /// diff --git a/Content.Server/Medical/HealthAnalyzerSystem.cs b/Content.Server/Medical/HealthAnalyzerSystem.cs index 491b83b607..22f0ac174f 100644 --- a/Content.Server/Medical/HealthAnalyzerSystem.cs +++ b/Content.Server/Medical/HealthAnalyzerSystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Damage; using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.MobState.Components; +using Content.Shared.Audio; using Robust.Server.GameObjects; using Robust.Shared.Player; using static Content.Shared.MedicalScanner.SharedHealthAnalyzerComponent; @@ -15,6 +16,7 @@ namespace Content.Server.Medical { public sealed class HealthAnalyzerSystem : EntitySystem { + [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly DiseaseSystem _disease = default!; [Dependency] private readonly DoAfterSystem _doAfterSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; @@ -55,6 +57,9 @@ namespace Content.Server.Medical return; healthAnalyzer.CancelToken = new CancellationTokenSource(); + + _audio.PlayPvs(healthAnalyzer.ScanningBeginSound, uid); + _doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, healthAnalyzer.ScanDelay, healthAnalyzer.CancelToken.Token, target: args.Target) { BroadcastFinishedEvent = new TargetScanSuccessfulEvent(args.User, args.Target, healthAnalyzer), @@ -69,6 +74,9 @@ namespace Content.Server.Medical private void OnTargetScanSuccessful(TargetScanSuccessfulEvent args) { args.Component.CancelToken = null; + + _audio.PlayPvs(args.Component.ScanningEndSound, args.User); + UpdateScannedUser(args.Component.Owner, args.User, args.Target, args.Component); // Below is for the traitor item // Piggybacking off another component's doafter is complete CBT so I gave up diff --git a/Resources/Audio/Items/Medical/healthscanner.ogg b/Resources/Audio/Items/Medical/healthscanner.ogg new file mode 100644 index 0000000000..ae4a9e9101 Binary files /dev/null and b/Resources/Audio/Items/Medical/healthscanner.ogg differ diff --git a/Resources/Audio/Items/Medical/license.txt b/Resources/Audio/Items/Medical/license.txt index 2b4b402865..e9385756eb 100644 --- a/Resources/Audio/Items/Medical/license.txt +++ b/Resources/Audio/Items/Medical/license.txt @@ -1,10 +1,11 @@ The following sounds were used from freesound: - + herbertboland - heavyskirtmovement.wav - CC BY 3.0 vinrax - cloth-sounds.mp3 - CC BY-NC 3.0 -lordvanye - skintouching.wav - CC0 1.0 +lordvanye - skintouching.wav - CC0 1.0 +FM Synthesis - healthscanner.ogg - CC BY 4.0 Additional sound effects from https://www.zapsplat.com -foley-cloth-denim-rip-003.mp3 - -zapsplat_food_bottle_golden_syrup_cap_open_then_close.mp3 \ No newline at end of file +foley-cloth-denim-rip-003.mp3 - +zapsplat_food_bottle_golden_syrup_cap_open_then_close.mp3 diff --git a/Resources/Prototypes/Entities/Objects/Devices/pda.yml b/Resources/Prototypes/Entities/Objects/Devices/pda.yml index bebb31ae7e..f6a664ac9a 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/pda.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/pda.yml @@ -141,6 +141,8 @@ state: pda-internmed - type: HealthAnalyzer scanDelay: 1.4 + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" - type: entity parent: BasePDA @@ -493,6 +495,8 @@ state: pda-cmo - type: HealthAnalyzer scanDelay: 1 + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" - type: entity parent: BasePDA @@ -513,6 +517,8 @@ state: pda-medical - type: HealthAnalyzer scanDelay: 1.2 + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" - type: entity parent: BasePDA diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/healthanalyzer.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/healthanalyzer.yml index 6032d5d0b2..0ae2385e03 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/healthanalyzer.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/healthanalyzer.yml @@ -16,6 +16,8 @@ - key: enum.HealthAnalyzerUiKey.Key type: HealthAnalyzerBoundUserInterface - type: HealthAnalyzer + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" - type: Tag tags: - DiscreteHealthAnalyzer