]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_instagib.qc
Merge branch 'maint' (early part)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_instagib.qc
index 14a8c6bcb5ecf639f9a0bd08fc49b15306fc3beb..4c384c0e9384a18b589d4dd7310a1ec30430e4ed 100644 (file)
@@ -5,47 +5,7 @@
 #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
+#include "../../common/items/all.qc"
 
 void spawnfunc_item_minst_cells (void)
 {
@@ -164,7 +124,7 @@ MUTATOR_HOOKFUNCTION(instagib_MonsterLoot)
 MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn)
 {
        // always refill ammo
-       if(self.monsterid == MON_MAGE)
+       if(self.monsterid == MON_MAGE.monsterid)
                self.skin = 1;
 
        return false;
@@ -330,7 +290,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                frag_mirrordamage = 0;
        }
 
-       if((frag_target.buffs & BUFF_INVISIBLE) || (frag_target.items & IT_STRENGTH))
+       if((frag_target.buffs & BUFF_INVISIBLE.m_itemid) || (frag_target.items & IT_STRENGTH))
                yoda = 1;
 
        return false;
@@ -445,7 +405,7 @@ MUTATOR_HOOKFUNCTION(instagib_ItemTouch)
 MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn)
 {
        if (!autocvar_g_powerups) { return false; }
-       if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega"))
+       if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.itemdef == ITEM_HealthMega))
                return false;
 
        entity e = spawn();