Client LuaCsForBarotrauma
CharacterAbilityBountyHunter.cs
1
namespace
Barotrauma.Abilities
2
{
3
class
CharacterAbilityBountyHunter
:
CharacterAbility
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
}
Barotrauma.Abilities.AbilityObject
Definition:
AbilityObjects.cs:6
Barotrauma.Abilities.CharacterAbilityBountyHunter
Definition:
CharacterAbilityBountyHunter.cs:4
Barotrauma.Abilities.CharacterAbilityBountyHunter.ApplyEffect
override void ApplyEffect(AbilityObject abilityObject)
Definition:
CharacterAbilityBountyHunter.cs:12
Barotrauma.Abilities.CharacterAbilityBountyHunter.CharacterAbilityBountyHunter
CharacterAbilityBountyHunter(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
Definition:
CharacterAbilityBountyHunter.cs:7
Barotrauma.Abilities.CharacterAbilityGroup
Definition:
CharacterAbilityGroup.cs:9
Barotrauma.Abilities.CharacterAbility
Definition:
CharacterAbility.cs:7
Barotrauma.Character
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:32
Barotrauma.Character.GiveMoney
void GiveMoney(int amount)
Shows visual notification of money gained by the specific player. Useful for mid-mission monetary gai...
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:5768
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.CharacterTalent.Prefab
readonly TalentPrefab Prefab
Definition:
CharacterTalent.cs:12
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeFloat
float GetAttributeFloat(string key, float def)
Barotrauma.Prefab.Identifier
readonly Identifier Identifier
Definition:
Prefab.cs:34
Barotrauma.Abilities.IAbilityCharacter
Definition:
AbilityInterfaces.cs:29
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
CustomAbilities
CharacterAbilityBountyHunter.cs
Generated by
1.9.1