Client LuaCsForBarotrauma
CharacterAbilityGiveStat.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  private readonly StatTypes statType;
6  private readonly float value;
7 
8  public CharacterAbilityGiveStat(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
9  {
10  statType = CharacterAbilityGroup.ParseStatType(abilityElement.GetAttributeString("stattype", ""), CharacterTalent.DebugIdentifier);
11  value = abilityElement.GetAttributeFloat("value", 0f);
12  }
13 
14  public override void InitializeAbility(bool addingFirstTime)
15  {
16  Character.ChangeStat(statType, value);
17  }
18  }
19 }
CharacterAbilityGiveStat(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
override void InitializeAbility(bool addingFirstTime)
static StatTypes ParseStatType(string statTypeString, string debugIdentifier)
void ChangeStat(StatTypes statType, float value)
string? GetAttributeString(string key, string? def)
float GetAttributeFloat(string key, float def)
StatTypes
StatTypes are used to alter several traits of a character. They are mostly used by talents.
Definition: Enums.cs:195