r3267 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 25 03:35:55 EST 2008


Author: lordhavoc
Date: 2008-01-25 03:35:40 -0500 (Fri, 25 Jan 2008)
New Revision: 3267

Modified:
   trunk/data/qcsrc/server/bots.qc
   trunk/data/qcsrc/server/havocbot.qc
   trunk/data/qcsrc/server/havocbot_roles.qc
   trunk/data/qcsrc/server/t_items.qc
   trunk/data/qcsrc/server/w_uzi.qc
Log:
tweaked bot weapon choosing
changed bot firing choice (they fire bursts now, not sporadic shots) and
added/changed a few other things
cleaned up commodity_pickupevalfunc a bit
increased importance of items to bots


Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2008-01-25 08:16:41 UTC (rev 3266)
+++ trunk/data/qcsrc/server/bots.qc	2008-01-25 08:35:40 UTC (rev 3267)
@@ -994,24 +994,28 @@
 {
 	local entity waylist, w, best;
 	local float dist, bestdist;
-	local vector v, org;
-	org = player.origin + (player.mins_z - PL_MIN_z) * '0 0 1';
-	if(player.tag_entity)
-		org = org + player.tag_entity.origin;
-	if (navigation_testtracewalk)
-		te_plasmaburn(org);
-	best = world;
-	bestdist = 1000;
+	local vector v, org, pm1, pm2;
+	pm1 = player.origin + PL_MIN;
+	pm2 = player.origin + PL_MAX;
 	waylist = findchain(classname, "waypoint");
 	// do two scans, because box test is cheaper
 	w = waylist;
 	while (w)
 	{
 		// if object is touching waypoint
-		if (boxesoverlap(org, org, w.absmin, w.absmax))
+		if (boxesoverlap(pm1, pm2, w.absmin, w.absmax))
 			return w;
 		w = w.chain;
 	}
+
+	org = player.origin + (player.mins_z - PL_MIN_z) * '0 0 1';
+	if(player.tag_entity)
+		org = org + player.tag_entity.origin;
+	if (navigation_testtracewalk)
+		te_plasmaburn(org);
+	best = world;
+	bestdist = 1050;
+
 	// box check failed, try walk
 	w = waylist;
 	while (w)
@@ -1212,17 +1216,21 @@
 		e.nearestwaypoint = navigation_findnearestwaypoint(e, TRUE);
 		e.nearestwaypointtimeout = time + random() * 3 + 5;
 	}
+	dprint(e.classname, " ", ftos(f));
 	if (e.nearestwaypoint)
 	if (e.nearestwaypoint.wpcost < 10000000)
 	{
 		//te_wizspike(e.nearestwaypoint.wpnearestpoint);
-		f = f / ((e.nearestwaypoint.wpcost + vlen(e.origin - e.nearestwaypoint.wpnearestpoint)) * 0.001 + 1);
+		dprint(e.classname, " ", ftos(f), "*(500/(500+", ftos((e.nearestwaypoint.wpcost + vlen(e.origin - e.nearestwaypoint.wpnearestpoint))), " = ");
+		f = f * 500 / ((e.nearestwaypoint.wpcost + vlen(e.origin - e.nearestwaypoint.wpnearestpoint)) + 500);
+		dprint(ftos(f));
 		if (navigation_bestrating < f)
 		{
 			navigation_bestrating = f;
 			navigation_bestgoal = e;
 		}
 	}
+	dprint("\n");
 };
 
 // replaces the goal stack with the path to a given item
@@ -1703,10 +1711,9 @@
 	// note the maxfiredeviation is in degrees so this has to convert to radians first
 	//if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
 	if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
-			self.bot_firetimer = time + 0.3/bound(1,skill*0.3,3);
+	if (vlen(trace_endpos-shotorg) < 500+500*bound(0, skill, 10) || random()*random()>bound(0,skill*0.05,1))
+		self.bot_firetimer = time + bound(0.1, 0.5-skill*0.05, 0.5);
 	traceline(shotorg,shotorg+shotdir*1000,FALSE,world);
-	if ( vlen(trace_endpos-shotorg)>bound(0,skill*20,20) && random()<bound(0,skill*0.5,10)*frametime*2 )
-		self.bot_canfire = 0;
 	//dprint(ftos(maxfiredeviation),"\n");
 	//dprint(" diff:", vtos(diffang), "\n");
 

