Basic AP (Action Points) system tied to the AI actions, but there's no way to set 'has AP' for the AI?

This commit is contained in:
Zed A. Shaw 2025-12-03 15:24:41 -05:00
parent c78b2ae75e
commit a38bb5b691
8 changed files with 64 additions and 18 deletions

View file

@ -102,6 +102,11 @@ namespace components {
int hp;
int max_hp;
int damage;
int ap_delta;
int max_ap;
// everyone starts at 0 but ap_delta is added each round
int ap = 0;
/* NOTE: This is used to _mark_ entities as dead, to detect ones that have just died. Don't make attack automatically set it.*/
bool dead = false;
@ -176,7 +181,7 @@ namespace components {
ENROLL_COMPONENT(EnemyConfig, ai_script, ai_start_name, ai_goal_name);
ENROLL_COMPONENT(Personality, hearing_distance, tough);
ENROLL_COMPONENT(Motion, dx, dy, random);
ENROLL_COMPONENT(Combat, hp, max_hp, damage, dead);
ENROLL_COMPONENT(Combat, hp, max_hp, damage, ap_delta, max_ap, dead);
ENROLL_COMPONENT(Device, config, events);
ENROLL_COMPONENT(Storyboard, image, audio, layout, beats);
ENROLL_COMPONENT(Animation, min_x, min_y,