]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/ammo.qc
Adjust item definition syntax
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qc
1 #include "ammo.qh"
2 #ifdef SVQC
3     #include "../../../server/t_items.qh"
4 #endif
5
6 #define WITH(it) this.m_##it;
7 #define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
8 #define DEFINE(id)                                                      \
9     REGISTER_ITEM(id, Ammo, LAMBDA(                                     \
10         IF(SV, CONFIGURE                                                \
11         ,   respawntime         =       GET(g_pickup_respawntime_ammo)  \
12         ,   respawntimejitter   = GET(g_pickup_respawntimejitter_ammo)  \
13         )                                                               \
14     ))
15
16 DEFINE(Bullets) {
17     APPLY(CONFIGURE
18     ,   model               =   "models/items/a_bullets.mdl"
19     ,   name                =   "bullets"
20     )
21     IF(SV, CONFIGURE
22     ,   botvalue            =   2000
23     ,   itemid              =   IT_NAILS
24     )
25 }
26 DEFINE(Cells) {
27     APPLY(CONFIGURE
28     ,   model               =   "models/items/a_cells.md3"
29     ,   name                =   "cells"
30     )
31     IF(SV, CONFIGURE
32     ,   botvalue            =   2000
33     ,   itemid              =   IT_CELLS
34     )
35 }
36 DEFINE(Plasma) {
37     APPLY(CONFIGURE
38     ,   model               =   "models/items/a_cells.md3"
39     ,   name                =   "plasma"
40     )
41     IF(SV, CONFIGURE
42     ,   botvalue            =   2000
43     ,   itemid              =   IT_PLASMA
44     )
45 }
46 DEFINE(Rockets) {
47     APPLY(CONFIGURE
48     ,   model               =   "models/items/a_rockets.md3"
49     ,   name                =   "rockets"
50     )
51     IF(SV, CONFIGURE
52     ,   botvalue            =   3000
53     ,   itemid              =   IT_ROCKETS
54     )
55 }
56 DEFINE(Shells) {
57     APPLY(CONFIGURE
58     ,   model               =   "models/items/a_shells.md3"
59     ,   name                =   "shells"
60     )
61     IF(SV, CONFIGURE
62     ,   botvalue            =   500
63     ,   itemid              =   IT_SHELLS
64     )
65 }
66
67 #undef WITH
68 #undef CONFIGURE
69 #undef DEFINE