From 868d143c207023fa68101a26a6235d9869f3069b Mon Sep 17 00:00:00 2001 From: drjaska Date: Tue, 16 May 2023 08:12:58 +0300 Subject: [PATCH] opt-in cvar g_balance_damagepush_speedfactor_onlyself --- balance-mario.cfg | 1 + balance-nexuiz25.cfg | 1 + balance-overkill.cfg | 1 + balance-samual.cfg | 1 + balance-xdf.cfg | 1 + balance-xonotic.cfg | 1 + balance-xpm.cfg | 1 + qcsrc/server/damage.qc | 5 +++-- qcsrc/server/damage.qh | 1 + 9 files changed, 11 insertions(+), 2 deletions(-) diff --git a/balance-mario.cfg b/balance-mario.cfg index 8b9f37ac1..494797e29 100644 --- a/balance-mario.cfg +++ b/balance-mario.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/balance-nexuiz25.cfg b/balance-nexuiz25.cfg index 0b39de222..7824ece78 100644 --- a/balance-nexuiz25.cfg +++ b/balance-nexuiz25.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.15 set g_balance_falldamage_maxdamage 25 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 0 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/balance-overkill.cfg b/balance-overkill.cfg index 3944d7d3b..69c0840ab 100644 --- a/balance-overkill.cfg +++ b/balance-overkill.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/balance-samual.cfg b/balance-samual.cfg index 5686c58d6..d8ab94e8b 100644 --- a/balance-samual.cfg +++ b/balance-samual.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/balance-xdf.cfg b/balance-xdf.cfg index d8d4df60d..6a6e8a1cb 100644 --- a/balance-xdf.cfg +++ b/balance-xdf.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/balance-xonotic.cfg b/balance-xonotic.cfg index a3bda49dc..23f11bf1a 100644 --- a/balance-xonotic.cfg +++ b/balance-xonotic.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 "scale self-damage's force with respect to target's velocity, this creates a speed limit and faster players stop themselves more easily" +set g_balance_damagepush_speedfactor_onlyself 0 "apply only to self inflicted forces" 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 diff --git a/balance-xpm.cfg b/balance-xpm.cfg index 87b781a55..f5249c3f3 100644 --- a/balance-xpm.cfg +++ b/balance-xpm.cfg @@ -220,6 +220,7 @@ set g_balance_falldamage_factor 0.20 set g_balance_falldamage_maxdamage 40 set g_balance_falldamage_onlyvertical 0 set g_balance_damagepush_speedfactor 2.5 +set g_balance_damagepush_speedfactor_onlyself 0 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 diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index c3bdc0459..7adad9428 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -830,8 +830,9 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de if (!IS_PLAYER(targ) || !StatusEffects_active(STATUSEFFECT_SpawnShield, targ) || targ == attacker) { vector farce = targ.damageforcescale * force; - if (attacker == targ && autocvar_g_balance_damagepush_speedfactor) - farce = damage_explosion_calcpush(farce, targ.velocity, autocvar_g_balance_damagepush_speedfactor); + if (autocvar_g_balance_damagepush_speedfactor) + if (!autocvar_g_balance_damagepush_speedfactor_onlyself || (attacker == targ)) + farce = damage_explosion_calcpush(farce, targ.velocity, autocvar_g_balance_damagepush_speedfactor); if(targ.move_movetype == MOVETYPE_PHYSICS) { diff --git a/qcsrc/server/damage.qh b/qcsrc/server/damage.qh index a1dadc1a2..e4a9d0a69 100644 --- a/qcsrc/server/damage.qh +++ b/qcsrc/server/damage.qh @@ -16,6 +16,7 @@ bool autocvar_g_mirrordamage_virtual; bool autocvar_g_mirrordamage_onlyweapons; float autocvar_g_maxpushtime; float autocvar_g_balance_damagepush_speedfactor; +bool autocvar_g_balance_damagepush_speedfactor_onlyself; int autocvar_g_balance_firetransfer_damage; int autocvar_g_balance_firetransfer_time; float autocvar_g_balance_armor_blockpercent; -- 2.39.2