1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
/*
*
*/
typedef struct ent_struct {
int type; /* ENTITIY_TYPES */
int class; /* ENTITY_CLASS */
int mode; /* ENTITY_MODES */
int x, y;
int x_v, y_v; /* x & y velocity. */
int height;
int width;
int health;
int speed;
int weapon;
int owner_id; /* ent_id of owner (only used for projectiles) */
int dir;
int frame;
int img_no; /* Which image to draw? */
int ent_id;
struct timeval last_frame; /* For animation */
struct ent_struct *next; /* Next in list */
} entity;
/* Keep first of each type the first!!! */
enum ENTITY_TYPES { TUX,
TUX_G,
GOWN,
BSD,
GNU,
VI,
MSCP, /* BADDIES */
MSCP_DIE,
CLIPPY,
CLIPPY_DIE,
TROLL,
FLAMER,
FLAMER_DIE,
COBOL,
COBOL_DIE,
BUG,
BUNNY, /* NEUTRALS */
BUNNY_G, /* Grooming bunny */
BUNNY_HEAD,
BUNNY_DEAD,
BLOOD_SPOT,
CD, /* PROJECTILES */
FIREBALL,
NUKE,
NUKE_CRATE, /* Items */
CAN,
DISK,
NODOZE,
SPOON,
/* KEEP THIS LAST!!!!! */
NUM_ENTITIES
};
#define BADDIE_OFFSET MSCP
#define NEUTRAL_OFFSET BUNNY
#define PROJECTILE_OFFSET CD
#define ITEM_OFFSET NUKE_CRATE
#define NUM_CHARACTER_TYPES PROJECTILE_OFFSET
#define CAN_HEALTH 15
enum ENTITY_MODES { DEAD,
DYING,
GIB,
ALIVE,
GROOMING, /* for bunny */
SLEEP,
ATTACKING };
enum ENTITY_CLASS { GOODIE,
BADDIE,
NEUTRAL,
PROJECTILE,
ITEM };
entity *create_entity(int type);
entity *remove_entity(int ent_id);
void remove_all_entities(void);
|