From: Samual Lenks Date: Sat, 22 Sep 2012 01:48:55 +0000 (-0400) Subject: Fixes to stalemate X-Git-Tag: xonotic-v0.7.0~218^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=30f020f96d715a6dec3f850cabe9476f03300d20;p=xonotic%2Fxonotic-data.pk3dir.git Fixes to stalemate --- diff --git a/gamemodes.cfg b/gamemodes.cfg index 84ed85e50..53b6e3f91 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -183,7 +183,9 @@ set g_ctf_flagcarrier_selfdamagefactor 1 set g_ctf_flagcarrier_selfforcefactor 1 set g_ctf_flagcarrier_damagefactor 1 set g_ctf_flagcarrier_forcefactor 1 -set g_ctf_flagcarrier_waypointforenemy_stalemate 60 "show the enemy flagcarrier location after both teams have held the flags for this amount of time" +set g_ctf_stalemate 1 "show the enemy flagcarrier location after both teams have held the flags a certain amount of time" +set g_ctf_stalemate_endcondition 1 "condition for stalemate mode to be finished: 1 = If ONE flag is no longer stale, 2 = If BOTH flags are no longer stale" +set g_ctf_stalemate_time 60 "time for each flag until stalemate mode is activated" set g_ctf_flagcarrier_waypointforenemy_spotting 1 "show the enemy flagcarrier location if a team mate presses +use to spot them" set g_ctf_dropped_capture_delay 1 "dropped capture delay" 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" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index c383d69e7..00a257acd 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -808,7 +808,6 @@ float autocvar_g_ctf_flagcarrier_selfdamagefactor; float autocvar_g_ctf_flagcarrier_selfforcefactor; float autocvar_g_ctf_flagcarrier_damagefactor; float autocvar_g_ctf_flagcarrier_forcefactor; -float autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate; //float autocvar_g_ctf_flagcarrier_waypointforenemy_spotting; float autocvar_g_ctf_fullbrightflags; float autocvar_g_ctf_ignore_frags; @@ -825,6 +824,9 @@ float autocvar_g_ctf_score_return; float autocvar_g_ctf_shield_force; float autocvar_g_ctf_shield_max_ratio; float autocvar_g_ctf_shield_min_negscore; +float autocvar_g_ctf_stalemate; +float autocvar_g_ctf_stalemate_endcondition; +float autocvar_g_ctf_stalemate_time; float autocvar_g_ctf_reverse; float autocvar_g_ctf_dropped_capture_delay; float autocvar_g_ctf_dropped_capture_radius; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 705469d6e..5233aa635 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -502,7 +502,10 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) FOR_EACH_REALPLAYER(tmp_player) { if(tmp_player == player) + { centerprint(tmp_player, strcat("You got the ", flag.netname, "!")); + //if(ctf_stalemate) { centerprint(tmp_player, "Stalemate! Enemies can see you on radar!"); } + } //else if(!IsDifferentTeam(tmp_player, player)) // centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!")); else if(!IsDifferentTeam(tmp_player, flag)) @@ -592,9 +595,9 @@ void ctf_CheckStalemate(void) // build list of stale flags for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext) { - if(autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate) + if(autocvar_g_ctf_stalemate) if(tmp_entity.ctf_status != FLAG_BASE) - if(time >= tmp_entity.ctf_pickuptime + autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate) + if(time >= tmp_entity.ctf_pickuptime + autocvar_g_ctf_stalemate_time) { tmp_entity.ctf_staleflagnext = ctf_staleflaglist; // link flag into staleflaglist ctf_staleflaglist = tmp_entity; @@ -609,9 +612,11 @@ void ctf_CheckStalemate(void) if(stale_red_flags && stale_blue_flags) ctf_stalemate = TRUE; - else if(!stale_red_flags && !stale_blue_flags) - ctf_stalemate = FALSE; - + else if((!stale_red_flags && !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 2) + { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; } + else if((!stale_red_flags || !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 1) + { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; } + // if sufficient stalemate, then set up the waypointsprite and announce the stalemate if necessary if(ctf_stalemate) { @@ -745,7 +750,7 @@ void ctf_FlagThink() ImpulseCommands(); self = tmp_entity; } - if(autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate) + if(autocvar_g_ctf_stalemate) { if(time >= wpforenemy_nextthink) { @@ -907,8 +912,6 @@ void ctf_RespawnFlag(entity flag) flag.ctf_dropper = world; flag.ctf_pickuptime = 0; flag.ctf_droptime = 0; - - wpforenemy_announced = FALSE; } void ctf_Reset()