RogueLife/src/enemies.h

59 lines
1.3 KiB
C
Raw Normal View History

2021-06-15 17:27:30 +02:00
//---
// enemies: List of enemies and their properties
//---
#pragma once
#include "comp/entity.h"
#include "comp/mechanical.h"
2021-06-15 17:27:30 +02:00
#include "geometry.h"
#include "anim.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;
2021-06-15 17:27:30 +02:00
/* enemy_t: Static enemy information */
typedef struct
{
/* Enemy name (shown in wave information) */
2021-06-15 17:27:30 +02:00
char const *name;
/* Map hitbox (represents ground size, collides with walls) */
rect hitbox;
2021-08-15 11:05:04 +02:00
/* Idle animation, death animation, damage animation */
2021-12-25 18:21:31 +01:00
anim_t *anim_idle, *anim_walking, *anim_attack, *anim_hit, *anim_death;
2021-06-15 17:27:30 +02:00
/* Movement parameters */
mechanical_limits_t limits;
/* Statistics model */
enemy_stat_t HP, ATK, DEF;
/* Level */
uint8_t level;
/* Shadow size */
uint8_t shadow_size;
/* Rendering elevation */
fixed_t z;
2021-06-15 17:27:30 +02:00
} enemy_t;
/* List of enemies */
enum {
/* ID 0 is used for the player! */
ENEMY_SLIME_1 = 1,
ENEMY_BAT_2 = 2,
ENEMY_GUNSLINGER_8 = 3,
2021-06-15 17:27:30 +02:00
};
2021-12-28 22:23:09 +01:00
/* Get enemy data by ID. */
enemy_t const *enemy_data(int enemy_id);
2021-06-15 17:27:30 +02:00
/* Create a new enemy of the given type. */
entity_t *enemy_make(int enemy_id);