5 internal sealed
class CharacterAbilityGiveItemStat : CharacterAbility
7 private readonly ItemTalentStats stat;
8 private readonly
float value;
9 private readonly
bool stackable;
10 private readonly
bool save;
12 public CharacterAbilityGiveItemStat(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
14 stat = abilityElement.GetAttributeEnum(
"stattype", ItemTalentStats.None);
15 value = abilityElement.GetAttributeFloat(
"value", 0f);
16 stackable = abilityElement.GetAttributeBool(
"stackable",
true);
17 save = abilityElement.GetAttributeBool(
"save",
false);
20 protected override void VerifyState(
bool conditionsMatched,
float timeSinceLastUpdate)
22 if (conditionsMatched)
28 protected override void ApplyEffect(AbilityObject abilityObject)
30 if (abilityObject is not IAbilityItem ability) {
return; }
32 ability.Item.StatManager.ApplyStat(stat, stackable, save, value, CharacterTalent);
virtual void ApplyEffect()