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_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
+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_throw_punish_count 3
+set g_ctf_throw_punish_delay 30
+set g_ctf_throw_punish_time 8
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"
float autocvar_g_ctf_throw;
float autocvar_g_ctf_throw_angle_max;
float autocvar_g_ctf_throw_angle_min;
+float autocvar_g_ctf_throw_punish_count;
+float autocvar_g_ctf_throw_punish_delay;
+float autocvar_g_ctf_throw_punish_time;
float autocvar_g_ctf_throw_strengthmultiplier;
float autocvar_g_ctf_throw_velocity_forward;
float autocvar_g_ctf_throw_velocity_up;
// throw the flag in front of you
if(autocvar_g_ctf_throw && player.flagcarried)
- { ctf_Handle_Throw(player, world, DROP_THROW); return TRUE; }
+ {
+ if(player.throw_count == -1)
+ {
+ if(time > player.throw_prevtime + autocvar_g_ctf_throw_punish_delay)
+ {
+ player.throw_prevtime = time;
+ player.throw_count = 1;
+ ctf_Handle_Throw(player, world, DROP_THROW);
+ return TRUE;
+ }
+ else
+ {
+ centerprint(player, strcat("Too many flag throws, throwing disabled for ", ftos((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time), " seconds."));
+ return FALSE;
+ }
+ }
+ else
+ {
+ if(time > player.throw_prevtime + autocvar_g_ctf_throw_punish_time) { player.throw_count = 1; }
+ else { player.throw_count += 1; }
+ if(player.throw_count >= autocvar_g_ctf_throw_punish_count) { player.throw_count = -1; }
+
+ player.throw_prevtime = time;
+ ctf_Handle_Throw(player, world, DROP_THROW);
+ return TRUE;
+ }
+ }
}
return FALSE;
.entity pass_sender;
.entity pass_target;
.float throw_antispam;
+.float throw_prevtime;
+.float throw_count;
// passing macros
#define PLAYER_CENTER(ent) (ent.origin + ((ent.classname == "player") ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))