From: Samual Date: Fri, 30 Mar 2012 18:29:53 +0000 (-0400) Subject: Enable/fix verbosename centerprints, and add cvar for showing dropped flag waypointsp... X-Git-Tag: xonotic-v0.7.0~240^2~159 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1dca371c3e72714c6bac199fa83b80ccc24429f7;p=xonotic%2Fxonotic-data.pk3dir.git Enable/fix verbosename centerprints, and add cvar for showing dropped flag waypointsprites --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 663db3f89..9e78f9453 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -602,6 +602,8 @@ set g_ctf_reverse 0 "if enabled, flags positions are switched: you have to captu set g_ctf_flag_collect_delay 1 set g_ctf_flag_health 0 set g_ctf_flag_take_damage 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 1 "show the name of the person who picked up the flag too" 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" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 156375002..6eeca7b70 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -768,6 +768,7 @@ float autocvar_g_ctf_flag_blue_skin; float autocvar_g_ctf_flag_capture_effects; float autocvar_g_ctf_flag_collect_delay; float autocvar_g_ctf_flag_damageforcescale; +float autocvar_g_ctf_flag_dropped_waypoint; float autocvar_g_ctf_flag_glowtrails; float autocvar_g_ctf_flag_health; float autocvar_g_ctf_flag_pickup_effects; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 3881db9aa..32a45b103 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -157,7 +157,9 @@ void ctf_Handle_Drop(entity player) PlayerScore_Add(player, SP_CTF_DROPS, 1); // waypoints - WaypointSprite_Spawn("flagdropped", 0, 0, flag, '0 0 64', world, player.team, flag, wps_flagdropped, FALSE, RADARICON_FLAG, '0 1 1'); // (COLOR_TEAM1 + COLOR_TEAM2 - flag.team) + if(autocvar_g_ctf_flag_dropped_waypoint) + WaypointSprite_Spawn("flagdropped", 0, 0, flag, '0 0 64', world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, FALSE, RADARICON_FLAG, '0 1 1'); // (COLOR_TEAM1 + COLOR_TEAM2 - flag.team) + WaypointSprite_Ping(player.wps_flagcarrier); WaypointSprite_Kill(player.wps_flagcarrier); @@ -275,12 +277,12 @@ void ctf_Handle_Pickup_Base(entity flag, entity player) Send_KillNotification (player.netname, flag.netname, "", INFO_GOTFLAG, MSG_INFO); sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE); ctf_EventLog("steal", flag.team, player); - verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat("(", player.netname, ")") : ""); // replace TRUE with an autocvar for it. + verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat(Team_ColorCode(player.team), "(^7", player.netname, Team_ColorCode(player.team), ") ") : ""); FOR_EACH_PLAYER(tmp_player) if(tmp_player.team == flag.team) - centerprint(tmp_player, strcat("The enemy ", verbosename, "got your flag! Retrieve it!")); + centerprint(tmp_player, strcat("The ", Team_ColorCode(player.team), "enemy ", verbosename, "^7got your flag! Retrieve it!")); else if((tmp_player.team == player.team) && (tmp_player != player)) - centerprint(tmp_player, strcat("Your team mate ", verbosename, "got the flag! Protect them!")); + centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!")); // scoring PlayerTeamScore_AddScore(player, ctf_ReadScore("score_pickup_base")); @@ -332,13 +334,13 @@ void ctf_Handle_Pickup_Dropped(entity flag, entity player) // make sure this wor Send_KillNotification (player.netname, flag.netname, "", INFO_PICKUPFLAG, MSG_INFO); sound (player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE); ctf_EventLog("pickup", flag.team, player); - verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat("(", player.netname, ")") : ""); + verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat(Team_ColorCode(player.team), "(^7", player.netname, Team_ColorCode(player.team), ") ") : ""); FOR_EACH_PLAYER(tmp_player) if(tmp_player.team == flag.team) - centerprint(tmp_player, strcat("The enemy ", verbosename, "got your flag! Retrieve it!")); + centerprint(tmp_player, strcat("The ", Team_ColorCode(player.team), "enemy ", verbosename, "^7got your flag! Retrieve it!")); else if((tmp_player.team == player.team) && (tmp_player != player)) - centerprint(tmp_player, strcat("Your team mate ", verbosename, "got the flag! Protect them!")); - + centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!")); + // scoring returnscore = floor((ctf_ReadScore("score_pickup_dropped_late") * (1-returnscore) + ctf_ReadScore("score_pickup_dropped_early") * returnscore) + 0.5); print("score is ", ftos(returnscore), "\n"); @@ -553,7 +555,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag self = flag; // for later usage with droptofloor() // main setup - flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist // todo: find out if this can be simplified + flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist ctf_worldflaglist = flag; setattachment(flag, world, "");