Attributes

In Alacrity, an entity's attributes define the modifiable values that hold the entity's state. The attribute values are dynamic types that can hold i64 or f64 types, depending on the specific attribute. Attributes can be affected by buffs modifiers, which modify their values according to a set of rules and conditions defined by the buff.

Unlike properties, which are non-modifiable values that hold arbitrary data for the entity, attributes can only hold numerical values, and are restricted to i64 or f64 value types. However, this does not limit their flexibility, as numerical values can represent a wide range of states and conditions for an entity.

It's important to note that while attributes can not be directly mutated, they can be modified through buffs modifiers. This means that buffs can affect the values of an entity's attributes, based on conditions that you define in the buff. Buffs can add or subtract values, set values to specific amounts, or apply complex calculations to change the values of attributes.

The Attributes section of the Alacrity documentation provides more information on how to define attributes, their types, and how to use them in combination with buffs to create complex systems for video games.