diff --git a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs index 49d51d01d6..4bcdfe4c9a 100644 --- a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs @@ -2,6 +2,7 @@ using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Shared.GameObjects; +using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Random; @@ -35,6 +36,7 @@ namespace Content.Server.GameObjects.Components.Destructible public DamageType damageType = DamageType.Total; public int damageValue = 0; public string spawnOnDestroy = ""; + public string destroySound = ""; public bool destroyed = false; ActSystem _actSystem; @@ -46,6 +48,7 @@ namespace Content.Server.GameObjects.Components.Destructible serializer.DataField(ref damageValue, "thresholdvalue", 100); serializer.DataField(ref damageType, "thresholdtype", DamageType.Total); serializer.DataField(ref spawnOnDestroy, "spawnondestroy", ""); + serializer.DataField(ref destroySound, "destroysound", ""); } public override void Initialize() @@ -68,6 +71,12 @@ namespace Content.Server.GameObjects.Components.Destructible { destroyed = true; _actSystem.HandleDestruction(Owner, true); + if(destroySound != string.Empty) + { + _entitySystemManager.GetEntitySystem().Play(destroySound, Owner); + } + + } } diff --git a/Resources/Audio/effects/metalbreak.ogg b/Resources/Audio/effects/metalbreak.ogg new file mode 100644 index 0000000000..0b447cc699 Binary files /dev/null and b/Resources/Audio/effects/metalbreak.ogg differ diff --git a/Resources/Prototypes/Entities/buildings/walls.yml b/Resources/Prototypes/Entities/buildings/walls.yml index b8a7c1edc9..17670a1a1c 100644 --- a/Resources/Prototypes/Entities/buildings/walls.yml +++ b/Resources/Prototypes/Entities/buildings/walls.yml @@ -286,6 +286,7 @@ - type: Destructible thresholdvalue: 100 spawnondestroy: girder + destroysound: /Audio/effects/metalbreak.ogg - type: IconSmooth key: walls base: solid