// relink entity (because solid may have changed)
setorigin(e, e.origin);
+ e.SendFlags |= ISF_STATUS;
}
+float it_armor_large_time;
+float it_health_mega_time;
+float it_invisible_time;
+float it_speed_time;
+float it_extralife_time;
+float it_strength_time;
+float it_shield_time;
+float it_fuelregen_time;
+float it_jetpack_time;
+float it_superweapons_time;
+
+void Item_ItemsTime_Init()
+{
+ it_armor_large_time = -1;
+ it_health_mega_time = -1;
+ it_invisible_time = -1;
+ it_speed_time = -1;
+ it_extralife_time = -1;
+ it_strength_time = -1;
+ it_shield_time = -1;
+ it_fuelregen_time = -1;
+ it_jetpack_time = -1;
+ it_superweapons_time = -1;
+}
+void Item_ItemsTime_Reset()
+{
+ it_armor_large_time = (it_armor_large_time == -1) ? -1 : 0;
+ it_health_mega_time = (it_health_mega_time == -1) ? -1 : 0;
+ it_invisible_time = (it_invisible_time == -1) ? -1 : 0;
+ it_speed_time = (it_speed_time == -1) ? -1 : 0;
+ it_extralife_time = (it_extralife_time == -1) ? -1 : 0;
+ it_strength_time = (it_strength_time == -1) ? -1 : 0;
+ it_shield_time = (it_shield_time == -1) ? -1 : 0;
+ it_fuelregen_time = (it_fuelregen_time == -1) ? -1 : 0;
+ it_jetpack_time = (it_jetpack_time == -1) ? -1 : 0;
+ it_superweapons_time= (it_superweapons_time== -1) ? -1 : 0;
+}
+void Item_ItemsTime_ResetForPlayer(entity e)
+{
+ e.item_armor_large_time = (it_armor_large_time == -1) ? -1 : 0;
+ e.item_health_mega_time = (it_health_mega_time == -1) ? -1 : 0;
+ e.item_invisible_time = (it_invisible_time == -1) ? -1 : 0;
+ e.item_speed_time = (it_speed_time == -1) ? -1 : 0;
+ e.item_extralife_time = (it_extralife_time == -1) ? -1 : 0;
+ e.item_strength_time = (it_strength_time == -1) ? -1 : 0;
+ e.item_shield_time = (it_shield_time == -1) ? -1 : 0;
+ e.item_fuelregen_time = (it_fuelregen_time == -1) ? -1 : 0;
+ e.item_jetpack_time = (it_jetpack_time == -1) ? -1 : 0;
+ e.item_superweapons_time= (it_superweapons_time== -1) ? -1 : 0;
+}
+void Item_ItemsTime_Get(entity e)
+{
+ e.item_armor_large_time = it_armor_large_time;
+ e.item_health_mega_time = it_health_mega_time;
+ e.item_invisible_time = it_invisible_time;
+ e.item_speed_time = it_speed_time;
+ e.item_extralife_time = it_extralife_time;
+ e.item_strength_time = it_strength_time;
+ e.item_shield_time = it_shield_time;
+ e.item_fuelregen_time = it_fuelregen_time;
+ e.item_jetpack_time = it_jetpack_time;
+ e.item_superweapons_time = it_superweapons_time;
+}
+float Item_ItemsTime_UpdateTime_Check(float item_time, float t)
+{
+ if(t == 0 && item_time == -1)
+ return TRUE;
+ if(time < t && (item_time <= time || t < item_time))
+ return TRUE;
+ return FALSE;
+}
+void Item_ItemsTime_UpdateTime(entity e, float t)
+{
+ if(g_minstagib)
+ {
+ switch(e.items)
+ {
+ case IT_STRENGTH://"item-invis"
+ if(Item_ItemsTime_UpdateTime_Check(it_invisible_time, t))
+ it_invisible_time = t;
+ break;
+ case IT_NAILS://"item-extralife"
+ if(Item_ItemsTime_UpdateTime_Check(it_extralife_time, t))
+ it_extralife_time = t;
+ break;
+ case IT_INVINCIBLE://"item-speed"
+ if(Item_ItemsTime_UpdateTime_Check(it_speed_time, t))
+ it_speed_time = t;
+ break;
+ }
+ }
+ else
+ {
+ switch(e.items)
+ {
+ case IT_HEALTH:
+ //if (e.classname == "item_health_mega")
+ if(Item_ItemsTime_UpdateTime_Check(it_health_mega_time, t))
+ it_health_mega_time = t;
+ break;
+ case IT_ARMOR:
+ if (e.classname == "item_armor_large")
+ if(Item_ItemsTime_UpdateTime_Check(it_armor_large_time, t))
+ it_armor_large_time = t;
+ break;
+ case IT_STRENGTH://"item-strength"
+ if(Item_ItemsTime_UpdateTime_Check(it_strength_time, t))
+ it_strength_time = t;
+ break;
+ case IT_INVINCIBLE://"item-shield"
+ if(Item_ItemsTime_UpdateTime_Check(it_shield_time, t))
+ it_shield_time = t;
+ break;
+ default:
+ if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if(Item_ItemsTime_UpdateTime_Check(it_superweapons_time, t))
+ it_superweapons_time = t;
+ }
+ }
+ switch(e.items)
+ {
+ case IT_FUEL_REGEN://"item-fuelregen"
+ if(Item_ItemsTime_UpdateTime_Check(it_fuelregen_time, t))
+ it_fuelregen_time = t;
+ break;
+ case IT_JETPACK://"item-jetpack"
+ if(Item_ItemsTime_UpdateTime_Check(it_jetpack_time, t))
+ it_jetpack_time = t;
+ break;
+ }
+}
+void Item_ItemsTime_GetForAll()
+{
+ entity e;
+ if(inWarmupStage)
+ {
+ FOR_EACH_REALCLIENT(e)
+ Item_ItemsTime_Get(e);
+ }
+ else
+ {
+ FOR_EACH_REALCLIENT(e)
+ {
+ if (e.classname != "player")
+ Item_ItemsTime_Get(e);
+ }
+ }
+}
+
void Item_Respawn (void)
{
+ float t;
+ entity head;
Item_Show(self, 1);
if(!g_minstagib && self.items == IT_STRENGTH)
sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound