]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add instagib items
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 12 May 2015 10:27:11 +0000 (20:27 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 12 May 2015 10:27:11 +0000 (20:27 +1000)
qcsrc/server/mutators/mutator_instagib.qc

index 2e6b195809da44ad840071cc7bebe7df1ef54eef..7f97ba131396de1711005ca39a9998059e396a51 100644 (file)
@@ -5,23 +5,61 @@
 #include "../cl_client.qh"
 #include "../../common/buffs.qh"
 
+#include "../../common/items/item.qh"
+
+#define WITH(it) this.m_##it;
+#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
+
+float instagib_respawntime_ammo = 45;
+float instagib_respawntimejitter_ammo = 0;
+GETTER(float, instagib_respawntime_ammo)
+GETTER(float, instagib_respawntimejitter_ammo)
+
+REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
+    ,IF(ALL, CONFIGURE
+    ,   model               =   "models/items/a_cells.md3"
+    ,  sound                           =       "misc/itempickup.wav"
+    ,   name                =   "Vaporizer Ammo"
+    )
+    ,IF(SV, CONFIGURE
+    ,   botvalue            =   100
+    ,   itemid              =   IT_CELLS
+    ,   respawntime         =            GET(instagib_respawntime_ammo)
+    ,   respawntimejitter   =   GET(instagib_respawntimejitter_ammo)
+    )
+))
+
+REGISTER_ITEM(ExtraLife, Pickup, MAP(IDENTITY
+    ,IF(ALL, CONFIGURE
+    ,   model               =   "models/items/g_h100.md3"
+    ,  sound                           =       "misc/megahealth.wav"
+    ,   name                =   "Extralife"
+    )
+    ,IF(SV, CONFIGURE
+    ,   botvalue            =   BOT_PICKUP_RATING_HIGH
+    ,  itemflags                       =       FL_POWERUP
+    ,   itemid              =   IT_NAILS
+    ,   respawntime         =            GET(g_pickup_respawntime_powerup)
+    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
+    )
+))
+
+#undef WITH
+#undef CONFIGURE
+
 void spawnfunc_item_minst_cells (void)
 {
        if (!g_instagib) { remove(self); return; }
        if (!self.ammo_cells)
                self.ammo_cells = autocvar_g_instagib_ammo_drop;
 
-       StartItem ("models/items/a_cells.md3",
-                          "misc/itempickup.wav", 45, 0,
-                          "Vaporizer Ammo", IT_CELLS, 0, 0, generic_pickupevalfunc, 100);
+       StartItemA (ITEM_VaporizerCells);
 }
 
 void instagib_health_mega()
 {
        self.max_health = 1;
-       StartItem ("models/items/g_h100.md3",
-                          "misc/megahealth.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
-                          "Extralife", IT_NAILS, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
+       StartItemA (ITEM_ExtraLife);
 }
 
 .float instagib_nextthink;