[nexuiz-commits] r7757 - in branches/nexuiz-2.0: . data data/gfx/menu/wickedz data/maps data/qcsrc/client data/qcsrc/menu data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Sep 12 10:16:40 EDT 2009


Author: div0
Date: 2009-09-12 10:16:40 -0400 (Sat, 12 Sep 2009)
New Revision: 7757

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/gfx/menu/wickedz/background_ingame.tga
   branches/nexuiz-2.0/data/gfx/menu/wickedz/background_ingame_l2.tga
   branches/nexuiz-2.0/data/gfx/menu/wickedz/skinvalues.txt
   branches/nexuiz-2.0/data/maps/tutorial.mapinfo
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/menu/menu.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc
Log:
r7735 | fruitiex | 2009-09-11 10:03:25 -0400 (Fri, 11 Sep 2009) | 2 lines
fix ingame menu bg so it does not look cut off on the left
r7736 | fruitiex | 2009-09-11 12:54:45 -0400 (Fri, 11 Sep 2009) | 2 lines
little wickedz theme tweak
r7737 | fruitiex | 2009-09-11 13:01:45 -0400 (Fri, 11 Sep 2009) | 2 lines
just SLIGHTLY more bgmvolume on the tutorial map (0.1 -> 0.2)
r7738 | div0 | 2009-09-11 13:20:28 -0400 (Fri, 11 Sep 2009) | 2 lines
new cvar: _menu_alpha (current alpha of menu, read only), so csqc can read menu's alpha
r7739 | div0 | 2009-09-11 13:22:33 -0400 (Fri, 11 Sep 2009) | 2 lines
fix typo
r7740 | div0 | 2009-09-11 13:24:01 -0400 (Fri, 11 Sep 2009) | 2 lines
fade out HUD when opening menu
r7741 | fruitiex | 2009-09-11 13:42:53 -0400 (Fri, 11 Sep 2009) | 2 lines
also hide crosshair when the menu is opened
r7753 | lordhavoc | 2009-09-12 09:11:06 -0400 (Sat, 12 Sep 2009) | 7 lines
fixed bug where every secondary test trace in RadiusDamage went to a
location near '0 0 0', and thus never hit the target
reworked RadiusDamage occlusion handling, now uses more traces for
occlusion tests and calculates a hit/miss ratio instead of simply
accepting the entire damage/force if any ray succeeded
enabled fractional values for g_throughfloor
r7754 | div0 | 2009-09-12 09:26:20 -0400 (Sat, 12 Sep 2009) | 2 lines
fix hitloc handling in RadiusDamage in a seldom case


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/.patchsets	2009-09-12 14:16:40 UTC (rev 7757)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731
+revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731,7735-7741,7753-7754

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-12 14:16:40 UTC (rev 7757)
@@ -1695,3 +1695,5 @@
 alias _gunalign_13 "cl_gunalign 4"
 alias _gunalign_14 "cl_gunalign 3"
 alias _gunalign_update "_gunalign_$v_flipped$menu_cl_gunalign"
+
+set _menu_alpha "" // will be set by menu QC to the current fading of the menu, can be used by CSQC to fade items

Modified: branches/nexuiz-2.0/data/gfx/menu/wickedz/background_ingame.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/wickedz/background_ingame_l2.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/wickedz/skinvalues.txt
===================================================================
--- branches/nexuiz-2.0/data/gfx/menu/wickedz/skinvalues.txt	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/gfx/menu/wickedz/skinvalues.txt	2009-09-12 14:16:40 UTC (rev 7757)
@@ -20,7 +20,7 @@
 HEIGHT_NORMAL                   1.5
 FONTSIZE_TITLE                  16
 HEIGHT_TITLE                    1.5
-HEIGHT_ZOOMEDTITLE              0
+HEIGHT_ZOOMEDTITLE              -1
 
 // tooltips
 //   uses "tooltip" images
@@ -51,7 +51,7 @@
 // centers, NOT the actual positions of the windows!)
 POSITION_DIALOG_MULTIPLAYER     '0.8 0.4 0'
 POSITION_DIALOG_SINGLEPLAYER    '0.2 0.4 0'
-POSITION_DIALOG_SETTINGS        '0.5 1 0'
+POSITION_DIALOG_SETTINGS        '0.5 0.95 0'
 POSITION_DIALOG_CREDITS         '-0.05 1.2 0'
 POSITION_DIALOG_QUIT            '1.05 1.2 0'
 
@@ -66,7 +66,7 @@
 //   uses "background_ingame" images
 ALIGN_BACKGROUND                37915
 ALIGN_BACKGROUND_INGAME         59
