]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/okc3
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Feb 2018 12:49:04 +0000 (13:49 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Feb 2018 12:49:04 +0000 (13:49 +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 28100182ea5fe41b0b1d028b020a93503228c9f5..b1060e06f603de84ce5b4648a39a08da568778eb 100644 (file)
@@ -185,6 +185,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 37099c1226dfa6ff992a97b74ef1217b91111b31..488dc08408cc6b4145189f0c5d946d34c0b8f6ac 100644 (file)
@@ -185,6 +185,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 3a321ce53d461b2eca19452f5ad420975f9f2c12..1e8794eb2c52023c628793a8d1c8bea393b22ef9 100644 (file)
@@ -185,6 +185,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 48c68d81be66e77c96cf8f55c417fd4b8565fe0f..7bf0dae77d89dcde76072bfefc61c24a79cb4825 100644 (file)
@@ -185,6 +185,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 562506283c44ad965d5d7d0f641a96a910aa11d3..cc7c8109d67a35bcb8d13e4baab7888079df67c3 100644 (file)
@@ -185,6 +185,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 32924a72d2cee7cca9d636330661abe49047f404..06870dc6c468f89517cdc9248c78bf12a7eef898 100644 (file)
@@ -185,6 +185,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 6901eda28a8c130622dc43db632f7475965050d3..ac7e7c54c859cbaedfe9a90abbed94852ed920f5 100644 (file)
@@ -185,6 +185,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 029660c2bf05c2e98975f609e8c35d943d4f168d..8778fba6fce54623d8c7ddbe7bf2df4ef570745c 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;
@@ -868,6 +874,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);