]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/items.qh
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / items.qh
index 269ec2d245ea02cc473e1345cd02aad9b585e598..95f4f3210c6a97c2650ff61317efb5018b509cdf 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-#include <common/items/all.qh>
+#include <common/items/_mod.qh>
 #include <common/items/item/ammo.qh>
 #include <common/items/item/powerup.qh>
 
@@ -9,36 +9,53 @@ float instagib_respawntimejitter_ammo = 0;
 GETTER(float, instagib_respawntime_ammo)
 GETTER(float, instagib_respawntimejitter_ammo)
 
-#ifndef MENUQC
+#ifdef GAMEQC
 MODEL(VaporizerCells_ITEM, Item_Model("a_cells.md3"));
-SOUND(VaporizerCells, "misc/itempickup");
+SOUND(VaporizerCells, Item_Sound("itempickup"));
 #endif
 
+#ifdef SVQC
+int autocvar_g_instagib_ammo_drop;
+void ammo_vaporizercells_init(Pickup this, entity item)
+{
+    if(!item.ammo_cells)
+        item.ammo_cells = autocvar_g_instagib_ammo_drop;
+}
+#endif
 REGISTER_ITEM(VaporizerCells, Ammo) {
-#ifndef MENUQC
+    this.m_canonical_spawnfunc = "item_vaporizer_cells";
+#ifdef GAMEQC
+    this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
     this.m_model                =   MDL_VaporizerCells_ITEM;
     this.m_sound                =   SND_VaporizerCells;
 #endif
+    this.netname                =   "vaporizer_cells";
     this.m_name                 =   "Vaporizer Ammo";
     this.m_icon                 =   "ammo_supercells";
 #ifdef SVQC
-    this.m_botvalue             =   100;
+    this.m_botvalue             =   2000;
     this.m_itemid               =   IT_CELLS;
     this.m_respawntime          =   GET(instagib_respawntime_ammo);
     this.m_respawntimejitter    =   GET(instagib_respawntimejitter_ammo);
+    this.m_iteminit             =   ammo_vaporizercells_init;
 #endif
 }
 
-#ifndef MENUQC
+SPAWNFUNC_ITEM(item_vaporizer_cells, ITEM_VaporizerCells)
+SPAWNFUNC_ITEM(item_minst_cells, ITEM_VaporizerCells)
+
+#ifdef GAMEQC
 MODEL(ExtraLife_ITEM, Item_Model("g_h100.md3"));
-SOUND(ExtraLife, "misc/megahealth");
+SOUND(ExtraLife, Item_Sound("megahealth"));
 #endif
 
 REGISTER_ITEM(ExtraLife, Powerup) {
-#ifndef MENUQC
-    this.m_model                =   MDL_ExtraLife_ITEM;
+    this.m_canonical_spawnfunc = "item_extralife";
+#ifdef GAMEQC
+       this.m_model                =   MDL_ExtraLife_ITEM;
     this.m_sound                =   SND_ExtraLife;
 #endif
+    this.netname                =   "extralife";
     this.m_name                 =   "Extra life";
     this.m_icon                 =   "item_mega_health";
     this.m_color                =   '1 0 0';
@@ -47,38 +64,74 @@ REGISTER_ITEM(ExtraLife, Powerup) {
     this.m_itemid               =   IT_NAILS;
 }
 
-#ifndef MENUQC
+SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife)
+
+#ifdef GAMEQC
 MODEL(Invisibility_ITEM, Item_Model("g_strength.md3"));
-SOUND(Invisibility, "misc/powerup");
+SOUND(Invisibility, Item_Sound("powerup"));
+#endif
+
+#ifdef SVQC
+/// \brief Initializes the invisibility powerup.
+/// \param[in,out] item Item to initialize.
+/// \return No return.
+void powerup_invisibility_init(Pickup this, entity item);
 #endif
 
 REGISTER_ITEM(Invisibility, Powerup) {
-#ifndef MENUQC
+    this.m_canonical_spawnfunc = "item_invisibility";
+#ifdef GAMEQC
+       this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
     this.m_model            =   MDL_Invisibility_ITEM;
     this.m_sound            =   SND_Invisibility;
+    this.m_glow             =   true;
+    this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
 #endif
+    this.netname            =   "invisibility";
     this.m_name             =   "Invisibility";
     this.m_icon             =   "strength";
     this.m_color            =   '0 0 1';
     this.m_waypoint         =   _("Invisibility");
     this.m_waypointblink    =   2;
     this.m_itemid           =   IT_STRENGTH;
+#ifdef SVQC
+    this.m_iteminit         =   powerup_invisibility_init;
+#endif
 }
 
-#ifndef MENUQC
+SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
+
+#ifdef GAMEQC
 MODEL(Speed_ITEM, Item_Model("g_invincible.md3"));
-SOUND(Speed, "misc/powerup_shield");
+SOUND(Speed, Item_Sound("powerup_shield"));
+#endif
+
+#ifdef SVQC
+/// \brief Initializes the speed powerup.
+/// \param[in,out] item Item to initialize.
+/// \return No return.
+void powerup_speed_init(Pickup this, entity item);
 #endif
 
 REGISTER_ITEM(Speed, Powerup) {
-#ifndef MENUQC
+    this.m_canonical_spawnfunc = "item_speed";
+#ifdef GAMEQC
+       this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
     this.m_model            =   MDL_Speed_ITEM;
     this.m_sound            =   SND_Speed;
+    this.m_glow             =   true;
+    this.m_respawnsound     =   SND_SHIELD_RESPAWN;
 #endif
+    this.netname            =   "speed";
     this.m_name             =   "Speed";
     this.m_icon             =   "shield";
     this.m_color            =   '1 0 1';
     this.m_waypoint         =   _("Speed");
     this.m_waypointblink    =   2;
     this.m_itemid           =   IT_INVINCIBLE;
+#ifdef SVQC
+    this.m_iteminit         =   powerup_speed_init;
+#endif
 }
+
+SPAWNFUNC_ITEM(item_speed, ITEM_Speed)