forked from NotAShelf/rogged
various: add speed/cooldown & initiative system
- Goblins act every ~2 turns, skeletons ~1.5, orcs ~1.2 - Enemies accumulate cooldown based on speed, act when <= 0 - Player always acts every turn (speed = 100)" Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id822579a0326887d91a80bd4ab27a72d6a6a6964
This commit is contained in:
parent
8f6650919d
commit
db21bdacdd
4 changed files with 185 additions and 41 deletions
|
|
@ -9,6 +9,9 @@ void enemy_spawn(Enemy enemies[], int *count, Map *map, Player *p, int floor);
|
|||
// Update all enemy AI
|
||||
void enemy_update_all(Enemy enemies[], int count, Player *p, Map *map);
|
||||
|
||||
// Perform a single action for an enemy (attack if adjacent, otherwise move)
|
||||
void enemy_act(Enemy *e, Player *p, Map *map, Enemy *all_enemies, int enemy_count);
|
||||
|
||||
// Check if position has an enemy
|
||||
int is_enemy_at(const Enemy *enemies, int count, int x, int y);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue