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_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;
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);
+
+ /*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.move_movetype == MOVETYPE_PHYSICS)
{
entity farcent = new(farce);