2palpic: whitespace cleanup
[rofl0r-openDOW.git] / weapon.h
blob3376ff067bebbb5e6b9d29480aec55e8f47b89ed
1 #ifndef WEAPON_H
2 #define WEAPON_H
4 #include <stdint.h>
5 #include "wavesounds.h"
7 enum __attribute__((__packed__)) ammo_id {
8 AMMO_45ACP = 0,
9 AMMO_9MMPARABELLUM,
10 AMMO_556,
11 AMMO_762,
12 AMMO_10MM,
13 AMMO_ROCKET83MM,
14 AMMO_ROCKET40MM,
15 AMMO_K200GRENADE40MM,
16 AMMO_GAS,
17 AMMO_GRENADE,
18 AMMO_MAX,
19 AMMO_INVALID = AMMO_MAX
22 struct ammo {
23 int mm;
24 int rounds;
25 int price;
28 enum weapon_flags {
29 WF_AUTOMATIC = 1,
30 WF_MUZZLEFLASH = 2,
33 enum __attribute__((__packed__)) shot_type {
34 ST_BULLET = 0,
35 ST_GRENADE,
36 ST_LAUNCHER,
37 ST_FLAMES,
40 struct weapon {
41 float bullet_speed;
42 uint16_t rpm;
43 uint16_t price;
44 enum ammo_id ammo;
45 enum wavesound_id sound;
46 enum shot_type shot;
47 uint8_t flags;
48 uint8_t range;
51 enum __attribute__((__packed__)) weapon_id {
52 WP_COLT45 = 0,
53 WP_BROWNING,
54 WP_SA80,
55 WP_MP5,
56 WP_UZI,
57 WP_STEYR,
58 WP_AK47,
59 WP_M16A2,
60 WP_M203,
61 WP_RPK,
62 WP_L7A2,
63 WP_HK21,
64 WP_M60,
65 WP_MG42,
66 WP_M134,
67 WP_RPG7,
68 WP_LAW,
69 WP_MAW,
70 WP_ABC,
71 WP_GRENADES,
72 WP_MAX,
73 WP_INVALID = WP_MAX
76 extern const struct weapon weapons[];
77 extern const struct ammo ammunition[];
78 const char* weapon_name(enum weapon_id id);
79 const char* ammo_name(enum ammo_id id);
81 #pragma RcB2 DEP "weapon.c"
83 #endif