]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/ammo.qc
Do something awesome with macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qc
1 #include "ammo.qh"
2 #include "../../../server/t_items.qh"
3
4 #define WITH(it) this.m_##it;
5
6 #define REGISTER_AMMO(id, ...)                      \
7     REGISTER_ITEM(id, Ammo, LAMBDA({                \
8         MAP(WITH, __VA_ARGS__)                      \
9         this.m_respawntime = SPAWNTIME_AMMO;        \
10         this.m_respawntimejitter = SPAWNTIME_AMMO;  \
11     }))
12
13 REGISTER_AMMO(Bullets
14     , model     = "models/items/a_bullets.mdl"
15     , sound     = "misc/itempickup.wav"
16     , name      = "bullets"
17     , itemid    = IT_NAILS
18     , botvalue  = 2000
19 )
20 REGISTER_AMMO(Cells
21     , model     = "models/items/a_cells.md3"
22     , sound     = "misc/itempickup.wav"
23     , name      = "cells"
24     , itemid    = IT_ROCKETS
25     , botvalue  = 2000
26 )
27 REGISTER_AMMO(Plasma
28     , model     = "models/items/a_cells.md3"
29     , sound     = "misc/itempickup.wav"
30     , name      = "plasma"
31     , itemid    = IT_ROCKETS
32     , botvalue  = 2000
33 )
34 REGISTER_AMMO(Rockets
35     , model     = "models/items/a_rockets.md3"
36     , sound     = "misc/itempickup.wav"
37     , name      = "rockets"
38     , itemid    = IT_ROCKETS
39     , botvalue  = 3000
40 )
41 REGISTER_AMMO(Shells
42     , model     = "models/items/a_shells.md3"
43     , sound     = "misc/itempickup.wav"
44     , name      = "shells"
45     , itemid    = IT_SHELLS
46     , botvalue  = 500
47 )
48
49 #undef WITH