Client LuaCsForBarotrauma
CharacterAbilityBountyHunter.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  private readonly float vitalityPercentage;
6 
7  public CharacterAbilityBountyHunter(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
8  {
9  vitalityPercentage = abilityElement.GetAttributeFloat("vitalitypercentage", 0f);
10  }
11 
12  protected override void ApplyEffect(AbilityObject abilityObject)
13  {
14  if ((abilityObject as IAbilityCharacter)?.Character is Character character)
15  {
16  int totalAmount = (int)(vitalityPercentage * character.MaxVitality);
17  Character.GiveMoney(totalAmount);
18  GameAnalyticsManager.AddMoneyGainedEvent(totalAmount, GameAnalyticsManager.MoneySource.Ability, CharacterTalent.Prefab.Identifier.Value);
19  }
20  }
21  }
22 }
override void ApplyEffect(AbilityObject abilityObject)
CharacterAbilityBountyHunter(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
void GiveMoney(int amount)
Shows visual notification of money gained by the specific player. Useful for mid-mission monetary gai...
readonly TalentPrefab Prefab
float GetAttributeFloat(string key, float def)
readonly Identifier Identifier
Definition: Prefab.cs:34