5 private readonly Identifier afflictionId;
6 private readonly
float strength;
7 private readonly Identifier multiplyStrengthBySkill;
8 private readonly
bool setValue;
14 multiplyStrengthBySkill = abilityElement.
GetAttributeIdentifier(
"multiplystrengthbyskill", Identifier.Empty);
17 if (afflictionId.IsEmpty)
19 DebugConsole.ThrowError($
"Error in talent {CharacterTalent.DebugIdentifier}, CharacterAbilityGiveAffliction - affliction identifier not set.",
24 protected override void VerifyState(
bool conditionsMatched,
float timeSinceLastUpdate)
26 if (conditionsMatched)
41 ApplyAfflictionToCharacter(character.Character);
45 private void ApplyAfflictionToCharacter(
Character character)
48 if (afflictionPrefab ==
null)
50 DebugConsole.ThrowError($
"Error in CharacterAbilityGiveAffliction - could not find an affliction with the identifier \"{afflictionId}\".",
54 float strength = this.strength;
55 if (!multiplyStrengthBySkill.IsEmpty)
override void ApplyEffect(AbilityObject abilityObject)
override void ApplyEffect()
override void VerifyState(bool conditionsMatched, float timeSinceLastUpdate)
CharacterAbilityGiveAffliction(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character....
static readonly PrefabCollection< AfflictionPrefab > Prefabs
void ApplyAffliction(Limb targetLimb, Affliction affliction, bool allowStacking=true, bool ignoreUnkillability=false, bool recalculateVitality=true)
CharacterHealth CharacterHealth
float GetSkillLevel(Identifier skillIdentifier)
Get the character's current skill level, taking into account any temporary boosts from wearables and ...
readonly TalentPrefab Prefab
float GetAttributeFloat(string key, float def)
ContentPackage? ContentPackage
bool GetAttributeBool(string key, bool def)
Identifier GetAttributeIdentifier(string key, string def)
ContentPackage? ContentPackage