]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/armor.qc
Replace `IF(ALL,` with `APPLY(`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / armor.qc
1 #include "armor.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, Armor, MAP(IDENTITY, __VA_ARGS__))
9
10 DEFINE(ArmorSmall
11     ,APPLY(CONFIGURE
12     ,   model               =   "models/items/item_armor_small.md3"
13     ,   sound               =   "misc/armor1.wav"
14     ,   name                =   "5 Armor"
15     )
16     ,IF(SV, CONFIGURE
17     ,   botvalue            =   BOT_PICKUP_RATING_LOW
18     ,   itemid              =   IT_ARMOR_SHARD
19     ,   respawntime         =         GET(g_pickup_respawntime_short)
20     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_short)
21     )
22 )
23
24 DEFINE(ArmorMedium
25     ,APPLY(CONFIGURE
26     ,   model               =   "models/items/item_armor_medium.md3"
27     ,   sound               =   "misc/armor10.wav"
28     ,   name                =   "25 Armor"
29     )
30     ,IF(SV, CONFIGURE
31     ,   botvalue            =   BOT_PICKUP_RATING_MID
32     ,   itemid              =   IT_ARMOR
33     ,   respawntime         =         GET(g_pickup_respawntime_medium)
34     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_medium)
35     )
36 )
37
38 DEFINE(ArmorBig
39     ,APPLY(CONFIGURE
40     ,   model               =   "models/items/item_armor_big.md3"
41     ,   sound               =   "misc/armor17_5.wav"
42     ,   name                =   "50 Armor"
43     )
44     ,IF(SV, CONFIGURE
45     ,   botvalue            =   20000 // FIXME: higher than BOT_PICKUP_RATING_HIGH?
46     ,   itemid              =   IT_ARMOR
47     ,   respawntime         =         GET(g_pickup_respawntime_long)
48     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_long)
49     )
50 )
51
52 DEFINE(ArmorLarge
53     ,APPLY(CONFIGURE
54     ,   model               =   "models/items/item_armor_large.md3"
55     ,   sound               =   "misc/armor25.wav"
56     ,   name                =   "100 Armor"
57     )
58     ,IF(SV, CONFIGURE
59     ,   botvalue            =   BOT_PICKUP_RATING_HIGH
60     ,   itemid              =   IT_ARMOR
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