]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/okc3
authorMartin Taibr <taibr.martin@gmail.com>
Sat, 10 Feb 2018 15:26:43 +0000 (16:26 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Sat, 10 Feb 2018 15:26:43 +0000 (16:26 +0100)
balance-mario.cfg
balance-nexuiz25.cfg
balance-overkill.cfg
balance-samual.cfg
balance-xdf.cfg
balance-xonotic.cfg
balance-xpm.cfg
defaultServer.cfg
qcsrc/server/g_damage.qc

index 4dda8bdc8842318701f1dcc39e95db6a87f8f7c3..fec951a68c5df007b6ec39befc813b867bd0d919 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 bf2ecc623cccf3ebd3fba2cc0afecb2ec7432e40..a29ad1ecd6a595930688409a3ffe1a8b78e54909 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 245fa7cc4cd06cdc0a8eabcf5ac346fc8190a5a7..6b2e4d5557f9373eab457ce4998204651b1a8133 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 4cabc2246ac608a760fa1fc596f576a54cf1e9a9..6ca445642e88dba6d3203208caf6fadc699ea19b 100644 (file)
@@ -346,7 +346,7 @@ set g_maplist_votable_screenshot_dir "maps levelshots"      "where to look for map sc
 
 set sv_vote_gametype 0 "show a vote screen for gametypes before map vote screen"
 set sv_vote_gametype_keeptwotime 10 "show only 2 options after this amount of time during gametype vote screen"
-set sv_vote_gametype_options "dm ctf ca lms tdm ft"
+set sv_vote_gametype_options "dm ctf ca lms tdm ft" "Keep the identifiers short, otherwise you'll run into issues with too long alias names when using sv_vote_gametype_hook_*"
 set sv_vote_gametype_timeout 20
 set sv_vote_gametype_default_current 1 "Keep the current gametype if no one votes"
 
index 75bf81f8a6c99ecc6ccea2b61dd767d2085e30a4..fcc83adcb138f94b7b86310bfeea67550a80115d 100644 (file)
@@ -607,6 +607,12 @@ void Unfreeze (entity targ)
        targ.iceblock = NULL;
 }
 
+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, vector hitloc, vector force)
 {
        float complainteamdamage = 0;
@@ -874,6 +880,33 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
        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);