common.h (1011B)
1 #include <stdint.h> 2 #include <stddef.h> 3 4 #define MAXLEVELWIDTH 15 5 #define MAXLEVELHEIGHT 15 6 #define MAXACTORS 128 7 8 typedef uint8_t u8; 9 typedef uint16_t u16; 10 typedef uint32_t u32; 11 typedef uint64_t u64; 12 13 enum { 14 TILE_NULL, 15 TILE_FLOOR, 16 TILE_WALL, 17 TILE_DOOR_CLOSED, 18 TILE_DOOR_OPEN 19 }; 20 21 typedef struct { 22 u32 x, y; 23 } Actor; 24 25 /* 26 * NOTE: A door can be locked and open at the same time! 27 * The effect would be that the door must be unlocked before 28 * it can be closed. Yes, this is the type of granularity 29 * that I want to implement. 30 */ 31 enum { 32 DOOR_HAS_LOCK, 33 DOOR_LOCK_ENGAGED 34 }; 35 36 void input_handle(void); 37 38 typedef struct { 39 u8 grace, lore, perception, charisma; 40 u32 abilities; 41 u8 name[64]; 42 } Thief; 43 44 u8 bandit_actor_think(void); 45 u32 tile_index(u32 x, u32 y); 46 47 void message_push(char *str); 48 u8 bandit_time_advance(void); 49 u8 bandit_actor_place(u32 in, u32 x, u32 y); 50 void bandit_action_interact(u32 x, u32 y); 51 void bandit_action(u32 choice); 52 53 void curses_input_handle(void);