Skip to content

ASAttribute

PT | EN
Inherits: Resource

Resource that defines an ability system attribute with validation and limits.

Description

[ASAttribute] is a [Resource] that serves as a definition for attributes in the Ability System. It contains metadata about the attribute including name, base value, and minimum/maximum limits. Usage with [ASAttributeSet] provides a typed and validated structure for attributes like HP, Mana, Stamina, etc.

Properties

TypeNameDefault
Stringattribute_name""
The unique name of this attribute.
floatbase_value0.0
The base value of the attribute. Will be automatically clamped between [member min_value] and [member max_value].
floatmax_value1000.0
The maximum value allowed for this attribute.
floatmin_value0.0
The minimum value allowed for this attribute.

Methods

ReturnName
floatclamp_value( value: float) const
Returns the value clamped between [member min_value] and [member max_value].
boolis_valid_value( value: float) const
Checks if the value is within the defined limits ([member min_value] and [member max_value]).

Signals

  • limits_changed( min_value: float, max_value: float)

    Emitted when the limits of the attribute are changed.

  • value_changed( old_value: float, new_value: float)

    Emitted when the base value of the attribute is changed.