]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/powerup.qc
Adjust item definition syntax
[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     ))
15
16 DEFINE(Strength) {
17     APPLY(CONFIGURE
18     ,   model               =   "models/items/g_strength.md3"
19     ,   sound               =   "misc/powerup.wav"
20     ,   name                =   "Strength Powerup"
21     )
22     IF(SV, CONFIGURE
23     ,   itemid              =   IT_STRENGTH
24     )
25 }
26 DEFINE(Shield) {
27     APPLY(CONFIGURE
28     ,   model               =   "models/items/g_invincible.md3"
29     ,   sound               =   "misc/powerup_shield.wav"
30     ,   name                =   "Shield"
31     )
32     IF(SV, CONFIGURE
33     ,   itemid              =   IT_INVINCIBLE
34     )
35 }
36
37 #undef WITH
38 #undef CONFIGURE
39 #undef DEFINE