diff --git a/Content.Server/Medical/Components/HealingComponent.cs b/Content.Server/Medical/Components/HealingComponent.cs index 0ae08a435b..b9d530b5e9 100644 --- a/Content.Server/Medical/Components/HealingComponent.cs +++ b/Content.Server/Medical/Components/HealingComponent.cs @@ -1,6 +1,7 @@ using System.Threading; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; +using Content.Shared.Sound; using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -42,5 +43,17 @@ namespace Content.Server.Medical.Components public float Delay = 3f; public CancellationTokenSource? CancelToken = null; + + /// + /// Sound played on healing begin + /// + [DataField("healingBeginSound")] + public SoundSpecifier? HealingBeginSound = null; + + /// + /// Sound played on healing end + /// + [DataField("healingEndSound")] + public SoundSpecifier? HealingEndSound = null; } } diff --git a/Content.Server/Medical/HealingSystem.cs b/Content.Server/Medical/HealingSystem.cs index 806a6e9abe..06af257f77 100644 --- a/Content.Server/Medical/HealingSystem.cs +++ b/Content.Server/Medical/HealingSystem.cs @@ -4,12 +4,13 @@ using Content.Server.Body.Systems; using Content.Server.DoAfter; using Content.Server.Medical.Components; using Content.Server.Stack; -using Content.Shared.ActionBlocker; +using Content.Shared.Audio; using Content.Shared.Damage; using Content.Shared.Database; using Content.Shared.Interaction; -using Content.Shared.Interaction.Helpers; using Content.Shared.Stacks; +using Robust.Shared.Audio; +using Robust.Shared.Player; namespace Content.Server.Medical; @@ -56,6 +57,11 @@ public sealed class HealingSystem : EntitySystem _logs.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed {EntityManager.ToPrettyString(uid):target} for {healed.Total:damage} damage"); else _logs.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed themselves for {healed.Total:damage} damage"); + + if (args.Component.HealingEndSound != null) + { + SoundSystem.Play(Filter.Pvs(uid, entityManager:EntityManager), args.Component.HealingEndSound.GetSound(), uid, AudioHelpers.WithVariation(0.125f).WithVolume(-5f)); + } } private static void OnHealingCancelled(HealingCancelledEvent ev) @@ -68,7 +74,7 @@ public sealed class HealingSystem : EntitySystem if (args.Handled) return; args.Handled = true; - Heal(args.User, args.User, component); + Heal(uid, args.User, args.User, component); } private void OnHealingAfterInteract(EntityUid uid, HealingComponent component, AfterInteractEvent args) @@ -76,10 +82,10 @@ public sealed class HealingSystem : EntitySystem if (args.Handled || !args.CanReach || args.Target == null) return; args.Handled = true; - Heal(args.User, args.Target.Value, component); + Heal(uid, args.User, args.Target.Value, component); } - private void Heal(EntityUid user, EntityUid target, HealingComponent component) + private void Heal(EntityUid uid, EntityUid user, EntityUid target, HealingComponent component) { if (component.CancelToken != null) { @@ -105,6 +111,11 @@ public sealed class HealingSystem : EntitySystem component.CancelToken = new CancellationTokenSource(); + if (component.HealingBeginSound != null) + { + SoundSystem.Play(Filter.Pvs(uid, entityManager:EntityManager), component.HealingBeginSound.GetSound(), uid, AudioHelpers.WithVariation(0.125f).WithVolume(-5f)); + } + _doAfter.DoAfter(new DoAfterEventArgs(user, component.Delay, component.CancelToken.Token, target) { BreakOnUserMove = true, diff --git a/Resources/Audio/Items/Medical/brutepack_begin.ogg b/Resources/Audio/Items/Medical/brutepack_begin.ogg new file mode 100644 index 0000000000..b7c4dab459 Binary files /dev/null and b/Resources/Audio/Items/Medical/brutepack_begin.ogg differ diff --git a/Resources/Audio/Items/Medical/brutepack_end.ogg b/Resources/Audio/Items/Medical/brutepack_end.ogg new file mode 100644 index 0000000000..985815d817 Binary files /dev/null and b/Resources/Audio/Items/Medical/brutepack_end.ogg differ diff --git a/Resources/Audio/Items/Medical/generic_healing_begin.ogg b/Resources/Audio/Items/Medical/generic_healing_begin.ogg new file mode 100644 index 0000000000..8924e26ce2 Binary files /dev/null and b/Resources/Audio/Items/Medical/generic_healing_begin.ogg differ diff --git a/Resources/Audio/Items/Medical/generic_healing_end.ogg b/Resources/Audio/Items/Medical/generic_healing_end.ogg new file mode 100644 index 0000000000..e99b5ed0df Binary files /dev/null and b/Resources/Audio/Items/Medical/generic_healing_end.ogg differ diff --git a/Resources/Audio/Items/Medical/license.txt b/Resources/Audio/Items/Medical/license.txt new file mode 100644 index 0000000000..2b4b402865 --- /dev/null +++ b/Resources/Audio/Items/Medical/license.txt @@ -0,0 +1,10 @@ +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 + +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 diff --git a/Resources/Audio/Items/Medical/ointment_begin.ogg b/Resources/Audio/Items/Medical/ointment_begin.ogg new file mode 100644 index 0000000000..5711550ff5 Binary files /dev/null and b/Resources/Audio/Items/Medical/ointment_begin.ogg differ diff --git a/Resources/Audio/Items/Medical/ointment_end.ogg b/Resources/Audio/Items/Medical/ointment_end.ogg new file mode 100644 index 0000000000..0aa0d4e387 Binary files /dev/null and b/Resources/Audio/Items/Medical/ointment_end.ogg differ diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml index fb639d4edd..ca6e1c804d 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml @@ -1,23 +1,36 @@ +- type: entity + parent: BaseItem + id: BaseHealingItem + abstract: true + components: + - type: Sprite + sprite: Objects/Specific/Medical/medical.rsi + - type: Item + sprite: Objects/Specific/Medical/medical.rsi + HeldPrefix: ointment + - type: entity name: ointment description: Used to treat those nasty burns. - parent: BaseItem + parent: BaseHealingItem id: Ointment components: - type: Tag tags: - Ointment - type: Sprite - sprite: Objects/Specific/Medical/medical.rsi state: ointment - type: Item - sprite: Objects/Specific/Medical/medical.rsi HeldPrefix: ointment - type: Healing damageContainer: Biological damage: groups: Burn: -10 # 5 for each type in the group + healingBeginSound: + path: "/Audio/Items/Medical/ointment_begin.ogg" + healingEndSound: + path: "/Audio/Items/Medical/ointment_end.ogg" - type: Stack stackType: Ointment max: 5 @@ -26,7 +39,7 @@ - type: entity name: bruise pack description: A therapeutic gel pack and bandages designed to treat blunt-force trauma. - parent: Ointment + parent: BaseHealingItem id: Brutepack components: - type: Tag @@ -40,13 +53,17 @@ groups: Brute: -15 # 5 for each type in the group bloodlossModifier: -3 # a little bit of bloodloss healing. + healingBeginSound: + path: "/Audio/Items/Medical/brutepack_begin.ogg" + healingEndSound: + path: "/Audio/Items/Medical/brutepack_end.ogg" - type: Stack stackType: Brutepack - type: entity name: roll of gauze description: Some sterile gauze to wrap around bloody stumps. - parent: Ointment + parent: BaseHealingItem id: Gauze components: - type: Tag @@ -61,6 +78,10 @@ Slash: -2.5 Piercing: -2.5 bloodlossModifier: -10 + healingBeginSound: + path: "/Audio/Items/Medical/brutepack_begin.ogg" + healingEndSound: + path: "/Audio/Items/Medical/brutepack_end.ogg" - type: Stack stackType: Gauze