]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to only account for vertical travel when calculating fall damage
authorMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 15:33:36 +0000 (01:33 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 15:33:36 +0000 (01:33 +1000)
balance-mario.cfg
balance-nexuiz25.cfg
balance-overkill.cfg
balance-samual.cfg
balance-testing.cfg
balance-testingxpm.cfg
balance-xdf.cfg
balance-xonotic.cfg
balance-xpm.cfg
qcsrc/server/autocvars.qh
qcsrc/server/sv_main.qc

index 1974ad6c811d130e2ad129424d24e5824b5135c9..de22d1f7b5f5d71392bee5d050c31a27f877f232 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index 73c63df9b7277014a78e9be149afa5dd222e9a23..81c786ed60cb08e895c964470125c8f061069fd4 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 150
 set g_balance_falldamage_minspeed 1400
 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_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
index 0e929ee74009f8038dc864228374d0af17766eb5..28f8f17d768c4424e5b60261fa5ad639b142906d 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index 9bcb976b60853f8dda7a81c66d22806766eaac02..f98731e01726b4c381c3459974a7bfd2b974e7a2 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index 96426aaa5ca191453edd6020b5ab131c83d50937..960211605e7dce56f54ae6f055fd159e8f65e952 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index 4fa3130f02176c1d61bde908a854a3b179cdc648..4ee3f36cdb6bf4d26960512fb08e27b9fc139177 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index 6a1622c2c42c5dc1a85148cd6d84e380c63c88a7..e866bd11d18ef8ea51f9b029029b15bed328833f 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index e19872454fa57d9b9cdfdd77ac6319763f390432..2666108f48b2e4163d985cb03f33dcd44dffbeae 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index c722638b1beb705ba42fb0eea195c87100b343f7..bcd58487892e716a01ba8122360838054ef65777 100644 (file)
@@ -185,6 +185,7 @@ set g_balance_falldamage_deadminspeed 250
 set g_balance_falldamage_minspeed 900
 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_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
index a783d72314a7a1c571014ce6b5cbe70d2d0ac440..415fedab8edacd0c977e956b508de864e1d542f7 100644 (file)
@@ -39,6 +39,7 @@ float autocvar_g_balance_falldamage_deadminspeed;
 float autocvar_g_balance_falldamage_factor;
 int autocvar_g_balance_falldamage_maxdamage;
 float autocvar_g_balance_falldamage_minspeed;
+bool autocvar_g_balance_falldamage_onlyvertical;
 int autocvar_g_balance_firetransfer_damage;
 int autocvar_g_balance_firetransfer_time;
 float autocvar_g_balance_fuel_limit;
index 345b7fdb836964b8e184c7e00c3d4ff46b23a08e..cd4693a2bdfbed24c6a0d2b2880c28e0726e96d6 100644 (file)
@@ -114,7 +114,11 @@ void CreatureFrame_FallDamage(entity this)
        }
        if(!have_hook)
        {
-               float dm = vlen(this.oldvelocity) - velocity_len; // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
+               float dm;
+               if(autocvar_g_balance_falldamage_onlyvertical)
+                       dm = vlen('0 0 1' * this.oldvelocity.z) - vlen('0 0 1' * this.velocity.z);
+               else
+                       dm = vlen(this.oldvelocity) - velocity_len; // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
                if (IS_DEAD(this))
                        dm = (dm - autocvar_g_balance_falldamage_deadminspeed) * autocvar_g_balance_falldamage_factor;
                else