-ALPHA_BACKGROUND_INGAME         0.7
+ALPHA_BACKGROUND_INGAME         1
 ALPHA_DISABLED                  0.2
 ALPHA_BEHIND                    0.5
 ALPHA_TEXT                      0.7

Modified: branches/nexuiz-2.0/data/maps/tutorial.mapinfo
===================================================================
--- branches/nexuiz-2.0/data/maps/tutorial.mapinfo	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/maps/tutorial.mapinfo	2009-09-12 14:16:40 UTC (rev 7757)
@@ -19,4 +19,4 @@
 settemp_for_type all g_use_ammunition 0
 settemp_for_type all sv_spectate 0
 clientsettemp_for_type all snd_mutewhenidle 0
-clientsettemp_for_type all bgmvolume 0.1
+clientsettemp_for_type all bgmvolume 0.2

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-09-12 14:16:40 UTC (rev 7757)
@@ -409,7 +409,7 @@
 		}
 	}
 
-	sbar_alpha_fg = cvar("sbar_alpha_fg" );
+	sbar_alpha_fg = cvar("sbar_alpha_fg" ) * (1 - cvar("_menu_alpha"));
 	sbar_currentammo = cvar("sbar_showcurrentammo");
 	sbar_hudselector = cvar("sbar_hudselector");
 	sbar_hud_accuracy = cvar("sbar_hud_accuracy");
@@ -609,8 +609,8 @@
                 wcross_color_x = cvar("crosshair_color_red");
                 wcross_color_y = cvar("crosshair_color_green");
                 wcross_color_z = cvar("crosshair_color_blue");
-                wcross_alpha = cvar("crosshair_color_alpha");
-                wcross_sizefloat = cvar("crosshair_size");
+                wcross_alpha = cvar("crosshair_color_alpha") * (1-cvar("_menu_alpha"));
+                wcross_sizefloat = cvar("crosshair_size") * (1-cvar("_menu_alpha"));
                 if (cvar("crosshair_per_weapon")) {
                     e = get_weaponinfo(activeweapon);
                     if (e && e.netname != "")

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-12 14:16:40 UTC (rev 7757)
@@ -2198,7 +2198,7 @@
 	bottomleft_y = vid_conheight;
 	bottomleft_z = 0;
 
-	sbar_alpha_bg = cvar("sbar_alpha_bg");
+	sbar_alpha_bg = cvar("sbar_alpha_bg") * (1 - cvar("_menu_alpha"));
 	sbar_border_thickness = bound(0, cvar("sbar_border_thickness"), 5);
 	sbar_color_bg_team = cvar("sbar_color_bg_team");
 	sbar_scoreboard_alpha_bg = cvar("sbar_scoreboard_alpha_bg");
@@ -2237,7 +2237,7 @@
 		pos_x = bottomleft_x;
 		pos_y = bottom_y - 50 - sbar_fontsize_spec_y;
 		s = textShortenToWidth(s, vid_conwidth/2.5/sbar_fontsize_spec_x, stringwidth_colors);
-		drawcolorcodedstring(pos, s, sbar_fontsize_spec, 1, DRAWFLAG_NORMAL);
+		drawcolorcodedstring(pos, s, sbar_fontsize_spec, sbar_alpha_fg, DRAWFLAG_NORMAL);
 
 		// spectator text in the upper right corner
 		if(spectatee_status == -1)

Modified: branches/nexuiz-2.0/data/qcsrc/menu/menu.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/menu.qc	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/qcsrc/menu/menu.qc	2009-09-12 14:16:40 UTC (rev 7757)
@@ -20,6 +20,8 @@
 
 void() m_init =
 {
+	cvar_set("_menu_alpha", "0");
+
 	dprint_load();
 	check_unacceptable_compiler_bugs();
 
@@ -583,6 +585,9 @@
 			drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME, SKINALIGN_BACKGROUND_INGAME, FALSE);
 	}
 
+	if(menuAlpha != prevMenuAlpha)
+		cvar_set("_menu_alpha", ftos(menuAlpha));
+
 	draw_reset();
 	preMenuDraw();
 	draw_reset();

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc	2009-09-12 14:15:45 UTC (rev 7756)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc	2009-09-12 14:16:40 UTC (rev 7757)
@@ -974,6 +974,8 @@
 	float   total_damage_to_creatures;
 	entity  next;
 	float weaponid;
+	float   tfloordmg;
+	float   tfloorforce;
 
 	float stat_damagedone;
 	float stat_maxdamage;
@@ -991,9 +993,11 @@
 		return 0;
 	}
 
-
 	RadiusDamage_running = 1;
 
