object break sounds (#477)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.Random;
|
using Robust.Shared.Interfaces.Random;
|
||||||
@@ -35,6 +36,7 @@ namespace Content.Server.GameObjects.Components.Destructible
|
|||||||
public DamageType damageType = DamageType.Total;
|
public DamageType damageType = DamageType.Total;
|
||||||
public int damageValue = 0;
|
public int damageValue = 0;
|
||||||
public string spawnOnDestroy = "";
|
public string spawnOnDestroy = "";
|
||||||
|
public string destroySound = "";
|
||||||
public bool destroyed = false;
|
public bool destroyed = false;
|
||||||
|
|
||||||
ActSystem _actSystem;
|
ActSystem _actSystem;
|
||||||
@@ -46,6 +48,7 @@ namespace Content.Server.GameObjects.Components.Destructible
|
|||||||
serializer.DataField(ref damageValue, "thresholdvalue", 100);
|
serializer.DataField(ref damageValue, "thresholdvalue", 100);
|
||||||
serializer.DataField(ref damageType, "thresholdtype", DamageType.Total);
|
serializer.DataField(ref damageType, "thresholdtype", DamageType.Total);
|
||||||
serializer.DataField(ref spawnOnDestroy, "spawnondestroy", "");
|
serializer.DataField(ref spawnOnDestroy, "spawnondestroy", "");
|
||||||
|
serializer.DataField(ref destroySound, "destroysound", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -68,6 +71,12 @@ namespace Content.Server.GameObjects.Components.Destructible
|
|||||||
{
|
{
|
||||||
destroyed = true;
|
destroyed = true;
|
||||||
_actSystem.HandleDestruction(Owner, true);
|
_actSystem.HandleDestruction(Owner, true);
|
||||||
|
if(destroySound != string.Empty)
|
||||||
|
{
|
||||||
|
_entitySystemManager.GetEntitySystem<AudioSystem>().Play(destroySound, Owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Resources/Audio/effects/metalbreak.ogg
Normal file
BIN
Resources/Audio/effects/metalbreak.ogg
Normal file
Binary file not shown.
@@ -286,6 +286,7 @@
|
|||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholdvalue: 100
|
thresholdvalue: 100
|
||||||
spawnondestroy: girder
|
spawnondestroy: girder
|
||||||
|
destroysound: /Audio/effects/metalbreak.ogg
|
||||||
- type: IconSmooth
|
- type: IconSmooth
|
||||||
key: walls
|
key: walls
|
||||||
base: solid
|
base: solid
|
||||||
|
|||||||
Reference in New Issue
Block a user