palpic2png.c: improve, make usable with ppic binary files
[rofl0r-openDOW.git] / enemy.h
blob621db7d4f0184313ad6b22d6114cd65780326275
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,
46 EW_FLAME,
49 struct enemy_route {
50 uint8_t start_step;
51 enum direction16 dir;
52 uint8_t vel;
53 enum enemy_shape shape;
56 #define ENEMY_MAX_ROUTE 8
57 #define ENEMY_MAX_SHOT 8
59 struct enemy_spawn {
60 uint8_t scroll_line;
61 enum enemy_weapon weapon;
62 int16_t x;
63 int16_t y;
64 struct enemy_route route[ENEMY_MAX_ROUTE];
65 uint8_t shots[ENEMY_MAX_SHOT];
68 struct enemy_spawn_screen {
69 uint16_t num_spawns;
70 const struct enemy_spawn *spawns;
73 struct enemy {
74 int curr_step;
75 const struct enemy_spawn* spawn;
79 #endif