Replace `MAP(IDENTITY)` with `UNWORDS`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / health.qc
1 #include "health.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, ...) REGISTER_ITEM(id, Health, UNWORDS(__VA_ARGS__))
9
10 DEFINE(HealthSmall
11     ,APPLY(CONFIGURE
12     ,   model               =   "models/items/g_h1.md3"
13     ,   sound               =   "misc/minihealth.wav"
14     ,   name                =   "5 Health"
15     )
16     ,IF(SV, CONFIGURE
17     ,   botvalue            =   BOT_PICKUP_RATING_LOW
18     ,   itemid              =   IT_5HP
19     ,   respawntime         =         GET(g_pickup_respawntime_short)
20     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_short)
21     )
22 )
23
24 DEFINE(HealthMedium
25     ,APPLY(CONFIGURE
26     ,   model               =   "models/items/g_h25.md3"
27     ,   sound               =   "misc/mediumhealth.wav"
28     ,   name                =   "25 Health"
29     )
30     ,IF(SV, CONFIGURE
31     ,   botvalue            =   BOT_PICKUP_RATING_MID
32     ,   itemid              =   IT_25HP
33     ,   respawntime         =         GET(g_pickup_respawntime_short)
34     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_short)
35     )
36 )
37
38 DEFINE(HealthLarge
39     ,APPLY(CONFIGURE
40     ,   model               =   "models/items/g_h50.md3"
41     ,   sound               =   "misc/mediumhealth.wav"
42     ,   name                =   "50 Health"
43     )
44     ,IF(SV, CONFIGURE
45     ,   botvalue            =   BOT_PICKUP_RATING_MID
46     ,   itemid              =   IT_25HP
47     ,   respawntime         =         GET(g_pickup_respawntime_medium)
48     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_medium)
49     )
50 )
51
52 DEFINE(HealthMega
53     ,APPLY(CONFIGURE
54     ,   model               =   "models/items/g_h100.md3"
55     ,   sound               =   "misc/megahealth.wav"
56     ,   name                =   "100 Health"
57     )
58     ,IF(SV, CONFIGURE
59     ,   botvalue            =   BOT_PICKUP_RATING_HIGH
60     ,   itemid              =   IT_HEALTH
61     ,   respawntime         =         GET(g_pickup_respawntime_long)
62     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_long)
63     )
64 )
65
66 #undef WITH
67 #undef CONFIGURE
68 #undef DEFINE