5 internal sealed
class CharacterAbilityReduceAffliction : CharacterAbility
7 private readonly Identifier afflictionId;
8 private readonly
float amount;
10 public CharacterAbilityReduceAffliction(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
12 afflictionId = abilityElement.GetAttributeIdentifier(
"afflictionid", abilityElement.GetAttributeIdentifier(
"affliction", Identifier.Empty));
13 amount = abilityElement.GetAttributeFloat(
"amount", 0);
15 if (afflictionId.IsEmpty)
17 DebugConsole.ThrowError($
"Error in {nameof(CharacterAbilityReduceAffliction)} - affliction identifier not set.",
18 contentPackage: abilityElement.ContentPackage);
22 protected override void ApplyEffect(AbilityObject abilityObject)
24 if (abilityObject is not IAbilityCharacter character) {
return; }
25 character.Character.CharacterHealth.ReduceAfflictionOnAllLimbs(afflictionId, amount, attacker: Character);
virtual void ApplyEffect()