+	tfloordmg = cvar("g_throughfloor");
+	tfloorforce = cvar("g_throughfloor");
+
 	blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
 	total_damage_to_creatures = 0;
 
@@ -1029,6 +1033,8 @@
 				power = 1 - ((vlen (diff) - 2) / rad);
 				//bprint(" ");
 				//bprint(ftos(power));
+				//if (targ == attacker)
+				//	print(ftos(power), "\n");
 				if (power > 0)
 				{
 					if (power > 1)
@@ -1036,47 +1042,72 @@
 					finaldmg = coredamage * power + edgedamage * (1 - power);
 					if (finaldmg > 0)
 					{
+						local float a;
+						local float c;
+						local float hits;
+						local float total;
+						local float hitratio;
+						local vector hitloc;
 						center = targ.origin + (targ.mins + targ.maxs) * 0.5;
 						// if it's a player, use the view origin as reference
 						if (targ.classname == "player")
 							center = targ.origin + targ.view_ofs;
-						force = normalize(center - blastorigin) * (finaldmg / coredamage) * forceintensity;
+						force = normalize(center - blastorigin);
+						force = force * (finaldmg / coredamage) * forceintensity;
 						// test line of sight to multiple positions on box,
 						// and do damage if any of them hit
-						local float c;
-						c = ceil(finaldmg / 10);
-						if (c > 20)
-							c = 20;
-						while (c > 0)
+						hits = 0;
+						total = ceil(bound(1, finaldmg, 50));
+						hitloc = nearest;
+						c = 0;
+						while (c < total)
 						{
-							c = c - 1;
-							traceline(blastorigin, nearest, TRUE, inflictor);
-							if (trace_fraction == 1 || trace_ent == targ
-							    || cvar("g_throughfloor"))
+							traceline(blastorigin, nearest, MOVE_NOMONSTERS, inflictor);
+							if (trace_fraction == 1 || trace_ent == targ)
 							{
-								if(targ.iscreature)
+								hits = hits + 1;
+								if (hits > 1)
+									hitloc = hitloc + nearest;
+								else
+									hitloc = nearest;
+							}
+							nearest_x = targ.origin_x + targ.mins_x + random() * targ.size_x;
+							nearest_y = targ.origin_y + targ.mins_y + random() * targ.size_y;
+							nearest_z = targ.origin_z + targ.mins_z + random() * targ.size_z;
+							c = c + 1;
+						}
+						nearest = hitloc * (1 / max(1, hits));
+						hitratio = (hits / total);
+						a = bound(0, tfloordmg + (1-tfloordmg) * hitratio, 1);
+						finaldmg = finaldmg * a;
+						a = bound(0, tfloorforce + (1-tfloorforce) * hitratio, 1);
+						force = force * a;
+						//if (targ == attacker)
+						//{
+						//	print("hits ", ftos(hits), " / ", ftos(total));
+						//	print(" finaldmg ", ftos(finaldmg), " force ", vtos(force));
+						//	print(" (", ftos(a), ")\n");
+						//}
+						if(hits || tfloordmg || tfloorforce)
+						{
+							if(targ.iscreature)
+							{
+								total_damage_to_creatures += finaldmg;
+
+								if(targ.flags & FL_CLIENT)
+								if(targ.deadflag == DEAD_NO)
+								if(targ != attacker)
+								if(!teamplay || targ.team != attacker.team)
 								{
-									total_damage_to_creatures += finaldmg;
-
-									if(targ.flags & FL_CLIENT)
-									if(targ.deadflag == DEAD_NO)
-									if(targ != attacker)
-									if(!teamplay || targ.team != attacker.team)
-									{
-										stat_damagedone += finaldmg;
-										stat_maxdamage += coredamage;
-									}
+									stat_damagedone += finaldmg;
+									stat_maxdamage += coredamage;
 								}
+							}
 
-								if(targ == directhitentity || DEATH_ISSPECIAL(deathtype))
-									Damage (targ, inflictor, attacker, finaldmg, deathtype, nearest, force);
-								else
-									Damage (targ, inflictor, attacker, finaldmg, deathtype | HITTYPE_SPLASH, nearest, force);
-								break;
-							}
-							nearest_x = targ.mins_x + random() * targ.size_x;
-							nearest_y = targ.mins_y + random() * targ.size_y;
-							nearest_z = targ.mins_z + random() * targ.size_z;
+							if(targ == directhitentity || DEATH_ISSPECIAL(deathtype))
+								Damage (targ, inflictor, attacker, finaldmg, deathtype, nearest, force);
+							else
+								Damage (targ, inflictor, attacker, finaldmg, deathtype | HITTYPE_SPLASH, nearest, force);
 						}
 					}
 				}



More information about the nexuiz-commits mailing list