if (!WEP_CVAR(oknex, charge)) return '0 0 0';
float charge = wepent.oknex_charge;
float animlimit = WEP_CVAR(oknex, charge_animlimit);
+ float f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / animlimit);
vector g;
- g.x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, charge / animlimit);
- g.y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, charge / animlimit);
- g.z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, charge / animlimit);
+ g.x = f * autocvar_g_weapon_charge_colormod_red_half;
+ g.y = f * autocvar_g_weapon_charge_colormod_green_half;
+ g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
if (charge > animlimit)
{
- g.x += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (charge - animlimit) / (1 - animlimit);
- g.y += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (charge - animlimit) / (1 - animlimit);
- g.z += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (charge - animlimit) / (1 - animlimit);
+ f = autocvar_g_weapon_charge_colormod_hdrmultiplier * (charge - animlimit) / (1 - animlimit);
+ g.x += f * autocvar_g_weapon_charge_colormod_red_full;
+ g.y += f * autocvar_g_weapon_charge_colormod_green_full;
+ g.z += f * autocvar_g_weapon_charge_colormod_blue_full;
}
return g;
}
if (!WEP_CVAR(vortex, charge)) return '0 0 0';
float charge = wepent.vortex_charge;
float animlimit = WEP_CVAR(vortex, charge_animlimit);
+ float f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / animlimit);
vector g;
- g.x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, charge / animlimit);
- g.y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, charge / animlimit);
- g.z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, charge / animlimit);
+ g.x = f * autocvar_g_weapon_charge_colormod_red_half;
+ g.y = f * autocvar_g_weapon_charge_colormod_green_half;
+ g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
if (charge > animlimit)
{
- g.x += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (charge - animlimit) / (1 - animlimit);
- g.y += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (charge - animlimit) / (1 - animlimit);
- g.z += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (charge - animlimit) / (1 - animlimit);
+ f = autocvar_g_weapon_charge_colormod_hdrmultiplier * (charge - animlimit) / (1 - animlimit);
+ g.x += f * autocvar_g_weapon_charge_colormod_red_full;
+ g.y += f * autocvar_g_weapon_charge_colormod_green_full;
+ g.z += f * autocvar_g_weapon_charge_colormod_blue_full;
}
return g;
}