]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/ammo.qc
Replace `IF(ALL,` with `APPLY(`
[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         MAP(IDENTITY, __VA_ARGS__)                                      \
15     ))
16
17 DEFINE(Bullets
18     ,APPLY(CONFIGURE
19     ,   model               =   "models/items/a_bullets.mdl"
20     ,   name                =   "bullets"
21     )
22     ,IF(SV, CONFIGURE
23     ,   botvalue            =   2000
24     ,   itemid              =   IT_NAILS
25     )
26 )
27 DEFINE(Cells
28     ,APPLY(CONFIGURE
29     ,   model               =   "models/items/a_cells.md3"
30     ,   name                =   "cells"
31     )
32     ,IF(SV, CONFIGURE
33     ,   botvalue            =   2000
34     ,   itemid              =   IT_CELLS
35     )
36 )
37 DEFINE(Plasma
38     ,APPLY(CONFIGURE
39     ,   model               =   "models/items/a_cells.md3"
40     ,   name                =   "plasma"
41     )
42     ,IF(SV, CONFIGURE
43     ,   botvalue            =   2000
44     ,   itemid              =   IT_PLASMA
45     )
46 )
47 DEFINE(Rockets
48     ,APPLY(CONFIGURE
49     ,   model               =   "models/items/a_rockets.md3"
50     ,   name                =   "rockets"
51     )
52     ,IF(SV, CONFIGURE
53     ,   botvalue            =   3000
54     ,   itemid              =   IT_ROCKETS
55     )
56 )
57 DEFINE(Shells
58     ,APPLY(CONFIGURE
59     ,   model               =   "models/items/a_shells.md3"
60     ,   name                =   "shells"
61     )
62     ,IF(SV, CONFIGURE
63     ,   botvalue            =   500
64     ,   itemid              =   IT_SHELLS
65     )
66 )
67
68 #undef WITH
69 #undef CONFIGURE
70 #undef DEFINE