// ItemsTime (#17)
//
-const float ITEMSTIME_MAXITEMS = 9;
+const float ITEMSTIME_MAXITEMS = 10;
float ItemsTime_time[ITEMSTIME_MAXITEMS];
string GetItemsTimePicture(float i)
{
case 6: return "shield";
case 7: return "fuelregen";
case 8: return "jetpack";
+ case 9: return "superweapons";
default: return "";
}
}
ItemsTime_time[6] = getstatf(STAT_SHIELD_TIME);
ItemsTime_time[7] = getstatf(STAT_FUELREGEN_TIME);
ItemsTime_time[8] = getstatf(STAT_JETPACK_TIME);
+ ItemsTime_time[9] = getstatf(STAT_SUPERWEAPONS_TIME);
}
else
{
ItemsTime_time[6] = time + 4;
ItemsTime_time[7] = time + 19;
ItemsTime_time[8] = time + 46;
+ ItemsTime_time[9] = time + 28;
}
float i;
float it_shield_time;
float it_fuelregen_time;
float it_jetpack_time;
+float it_superweapons_time;
void Item_ItemsTime_Init()
{
it_shield_time = -1;
it_fuelregen_time = -1;
it_jetpack_time = -1;
+ it_superweapons_time = -1;
}
void Item_ItemsTime_Clear()
{
self.item_shield_time = (it_shield_time == -1) ? -1 : 0;
self.item_fuelregen_time = (it_fuelregen_time == -1) ? -1 : 0;
self.item_jetpack_time = (it_jetpack_time == -1) ? -1 : 0;
+ self.item_superweapons_time= (it_superweapons_time== -1) ? -1 : 0;
}
void Item_ItemsTime_Get(entity e)
{
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(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)
sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
setorigin (self, self.origin);
- if (self.flags & FL_POWERUP || self.classname == "item_armor_large" || self.items == IT_HEALTH)
+ if(self.flags & FL_POWERUP || self.classname == "item_armor_large" || self.items == IT_HEALTH || WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
{
- for(t = 0, head = world; (head = find(head, classname, self.classname)); )
+ if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
{
- // in minstagib .classname is "minstagib" for every item
- if (g_minstagib && self.items != head.items)
- continue;
- if (head.scheduledrespawntime > time)
- if (t == 0 || head.scheduledrespawntime < t)
+ for(t = 0, head = world; (head = nextent(head)); )
+ {
+ if(clienttype(head) == CLIENTTYPE_NOTACLIENT)
+ if(WEPSET_CONTAINS_ANY_EA(head, WEPBIT_SUPERWEAPONS))
+ if(head.scheduledrespawntime > time)
+ if(t == 0 || head.scheduledrespawntime < t)
t = head.scheduledrespawntime;
+ }
}
+ else
+ for(t = 0, head = world; (head = find(head, classname, self.classname)); )
+ {
+ // in minstagib .classname is "minstagib" for every item
+ if(g_minstagib && self.items != head.items)
+ continue;
+ if(head.scheduledrespawntime > time)
+ if(t == 0 || head.scheduledrespawntime < t)
+ t = head.scheduledrespawntime;
+ }
Item_ItemsTime_UpdateTime(self, t);
FOR_EACH_REALCLIENT(head)
{