]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
By request, disable aim limits on throwing and add cvars
authorSamual Lenks <samual@xonotic.org>
Wed, 19 Sep 2012 14:42:25 +0000 (10:42 -0400)
committerSamual Lenks <samual@xonotic.org>
Wed, 19 Sep 2012 14:42:25 +0000 (10:42 -0400)
gamemodes.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/gamemode_ctf.qc

index cc5a940aa8626e0608b7fb1d5854a7a6e0a69f99..163824253bc3da086be5325324ca3b28697cfe9f 100644 (file)
@@ -194,9 +194,14 @@ set g_ctf_flag_health 0
 set g_ctf_flag_dropped_waypoint 2 "show dropped flag waypointsprite when a flag is lost. 1 = team only, 2 = for all players"
 set g_ctf_flag_dropped_floatinwater 200 "move upwards while in water at this velocity"
 set g_ctf_flag_pickup_verbosename 0 "show the name of the person who picked up the flag too"
-set g_ctf_drop 1 "dropping allows circumventing carrierkill score, so enable this with care!"
-set g_ctf_drop_strengthmultiplier 2 "multiplier for velocity when you have the strength... essentially, throw the flag REALLY hard when you have the strength :D"
-set g_ctf_drop_velocity 500 "how fast or far a player can throw the flag"
+set g_ctf_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
+set g_ctf_throw_strengthmultiplier 2 "multiplier for velocity when you have the strength... essentially, throw the flag REALLY hard when you have the strength :D"
+set g_ctf_throw_velocity_forward 500 "how fast or far a player can throw the flag"
+set g_ctf_throw_velocity_up 200 "upwards velocity added upon initial throw"
+set g_ctf_throw_angle_max 90 "maximum upwards angle you can throw the flag"
+set g_ctf_throw_angle_min -90 "minimum downwards angle you can throw the flag"
+set g_ctf_drop_velocity_up 200 "upwards velocity when a flag is dropped (i.e. when a flag carrier dies)"
+set g_ctf_drop_velocity_side 100 "randomized sideways velocity when a flag is dropped"
 set g_ctf_pass 1 "allow passing of flags to nearby team mates"
 set g_ctf_pass_radius 500 "maximum radius that you can pass to a team mate in"
 set g_ctf_pass_wait 2 "delay in seconds between how often players can pass the flag (antispam, essentially)"
index cfd29b2038c06fb670835eb892613d67da2fbbb6..553ae5143ae155549c5dfbda32d33346bc2f2bbc 100644 (file)
@@ -762,9 +762,14 @@ float autocvar_g_chat_nospectators;
 float autocvar_g_chat_teamcolors;
 float autocvar_g_ctf_allow_vehicle_carry;
 float autocvar_g_ctf_allow_vehicle_touch;
-float autocvar_g_ctf_drop;
-float autocvar_g_ctf_drop_strengthmultiplier;
-float autocvar_g_ctf_drop_velocity;
+float autocvar_g_ctf_throw;
+float autocvar_g_ctf_throw_angle_max;
+float autocvar_g_ctf_throw_angle_min;
+float autocvar_g_ctf_throw_strengthmultiplier;
+float autocvar_g_ctf_throw_velocity_forward;
+float autocvar_g_ctf_throw_velocity_up;
+float autocvar_g_ctf_drop_velocity_up;
+float autocvar_g_ctf_drop_velocity_side;
 float autocvar_g_ctf_portalteleport;
 float autocvar_g_ctf_pass;
 float autocvar_g_ctf_pass_radius;
index d5201e6f11062f000a01cb95fb762498609a91e8..38509343ef8ad6e1a040e12ab5e8b9a0bb7e3a14 100644 (file)
@@ -288,8 +288,9 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype)
                
                case DROP_THROW:
                {
-                       makevectors((player.v_angle_y * '0 1 0') + (player.v_angle_x * '0.5 0 0'));
-                       flag_velocity = ('0 0 200' + ((v_forward * autocvar_g_ctf_drop_velocity) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_drop_strengthmultiplier : 1)));
+                       makevectors((player.v_angle_y * '0 1 0') + (bound(autocvar_g_ctf_throw_angle_min, player.v_angle_x, autocvar_g_ctf_throw_angle_max) * '1 0 0'));
+                               
+                       flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_throw_strengthmultiplier : 1)));
                        flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, FALSE);
                        ctf_Handle_Drop(flag, player, droptype);
                        break;
@@ -304,7 +305,7 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype)
                default:
                case DROP_NORMAL:
                {
-                       flag.velocity = W_CalculateProjectileVelocity(player.velocity, ('0 0 200' + ('0 100 0' * crandom()) + ('100 0 0' * crandom())), FALSE);
+                       flag.velocity = W_CalculateProjectileVelocity(player.velocity, (('0 0 1' * autocvar_g_ctf_drop_velocity_up) + ((('0 1 0' * crandom()) + ('1 0 0' * crandom())) * autocvar_g_ctf_drop_velocity_side)), FALSE);
                        ctf_Handle_Drop(flag, player, droptype);
                        break;
                }
@@ -1787,7 +1788,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                }
                
                // throw the flag in front of you
-               if(autocvar_g_ctf_drop && player.flagcarried)
+               if(autocvar_g_ctf_throw && player.flagcarried)
                        { ctf_Handle_Throw(player, world, DROP_THROW); return TRUE; }
        }