[nexuiz-commits] r7727 - in branches/nexuiz-2.0: . data data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Sep 11 04:48:29 EDT 2009


Author: div0
Date: 2009-09-11 04:48:29 -0400 (Fri, 11 Sep 2009)
New Revision: 7727

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
   branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
   branches/nexuiz-2.0/data/weapons.cfg
   branches/nexuiz-2.0/data/weaponsHavoc.cfg
Log:
r7680 | m0rfar | 2009-09-07 14:27:35 -0400 (Mon, 07 Sep 2009) | 2 lines
g_ctf_captimerecord_allow_assisted -> g_ctf_captimerecord_always
More user-friendly cvar name imo.
r7687 | div0 | 2009-09-08 08:06:04 -0400 (Tue, 08 Sep 2009) | 2 lines
Random Mutator Day: RANDOM WEAPON ARENA. You spawn randomly with any of the arena weapons set up.


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/.patchsets	2009-09-11 08:48:29 UTC (rev 7727)
@@ -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-7678,7686-7686,7689-7690
+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-7678,7680-7680,7686-7687,7689-7690

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-11 08:48:29 UTC (rev 7727)
@@ -447,6 +447,7 @@
 set g_minstagib_speed_moverate 1.25 "speed-multiplier that applies while you carry the invincibility powerup"
 set g_vampire 0 "set to 1 to enable the vampire mode, where the damage done to your opponent gets added to your own health"
 set g_weaponarena "0"	"put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
+set g_weaponarena_random "0"	"if set to a number, only that weapon count is given on every spawn (randomly)"
 set g_laserguided_missile 0 "if set to 1 the rockets of the rocket launcher can be steered using a laserpointer"
 set g_midair 0 "if set to 1 you can only apply damage to your opponent while he is airborne"
 set g_midair_shieldtime 0.3 "number of seconds you are still invincible since you lost contact to the ground"
@@ -575,7 +576,7 @@
 set g_ctf_flag_glowtrails 0
 set g_ctf_flag_pickup_effects 1
 set g_ctf_flag_capture_effects 1
-set g_ctf_captimerecord_allow_assisted 0 "if enabled, assisted CTF records (with other players on the server) are recorded too"
+set g_ctf_captimerecord_always 0 "if enabled, assisted CTF records (with other players on the server) are recorded too"
 
 exec ctfscoring-div0.cfg
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-09-11 08:48:29 UTC (rev 7727)
@@ -848,6 +848,10 @@
 			self.armorvalue = start_armorvalue;
 			self.weapons = start_weapons;
 		}
+
+		if(g_weaponarena_random)
+			self.weapons = randombits(self.weapons, g_weaponarena_random);
+
 		self.items = start_items;
 		self.switchweapon = w_getbestweapon(self);
 		self.cnt = self.switchweapon;

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-09-11 08:48:29 UTC (rev 7727)
@@ -1,5 +1,5 @@
-string CVAR_CHECK_DEFAULT = "ff6f4ae047891b3b61ecfc5b3d3b38b4";
-string CVAR_CHECK_WEAPONS = "a7ca57b891d66754b856e24e5c1745e3";
+string CVAR_CHECK_DEFAULT = "ff4c4b4c9c9574b0d647c023021a8956";
+string CVAR_CHECK_WEAPONS = "eead6b984631a74c8337b1bf9756cfc9";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/ctf.qc	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/qcsrc/server/ctf.qc	2009-09-11 08:48:29 UTC (rev 7727)
@@ -437,7 +437,7 @@
 		{
 			return;
 		}
-		if(cvar("g_ctf_captimerecord_allow_assisted") || player_count - currentbots <= 1) // at most one human
+		if(cvar("g_ctf_captimerecord_always") || player_count - currentbots <= 1) // at most one human
 		{
 			t = time - other.flagcarried.flagpickuptime;
 			s = ftos_decimals(t, 2);

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-09-11 08:48:29 UTC (rev 7727)
@@ -725,6 +725,7 @@
 float g_pickup_healthmega;
 float g_pickup_healthmega_max;
 float g_weaponarena;
+float g_weaponarena_random;
 string g_weaponarena_list;
 float g_weaponspeedfactor;
 float g_weaponratefactor;
@@ -825,9 +826,14 @@
                 print("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
             }
         }
-        g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
-    }
+		g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
+	}
 
+	if(g_weaponarena)
+		g_weaponarena_random = cvar("g_weaponarena_random");
+	else
+		g_weaponarena_random = 0;
+
     if (g_nixnex)
     {
         start_weapons = 0;
@@ -2552,3 +2558,51 @@
 {
 	return modeleffect_spawn(m, 0, 0, org, '0 0 0', '0 0 0', '0 0 0', 0, sz, 1, t1, t2);
 }
+
+float randombit(float bits)
+{
+	if not(bits & (bits-1)) // this ONLY holds for powers of two!
+		return bits;
+
+	float n, f, b, r;
+
+	r = random();
+	b = 0;
+	n = 0;
+
+	for(f = 1; f <= bits; f *= 2)
+	{
+		if(bits & f)
+		{
+			++n;
+			r *= n;
+			if(r <= 1)
+				b = f;
+			else
+				r = (r - 1) / (n - 1);
+		}
+	}
+
+	return b;
+}
+
+float randombits(float bits, float k)
+{
+	float r;
+	r = 0;
+	while(k > 0 && bits != r)
+	{
+		r += randombit(bits - r);
+		--k;
+	}
+	return r;
+}
+
+void randombit_test(float bits, float iter)
+{
+	while(iter > 0)
+	{
+		print(ftos(randombit(bits)), "\n");
+		--iter;
+	}
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2009-09-11 08:48:29 UTC (rev 7727)
@@ -476,7 +476,12 @@
 	if(g_nixnex)
 		modifications = strcat(modifications, ", NixNex");
 	if(g_weaponarena)
-		modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
+	{
+		if(g_weaponarena_random)
+			modifications = strcat(modifications, ", ", ftos(g_weaponarena_random), " of ", g_weaponarena_list, " Arena");
+		else
+			modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
+	}
 	if(cvar("g_start_weapon_laser") == 0)
 		modifications = strcat(modifications, ", No start weapons");
 	if(cvar("sv_gravity") < 800)

Modified: branches/nexuiz-2.0/data/weapons.cfg
===================================================================
--- branches/nexuiz-2.0/data/weapons.cfg	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/weapons.cfg	2009-09-11 08:48:29 UTC (rev 7727)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit weaponsHavoc.cfg too.
 
-set cvar_check_weapons d8c27ad261a5506934d70968b6a47244
+set cvar_check_weapons eead6b984631a74c8337b1bf9756cfc9
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!

Modified: branches/nexuiz-2.0/data/weaponsHavoc.cfg
===================================================================
--- branches/nexuiz-2.0/data/weaponsHavoc.cfg	2009-09-11 08:44:39 UTC (rev 7726)
+++ branches/nexuiz-2.0/data/weaponsHavoc.cfg	2009-09-11 08:48:29 UTC (rev 7727)
@@ -1,4 +1,4 @@
-set cvar_check_weapons d8c27ad261a5506934d70968b6a47244
+set cvar_check_weapons eead6b984631a74c8337b1bf9756cfc9
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!



More information about the nexuiz-commits mailing list