RogueLife/src/enemies.h

51 lines
1.2 KiB
C

//---
// enemies: List of enemies and their properties
//---
#pragma once
#include "geometry.h"
#include "anim.h"
#include "entities.h"
/* enemy_stat_t: Statistic base and growth */
typedef struct {
/* Base value at level 1 */
fixed_t base;
/* Initial per-level growth */
fixed_t growth;
/* Per-level increase of growth */
fixed_t affinity;
} enemy_stat_t;
/* enemy_t: Static enemy information */
typedef struct {
/* Enemy name (showed in wave information) */
char const *name;
/* Map hitbox (represents ground size, collides with walls) */
frect_t hitbox;
/* Sprite hitbox (interacts with attacks and effect areas) */
frect_t sprite;
/* Idle animation, death animation */
anim_frame_t *anim_idle[2], *anim_death[2];
/* Movement parameters */
entity_movement_params_t movement_params;
/* Statistics model */
enemy_stat_t HP, ATK, DEF;
} enemy_t;
/* List of enemies */
enum {
/* ID 0 is used for the player! */
ENEMY_SLIME = 1,
ENEMY_BAT = 2,
};
/* Array of enemy data */
extern enemy_t const * const enemies[];
/* Create a new enemy of the given type. */
entity_t *enemy_spawn(int enemy_id, int level);