StatsData ​
Inherits: Resource
StatsData resource that defines the initial stats and pools for an Entity/Object This is passed to StatsComponent.setup_from_stats_data() to initialize all stats and pools
Properties ​
int | master_pool_id | 0 |
Array[int] | permanent_immunities | [] |
Dictionary | stats_base_values | {} |
Dictionary | stats_active_states | {} |
Array[int] | health_pool_definitions | [] |
Array[int] | resource_pool_definitions | [] |
Dictionary | health_pool_base_values | {} |
Dictionary | resource_pool_base_values | {} |
int | growth_profile_id | 0 |
Array[GrowthOverride] | growth_overrides | [] |
float | movement_speed_base | 0.0 |
float | attack_speed_base | 0.0 |
float | global_cooldown_duration_base | 0.0 |
float | cast_speed_base | 0.0 |
float | carry_weight_base | 0.0 |
float | carry_capacity_base | 0.0 |
float | sight_range_base | 0.0 |
float | weapon_damage_base | 0.0 |
float | weapon_damage_variance | 0.0 |
float | weapon_speed_base | 0.0 |
Methods ​
Property descriptions ​
int master_pool_id = 0 ​
Master pool configuration (ID of the master health pool)
Array[int] permanent_immunities = [] ​
Starting Immunities (IDs of immunity definitions)
Dictionary stats_base_values = ​
Base stat values - unified for all stats
Dictionary stats_active_states = ​
Active state tracking for stats - determines if stat is enabled
Array[int] health_pool_definitions = [] ​
Pool definitions - these define which pools this Entity/Object should have
Array[int] resource_pool_definitions = [] ​
Array of pool IDs
Dictionary health_pool_base_values = ​
Pool base values (auto-populated when adding definitions)
Dictionary resource_pool_base_values = ​
Key: pool_id (int), Value: {"current": float, "max": float}
Level Growth Overrides
int growth_profile_id = 0 ​
The growth profile of this entity (a GrowthProfile id): a shared list of growth entries for a kind of entity (heavy, caster, minion). 0 = none for a player class; an NPC with 0 uses the project's default profile (Gameplay Config, NPC Level Scaling). The entries below win over the profile
Array[GrowthOverride] growth_overrides = [] ​
Growth of a stat or pool for this entity only (a warrior's Strength grows faster than a mage's). An entry replaces the growth the stat or pool has on its own definition; the ones without an entry keep it.
Core Stat Overrides
float movement_speed_base = 0.0 ​
0 = use the base value of the core stat's definition (Stats tab: Movement Speed, Attack Speed ...) Movement speed override (0 = use default)
float attack_speed_base = 0.0 ​
Attack speed multiplier override (0 = use default)
float global_cooldown_duration_base = 0.0 ​
Global cooldown override in seconds (0 = use default)
float cast_speed_base = 0.0 ​
Cast speed multiplier override (0 = use default)
float carry_weight_base = 0.0 ​
Bag slots override (0 = use default). It is called carry weight in older data
float carry_capacity_base = 0.0 ​
Carry capacity (the weight the entity can carry) override (0 = use default)
float sight_range_base = 0.0 ​
Sight/detection range override (0 = use default)
Weapon Combat Stats
float weapon_damage_base = 0.0 ​
Base weapon damage for this entity (0 = no intrinsic weapon damage)
float weapon_damage_variance = 0.0 ​
Damage variance (±amount around base damage)
float weapon_speed_base = 0.0 ​
Base weapon swing speed in seconds (0 = use default)
Method descriptions ​
void refresh_default_health_pool() ​
Force refresh the default health pool (useful after database changes)
bool is_using_default_health_pool() ​
Check if using the default health pool
void sync_custom_stats() ​
Sync custom stats with the database cache Adds any new stats from the database and removes any that no longer exist
GrowthOverride get_growth_override( target_id: int ) ​
The growth override of a stat or pool, or null when this entity uses the definition's own growth
void set_growth_override( growth_override: GrowthOverride ) ​
Gives the stat or pool its own growth for this entity (replaces an earlier one)
void remove_growth_override( target_id: int ) ​
Removes the growth override of a stat or pool, so the entity grows as the definition says again
void sync_with_database() ​
Legacy alias
void add_health_pool_definition( pool_id: int ) ​
Gives the entity a health pool (a PoolDefinition id). A warning when it has it already
void add_resource_pool_definition( pool_id: int ) ​
Gives the entity a resource pool (mana, rage). A warning when it has it already
bool remove_health_pool_definition( pool_id: int ) ​
Takes a health pool away, with its base values. False when the entity did not have it
bool remove_resource_pool_definition( pool_id: int ) ​
Takes a resource pool away, with its base values. False when the entity did not have it
PoolDefinition get_health_pool_definition( pool_id: int ) ​
The definition of one of the entity's health pools, or null
PoolDefinition get_resource_pool_definition( pool_id: int ) ​
The definition of one of the entity's resource pools, or null
bool has_health_pool_definition( pool_id: int ) ​
Does the entity have this health pool?
bool has_resource_pool_definition( pool_id: int ) ​
Does the entity have this resource pool?
Dictionary get_health_pool_base_with_fallback( pool_id: int ) ​
The starting current and max of a health pool as {current, max}, with the definition's defaults for what this entity does not set
Dictionary get_resource_pool_base_with_fallback( pool_id: int ) ​
The starting current and max of a resource pool as {current, max}, with the definition's defaults for what this entity does not set
void set_health_pool_base_value( pool_id: int, current: float, max_value: float ) ​
Sets the starting current and max of a health pool for this entity. Only for a pool it has
void set_resource_pool_base_value( pool_id: int, current: float, max_value: float ) ​
Sets the starting current and max of a resource pool for this entity. Only for a pool it has
Dictionary get_health_pool_base_value( pool_id: int ) ​
A copy of the starting {current, max} of a health pool; the definition's defaults when the entity sets none
Dictionary get_resource_pool_base_value( pool_id: int ) ​
A copy of the starting {current, max} of a resource pool; the definition's defaults when the entity sets none
void set_stat_base_value( stat_id: int, value: float ) ​
Sets the base value of a stat for this entity
float get_stat_base_value( stat_id: int ) ​
The base value of a stat for this entity, or the default value of the stat definition
void set_stat_active( stat_id: int, active: bool ) ​
Switches a stat on or off for this entity from the start (an inactive stat is worth 0)
bool get_stat_active( stat_id: int ) ​
Is the stat on for this entity? True unless it was switched off
bool has_stat( stat_id: int ) ​
Does the entity set a base value for this stat?
void remove_stat( stat_id: int ) ​
Forgets the base value and the active state of a stat
void set_movement_speed_base( speed: float ) ​
Overrides the movement speed core stat for this entity (0 or more; 0 = the definition's base value)
void set_attack_speed_base( speed: float ) ​
Overrides the attack speed core stat for this entity (0 = the definition's base value)
void set_global_cooldown_duration_base( duration: float ) ​
Overrides the global cooldown core stat for this entity, in seconds (0 = the definition's base value)
void set_cast_speed_base( speed: float ) ​
Overrides the cast speed core stat for this entity (0 = the definition's base value)
void set_carry_weight_base( weight: float ) ​
Overrides the carry weight core stat for this entity (0 = the definition's base value)
void set_sight_range_base( range: float ) ​
Overrides the sight range core stat for this entity (0 = the definition's base value)
float get_movement_speed_base() ​
The movement speed override (0 = none)
float get_attack_speed_base() ​
The attack speed override (0 = none)
float get_global_cooldown_duration_base() ​
The global cooldown override (0 = none)
float get_cast_speed_base() ​
The cast speed override (0 = none)
float get_carry_weight_base() ​
The carry weight override (0 = none)
float get_carry_capacity_base() ​
The carry capacity override (0 = none)
float get_sight_range_base() ​
The sight range override (0 = none)
float get_core_value( stat_id: int ) ​
The value this entity's core stat starts at: its override, or the base value of the core stat's definition
void clear_core_stat_overrides() ​
Sets every core stat override to 0, so the entity uses the base values of the core stat definitions
void set_weapon_damage_base( damage: float ) ​
Set weapon combat base values
void set_weapon_damage_variance( variance: float ) ​
Sets how far the intrinsic weapon damage varies (0 or more)
void set_weapon_speed_base( speed: float ) ​
Sets the intrinsic weapon speed in seconds (0 or more; 0 = the default)
float get_weapon_damage_base() ​
Get weapon combat base values
float get_weapon_damage_variance() ​
How far the intrinsic weapon damage varies
float get_weapon_speed_base() ​
The intrinsic weapon speed
bool has_weapon_damage() ​
Check if entity has intrinsic weapon stats
bool has_weapon_speed() ​
True when the entity has an intrinsic weapon speed
bool has_any_weapon_stats() ​
True when the entity has an intrinsic weapon damage or speed
String get_weapon_damage_range_text() ​
Get weapon damage range for display
void clear_weapon_combat_stats() ​
Clear all weapon combat stats
void set_weapon_combat_stats( damage: float, variance: float = 0.0, speed: float = 0.0 ) ​
Set all weapon stats at once
void sync_all_pool_base_values() ​
Gives every pool the entity has a starting value, from its definition, when it has none
bool reset_health_pool_base_value( pool_id: int ) ​
Sets the starting values of a health pool back to the definition's defaults. False when the entity does not have it
bool reset_resource_pool_base_value( pool_id: int ) ​
Sets the starting values of a resource pool back to the definition's defaults. False when the entity does not have it