]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/okc3
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 7 Oct 2018 21:30:57 +0000 (23:30 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 7 Oct 2018 21:30:57 +0000 (23:30 +0200)
balance-mario.cfg
balance-nexuiz25.cfg
balance-overkill.cfg
balance-samual.cfg
balance-xdf.cfg
balance-xonotic.cfg
balance-xpm.cfg
qcsrc/server/g_damage.qc

index 1974ad6c811d130e2ad129424d24e5824b5135c9..1be3f92b3653b570f3b0ccc4bcc0f0aa37ee4c29 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index 73c63df9b7277014a78e9be149afa5dd222e9a23..e552bcfa6e6b25140c2ab56b2f23903aef94e4c3 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 1400
 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
index 18d862d747808a987ea24b1946a8eb5b39c11096..24020bcf874c70b69250d64f7c00a65367aaa2bb 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index 9bcb976b60853f8dda7a81c66d22806766eaac02..75a78d131c7e0965b9307378e9d1ed2bf7487156 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index 6a1622c2c42c5dc1a85148cd6d84e380c63c88a7..c521cf288012ea91fc176b7d5a7e1eaef727860e 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index e19872454fa57d9b9cdfdd77ac6319763f390432..9c130b20f7f7634545b5fc89ed1ef765f7772057 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index 5b8c67d2f5f9395af13f8fadde4a28c613a930e8..15a977bb0db5d83436efedd63771b3bdbf60df81 100644 (file)
@@ -186,6 +186,12 @@ set g_balance_falldamage_minspeed 900
 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
index e9ab3d79ac945a2fa9cec1cf2a392b16aa72fbe0..644b2ea15e5b657e753da6a302630a0102d07d27 100644 (file)
@@ -566,6 +566,12 @@ void Unfreeze(entity targ, bool reset_health)
        MUTATOR_CALLHOOK(Unfreeze, targ);
 }
 
+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, .entity weaponentity, vector hitloc, vector force)
 {
        float complainteamdamage = 0;
@@ -833,6 +839,33 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
        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);