1 enum { 2 GOODIE, 3 BADDIE, 4 NEUTRAL, 5 ITEM, 6 PROJECTILE, 7 VIRTUAL, 8 NUM_ENT_CLASSES 9 }; 10 11 12 /* Powerups */ 13 typedef enum { 14 PU_RANDOM, 15 PU_HALF_AMMO_USAGE, 16 PU_DOUBLE_FIRE_RATE, 17 PU_WOUND, 18 PU_RESISTANCE, 19 PU_FROZEN, 20 PU_INVISIBILITY, 21 PU_E, 22 PU_FIXED_WEAPON, 23 PU_SWITCHEROO, 24 NUM_POWERUPS 25 } powerup_t; 26 27 /* Things items can do to the thing that picked them up */ 28 typedef enum { 29 HEAL, 30 FULLHEAL, 31 GIVEWEAPON, 32 GIVEAMMO, 33 GIVEKEY, 34 POWERUP, 35 NUM_ITEM_ACTIONS 36 } item_action_t; 37 38 typedef enum { 39 LIMBO, /* Taken, but to be respawned */ 40 DEAD, 41 DYING, 42 GIBBED, 43 FROZEN, 44 ALIVE, 45 PATROL, 46 FIDGETING, /* Animating */ 47 SLEEP, 48 ATTACK, 49 ENLIGHTENED, 50 COMEDOWN, 51 NUM_ENT_MODES 52 } ent_mode_t; 53 54 typedef enum { 55 AI_NONE, 56 AI_FIGHT, 57 AI_FLEE, 58 AI_SEEK, 59 AI_ROTATE, 60 NUM_AI_MODES 61 } ai_mode_t; 62 63 typedef struct { 64 char pixmap[32]; 65 msec_t framelen; 66 int stationary_ani; 67 int draw_hand; 68 int img_w; 69 int img_h; 70 int arm_x; 71 int arm_y; 72 byte order[4]; 73 byte images; 74 byte directions; 75 byte frames; 76 } animation_t; 77 78 typedef struct entity_type { 79 struct entity_type *next; 80 char *line; 81 int health; 82 int touchdamage; 83 int explosive; 84 int speed; 85 int accel; 86 int width; 87 int height; 88 int draw_weapon; 89 int bleeder; 90 int cliplevel; 91 ent_mode_t mode; 92 char name[32]; 93 /* weapon_name stores the string of the weapon that is either the entities 94 default weapon, OR the weapon the entity gives you if it is a giveweapon 95 item. After the weapon config file is read, the string is matched 96 against found weapons and .weapon or .item_type is set accordingly */ 97 char weapon_name[16]; 98 byte weapon; 99 byte class; 100 101 /* Item stuff */ 102 int item_value; 103 int item_type; 104 msec_t item_respawn_time; 105 item_action_t item_action; 106 powerup_t item_powerup; 107 char *item_pickup_str; /* Told to the client who's entity picked it up */ 108 char *item_announce_str; /* Told to everyone upon item pickup */ 109 110 /* AI stuff */ 111 ai_mode_t ai; 112 int sight; /* How far the enemy can see (used in AI) */ 113 114 /* Dripping stuff */ 115 int dripping; 116 msec_t drip_time; 117 byte drip1, drip2; /* Default dripping colors */ 118 119 /* Animation details */ 120 animation_t *animation[NUM_ENT_MODES]; 121 } ent_type_t; 122 123 byte entity_types(void); 124 /* Creates a table of ent_type_t's of size num_entities */ 125 ent_type_t *entity_type(byte type); 126 animation_t *entity_type_animation(ent_type_t *et, int mode); 127 int match_entity_type(char *name); 128 byte entity_type_init(void); 129