ASAttribute
Inherits:
ResourceResource 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
| Type | Name | Default |
|---|---|---|
String | attribute_name | "" |
The unique name of this attribute. | ||
float | base_value | 0.0 |
The base value of the attribute. Will be automatically clamped between [member min_value] and [member max_value]. | ||
float | max_value | 1000.0 |
The maximum value allowed for this attribute. | ||
float | min_value | 0.0 |
The minimum value allowed for this attribute. | ||
Methods
| Return | Name |
|---|---|
float | clamp_value(
value: float)
const |
Returns the value clamped between [member min_value] and [member max_value]. | |
bool | is_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.