Client LuaCsForBarotrauma
AbilityConditionHasAffliction.cs
1
namespace
Barotrauma.Abilities
2
{
3
class
AbilityConditionHasAffliction
:
AbilityConditionDataless
4
{
5
private
readonly Identifier afflictionIdentifier;
6
private
readonly
float
minimumPercentage;
7
8
public
AbilityConditionHasAffliction
(
CharacterTalent
characterTalent
,
ContentXElement
conditionElement) : base(
characterTalent
, conditionElement)
9
{
10
afflictionIdentifier = conditionElement.
GetAttributeIdentifier
(
"afflictionidentifier"
, Identifier.Empty);
11
minimumPercentage = conditionElement.
GetAttributeFloat
(
"minimumpercentage"
, 0f);
12
}
13
14
protected
override
bool
MatchesConditionSpecific
()
15
{
16
if
(!afflictionIdentifier.IsEmpty)
17
{
18
var affliction =
character
.
CharacterHealth
.
GetAffliction
(afflictionIdentifier);
19
if
(affliction ==
null
) {
return
false
; }
20
return
affliction.
Strength
>= affliction.Prefab.ActivationThreshold && minimumPercentage <= affliction.Strength / affliction.Prefab.MaxStrength;
21
}
22
return
false
;
23
}
24
}
25
}
Barotrauma.Abilities.AbilityConditionDataless
Definition:
AbilityConditionDataless.cs:4
Barotrauma.Abilities.AbilityConditionHasAffliction
Definition:
AbilityConditionHasAffliction.cs:4
Barotrauma.Abilities.AbilityConditionHasAffliction.MatchesConditionSpecific
override bool MatchesConditionSpecific()
Definition:
AbilityConditionHasAffliction.cs:14
Barotrauma.Abilities.AbilityConditionHasAffliction.AbilityConditionHasAffliction
AbilityConditionHasAffliction(CharacterTalent characterTalent, ContentXElement conditionElement)
Definition:
AbilityConditionHasAffliction.cs:8
Barotrauma.Abilities.AbilityCondition.character
Character character
Definition:
AbilityCondition.cs:9
Barotrauma.Abilities.AbilityCondition.characterTalent
CharacterTalent characterTalent
Definition:
AbilityCondition.cs:8
Barotrauma.Affliction.Strength
virtual float Strength
Definition:
Affliction.cs:31
Barotrauma.CharacterHealth.GetAffliction
Affliction GetAffliction(string identifier, bool allowLimbAfflictions=true)
Barotrauma.Character.CharacterHealth
CharacterHealth CharacterHealth
Definition:
BarotraumaShared/SharedSource/Characters/Character.cs:962
Barotrauma.CharacterTalent
Definition:
CharacterTalent.cs:8
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.GetAttributeFloat
float GetAttributeFloat(string key, float def)
Barotrauma.ContentXElement.GetAttributeIdentifier
Identifier GetAttributeIdentifier(string key, string def)
Barotrauma.Abilities
Definition:
AbilityCondition.cs:5
Barotrauma
BarotraumaShared
SharedSource
Characters
Talents
Abilities
AbilityConditionals
AbilityConditionDataless
AbilityConditionHasAffliction.cs
Generated by
1.9.1