]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/powerup.qc
f10a97e54ff8770b2660ecad293f5cc70d0a67b0
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / powerup.qc
1 #include "powerup.qh"
2 #include "../../../server/t_items.qh"
3
4 #define WITH(it) this.m_##it;
5 #define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
6 #define DEFINE(id, ...)                                                     \
7     REGISTER_ITEM(id, Ammo, LAMBDA(                                         \
8         IF(SV, CONFIGURE                                                    \
9         ,   botvalue            =   100000                                  \
10         ,   itemflags           =   FL_POWERUP                              \
11         ,   respawntime         =         GET(g_pickup_respawntime_powerup) \
12         ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup) \
13         )                                                                   \
14         UNWORDS(__VA_ARGS__)                                          \
15     ))
16
17 DEFINE(Strength
18     ,APPLY(CONFIGURE
19     ,   model               =   "models/items/g_strength.md3"
20     ,   sound               =   "misc/powerup.wav"
21     ,   name                =   "Strength Powerup"
22     )
23     ,IF(SV, CONFIGURE
24     ,   itemid              =   IT_STRENGTH
25     )
26 )
27 DEFINE(Shield
28     ,APPLY(CONFIGURE
29     ,   model               =   "models/items/g_invincible.md3"
30     ,   sound               =   "misc/powerup_shield.wav"
31     ,   name                =   "Shield"
32     )
33     ,IF(SV, CONFIGURE
34     ,   itemid              =   IT_INVINCIBLE
35     )
36 )
37
38 #undef WITH
39 #undef CONFIGURE
40 #undef DEFINE