]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/jetpack.qc
Simplify item definitions
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / jetpack.qc
index 45a256b1bbe4919876e2288a90ee9dd5b3467acc..ad4ab2d0df48bf0c95b653dd778f1c0ad882495e 100644 (file)
@@ -3,54 +3,40 @@
     #include "../../../server/constants.qh"
 #endif
 
-#define WITH(it) this.m_##it;
-#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
-#define DEFINE(id) REGISTER_ITEM(id, Pickup, )
-
-DEFINE(Jetpack) {
-    APPLY(CONFIGURE
-    ,   model               =   "models/items/g_jetpack.md3"
-    ,   name                =   "Jet pack"
-    )
-    IF(SV, CONFIGURE
-    ,   botvalue            =   BOT_PICKUP_RATING_LOW
-    ,   itemflags           =   FL_POWERUP
-    ,   itemid              =   IT_JETPACK
-    ,   pickupevalfunc      =   commodity_pickupevalfunc
-    ,   respawntime         =         GET(g_pickup_respawntime_powerup)
-    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
-    )
+REGISTER_ITEM(Jetpack, Pickup) {
+    this.m_model                =   "models/items/g_jetpack.md3";
+    this.m_name                 =   "Jet pack";
+#ifdef SVQC
+    this.m_botvalue             =   BOT_PICKUP_RATING_LOW;
+    this.m_itemflags            =   FL_POWERUP;
+    this.m_itemid               =   IT_JETPACK;
+    this.m_pickupevalfunc       =   commodity_pickupevalfunc;
+    this.m_respawntime          =   GET(g_pickup_respawntime_powerup);
+    this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_powerup);
+#endif
 }
 
-DEFINE(JetpackFuel) {
-    APPLY(CONFIGURE
-    ,   model               =   "models/items/g_fuel.md3"
-    ,   name                =   "Fuel"
-    )
-    IF(SV, CONFIGURE
-    ,   botvalue            =   BOT_PICKUP_RATING_LOW
-    ,   itemid              =   IT_FUEL
-    ,   pickupevalfunc      =   commodity_pickupevalfunc
-    ,   respawntime         =         GET(g_pickup_respawntime_ammo)
-    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_ammo)
-    )
+REGISTER_ITEM(JetpackFuel, Pickup) {
+    this.m_model                =   "models/items/g_fuel.md3";
+    this.m_name                 =   "Fuel";
+#ifdef SVQC
+    this.m_botvalue             =   BOT_PICKUP_RATING_LOW;
+    this.m_itemid               =   IT_FUEL;
+    this.m_pickupevalfunc       =   commodity_pickupevalfunc;
+    this.m_respawntime          =   GET(g_pickup_respawntime_ammo);
+    this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_ammo);
+#endif
 }
 
-DEFINE(JetpackRegen) {
-    APPLY(CONFIGURE
-    ,   model               =   "models/items/g_fuelregen.md3"
-    ,   name                =   "Fuel regenerator"
-    )
-    IF(SV, CONFIGURE
-    ,   botvalue            =   BOT_PICKUP_RATING_LOW
-    ,   itemflags           =   FL_POWERUP
-    ,   itemid              =   IT_FUEL_REGEN
-    ,   pickupevalfunc      =   commodity_pickupevalfunc
-    ,   respawntime         =         GET(g_pickup_respawntime_powerup)
-    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
-    )
+REGISTER_ITEM(JetpackRegen, Pickup) {
+    this.m_model                =   "models/items/g_fuelregen.md3";
+    this.m_name                 =   "Fuel regenerator";
+#ifdef SVQC
+    this.m_botvalue             =   BOT_PICKUP_RATING_LOW;
+    this.m_itemflags            =   FL_POWERUP;
+    this.m_itemid               =   IT_FUEL_REGEN;
+    this.m_pickupevalfunc       =   commodity_pickupevalfunc;
+    this.m_respawntime          =   GET(g_pickup_respawntime_powerup);
+    this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_powerup);
+#endif
 }
-
-#undef WITH
-#undef CONFIGURE
-#undef DEFINE