SimpleAttackLogic ​
Inherits: AttackStateLogic < Resource
SimpleAttackLogic automatically creates priority-based actions from the entity's active abilities. This provides a zero-configuration combat AI that cycles through abilities in order.
Description ​
The system automatically:
- Creates UseAbilityAction for each active ability
- Assigns priority based on array order (first = highest priority)
- Includes basic cooldown and casting checks
- Falls back to basic attack if no abilities are available
Properties ​
float | min_first_delay | 2.0 |
float | max_first_delay | 5.0 |
float | rest_after_action | 3 |
Variables ​
float | first_ability_delay | 0.0 |
bool | first_ability_used | false |
float | rest_timer | 0.0 |
Array[CombatAction] | generated_actions | [] |
Methods ​
void | setup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript ) |
bool | execute( delta: float ) |
void | refresh_actions() |
Array[CombatAction] | get_generated_actions() |
int | get_action_count() |
bool | has_actions() |
Dictionary | to_save_data() |
void | from_save_data( save_data: Dictionary ) |
void | cleanup() |
Property descriptions ​
float min_first_delay = 2.0 ​
Minimum delay before first ability (seconds)
float max_first_delay = 5.0 ​
Maximum delay before first ability (seconds)
float rest_after_action = 3 ​
Rest period after successful action execution (seconds)
Variable descriptions ​
float first_ability_delay = 0.0 ​
Timer for the first ability delay
bool first_ability_used = false ​
Whether the first ability has been used yet
float rest_timer = 0.0 ​
Timer for rest period after successful action
Array[CombatAction] generated_actions = [] ​
Auto-generated priority actions
Method descriptions ​
void setup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript ) ​
Setup the simple logic
bool execute( delta: float ) ​
Execute the highest priority valid action
void refresh_actions() ​
Refresh actions when abilities change (call this if entity gains/loses abilities)
Array[CombatAction] get_generated_actions() ​
Get current generated actions (for debugging/inspection)
int get_action_count() ​
Get action count
bool has_actions() ​
Check if any actions are available
Dictionary to_save_data() ​
Save runtime state
void from_save_data( save_data: Dictionary ) ​
Restore runtime state
void cleanup() ​
Cleanup all generated actions