set g_ctf_flagcarrier_selfforcefactor 1
set g_ctf_flagcarrier_damagefactor 1
set g_ctf_flagcarrier_forcefactor 1
+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_fullbrightflags 0
set g_ctf_dynamiclights 0
set g_ctf_flag_damageforcescale 2
-set g_ctf_allow_drop 1 "dropping allows circumventing carrierkill score, so enable this with care!"
+set g_ctf_portalteleport 0 "allow flag carriers to go through portals made in portal gun without dropping the flag"
set g_ctf_reverse 0 "if enabled, flags positions are switched: you have to capture the enemy's flag from your own base by bringing it to your own flag in the enemy base"
set g_ctf_flag_collect_delay 1
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_pickup_verbosename 0 "show the name of the person who picked up the flag too"
-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_drop 1 "dropping allows circumventing carrierkill score, so enable this with care!"
+set g_ctf_drop_velocity 500 "how fast or far a player can throw the flag"
+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)"
-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_pass_velocity 750 "how fast or far a player can pass the flag"
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"
float autocvar_g_chat_flood_spl_tell;
float autocvar_g_chat_nospectators;
float autocvar_g_chat_teamcolors;
-float autocvar_g_ctf_allow_drop;
-float autocvar_g_ctf_allow_pass;
+float autocvar_g_ctf_drop;
+float autocvar_g_ctf_drop_velocity;
+float autocvar_g_ctf_portalteleport;
+float autocvar_g_ctf_pass;
float autocvar_g_ctf_pass_radius;
float autocvar_g_ctf_pass_wait;
float autocvar_g_ctf_pass_request;
float autocvar_g_ctf_pass_turnrate;
float autocvar_g_ctf_pass_timelimit;
-float autocvar_g_ctf_throw_velocity;
+float autocvar_g_ctf_pass_velocity;
float autocvar_g_ctf_captimerecord_always;
float autocvar_g_ctf_dynamiclights;
string autocvar_g_ctf_flag_blue_model;
case DROP_PASS:
{
vector targ_origin = (0.5 * (reciever.absmin + reciever.absmax));
- flag.velocity = (normalize(targ_origin - player.origin) * autocvar_g_ctf_throw_velocity);
+ flag.velocity = (normalize(targ_origin - player.origin) * autocvar_g_ctf_pass_velocity);
break;
}
case DROP_THROW:
{
makevectors((player.v_angle_y * '0 1 0') + (player.v_angle_x * '0.5 0 0'));
- flag.velocity = W_CalculateProjectileVelocity(player.velocity, ('0 0 200' + (v_forward * autocvar_g_ctf_throw_velocity)), FALSE);
+ flag.velocity = W_CalculateProjectileVelocity(player.velocity, ('0 0 200' + (v_forward * autocvar_g_ctf_drop_velocity)), FALSE);
break;
}
vector desired_direction = normalize(targ_origin - self.origin);
vector current_direction = normalize(self.velocity);
- self.velocity = (normalize(current_direction + (desired_direction * autocvar_g_ctf_pass_turnrate)) * autocvar_g_ctf_throw_velocity);
+ self.velocity = (normalize(current_direction + (desired_direction * autocvar_g_ctf_pass_turnrate)) * autocvar_g_ctf_pass_velocity);
}
return;
}
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(ctf_HookedDrop)
+MUTATOR_HOOKFUNCTION(ctf_RemovePlayer)
{
- if(self.flagcarried) { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+ if(self.flagcarried)
+ { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
+{
+ if(self.flagcarried)
+ if(!autocvar_g_ctf_portalteleport)
+ { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+
return 0;
}
if(time > player.throw_antispam)
{
// pass the flag to a team mate
- if(autocvar_g_ctf_allow_pass)
+ if(autocvar_g_ctf_pass)
{
entity head, closest_target;
head = findradius(player.origin, autocvar_g_ctf_pass_radius);
}
// throw the flag in front of you
- if(autocvar_g_ctf_allow_drop && player.flagcarried && !player.speedrunning)
+ if(autocvar_g_ctf_drop && player.flagcarried && !player.speedrunning)
{ ctf_Handle_Throw(player, world, DROP_THROW); }
}
MUTATOR_DEFINITION(gamemode_ctf)
{
- MUTATOR_HOOK(MakePlayerObserver, ctf_HookedDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, ctf_HookedDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ctf_HookedDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(PortalTeleport, ctf_HookedDrop, CBC_ORDER_ANY);
+ MUTATOR_HOOK(MakePlayerObserver, ctf_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(ClientDisconnect, ctf_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, ctf_RemovePlayer, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PortalTeleport, ctf_PortalTeleport, CBC_ORDER_ANY);
MUTATOR_HOOK(GiveFragsForKill, ctf_GiveFragsForKill, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, ctf_PlayerPreThink, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_Calculate, ctf_PlayerDamage, CBC_ORDER_ANY);