Modified: trunk/data/qcsrc/server/havocbot.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot.qc	2008-01-25 08:16:41 UTC (rev 3266)
+++ trunk/data/qcsrc/server/havocbot.qc	2008-01-25 08:35:40 UTC (rev 3267)
@@ -272,8 +272,6 @@
 };
 
 float(entity e) w_getbestweapon;
-.float havocbot_chooseweapon_timer;
-.float havocbot_chooseweapon_lastbestscore;
 void() havocbot_chooseweapon =
 {
 	// TODO: clean this up by moving it to weapon code
@@ -283,6 +281,7 @@
 		return;
 	}
 
+	local float w, s;
 	local float rocket  ; rocket   =-1000;
 	local float nex     ; nex      =-1000;
 	local float hagar   ; hagar    =-1000;
@@ -292,6 +291,7 @@
 	local float uzi     ; uzi      =-1000;
 	local float shotgun ; shotgun  =-1000;
 	local float laser   ; laser    =-1000;
+	local float currentscore;
 	local float bestscore; bestscore = 0;
 	local float bestweapon; bestweapon=self.switchweapon;
 	local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
@@ -322,23 +322,23 @@
 			* bound(0,(cvar("g_balance_electro_primary_speed")/distance*maxdelaytime),1)*1.0;
 	if (client_hasweapon(self, WEP_CRYLINK, TRUE, FALSE))
 		crylink = (cvar("g_balance_crylink_primary_damage")/cvar("g_balance_crylink_primary_refire")*1.0)
-			* bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*1.0;
+			* bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*(64/(32+cvar("g_balance_crylink_primary_spread")*distance))*1.0;
 	if (client_hasweapon(self, WEP_UZI, TRUE, FALSE))
 		uzi = (cvar("g_balance_uzi_sustained_damage")/cvar("g_balance_uzi_sustained_refire")*1.0)
-			* bound(0,1/cvar("g_balance_uzi_sustained_spread")/distance*spreadpenalty,1)*0.5;
+			* bound(0,32/(32+cvar("g_balance_uzi_sustained_spread")*distance),1);
 	if (client_hasweapon(self, WEP_SHOTGUN, TRUE, FALSE))
 		shotgun = (cvar("g_balance_shotgun_primary_damage")*cvar("g_balance_shotgun_primary_bullets")/cvar("g_balance_shotgun_primary_refire")*1.0)
-			* bound(0,1/cvar("g_balance_shotgun_primary_spread")/distance*spreadpenalty,1);
+			* bound(0,32/(32+cvar("g_balance_shotgun_primary_spread")*distance),1);
 	if (client_hasweapon(self, WEP_LASER, FALSE, FALSE))
 		laser = (cvar("g_balance_laser_primary_damage")/cvar("g_balance_laser_primary_refire")*1.0)
