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