Client LuaCsForBarotrauma
CharacterAbilityInsurancePolicy.cs
1
namespace
Barotrauma.Abilities
2
{
3
class
CharacterAbilityInsurancePolicy
:
CharacterAbility
4
{
5
public
override
bool
AppliesEffectOnIntervalUpdate
=>
true
;
6
7
private
readonly
int
moneyPerMission;
8
9
public
CharacterAbilityInsurancePolicy
(
CharacterAbilityGroup
characterAbilityGroup,
ContentXElement
abilityElement) : base(characterAbilityGroup, abilityElement)
10
{
11
moneyPerMission = abilityElement.
GetAttributeInt
(
"moneypermission"
, 0);
12
}
13
14
protected
override
void
ApplyEffect
(
AbilityObject
abilityObject)
15
{
16
if
(
Character
?.Info is
CharacterInfo
info &&
GameMain
.
GameSession
?.
GameMode
is
CampaignMode
campaign)
17
{
18
int
totalAmount = moneyPerMission * info.MissionsCompletedSinceDeath;
19
campaign.Bank.Give(totalAmount);
20
GameAnalyticsManager.AddMoneyGainedEvent(totalAmount, GameAnalyticsManager.MoneySource.Ability,
CharacterTalent
.
Prefab
.
Identifier
.Value);
21
}
22
}
23
}
24
}
Barotrauma.Abilities.AbilityObject
Definition:
AbilityObjects.cs:6
Barotrauma.Abilities.CharacterAbilityGroup
Definition:
CharacterAbilityGroup.cs:9
Barotrauma.Abilities.CharacterAbility
Definition:
CharacterAbility.cs:7
Barotrauma.Abilities.CharacterAbilityInsurancePolicy
Definition:
CharacterAbilityInsurancePolicy.cs:4
Barotrauma.Abilities.CharacterAbilityInsurancePolicy.AppliesEffectOnIntervalUpdate
override bool AppliesEffectOnIntervalUpdate
Definition:
CharacterAbilityInsurancePolicy.cs:5
Barotrauma.Abilities.CharacterAbilityInsurancePolicy.ApplyEffect
override void ApplyEffect(AbilityObject abilityObject)
Definition:
CharacterAbilityInsurancePolicy.cs:14
Barotrauma.Abilities.CharacterAbilityInsurancePolicy.CharacterAbilityInsurancePolicy
CharacterAbilityInsurancePolicy(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
Definition:
CharacterAbilityInsurancePolicy.cs:9
Barotrauma.CampaignMode
Definition:
BarotraumaShared/SharedSource/GameSession/GameModes/CampaignMode.cs:15
Barotrauma.Character
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:32
Barotrauma.CharacterInfo
Stores information about the Character that is needed between rounds in the menu etc....
Definition:
BarotraumaShared/SharedSource/Characters/CharacterInfo.cs:95
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.CharacterTalent.Prefab
readonly TalentPrefab Prefab
Definition:
CharacterTalent.cs:12
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeInt
int GetAttributeInt(string key, int def)
Barotrauma.GameMain
Definition:
GameMain.cs:25
Barotrauma.GameMain.GameSession
static GameSession?? GameSession
Definition:
GameMain.cs:88
Barotrauma.GameSession.GameMode
GameMode? GameMode
Definition:
BarotraumaShared/SharedSource/GameSession/GameSession.cs:71
Barotrauma.Prefab.Identifier
readonly Identifier Identifier
Definition:
Prefab.cs:34
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
CustomAbilities
CharacterAbilityInsurancePolicy.cs
Generated by
1.9.1