-			* bound(0,cvar("g_balance_laser_primary_speed")/distance*0.2*maxdelaytime,1);
+			* bound(0,cvar("g_balance_laser_primary_speed")/distance*maxdelaytime,1);
 	if((self.enemy.flags & FL_ONGROUND)==FALSE){
-		rocket = rocket   * (1-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius"         ),0.9)); //slight bigger change
-		grenade = grenade * (1-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
-		electro = electro * (1-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius"        ),0.95));
-		laser = laser     * (1-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius"                  ),0.95));
+		rocket = rocket   * (1.5-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius"         ),0.9)); //slight bigger change
+		grenade = grenade * (1.5-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
+		electro = electro * (1.5-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius"        ),0.95));
+		laser = laser     * (1.5-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius"                  ),0.95));
 	}
-/*
+	/*
 	dprint("Floor distance: ",ftos(distancefromfloor),"\n");
 	dprint("Rocket: " , ftos(rocket  ), "\n");
 	dprint("Nex: "    , ftos(nex     ), "\n");
@@ -349,26 +349,21 @@
 	dprint("Uzi: "    , ftos(uzi     ), "\n");
 	dprint("Shotgun :", ftos(shotgun ), "\n");
 	dprint("Laser   :", ftos(laser   ), "\n\n");
-*/
-	if (rocket  > bestscore){ bestscore = rocket  ; bestweapon = WEP_ROCKET_LAUNCHER  ;}
-	if (nex     > bestscore){ bestscore = nex     ; bestweapon = WEP_NEX              ;}
-	if (hagar   > bestscore){ bestscore = hagar   ; bestweapon = WEP_HAGAR            ;}
-	if (grenade > bestscore){ bestscore = grenade ; bestweapon = WEP_GRENADE_LAUNCHER ;}
-	if (electro > bestscore){ bestscore = electro ; bestweapon = WEP_ELECTRO          ;}
-	if (crylink > bestscore){ bestscore = crylink ; bestweapon = WEP_CRYLINK          ;}
-	if (uzi     > bestscore){ bestscore = uzi     ; bestweapon = WEP_UZI              ;}
-	if (shotgun > bestscore){ bestscore = shotgun ; bestweapon = WEP_SHOTGUN          ;}
-	if (laser   > bestscore){ bestscore = laser   ; bestweapon = WEP_LASER            ;}
+	*/
+	currentscore = -1;
+	w = WEP_ROCKET_LAUNCHER  ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_NEX              ;s = nex    ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_HAGAR            ;s = hagar  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_GRENADE_LAUNCHER ;s = grenade;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_ELECTRO          ;s = electro;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_CRYLINK          ;s = crylink;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_UZI              ;s = uzi    ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_SHOTGUN          ;s = shotgun;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+	w = WEP_LASER            ;s = laser  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
 
-	if(time>self.havocbot_chooseweapon_timer || self.havocbot_chooseweapon_lastbestscore<bestscore/10) //Or when the new damage is SOO much larger ! Or my gun runs out of ammo
-	{
-		self.havocbot_chooseweapon_timer=max(self.havocbot_chooseweapon_timer+cvar("g_balance_weaponswitchdelay")*120*(10-skill)*0.1,time);
-		if( self.havocbot_chooseweapon_lastbestscore*1.5<bestscore*bound(1,1+(skill*skill)*0.01,2))
-		{
-			self.switchweapon = bestweapon; 
-			self.havocbot_chooseweapon_lastbestscore=bestscore;
-		}
-	}
+	// switch if the best weapon would provide a significant damage increase
+	if (bestscore > currentscore*1.5)
+		self.switchweapon = bestweapon;
 };
 
 .float nextaim;

Modified: trunk/data/qcsrc/server/havocbot_roles.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot_roles.qc	2008-01-25 08:16:41 UTC (rev 3266)
+++ trunk/data/qcsrc/server/havocbot_roles.qc	2008-01-25 08:35:40 UTC (rev 3267)
@@ -14,6 +14,7 @@
 {
 	local entity head;
 	local float t;
+	ratingscale = ratingscale * 0.0001; // items are rated around 10000 already
 	head = findchainfloat(bot_pickup, TRUE);
 	while (head)
 	{
@@ -24,7 +25,7 @@
 			//if (!head.bot_pickupevalfunc || head.model == "")
 			//	eprint(head);
 			// get the value of the item
-			t = head.bot_pickupevalfunc(self, head) * 0.0001;
+			t = head.bot_pickupevalfunc(self, head);
 			if (t > 0)
 				navigation_routerating(head, t * ratingscale);
 		}
@@ -51,6 +52,10 @@
 	}
 };
 
+/*
+// LordHavoc: this function was already unused, but for waypoints to be a
+// useful goal the bots would have to seek out the least-recently-visited
+// ones, not the closest
 void(float ratingscale, vector org, float sradius) havocbot_goalrating_waypoints =
 {
 	local entity head;
@@ -62,12 +67,12 @@
 		head = head.chain;
 	}
 };
+*/
 
 void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers =
 {
 	local entity head;
 	local float t, noteam;
-	ratingscale = ratingscale * 1200;
 	noteam = ((self.team == 0) || (teamplay == 0)); // fteqcc sucks
 	//dprint("teamplay is "); dprint(ftos(teamplay)); dprint(", own team is ");
 	//dprint(ftos(self.team)); dprint(" -> noteam is "); dprint(ftos(noteam));
@@ -80,10 +85,7 @@
 		if ((noteam && (!bot_ignore_bots || clienttype(head) == CLIENTTYPE_REAL)) || head.team != self.team)
 		if (vlen(head.origin - org) < sradius)
 		{
-			t = head.frags + 25;
-			if (t < 1)
-				t = 1;
-			t = t / (head.health + head.armortype * head.armorvalue);
+			t = 100 / (head.health + head.armorvalue);
 			if (t > 0)
 			{
 				//dprint("found: "); dprint(head.netname); dprint("\n");
@@ -477,7 +479,7 @@
 		navigation_goalrating_start();
 		havocbot_goalrating_controlpoints(10000, self.origin, 15000);
 		havocbot_goalrating_items(8000, self.origin, 8000);
-		//havocbot_goalrating_enemyplayers(1, self.origin, 2000);
+		//havocbot_goalrating_enemyplayers(3000, self.origin, 2000);
 		//havocbot_goalrating_waypoints(1, self.origin, 1000);
 		navigation_goalrating_end();
 	}
@@ -492,7 +494,7 @@
 		self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
 		navigation_goalrating_start();
 		havocbot_goalrating_items(10000, self.origin, 10000);
-		havocbot_goalrating_enemyplayers(1, self.origin, 20000);
+		havocbot_goalrating_enemyplayers(5000, self.origin, 20000);
 		//havocbot_goalrating_waypoints(1, self.origin, 1000);
 		navigation_goalrating_end();
 	}

Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2008-01-25 08:16:41 UTC (rev 3266)
+++ trunk/data/qcsrc/server/t_items.qc	2008-01-25 08:35:40 UTC (rev 3267)
@@ -240,22 +240,22 @@
 	// find out how much more ammo/armor/health the player can hold
 	if (item.ammo_shells)
 	if (player.ammo_shells < g_pickup_shells_max)
-		c = c + 1 - min(player.ammo_shells / g_pickup_shells_max, 1);
+		c = c + max(0, 1 - player.ammo_shells / g_pickup_shells_max);
 	if (item.ammo_nails)
 	if (player.ammo_nails < g_pickup_nails_max)
-		c = c + 1 - min(player.ammo_nails / g_pickup_nails_max, 1);
+		c = c + max(0, 1 - player.ammo_nails / g_pickup_nails_max);
 	if (item.ammo_rockets)
 	if (player.ammo_rockets < g_pickup_rockets_max)
-		c = c + 1 - min(player.ammo_rockets / g_pickup_rockets_max, 1);
+		c = c + max(0, 1 - player.ammo_rockets / g_pickup_rockets_max);
 	if (item.ammo_cells)
 	if (player.ammo_cells < g_pickup_cells_max)
-		c = c + 1 - min(player.ammo_cells / g_pickup_cells_max, 1);
+		c = c + max(0, 1 - player.ammo_cells / g_pickup_cells_max);
 	if (item.armorvalue)
 	if (player.armorvalue < item.max_armorvalue)
-		c = c + 1 - min(player.armorvalue / item.max_armorvalue, 1);
+		c = c + max(0, 1 - player.armorvalue / item.max_armorvalue);
 	if (item.health)
 	if (player.health < item.max_health)
-		c = c + 1 - min(player.health / item.max_health, 1);
+		c = c + max(0, 1 - player.health / item.max_health);
 
 	if (cvar("deathmatch") == 2) // weapon stay is on, so weapons the player already has are of no interest
 	if (item.flags & FL_WEAPON)
@@ -533,7 +533,7 @@
 
 	if(!self.ammo_nails)
 		self.ammo_nails = cvar("g_pickup_nails");
-	StartItem ("models/weapons/g_uzi.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_UZI), IT_UZI, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_uzi.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_UZI), IT_UZI, FL_WEAPON, weapon_pickupevalfunc, 20000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_UZI, WR_PRECACHE);
 }
@@ -551,7 +551,7 @@
 
 	if(!self.ammo_shells)
 		self.ammo_shells = cvar("g_pickup_shells");
-	StartItem ("models/weapons/g_shotgun.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_SHOTGUN), IT_SHOTGUN, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_shotgun.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_SHOTGUN), IT_SHOTGUN, FL_WEAPON, weapon_pickupevalfunc, 10000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_SHOTGUN, WR_PRECACHE);
 }
@@ -560,7 +560,7 @@
 {
 	if(!self.ammo_rockets)
 		self.ammo_rockets = cvar("g_pickup_rockets");
-	StartItem ("models/weapons/g_gl.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_GRENADE_LAUNCHER), IT_GRENADE_LAUNCHER, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_gl.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_GRENADE_LAUNCHER), IT_GRENADE_LAUNCHER, FL_WEAPON, weapon_pickupevalfunc, 20000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_GRENADE_LAUNCHER, WR_PRECACHE);
 }
@@ -569,7 +569,7 @@
 {
 	if(!self.ammo_cells)
 		self.ammo_cells = cvar("g_pickup_cells");
-	StartItem ("models/weapons/g_electro.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_ELECTRO), IT_ELECTRO, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_electro.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_ELECTRO), IT_ELECTRO, FL_WEAPON, weapon_pickupevalfunc, 15000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_ELECTRO, WR_PRECACHE);
 }
@@ -578,7 +578,7 @@
 {
 	if(!self.ammo_cells)
 		self.ammo_cells = cvar("g_pickup_cells");
-	StartItem ("models/weapons/g_crylink.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_CRYLINK), IT_CRYLINK, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_crylink.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_CRYLINK), IT_CRYLINK, FL_WEAPON, weapon_pickupevalfunc, 10000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_CRYLINK, WR_PRECACHE);
 }
@@ -600,7 +600,7 @@
 		nextime = 15 * nextime;
 	else
 		nextime = 15;
-	StartItem ("models/weapons/g_nex.md3", "weapons/weaponpickup.wav", nextime, W_Name(WEP_NEX), IT_NEX, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_nex.md3", "weapons/weaponpickup.wav", nextime, W_Name(WEP_NEX), IT_NEX, FL_WEAPON, weapon_pickupevalfunc, 30000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_NEX, WR_PRECACHE);
 }
@@ -609,7 +609,7 @@
 {
 	if(!self.ammo_rockets)
 		self.ammo_rockets = cvar("g_pickup_rockets");
-	StartItem ("models/weapons/g_hagar.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_HAGAR), IT_HAGAR, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_hagar.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_HAGAR), IT_HAGAR, FL_WEAPON, weapon_pickupevalfunc, 10000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_HAGAR, WR_PRECACHE);
 }
@@ -625,7 +625,7 @@
 	}
 	if(!self.ammo_rockets)
 		self.ammo_rockets = g_pickup_rockets;
-	StartItem ("models/weapons/g_rl.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_ROCKET_LAUNCHER), IT_ROCKET_LAUNCHER, FL_WEAPON, weapon_pickupevalfunc, 1000);
+	StartItem ("models/weapons/g_rl.md3", "weapons/weaponpickup.wav", 15, W_Name(WEP_ROCKET_LAUNCHER), IT_ROCKET_LAUNCHER, FL_WEAPON, weapon_pickupevalfunc, 30000);
 	if (self.modelindex) // don't precache if self was removed
 		weapon_action(WEP_ROCKET_LAUNCHER, WR_PRECACHE);
 }
@@ -633,7 +633,7 @@
 void item_rockets (void) {
 	if(!self.ammo_rockets)
 		self.ammo_rockets = g_pickup_rockets;
-	StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", 15, "rockets", IT_ROCKETS, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", 15, "rockets", IT_ROCKETS, 0, commodity_pickupevalfunc, 3000);
 }
 
 void item_shells (void);
@@ -650,13 +650,13 @@
 
 	if(!self.ammo_nails)
 		self.ammo_nails = g_pickup_nails;
-	StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", 15, "bullets", IT_NAILS, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", 15, "bullets", IT_NAILS, 0, commodity_pickupevalfunc, 2000);
 }
 
 void item_cells (void) {
 	if(!self.ammo_cells)
 		self.ammo_cells = g_pickup_cells;
-	StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", 15, "cells", IT_CELLS, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", 15, "cells", IT_CELLS, 0, commodity_pickupevalfunc, 2000);
 }
 
 void item_shells (void) {
@@ -672,7 +672,7 @@
 
 	if(!self.ammo_shells)
 		self.ammo_shells = g_pickup_shells;
-	StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", 15, "shells", IT_SHELLS, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", 15, "shells", IT_SHELLS, 0, commodity_pickupevalfunc, 500);
 }
 
 void item_armor_small (void) {
@@ -680,7 +680,7 @@
 		self.armorvalue = g_pickup_armorsmall;
 	if(!self.max_armorvalue)
 		self.max_armorvalue = g_pickup_armorsmall_max;
-	StartItem ("models/items/g_a1.md3", "misc/armor1.wav", 15, "5 Armor", IT_ARMOR_SHARD, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/g_a1.md3", "misc/armor1.wav", 15, "5 Armor", IT_ARMOR_SHARD, 0, commodity_pickupevalfunc, 1000);
 }
 
 void item_armor_medium (void) {
@@ -688,7 +688,7 @@
 		self.armorvalue = g_pickup_armormedium;
 	if(!self.max_armorvalue)
 		self.max_armorvalue = g_pickup_armormedium_max;
-	StartItem ("models/items/g_armormedium.md3", "misc/armor1.wav", 30, "25 Armor", IT_ARMOR, 0, commodity_pickupevalfunc, 2000);
+	StartItem ("models/items/g_armormedium.md3", "misc/armor1.wav", 30, "25 Armor", IT_ARMOR, 0, commodity_pickupevalfunc, 20000);
 }
 
 void item_armor_large (void) {
@@ -696,7 +696,7 @@
 		self.armorvalue = g_pickup_armorlarge;
 	if(!self.max_armorvalue)
 		self.max_armorvalue = g_pickup_armorlarge_max;
-	StartItem ("models/items/g_a25.md3", "misc/armor25.wav", 30, "100 Armor", IT_ARMOR, 0, commodity_pickupevalfunc, 2000);
+	StartItem ("models/items/g_a25.md3", "misc/armor25.wav", 30, "100 Armor", IT_ARMOR, 0, commodity_pickupevalfunc, 20000);
 }
 
 void item_health_small (void) {
@@ -704,7 +704,7 @@
 		self.max_health = g_pickup_healthsmall_max;
 	if(!self.health)
 		self.health = g_pickup_healthsmall;
-	StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", 15, "5 Health", IT_5HP, 0, commodity_pickupevalfunc, 100);
+	StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", 15, "5 Health", IT_5HP, 0, commodity_pickupevalfunc, 1000);
 }
 
 void item_health_medium (void) {
@@ -712,7 +712,7 @@
 		self.max_health = g_pickup_healthmedium_max;
 	if(!self.health)
 		self.health = g_pickup_healthmedium;
-	StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", 15, "25 Health", IT_25HP, 0, commodity_pickupevalfunc, 500);
+	StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", 15, "25 Health", IT_25HP, 0, commodity_pickupevalfunc, 5000);
 }
 
 void item_health_large (void) {
@@ -720,7 +720,7 @@
 		self.max_health = g_pickup_healthlarge_max;
 	if(!self.health)
 		self.health = g_pickup_healthlarge;
-	StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", 15, "50 Health", IT_25HP, 0, commodity_pickupevalfunc, 500);
+	StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", 15, "50 Health", IT_25HP, 0, commodity_pickupevalfunc, 5000);
 }
 
 void item_health_mega (void) {
@@ -737,7 +737,7 @@
 			self.max_health = g_pickup_healthmega_max;
 		if(!self.health)
 			self.health = g_pickup_healthmega;
-		StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", IT_HEALTH, 0, commodity_pickupevalfunc, 2000);
+		StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", IT_HEALTH, 0, commodity_pickupevalfunc, 20000);
 	}
 }
 
@@ -760,7 +760,7 @@
 	} else {
 		precache_sound("weapons/strength_fire.wav");
 		self.strength_finished = 30;
-		self.effects = EF_ADDITIVE;StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, FL_POWERUP, generic_pickupevalfunc, 10000);
+		self.effects = EF_ADDITIVE;StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, FL_POWERUP, generic_pickupevalfunc, 100000);
 	}
 }
 
@@ -776,7 +776,7 @@
 	} else {
 		self.invincible_finished = 30;
 		self.effects = EF_ADDITIVE;
-		StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", 120, "Invulnerability", IT_INVINCIBLE, FL_POWERUP, generic_pickupevalfunc, 10000);
+		StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", 120, "Invulnerability", IT_INVINCIBLE, FL_POWERUP, generic_pickupevalfunc, 100000);
 	}
 }
 //void item_speed (void) {self.speed_finished = 30;StartItem ("models/items/g_speed.md3", "misc/powerup.wav", 120, "Speed Powerup", IT_SPEED, FL_POWERUP, generic_pickupevalfunc, 10000);}

Modified: trunk/data/qcsrc/server/w_uzi.qc
===================================================================
--- trunk/data/qcsrc/server/w_uzi.qc	2008-01-25 08:16:41 UTC (rev 3266)
+++ trunk/data/qcsrc/server/w_uzi.qc	2008-01-25 08:35:40 UTC (rev 3267)
@@ -104,7 +104,7 @@
 float(float req) w_uzi =
 {
 	if (req == WR_AIM)
-		if(vlen(self.origin-self.enemy.origin)<750)
+		if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
 			self.button0 = bot_aim(1000000, 0, 0.001, FALSE);
 		else
 		{




More information about the nexuiz-commits mailing list