Many fixes and adaptations to the Accuracy Stats window, and get the Grabber to prope...
[voretournament/voretournament.git] / data / qcsrc / common / items.qh
1 float BOT_PICKUP_RATING_LOW     = 2500;\r
2 float BOT_PICKUP_RATING_MID     = 5000;\r
3 float BOT_PICKUP_RATING_HIGH    = 10000;\r
4 \r
5 float WEP_TYPE_OTHER    = 0x00; // e.g: Grabber, etc\r
6 float WEP_TYPE_SPLASH   = 0x01;\r
7 float WEP_TYPE_HITSCAN  = 0x02;\r
8 float WEP_TYPEMASK      = 0x0F;\r
9 float WEP_FLAG_CANCLIMB = 0x10;\r
10 float WEP_FLAG_NORMAL   = 0x20;\r
11 float WEP_FLAG_HIDDEN   = 0x40;\r
12 \r
13 float   IT_UNLIMITED_WEAPON_AMMO  = 1;\r
14 // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.\r
15 float   IT_UNLIMITED_SUPERWEAPONS = 2;\r
16 // when this bit is set, using a superweapon does not throw it away. Checkpoints can give this powerup.\r
17 float   IT_CTF_SHIELDED           = 4; // set for the flag shield\r
18 // using jetpack\r
19 float   IT_USING_JETPACK          = 8; // confirmation that button is pressed\r
20 float   IT_JETPACK                = 16; // actual item\r
21 float   IT_FUEL_REGEN             = 32; // fuel regeneration trigger\r
22 float   IT_SUPERWEAPON                  = 4096;\r
23 float   IT_FUEL                                 = 128;\r
24 float   IT_STRENGTH                             = 8192;\r
25 float   IT_INVINCIBLE                   = 16384;\r
26 float   IT_HEALTH                               = 32768;\r
27 // union:\r
28         // for items:\r
29         float   IT_KEY1                                 = 131072;\r
30         float   IT_KEY2                                 = 262144;\r
31         // for players:\r
32         float   IT_RED_FLAG_TAKEN               = 32768;\r
33         float   IT_RED_FLAG_LOST                = 65536;\r
34         float   IT_RED_FLAG_CARRING             = 98304;\r
35         float   IT_BLUE_FLAG_TAKEN              = 131072;\r
36         float   IT_BLUE_FLAG_LOST               = 262144;\r
37         float   IT_BLUE_FLAG_CARRING    = 393216;\r
38 // end\r
39 float   IT_5HP                                  = 524288;\r
40 float   IT_25HP                                 = 1048576;\r
41 float   IT_ARMOR_SHARD                  = 2097152;\r
42 float   IT_ARMOR                                = 4194304; // armor is not used in Vore Tournament by default, but still exists for mods that might want it\r
43 \r
44 float   IT_AMMO                                 = 8064; // IT_FUEL;\r
45 float   IT_PICKUPMASK           = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately\r
46 float   IT_UNLIMITED_AMMO       = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;\r
47 \r
48 // variables:\r
49 string weaponpriority_hudselector_0;\r
50 string weaponpriority_hudselector_1;\r
51 \r
52 // functions:\r
53 entity get_weaponinfo(float id);\r
54 string W_FixWeaponOrder(string order, float complete);\r
55 string W_NameWeaponOrder(string order);\r
56 string W_NumberWeaponOrder(string order);\r
57 \r
58 // entity properties of weaponinfo:\r
59 .float weapon; // WEP_...\r
60 .float weapons; // WEPBIT_...\r
61 .string netname; // short name\r
62 .string message; // human readable name\r
63 .float items; // IT_...\r
64 .float(float) weapon_func; // w_...\r
65 .string mdl; // modelname without g_, v_, w_\r
66 .string model; // full name of g_ model\r
67 .float spawnflags; // WEPSPAWNFLAG_... combined\r
68 .float impulse; // weapon impulse\r
69 .float bot_pickupbasevalue; // bot weapon priority\r
70 .string model2; // wpn- sprite name\r
71 \r
72 \r
73 \r
74 // dynamic weapon adding\r
75 float w_null(float dummy);\r
76 void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);\r
77 void register_weapons_done();\r
78 \r
79 float WEP_COUNT;\r
80 float WEP_FIRST = 1;\r
81 float WEP_LAST;\r
82 #define WEP_MAXCOUNT 24\r
83 float WEPBIT_ALL;\r
84 #define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \\r
85         float id; \\r
86         float bit; \\r
87         float func(float); \\r
88         void RegisterWeapons_##id() \\r
89         { \\r
90                 WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \\r
91                 WEPBIT_ALL |= (bit = power2of(WEP_COUNT)); \\r
92                 ++WEP_COUNT; \\r
93                 register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \\r
94         } \\r
95         ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)\r
96 #ifdef SVQC\r
97 #define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \\r
98         REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)\r
99 #else\r
100 #define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \\r
101         REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)\r
102 #endif\r
103 \r
104 #include "../server/w_all.qc"\r
105 \r
106 #undef REGISTER_WEAPON\r
107 ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done)\r