PoolDefinition ​
Inherits: DatabaseResource < Resource
Definition for pool stats - contains ALL logic for damage absorption, overfill, etc.
Properties ​
Color | color | Color.WHITE |
float | default_max_value | 100.0 |
float | default_current_value | 100.0 |
StartValue | start_value | StartValue.STARTS_FULL |
GenerationLogic | pool_gen | GenerationLogic.REGEN |
float | gen_rate | 0.0 |
float | gen_value | 0.0 |
bool | is_protective_pool | false |
float | maximum_absorption_per_hit | 0.0 |
bool | can_overfill | false |
float | overfill_max | 0.0 |
float | overfill_decay_rate | 0.0 |
bool | can_go_negative | false |
float | negative_max | 0.0 |
bool | absorbs_damage | true |
int | absorption_priority | 0 |
bool | receives_healing | true |
Array[int] | absorbs_damage_types | [] |
Methods ​
Dictionary | calculate_generation( current_value: float, max_value: float, delta_time: float ) |
String | get_generation_description() |
bool | should_absorb_damage_type( damage_type: int ) |
float | calculate_max_absorption( incoming_damage: float, damage_type: int ) |
Dictionary | calculate_actual_absorption( incoming_damage: float, damage_type: int, current_pool_value: float ) |
Dictionary | calculate_healing_application( healing_amount: float, current_value: float, max_value: float, overfill_current: float = 0.0 ) |
Dictionary | calculate_overfill_decay( current_overfill: float, delta_time: float ) |
float | apply_value_constraints( current_value: float ) |
float | get_total_max_value() |
PoolInstance | create_instance( chorno_manager: ChronoManager, initial_current_value: float = -1.0 ) |
String | get_pool_description() |
Enumerations ​
enum StartValue ​
The options of start value: starts full, starts empty.
- STARTS_FULL =
0 - STARTS_EMPTY =
1
enum GenerationLogic ​
The options of generation logic: regen, decay.
- REGEN =
0 - DECAY =
1
Property descriptions ​
Basic Properties
Color color = Color.WHITE ​
The color that stands for this in the interface
Pool Properties
float default_max_value = 100.0 ​
The maximum of the pool when an entity is created, before stats, growth and equipment change it
float default_current_value = 100.0 ​
The value the pool starts with when it does not start full
StartValue start_value = StartValue.STARTS_FULL ​
Does the pool start full or empty?
Generation/Decay
GenerationLogic pool_gen = GenerationLogic.REGEN ​
Does the pool regenerate (REGEN) or decay (DECAY) over time?
float gen_rate = 0.0 ​
Ticks per second (0 = disabled)
float gen_value = 0.0 ​
Amount per tick
Pool Behavior
bool is_protective_pool = false ​
If true, absorption counts as blocking/mitigation, not actual damage
float maximum_absorption_per_hit = 0.0 ​
The most damage the pool absorbs from one hit (0 = no limit). For shields with limited absorption
bool can_overfill = false ​
Can the pool go above its maximum (temporary shields, overhealing)?
float overfill_max = 0.0 ​
How far above the maximum the pool can go (0 = no limit)
float overfill_decay_rate = 0.0 ​
How much of the overfill is lost each second (0 = it does not decay)
bool can_go_negative = false ​
Can the pool go below zero (debt, corruption)?
float negative_max = 0.0 ​
How far below zero the pool can go (0 = no limit)
Damage Layer
bool absorbs_damage = true ​
Does this pool take part of the damage an entity suffers (health, a shield)? A pool in an entity's health pool list gets a damage layer from these settings; any pool can get a temporary one from an effect (a mana shield).
int absorption_priority = 0 ​
Pools with a higher priority absorb first (a shield above health). Equal priorities: the pool added last absorbs first
bool receives_healing = true ​
Do heals fill this pool? Turn it off for a shield: over-healing must not fill it
Damage Type Integration
Array[int] absorbs_damage_types = [] ​
The damage types the pool absorbs. Empty = all of them
Method descriptions ​
Dictionary calculate_generation( current_value: float, max_value: float, delta_time: float ) ​
========== GENERATION/DECAY LOGIC ==========
String get_generation_description() ​
A text about how the pool fills or drains by itself.
bool should_absorb_damage_type( damage_type: int ) ​
========== DAMAGE ABSORPTION LOGIC ==========
float calculate_max_absorption( incoming_damage: float, damage_type: int ) ​
The most this pool can take of incoming damage of a type.
Dictionary calculate_actual_absorption( incoming_damage: float, damage_type: int, current_pool_value: float ) ​
How much of the incoming damage the pool takes now, given what it holds.
Dictionary calculate_healing_application( healing_amount: float, current_value: float, max_value: float, overfill_current: float = 0.0 ) ​
========== HEALING/RESTORATION LOGIC ==========
Dictionary calculate_overfill_decay( current_overfill: float, delta_time: float ) ​
========== OVERFILL DECAY LOGIC ==========
float apply_value_constraints( current_value: float ) ​
========== VALUE CONSTRAINTS ==========
float get_total_max_value() ​
The maximum of the pool including its overfill.
PoolInstance create_instance( chorno_manager: ChronoManager, initial_current_value: float = -1.0 ) ​
========== INSTANCE CREATION ==========
String get_pool_description() ​
========== UTILITY METHODS ==========