]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/t_items.qc
Add a new key to override the initial item respawn delay
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / t_items.qc
index 0bb3ac1742e0e0991f9f90b5694fb17ef7b4b0ae..876bc6347a5e9cc8c1d4a11decca8b61f6ae4ea3 100644 (file)
@@ -615,7 +615,7 @@ void Item_ScheduleRespawn(entity e)
 void Item_ScheduleInitialRespawn(entity e)
 {
        Item_Show(e, 0);
-       Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
+       Item_ScheduleRespawnIn(e, game_starttime - time + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e)));
 }
 
 float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
@@ -707,6 +707,14 @@ float Item_GiveTo(entity item, entity player)
                }
        }
 
+       if (item.itemdef.instanceOfPowerup)
+       {
+               if ((item.itemdef == ITEM_JetpackRegen) && !(player.items & IT_FUEL_REGEN))
+                       Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_FUELREGEN_GOT);
+               else if ((item.itemdef == ITEM_Jetpack) && !(player.items & IT_JETPACK))
+                       Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_JETPACK_GOT);
+       }
+
        int its;
        if((its = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
        {
@@ -894,7 +902,6 @@ void Item_FindTeam()
 }
 
 // Savage: used for item garbage-collection
-// TODO: perhaps nice special effect?
 void RemoveItem()
 {SELFPARAM();
        if(wasfreed(self) || !self) { return; }
@@ -1529,7 +1536,7 @@ spawnfunc(target_items)
                if(self.ammo_plasma != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_plasma), "plasma");
                if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
                if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
-               if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "armor");
+               if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.armorvalue), "armor");
                FOREACH(Weapons, it != WEP_Null, LAMBDA(self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname)));
        }
        self.netname = strzone(self.netname);