Extended Stat

ExtendedStatComponent is used to implement more advanced stats like health / stamina /mana.

StatsManagerComponent stores only informations about max / top and modifier values.
ExtendedStatComponent allows to add min, current values and regeneration.

Let’s take a look at BP_CombatCharacter, it has ExtendedHealth and ExtendedStamina components.

We can modify few variables.

  • Type - type of stat to bind to
  • DoesRegenerates - regenerate when current value is less than max
  • RegenValue - how much value will be regenerated each tick
  • ReenableRegenTime - when regeneration is interrupted, e.g when attacking, it will start regenerating again after that time

There is no max value variable to set, because it will be taken from StatsManagerComponent.

Function ModifyStat allows to modify extented stat.

  • Value - value that will be added to current value, should be negative to subtract)
  • InterruptRegeneration - whether regeneration should be interrupted (and re enabled after delay) or not

GetCurrentValue, GetMaxValue allows to retrieve current and max values.