Client LuaCsForBarotrauma
AbilityConditionHasAffliction.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  private readonly Identifier afflictionIdentifier;
6  private readonly float minimumPercentage;
7 
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 }
AbilityConditionHasAffliction(CharacterTalent characterTalent, ContentXElement conditionElement)
virtual float Strength
Definition: Affliction.cs:31
Affliction GetAffliction(string identifier, bool allowLimbAfflictions=true)
float GetAttributeFloat(string key, float def)
Identifier GetAttributeIdentifier(string key, string def)