Client LuaCsForBarotrauma
CharacterSound.cs
1 using Barotrauma.Sounds;
2 using System.Collections.Immutable;
3 
4 namespace Barotrauma
5 {
7  {
8  public enum SoundType
9  {
10  Idle, Attack, Die, Damage, Happy, Unhappy
11  }
12 
13  private readonly RoundSound roundSound;
15 
16  public SoundType Type => Params.State;
17  public ImmutableHashSet<Identifier> TagSet => Params.TagSet;
18  public float Volume => roundSound == null ? 0.0f : roundSound.Volume;
19  public float Range => roundSound == null ? 0.0f : roundSound.Range;
20  public Sound Sound => roundSound?.Sound;
21 
22  public bool IgnoreMuffling => roundSound?.IgnoreMuffling ?? false;
23 
25  {
26  Params = soundParams;
27  roundSound = RoundSound.Load(soundParams.Element);
28  }
29  }
30 }
Attacks are used to deal damage to characters, structures and items. They can be defined in the weapo...
Contains character data that should be editable in the character editor.
readonly CharacterParams.SoundParams Params
ImmutableHashSet< Identifier > TagSet
CharacterSound(CharacterParams.SoundParams soundParams)
static ? RoundSound Load(ContentXElement element, bool stream=false)
Definition: RoundSound.cs:61
Sound(SoundManager owner, string filename, bool stream, bool streamsReliably, ContentXElement xElement=null, bool getFullPath=true)
Definition: Sound.cs:65