/* enemy.h - Header for enemy.c */

#ifndef ENEMY_H_INC
#define ENEMY_H_INC

#define DRONE 0
#define DROID 1
#define TURRET 2
#define BULLET 3
#define TURRETDROID 4
#define ROCKET 5
#define DUMBDRONE 6
#define ASTEROID 7
#define SMALLAST 8
#define SNAKEHEAD 9
#define SNAKEBODY 10
#define ENEMIES 11

//Angles for the snake (fixed point)
#define UP 192<<16
#define DOWN 64<<16
#define LEFT 128<<16
#define RIGHT 0<<16

//This is *after* the PP-defines because ENEMIES is required for draw.h
#include <allegro.h>
#include <stdio.h>
#include "draw.h"
#include "sound.h"
#include "sparks.h"
#include "main.h"

typedef struct enemy_s {
  fixed x, y;
  fixed xs, ys;
  fixed angle;
  int type;
  int cooldown;
  int damage;
  struct enemy_s *prev;
  struct enemy_s *next;
} enemy_t;

extern enemy_t *enemy_list;
extern enemy_t *last_enemy;

extern const int radius[ENEMIES];

void new_enemy(fixed x, fixed y, fixed xs, fixed ys, fixed angle, int type, int damage);
void del_enemy(enemy_t *enemy);
void draw_enemies(BITMAP *canvas);
void update_enemies(void);
void control_enemy(enemy_t *enemy);
void spawn_enemy(int points);
void kill_enemies(char points);
void split_snake(enemy_t *enemy);

#endif
