Replace `MAP(IDENTITY)` with `UNWORDS`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / jetpack.qc
1 #ifdef SVQC
2     #include "../../../server/t_items.qh"
3     #include "../../../server/constants.qh"
4 #endif
5
6 #define WITH(it) this.m_##it;
7 #define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
8 #define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, UNWORDS(__VA_ARGS__))
9
10 DEFINE(Jetpack
11     ,APPLY(CONFIGURE
12     ,   model               =   "models/items/g_jetpack.md3"
13     ,   name                =   "Jet pack"
14     )
15     ,IF(SV, CONFIGURE
16     ,   botvalue            =   BOT_PICKUP_RATING_LOW
17     ,   itemflags           =   FL_POWERUP
18     ,   itemid              =   IT_JETPACK
19     ,   pickupevalfunc      =   commodity_pickupevalfunc
20     ,   respawntime         =         GET(g_pickup_respawntime_powerup)
21     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
22     )
23 )
24
25 DEFINE(JetpackFuel
26     ,APPLY(CONFIGURE
27     ,   model               =   "models/items/g_fuel.md3"
28     ,   name                =   "Fuel"
29     )
30     ,IF(SV, CONFIGURE
31     ,   botvalue            =   BOT_PICKUP_RATING_LOW
32     ,   itemid              =   IT_FUEL
33     ,   pickupevalfunc      =   commodity_pickupevalfunc
34     ,   respawntime         =         GET(g_pickup_respawntime_ammo)
35     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_ammo)
36     )
37 )
38
39 DEFINE(JetpackRegen
40     ,APPLY(CONFIGURE
41     ,   model               =   "models/items/g_fuelregen.md3"
42     ,   name                =   "Fuel regenerator"
43     )
44     ,IF(SV, CONFIGURE
45     ,   botvalue            =   BOT_PICKUP_RATING_LOW
46     ,   itemflags           =   FL_POWERUP
47     ,   itemid              =   IT_FUEL_REGEN
48     ,   pickupevalfunc      =   commodity_pickupevalfunc
49     ,   respawntime         =         GET(g_pickup_respawntime_powerup)
50     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
51     )
52 )
53
54 #undef WITH
55 #undef CONFIGURE
56 #undef DEFINE