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_pickup_verbosename 1 "show the name of the person who picked up the flag too"
set g_ctf_flag_return_when_unreachable 1 "automatically return the flag if it falls into lava/slime/trigger hurt"
-set g_ctf_throw_velocity 500 "how far a player can throw the flag"
+set g_ctf_throw_velocity 700 "how fast or far a player can throw the flag"
set g_ctf_allow_pass 1 "allow passing of flags to nearby team mates"
-set g_ctf_pass_radius 300 "maximum radius that you can pass to a team mate in"
+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)"
set g_ctf_dropped_capture_radius 100 "allow dropped flags to be automatically captured by base flags if the dropped flag is within this radius of it"
set g_ctf_pass_request 1 "allow players to request the flag carrier to pass the flag to them"
set g_ctf_pass_turnrate 50 "how well the flag follows the best direction to its target while passing"
+set g_ctf_pass_timelimit 2 "how long a flag can stay trying to pass before it gives up and just becomes dropped"
set g_ctf_shield_max_ratio 0 "shield at most this percentage of a team from the enemy flag (try: 0.4 for 40%)"
set g_ctf_shield_min_negscore 20 "shield the player from the flag if he's got this negative amount of points or less"
void ctf_Handle_Failed_Pass(entity flag)
{
+ print("ctf_Handle_Failed_Pass(entity flag) called.\n");
entity sender = flag.pass_sender;
flag.movetype = MOVETYPE_TOSS;
void ctf_Handle_Retrieve(entity flag, entity player)
{
+ print("ctf_Handle_Retrieve(entity flag, entity player) called.\n");
entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players
entity sender = flag.pass_sender;
flag.owner.flagcarried = world;
flag.owner = world;
flag.solid = SOLID_TRIGGER;
+ flag.ctf_droptime = time;
switch(droptype)
{
case DROPTYPE_PASS:
{
vector targ_origin = (0.5 * (reciever.absmin + reciever.absmax));
- flag.velocity = W_CalculateProjectileVelocity(player.velocity, ('0 0 200' + (normalize(targ_origin - player.origin) * autocvar_g_ctf_throw_velocity)), FALSE);
+ flag.velocity = (normalize(targ_origin - player.origin) * autocvar_g_ctf_throw_velocity);
break;
}
flag.movetype = MOVETYPE_TOSS;
flag.takedamage = DAMAGE_YES;
flag.health = flag.max_flag_health;
- flag.ctf_droptime = time;
flag.ctf_dropper = player;
flag.ctf_status = FLAG_DROPPED;
}
case FLAG_PASSING:
- {
- traceline(self.origin, self.pass_target.origin, MOVE_NOMONSTERS, self);
-
+ {
vector targ_origin = (0.5 * (self.pass_target.absmin + self.pass_target.absmax));
+ traceline(self.origin, targ_origin, MOVE_NOMONSTERS, self);
+
if((self.pass_target.deadflag != DEAD_NO)
|| (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius)
- || ((trace_fraction < 1) && (trace_ent != self.pass_target)))
+ || ((trace_fraction < 1) && (trace_ent != self.pass_target))
+ || (time > self.ctf_droptime + autocvar_g_ctf_pass_timelimit))
{
ctf_Handle_Failed_Pass(self);
}
if(head != player && !IsDifferentTeam(head, player))
if(!player.speedrunning && !head.speedrunning)
{
- if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried)
- {
- if(clienttype(head) == CLIENTTYPE_BOT)
- {
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
- ctf_Handle_Throw(head, player, DROPTYPE_PASS);
+ traceline(player.origin, head.origin, MOVE_NOMONSTERS, player);
+ if not((trace_fraction < 1) && (trace_ent != head))
+ {
+ if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried)
+ {
+ if(clienttype(head) == CLIENTTYPE_BOT)
+ {
+ centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ ctf_Handle_Throw(head, player, DROPTYPE_PASS);
+ }
+ else
+ {
+ centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname));
+ centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ }
+ player.throw_antispam = time + autocvar_g_ctf_pass_wait;
+ return 0;
}
- else
+ else if(player.flagcarried)
{
- centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname));
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ if(closest_target) { if(vlen(player.origin - head.origin) < vlen(player.origin - closest_target.origin)) { closest_target = head; } }
+ else { closest_target = head; }
}
- player.throw_antispam = time + autocvar_g_ctf_pass_wait;
- return 0;
- }
- else if(player.flagcarried)
- {
- if(closest_target) { if(vlen(player.origin - head.origin) < vlen(player.origin - closest_target.origin)) { closest_target = head; } }
- else { closest_target = head; }
}
}
head = head.chain;