set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.15
set g_balance_falldamage_maxdamage 25
set g_balance_damagepush_speedfactor 0
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
-set g_balance_damagepush_scaling_speed_min 700
-set g_balance_damagepush_scaling_speed_max 1300
-set g_balance_damagepush_scaling_factor_slowest 1
-set g_balance_damagepush_scaling_factor_fastest 1
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_damagepush_scaling_speed_min 0 "speed at which reduction_slowest applies"
+set g_balance_damagepush_scaling_speed_max 700 "speed at which reduction_fastest applies"
+set g_balance_damagepush_scaling_reduction_slowest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_reduction_fastest 0 "blaster self-push forward force is reduced by this fraction of original force between reduction_slowest and reduction_fastest scaled linearly"
+set g_balance_damagepush_scaling_sideways 0 "fraction of reduction to apply to sideways pushing"
+set g_balance_damagepush_scaling_vertical 0 "fraction of reduction to apply to vertical pushing"
set g_balance_contents_damagerate 0.2 // ticrate interval for applying damage with playerdamage/projectiledamage
set g_balance_contents_drowndelay 10 // time under water before a player begins drowning
set g_balance_contents_playerdamage_drowning 20 // damage per second for while player is drowning
targ.iceblock = NULL;
}
-// TODO balance cfgs
float autocvar_g_balance_damagepush_scaling_speed_min;
float autocvar_g_balance_damagepush_scaling_speed_max;
-float autocvar_g_balance_damagepush_scaling_factor_slowest;
-float autocvar_g_balance_damagepush_scaling_factor_fastest;
+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;
{
vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
- /*LOG_INFOF("farce %v (%f)\n", farce, vlen(targ.velocity + farce));
- vector velocity_end = targ.origin + targ.velocity / 10;
- vector farce_end = velocity_end + farce / 10;
- te_lightning1(NULL, targ.origin, velocity_end);
- te_lightning1(NULL, velocity_end, farce_end);*/
-
- //float horiz_speed = vlen(vec2(targ.velocity));
- /*float factor = map_bound_ranges(horiz_speed,
- autocvar_g_balance_damagepush_scaling_speed_min, autocvar_g_balance_damagepush_scaling_speed_max,
- autocvar_g_balance_damagepush_scaling_factor_slowest, autocvar_g_balance_damagepush_scaling_factor_fastest);*/
-
- float factor = map_bound_ranges(vlen(targ.velocity + farce),
- autocvar_g_balance_damagepush_scaling_speed_min, autocvar_g_balance_damagepush_scaling_speed_max,
- autocvar_g_balance_damagepush_scaling_factor_slowest, autocvar_g_balance_damagepush_scaling_factor_fastest);
- farce = vec3(farce.x * factor, farce.y * factor, farce.z);
- /*te_lightning1(NULL, targ.origin, targ.origin + farce / 10);
- LOG_INFOF("factor %f - new farce %v (%f)\n", factor, farce, vlen(farce));*/
+ 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)
{