From: Samual Lenks Date: Wed, 19 Sep 2012 14:42:25 +0000 (-0400) Subject: By request, disable aim limits on throwing and add cvars X-Git-Tag: xonotic-v0.7.0~218^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9e17e23dce57b950753a9a9aab15747b4719c82f;p=xonotic%2Fxonotic-data.pk3dir.git By request, disable aim limits on throwing and add cvars --- diff --git a/gamemodes.cfg b/gamemodes.cfg index cc5a940aa..163824253 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -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)" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index cfd29b203..553ae5143 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index d5201e6f1..38509343e 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -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; } }