2022-05-22 18:23:37 +10:00
|
|
|
using Content.Shared.Damage.Prototypes;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2022-05-22 18:23:37 +10:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
|
|
|
|
|
2022-09-29 15:51:59 +10:00
|
|
|
namespace Content.Server.Weapons.Ranged.Components;
|
2022-05-22 18:23:37 +10:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Plays the specified sound upon receiving damage of that type.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class RangedDamageSoundComponent : Component
|
2022-05-22 18:23:37 +10:00
|
|
|
{
|
|
|
|
|
// TODO: Limb damage changing sound type.
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specified sounds to apply when the entity takes damage with the specified group.
|
|
|
|
|
/// Will fallback to defaults if none specified.
|
|
|
|
|
/// </summary>
|
2022-11-16 20:22:11 +01:00
|
|
|
[DataField("soundGroups",
|
2022-05-22 18:23:37 +10:00
|
|
|
customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, DamageGroupPrototype>))]
|
|
|
|
|
public Dictionary<string, SoundSpecifier>? SoundGroups;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specified sounds to apply when the entity takes damage with the specified type.
|
|
|
|
|
/// Will fallback to defaults if none specified.
|
|
|
|
|
/// </summary>
|
2022-11-16 20:22:11 +01:00
|
|
|
[DataField("soundTypes",
|
2022-05-22 18:23:37 +10:00
|
|
|
customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, DamageTypePrototype>))]
|
|
|
|
|
public Dictionary<string, SoundSpecifier>? SoundTypes;
|
|
|
|
|
}
|