RangedDamageSoundComponent.cs 1.2 KB

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