#include "constants.qh"
#include <common/deathtypes/all.qh>
- #include <common/notifications.qh>
+ #include <common/notifications/all.qh>
#include "triggers/subs.qh"
#include "util.qh"
}
bool Item_ItemsTime_SpectatorOnly(GameItem it);
-bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons);
+bool Item_ItemsTime_Allow(GameItem it);
float Item_ItemsTime_UpdateTime(entity e, float t);
void Item_ItemsTime_SetTime(entity e, float t);
void Item_ItemsTime_SetTimesForAllPlayers();
sound (self, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM); // play respawn sound
setorigin (self, self.origin);
- if (Item_ItemsTime_Allow(self.itemdef, self.weapons))
+ if (Item_ItemsTime_Allow(self.itemdef) || self.weapons & WEPSET_SUPERWEAPONS)
{
float t = Item_ItemsTime_UpdateTime(self, 0);
Item_ItemsTime_SetTime(self, t);
void Item_ScheduleRespawnIn(entity e, float t)
{
- if (Item_ItemsTime_Allow(e.itemdef, e.weapons))
+ // if the respawn time is longer than 10 seconds, show a waypoint, otherwise, just respawn normally
+ if ((Item_ItemsTime_Allow(e.itemdef) || e.weapons & WEPSET_SUPERWEAPONS) && (t - ITEM_RESPAWN_TICKS) > 0)
{
e.think = Item_RespawnCountdown;
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
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)
}
}
+ 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))
{
}
// Savage: used for item garbage-collection
-// TODO: perhaps nice special effect?
void RemoveItem()
{SELFPARAM();
if(wasfreed(self) || !self) { return; }
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);