drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((getstatf(STAT_REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * getstatf(STAT_REVIVE_PROGRESS)) + ('0 1 1' * getstatf(STAT_REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
else if (getstatf(STAT_HEALING_ORB)>time)
drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, Nade_Color(NADE_TYPE_HEAL), autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE);
+ if(!intermission)
+ if(getstatf(STAT_NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
+ {
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_NADE_TIMER), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
else if(getstatf(STAT_REVIVE_PROGRESS))
{
DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
_nade.flags = FL_PROJECTILE;
_nade.projectiledeathtype = DEATH_NADE;
_nade.toss_time = time;
- _nade.solid = ((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
+ _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
nade_spawn(_nade);
}
e.nade_refire = time + autocvar_g_nades_nade_refire;
+ e.nade_timer = 0;
}
void nades_GiveBonus(entity player, float score)
{
// somewhat hide the model, but keep the glow
//self.effects = 0;
- self.alpha = -1;
+ //self.alpha = -1;
+ return FALSE; // or not
}
else
{
remove(player.fake_nade);
player.nade = player.fake_nade = world;
+ player.nade_timer = 0;
}
MUTATOR_HOOKFUNCTION(nades_CheckThrow)
if(self.nade)
{
+ self.nade_timer = bound(0, (time - self.nade.lifetime) / autocvar_g_nades_nade_lifetime, 1);
+ //print(sprintf("%d %d\n", self.nade_timer, time - self.nade.lifetime));
makevectors(self.angles);
self.nade.velocity = self.velocity;
if(autocvar_g_nades_bonus_client_select)
self.nade_type = self.cvar_cl_nade_type;
+ self.nade_timer = 0;
+
if(self.nade_spawnloc)
{
setorigin(self, self.nade_spawnloc.origin);
MUTATOR_HOOKFUNCTION(nades_SpectateCopy)
{
+ self.nade_timer = other.nade_timer;
self.nade_type = other.nade_type;
self.pokenade_type = other.pokenade_type;
self.bonus_nades = other.bonus_nades;
void nades_Initialize()
{
+ addstat(STAT_NADE_TIMER, AS_FLOAT, nade_timer);
addstat(STAT_NADE_BONUS, AS_FLOAT, bonus_nades);
addstat(STAT_NADE_BONUS_TYPE, AS_INT, nade_type);
addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
MUTATOR_HOOK(ForbidThrowCurrentWeapon, nades_CheckThrow, CBC_ORDER_LAST);
MUTATOR_HOOK(VehicleEnter, nades_VehicleEnter, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, nades_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_LAST);
+ MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDies, nades_PlayerDies, CBC_ORDER_LAST);
- MUTATOR_HOOK(PlayerDamage_Calculate, nades_PlayerDamage, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(PlayerDamage_Calculate, nades_PlayerDamage, CBC_ORDER_ANY);
MUTATOR_HOOK(MonsterDies, nades_MonsterDies, CBC_ORDER_ANY);
MUTATOR_HOOK(MakePlayerObserver, nades_RemovePlayer, CBC_ORDER_ANY);
MUTATOR_HOOK(ClientDisconnect, nades_RemovePlayer, CBC_ORDER_ANY);