From de32ae64ea4ee4b50808a0738b4ab9fe7bc708e4 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Wed, 7 Jul 2010 20:01:04 +0300 Subject: [PATCH] cl_gentle split into cl_gentle_gibs and cl_gentle_messages, cl_gentle left in as a master switch for enabling both. Later on we could perhaps do cl_gentle_chat as well to filter out bad words --- defaultXonotic.cfg | 6 ++-- qcsrc/client/autocvars.qh | 4 +++ qcsrc/client/gibs.qc | 10 +++--- qcsrc/client/hud.qc | 67 ++++++++++++++++++++------------------- 4 files changed, 48 insertions(+), 39 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e9624f6cf9..9a6509cf37 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1640,8 +1640,10 @@ set camera_look_attenuation 8 "Attenuation of \"looking\" movements, only if ca set camera_forward_follows 1 "0: Move the camera forwards without changing altitude. 1: Move towards what you are looking" // "Gentle mode": show no blood -seta sv_gentle 0 "force gentle mode for everyone, also remove references to acts of killing from the messages" -seta cl_gentle 0 "client side gentle mode (only replaces gibs); when set to 1, white smoke replaces gibs, when set to 2, colorful clouds replace gibs" +seta sv_gentle 0 "force gentle mode for everyone, also remove references to acts of killing from the messages" +seta cl_gentle 0 "client side gentle mode, master switch for removing both gibs and messages" +seta cl_gentle_gibs 0 "client side gentle mode (only replaces gibs); when set to 1, white smoke replaces gibs, when set to 2, colorful clouds replace gibs" +seta cl_gentle_messages 0 "client side gentle mode (only replaces frag messages/centerprints)" seta cl_racetimer_position 0.25 "Y-axis positioning of the race timer (from 0 to 1)" seta cl_showpressedkeys 0 "Show which movement keys someone is pressing: 1 for spectating, 2 for always" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index a686ac5dcd..f12d5bbcfe 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -6,6 +6,10 @@ var float autocvar_cl_gibs_sloppy = 1; var float autocvar_cl_casings_ticrate = 0.1; var float autocvar_cl_casings_sloppy = 1; +var float autocvar_cl_gentle; +var float autocvar_cl_gentle_gibs; +var float autocvar_cl_gentle_messages; + var float autocvar__menu_alpha; var float autocvar__hud_configure; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index a92567e619..f395fb6a7b 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -151,16 +151,16 @@ void Ent_GibSplash(float isNew) org_z = ReadShort() * 4 + 2; vel = decompressShortVector(ReadShort()); - if(cvar("cl_gentle")) + if(cvar("cl_gentle_gibs") || cvar("cl_gentle")) type |= 0x80; // set gentle bit if(type & 0x80) { - if(cvar("cl_gentle") == 2) + if(cvar("cl_gentle_gibs") == 2) gentle_prefix = ""; - else if(cvar("cl_gentle") == 3) + else if(cvar("cl_gentle_gibs") == 3) gentle_prefix = "happy_"; - else if(cvar("cl_gentle")) + else gentle_prefix = "morphed_"; } else if(cvar("cl_particlegibs")) @@ -169,7 +169,7 @@ void Ent_GibSplash(float isNew) gentle_prefix = "particlegibs_"; } - if not(cvar("cl_gentle")) + if not(cvar("cl_gentle_gibs") || cvar("cl_gentle")) amount *= 1 - cvar("cl_nogibs"); if(cvar("ekg")) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 701c18b47b..e5f7473503 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2297,8 +2297,9 @@ void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) { float w; - float alsoprint; + float alsoprint, gentle; alsoprint = (autocvar_hud_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled + gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages); if(msg == MSG_SUICIDE) { // TODO: cl_gentle @@ -2354,20 +2355,20 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, s2, 1, type); if(alsoprint) { - if(cvar("cl_gentle")) { + if(gentle) { print ("^1", s1, "^1 took action against a team mate\n"); } else { print ("^1", s1, "^1 mows down a team mate\n"); } } if (stof(s2) > 2 && type == KILL_TEAM_SPREE) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1,"^1 ended a ",s3," scoring spree by going against a team mate\n"); else print ("^1",s1,"^1 ended a ",s3," kill spree by killing a team mate\n"); } else if (stof(s2) > 2) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1,"'s ^1",s3," scoring spree was ended by a team mate!\n"); else print ("^1",s1,"'s ^1",s3," kill spree was ended by a team mate!\n"); @@ -2468,47 +2469,47 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) } } else if(msg == MSG_SPREE) { if(type == KILL_END_SPREE) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1,"'s ^1", s2, " scoring spree was ended by ", s3, "\n"); else print ("^1",s1,"'s ^1", s2, " kill spree was ended by ", s3, "\n"); } else if(type == KILL_SPREE) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1,"^1 made ",s2," scores in a row\n"); else print ("^1",s1,"^1 has ",s2," frags in a row\n"); } else if(type == KILL_SPREE_3) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made a ^1TRIPLE SCORE\n"); else print (s1,"^7 made a ^1TRIPLE FRAG\n"); } else if(type == KILL_SPREE_5) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 unleashes ^1SCORING RAGE\n"); else print (s1,"^7 unleashes ^1RAGE\n"); } else if(type == KILL_SPREE_10) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made ^1TEN SCORES IN A ROW!\n"); else print (s1,"^7 starts the ^1MASSACRE!\n"); } else if(type == KILL_SPREE_15) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made ^1FIFTEEN SCORES IN A ROW!\n"); else print (s1,"^7 executes ^1MAYHEM!\n"); } else if(type == KILL_SPREE_20) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made ^1TWENTY SCORES IN A ROW!\n"); else print (s1,"^7 is a ^1BERSERKER!\n"); } else if(type == KILL_SPREE_25) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n"); else print (s1,"^7 inflicts ^1CARNAGE!\n"); } else if(type == KILL_SPREE_30) { - if(cvar("cl_gentle")) + if(gentle) print (s1,"^7 made ^1THIRTY SCORES IN A ROW!\n"); else print (s1,"^7 unleashes ^1ARMAGEDDON!\n"); @@ -2518,7 +2519,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_DROWN); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 was in the water for too long\n"); else print ("^1",s1, "^1 drowned\n"); @@ -2531,7 +2532,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_LAVA); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 found a hot place\n"); else print ("^1",s1, "^1 turned into hot slag\n"); @@ -2540,7 +2541,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 tested gravity (and it worked)\n"); else print ("^1",s1, "^1 hit the ground with a crunch\n"); @@ -2553,7 +2554,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 discovered a swamp\n"); else print ("^1",s1, "^1 is now conserved for centuries to come\n"); @@ -2582,7 +2583,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 felt a little hot\n"); else print ("^1",s1, "^1 burnt to death\n"); @@ -2591,14 +2592,14 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if(alsoprint) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1, "^1 needs a restart\n"); else print ("^1",s1, "^1 died\n"); } } } else if(msg == MSG_KILL_ACTION_SPREE) { - if(cvar("cl_gentle")) + if(gentle) print ("^1",s1,"^1 needs a restart after a ",s2," scoring spree\n"); else print ("^1",s1,"^1 died with a ",s2," kill spree\n"); @@ -2623,78 +2624,80 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) void HUD_Centerprint(string s1, string s2, float type, float msg) { + float gentle; + gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages); if(msg == MSG_SUICIDE) { if (type == DEATH_TEAMCHANGE) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1)); } else if (type == DEATH_AUTOTEAMCHANGE) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You have been moved into a different team to improve team balance\nYou are now on: ", s1)); } else if (type == DEATH_CAMP) { - if(cvar("cl_gentle")) + if(gentle) centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Reconsider your tactics, camper!")); else centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Die camper!")); } else if (type == DEATH_NOAMMO) { - if(cvar("cl_gentle")) + if(gentle) centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You are reinserted into the game for running out of ammo...")); else centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were killed for running out of ammo...")); } else if (type == DEATH_ROT) { - if(cvar("cl_gentle")) + if(gentle) centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to preserve your health")); else centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You grew too old without taking your medicine")); } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { - if(cvar("cl_gentle")) + if(gentle) centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!")); else centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!")); } else if (type == DEATH_QUIET) { // do nothing } else if (type == DEATH_KILL) { - if(cvar("cl_gentle")) + if(gentle) centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!")); else centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!")); } } else if(msg == MSG_KILL) { if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against", s1, ",a team mate!")); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s1, ", a team mate!")); } } else if (type == KILL_FIRST_BLOOD) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First score")); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First blood")); } } else if (type == KILL_FIRST_VICTIM) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First casualty")); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First victim")); } } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap... - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You scored against ^7", s1, "^1 who was typing!", s2)); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You typefragged ^7", s1, s2)); } } else if (type == KILL_TYPEFRAGGED) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, "^1 while you were typing!", s2)); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were typefragged by ^7", s1, s2)); } } else if (type == KILL_FRAG) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You scored against ^7", s1, s2)); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You fragged ^7", s1, s2)); } } else if (type == KILL_FRAGGED) { - if(cvar("cl_gentle")) { + if(gentle) { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, s2)); } else { centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were fragged by ^7", s1, s2)); -- 2.39.2