ASAttributeSet
Inherits:
ResourceResource managing a collection of attributes and unlocked abilities.
Description
[ASAttributeSet] defines which attributes an actor has and which abilities are permitted for use (unlocked).
Properties
| Type | Name | Default |
|---|---|---|
ASAttribute[] | attribute_definitions | [] |
Definitions for each attribute (limits, base). | ||
Dictionary[] | attribute_drivers | [] |
List of rules that drive an attribute value based on another (e.g., Strength driving Attack). | ||
ASAbility[] | unlocked_abilities | [] |
Abilities permitted for use by the actor. | ||
Methods
| Return | Name |
|---|---|
void | add_attribute_definition(
attribute: ASAttribute) |
Adds an attribute definition to the set. | |
void | add_modifier(
name: StringName, value: float, type: int = 0) |
Adds a modifier to an attribute’s current value. | |
float | get_attribute_base_value(
name: StringName)
const |
Returns the base value of the specified attribute. | |
ASAttribute | get_attribute_definition(
name: StringName)
const |
Returns the definition of the specified attribute. | |
StringName[] | get_attribute_list(
)
const |
Returns a list of all attribute names in the set. | |
float | get_attribute_value(
name: StringName)
const |
Returns the current value of the specified attribute. | |
bool | has_attribute(
name: StringName)
const |
Returns true if the set contains the specified attribute. | |
void | remove_attribute_definition(
name: StringName) |
Removes an attribute definition from the set by its tag name. | |
void | remove_modifier(
name: StringName, value: float, type: int = 0) |
Removes a previously applied modifier from an attribute. | |
void | set_attribute_base_value(
name: StringName, value: float) |
Sets the base value for a specific attribute. | |
Signals
- attribute_changed(
attribute_name:
StringName, old_value:float, new_value:float)Emitted when a value changes.
Constants
| Name | Value |
|---|---|
| MODIFIER_ADD | 0 |
Addition modifier type. | |
| MODIFIER_MULTIPLY | 1 |
Multiplication modifier type. | |