implement shooting gunturrets
[rofl0r-openDOW.git] / enemy.h
blob898b44004730ccb7fd7d096a08d5fb55e8fd99f6
1 #ifndef ENEMY_H
2 #define ENEMY_H
4 #include "direction.h"
5 #include <stdint.h>
7 enum __attribute__ ((__packed__)) enemy_shape {
8 ES_INVALID = 0,
9 ES_FIRST = 1,
10 ES_SOLDIER1_DOWN = ES_FIRST,
11 ES_SOLDIER1_LEFT,
12 ES_SOLDIER1_RIGHT,
13 ES_SOLDIER2_DOWN,
14 ES_SOLDIER2_LEFT,
15 ES_SOLDIER2_RIGHT,
16 ES_GUNTURRET_MOVABLE_MAN,
17 ES_GUNTURRET_MOVABLE_MACHINE,
18 ES_JEEP,
19 ES_TANK_SMALL,
20 ES_TANK_BIG,
21 ES_TRANSPORTER,
22 ES_BUNKER_1,
23 ES_BUNKER_2,
24 ES_BUNKER_3,
25 ES_BUNKER_4,
26 ES_BUNKER_5,
27 ES_MINE_FLAT,
28 ES_MINE_CROSS,
29 ES_FLAMETURRET,
30 ES_GUNTURRET_FIXED_SOUTH,
31 ES_GUNTURRET_FIXED_NORTH,
32 ES_BOSS,
33 ES_MAX,
36 // shotdirection is derived from the shape
38 enum __attribute__ ((__packed__)) enemy_type {
39 ET_WESTERN = 0,
40 ET_ASIAN,
43 enum __attribute__ ((__packed__)) enemy_weapon {
44 EW_GUN = 0,
45 EW_GRENADE,
48 struct enemy_route {
49 uint8_t start_step;
50 enum direction16 dir;
51 uint8_t vel;
52 enum enemy_shape shape;
55 #define ENEMY_MAX_ROUTE 8
56 #define ENEMY_MAX_SHOT 8
58 struct enemy_spawn {
59 uint8_t scroll_line;
60 enum enemy_weapon weapon;
61 int16_t x;
62 int16_t y;
63 struct enemy_route route[ENEMY_MAX_ROUTE];
64 uint8_t shots[ENEMY_MAX_SHOT];
67 struct enemy_spawn_screen {
68 uint16_t num_spawns;
69 const struct enemy_spawn *spawns;
72 struct enemy {
73 int curr_step;
74 const struct enemy_spawn* spawn;
78 #endif