1 typedef enum { 2 WT_NONE, 3 WT_PROJECTILE, 4 WT_BULLET, 5 WT_ROCKET, 6 WT_SLUG, 7 WT_BEAM, 8 NUM_WEAPON_CLASSES 9 } weapon_class_t; 10 11 typedef enum { 12 AMMO_INFINITE, 13 AMMO_BULLET, 14 AMMO_SHELL, 15 AMMO_ROCKET, 16 AMMO_SLUG, 17 AMMO_CELL, 18 NUM_AMMO_TYPES 19 } ammo_t; 20 21 22 typedef struct weapon_type { 23 char name[32]; 24 char weapon_image[32]; 25 char weapon_icon[32]; 26 char *obituary; /* String of format "%s was killed by %s" */ 27 weapon_class_t class; /* Used when handling physics etc */ 28 ammo_t ammo_type; 29 short ammo_usage; /* Amount of ammo used per weapon fire */ 30 short initial_ammo; /* Ammo (of type ammo_type) that comes with the gun */ 31 byte projectile; /* projectile is an entity type */ 32 byte spread; 33 int explosion; 34 int splashdamage; 35 int push_factor; 36 int muzzle_flash; 37 int draw_particles; 38 int number; 39 int max_length; 40 int has_weapon_image; 41 int has_weapon_icon; 42 int entstop; /* Stops on entities (default = 1) */ 43 int wallstop; /* Stops on walls (default = 1) */ 44 int damage; 45 int speed; 46 int frames; 47 msec_t reload_time; 48 struct weapon_type *next; 49 } weap_type_t; 50 51 /* Creates a table of ent_type_t's of size num_entities */ 52 weap_type_t *weapon_type(byte type); 53 int match_weapon_type(char *name); 54 byte weapon_type_init(void); 55 ammo_t match_ammo_type(char *ammo); 56