]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/ammo.qc
Merge branch 'terencehill/bot_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qc
index b6f9abcc6eb591102f761c6809f52d15ab7c82a6..16673711eea4b463b17c76d37702148dfa72176b 100644 (file)
@@ -1,73 +1,84 @@
 #include "ammo.qh"
-#include "../../../server/t_items.qh"
+#ifdef SVQC
+    #include "../../../server/t_items.qh"
+#endif
 
-#define WITH(it) this.m_##it;
-#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
-#define DEFINE(id, ...)                                                 \
-    REGISTER_ITEM(id, Ammo, LAMBDA(                                     \
-        IF(SV, CONFIGURE                                                \
-        ,   respawntime         =       GET(g_pickup_respawntime_ammo)  \
-        ,   respawntimejitter   = GET(g_pickup_respawntimejitter_ammo)  \
-        )                                                               \
-        MAP(IDENTITY, __VA_ARGS__)                                      \
-    ))
+#ifndef MENUQC
+MODEL(Bullets_ITEM, Item_Model("a_bullets.mdl"));
+#endif
 
-DEFINE(Bullets
-    ,IF(ALL, CONFIGURE
-    ,   model               =   "models/items/a_bullets.mdl"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "bullets"
-    ,   itemid              =   IT_NAILS
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    )
-)
-DEFINE(Cells
-    ,IF(ALL, CONFIGURE
-    ,   model               =   "models/items/a_cells.md3"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "cells"
-    ,   itemid              =   IT_ROCKETS
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    )
-)
-DEFINE(Plasma
-    ,IF(ALL, CONFIGURE
-    ,   model               =   "models/items/a_cells.md3"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "plasma"
-    ,   itemid              =   IT_ROCKETS
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    )
-)
-DEFINE(Rockets
-    ,IF(ALL, CONFIGURE
-    ,   model               =   "models/items/a_rockets.md3"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "rockets"
-    ,   itemid              =   IT_ROCKETS
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   3000
-    )
-)
-DEFINE(Shells
-    ,IF(ALL, CONFIGURE
-    ,   model               =   "models/items/a_shells.md3"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "shells"
-    ,   itemid              =   IT_SHELLS
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   500
-    )
-)
+REGISTER_ITEM(Bullets, Ammo) {
+#ifndef MENUQC
+    this.m_model    =   MDL_Bullets_ITEM;
+#endif
+    this.m_name     =   "bullets";
+    this.m_icon     =   "ammo_bullets";
+#ifdef SVQC
+    this.m_botvalue =   2000;
+    this.m_itemid   =   IT_NAILS;
+#endif
+}
 
-#undef WITH
-#undef CONFIGURE
-#undef DEFINE
+#ifndef MENUQC
+MODEL(Cells_ITEM, Item_Model("a_cells.md3"));
+#endif
+
+REGISTER_ITEM(Cells, Ammo) {
+#ifndef MENUQC
+    this.m_model    =   MDL_Cells_ITEM;
+#endif
+    this.m_name     =   "cells";
+    this.m_icon     =   "ammo_cells";
+#ifdef SVQC
+    this.m_botvalue =   2000;
+    this.m_itemid   =   IT_CELLS;
+#endif
+}
+
+#ifndef MENUQC
+MODEL(Plasma_ITEM, Item_Model("a_cells.md3"));
+#endif
+
+REGISTER_ITEM(Plasma, Ammo) {
+#ifndef MENUQC
+    this.m_model    =   MDL_Plasma_ITEM;
+#endif
+    this.m_name     =   "plasma";
+    this.m_icon     =   "ammo_plasma";
+#ifdef SVQC
+    this.m_botvalue =   2000;
+    this.m_itemid   =   IT_PLASMA;
+#endif
+}
+
+#ifndef MENUQC
+MODEL(Rockets_ITEM, Item_Model("a_rockets.md3"));
+#endif
+
+REGISTER_ITEM(Rockets, Ammo) {
+#ifndef MENUQC
+    this.m_model    =   MDL_Rockets_ITEM;
+#endif
+    this.m_name     =   "rockets";
+    this.m_icon     =   "ammo_rockets";
+#ifdef SVQC
+    this.m_botvalue =   3000;
+    this.m_itemid   =   IT_ROCKETS;
+#endif
+}
+
+#ifndef MENUQC
+MODEL(Shells_ITEM, Item_Model("a_shells.md3"));
+#endif
+
+REGISTER_ITEM(Shells, Ammo) {
+#ifndef MENUQC
+    this.m_model    =   MDL_Shells_ITEM;
+#endif
+    this.m_name     =   "shells";
+    this.m_icon     =   "ammo_shells";
+#ifdef SVQC
+    this.m_botvalue =   500;
+    this.m_itemid   =   IT_SHELLS;
+#endif
+}