Client LuaCsForBarotrauma
CharacterAbilityApprenticeship.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  private readonly bool ignoreAbilitySkillGain;
6 
7  public CharacterAbilityApprenticeship(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
8  {
9  ignoreAbilitySkillGain = abilityElement.GetAttributeBool("ignoreabilityskillgain", true);
10  }
11 
12  protected override void ApplyEffect(AbilityObject abilityObject)
13  {
14  if (abilityObject is AbilitySkillGain abilitySkillGain && abilitySkillGain.Character != Character)
15  {
16  if (ignoreAbilitySkillGain && abilitySkillGain.GainedFromAbility) { return; }
17  Character.Info?.IncreaseSkillLevel(abilitySkillGain.SkillIdentifier, 1.0f, gainedFromAbility: true);
18  }
19  }
20  }
21 }
CharacterAbilityApprenticeship(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
override void ApplyEffect(AbilityObject abilityObject)
void IncreaseSkillLevel(Identifier skillIdentifier, float increase, bool gainedFromAbility=false, bool forceNotification=false)
Increase the skill by a specific amount. Talents may affect the actual, final skill increase.
bool GetAttributeBool(string key, bool def)