RangedDamageSoundComponent.cs 1.2 KB

123456789101112131415161718192021222324252627282930
  1. using Content.Shared.Damage.Prototypes;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
  4. namespace Content.Server.Weapons.Ranged.Components;
  5. /// <summary>
  6. /// Plays the specified sound upon receiving damage of that type.
  7. /// </summary>
  8. [RegisterComponent]
  9. public sealed partial class RangedDamageSoundComponent : Component
  10. {
  11. // TODO: Limb damage changing sound type.
  12. /// <summary>
  13. /// Specified sounds to apply when the entity takes damage with the specified group.
  14. /// Will fallback to defaults if none specified.
  15. /// </summary>
  16. [DataField("soundGroups",
  17. customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, DamageGroupPrototype>))]
  18. public Dictionary<string, SoundSpecifier>? SoundGroups;
  19. /// <summary>
  20. /// Specified sounds to apply when the entity takes damage with the specified type.
  21. /// Will fallback to defaults if none specified.
  22. /// </summary>
  23. [DataField("soundTypes",
  24. customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, DamageTypePrototype>))]
  25. public Dictionary<string, SoundSpecifier>? SoundTypes;
  26. }