set g_buffs -1 "enable buffs (requires buff items or powerups)"
set g_buffs_effects 1 "show particle effects from carried buffs"
set g_buffs_waypoint_distance 1024 "maximum distance at which buff waypoint can be seen from item"
+set g_buffs_pickup_delay 0.7 "cooldown before player can pick up another buff after dropping one"
set g_buffs_randomize 1 "randomize buff type when player drops buff"
set g_buffs_random_lifetime 30 "re-spawn the buff again if it hasn't been touched after this time in seconds"
set g_buffs_random_location 0 "randomize buff location on start and when reset"
if((this.team && DIFF_TEAM(toucher, this))
|| (STAT(FROZEN, toucher))
|| (toucher.vehicle)
+ || (time < toucher.buff_shield)
|| (!this.buff_active)
)
{
Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
player.buffs = 0;
- player.buff_time = 0; // already notified
+ player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
+ //player.buff_time = 0; // already notified
sound(player, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
return true;
}
else
Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
player.buffs = 0;
+ player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
}
}
bool autocvar_g_buffs_effects;
float autocvar_g_buffs_waypoint_distance;
+float autocvar_g_buffs_pickup_delay = 0.7;
bool autocvar_g_buffs_randomize;
float autocvar_g_buffs_random_lifetime;
bool autocvar_g_buffs_random_location;
.float buff_activetime_updated;
.entity buff_waypoint;
.int oldbuffs; // for updating effects
+.float buff_shield; // delay for players to keep them from spamming buff pickups
.entity buff_model; // controls effects (TODO: make csqc)
const vector BUFF_MIN = ('-16 -16 0');