Client LuaCsForBarotrauma
CharacterAbilityResetPermanentStat.cs
1 
2 namespace Barotrauma.Abilities
3 {
5  {
6  private readonly Identifier statIdentifier;
7  public override bool AppliesEffectOnIntervalUpdate => true;
8  public override bool AllowClientSimulation => true;
9 
10  public CharacterAbilityResetPermanentStat(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
11  {
12  statIdentifier = abilityElement.GetAttributeIdentifier("statidentifier", Identifier.Empty);
13  if (statIdentifier.IsEmpty)
14  {
15  DebugConsole.ThrowError($"Error in talent {CharacterTalent.DebugIdentifier}, {nameof(CharacterAbilityResetPermanentStat)} - statIdentifier is empty.",
16  contentPackage: abilityElement.ContentPackage);
17  }
18  }
19  protected override void ApplyEffect(AbilityObject abilityObject)
20  {
21  ApplyEffectSpecific();
22  }
23 
24  protected override void ApplyEffect()
25  {
26  ApplyEffectSpecific();
27  }
28 
29  private void ApplyEffectSpecific()
30  {
31  Character?.Info.ResetSavedStatValue(statIdentifier);
32  }
33  }
34 }
CharacterAbilityResetPermanentStat(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
ContentPackage? ContentPackage
Identifier GetAttributeIdentifier(string key, string def)