targ.iceblock = NULL;
}
+float autocvar_g_balance_damagepush_scaling_speed_min;
+float autocvar_g_balance_damagepush_scaling_speed_max;
+float autocvar_g_balance_damagepush_scaling_reduction_slowest;
+float autocvar_g_balance_damagepush_scaling_reduction_fastest;
+float autocvar_g_balance_damagepush_scaling_sideways;
+float autocvar_g_balance_damagepush_scaling_vertical;
void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
float complainteamdamage = 0;
if (!IS_PLAYER(targ) || time >= targ.spawnshieldtime || targ == attacker)
{
vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
+
+ if (targ == attacker && DEATH_ISWEAPON(deathtype, WEP_BLASTER)) {
+ if (vec2(targ.velocity) == '0 0 0') {
+ // using vectoangles here would give weird results (v_forward would point up)
+ makevectors(targ.angles);
+ } else {
+ vector horiz_vel = vec2(targ.velocity);
+ makevectors(vectoangles(horiz_vel));
+ }
+
+ // split farce into 3 perpendicular vectors
+ v_forward *= v_forward * farce;
+ v_right *= v_right * farce;
+ v_up *= v_up * farce;
+ //LOG_INFOF("farce vlen %f - sizes: %f %f %f", vlen(farce), vlen(v_forward), vlen(v_right), vlen(v_up));
+
+ float reduction = map_bound_ranges(vlen(targ.velocity),
+ autocvar_g_balance_damagepush_scaling_speed_min, autocvar_g_balance_damagepush_scaling_speed_max,
+ autocvar_g_balance_damagepush_scaling_reduction_slowest, autocvar_g_balance_damagepush_scaling_reduction_fastest);
+ //LOG_INFOF("reduction %f", reduction);
+ v_forward -= reduction * v_forward;
+ v_right -= (reduction * autocvar_g_balance_damagepush_scaling_sideways) * v_right;
+ v_up -= (reduction * autocvar_g_balance_damagepush_scaling_vertical) * v_up;
+ farce = v_forward + v_right + v_up;
+ //LOG_INFOF("farce vlen %f - sizes: %f %f %f", vlen(farce), vlen(v_forward), vlen(v_right), vlen(v_up));
+ }
+
if(targ.move_movetype == MOVETYPE_PHYSICS)
{
entity farcent = new(farce);