[nexuiz-commits] r6382 - in branches/nexuiz-2.0: . data data/gfx data/models/items data/qcsrc/client data/qcsrc/common data/qcsrc/server data/scripts misc/mediasource/models misc/netradiant-NexuizPack/nexuiz.game/data

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 30 09:47:03 EDT 2009


Author: div0
Date: 2009-03-30 09:47:02 -0400 (Mon, 30 Mar 2009)
New Revision: 6382

Added:
   branches/nexuiz-2.0/data/gfx/sb_fuel.tga
   branches/nexuiz-2.0/data/models/items/g_fuel.md3
   branches/nexuiz-2.0/data/models/items/g_fuelregen.md3
   branches/nexuiz-2.0/data/models/items/g_jetpack.md3
   branches/nexuiz-2.0/data/models/items/jetpack.tga
   branches/nexuiz-2.0/misc/mediasource/models/jetpack.blend
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/common/constants.qh
   branches/nexuiz-2.0/data/qcsrc/common/items.qh
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/defs.qh
   branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_quake3.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc
   branches/nexuiz-2.0/data/scripts/entities.def
   branches/nexuiz-2.0/data/weapons.cfg
   branches/nexuiz-2.0/data/weaponsHavoc.cfg
   branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
Log:
r6359 | div0 | 2009-03-30 10:39:32 +0200 (Mon, 30 Mar 2009) | 2 lines
jetpack: add a "fuel" ammo type, and use that - and let it have regeneration
r6360 | div0 | 2009-03-30 10:54:16 +0200 (Mon, 30 Mar 2009) | 13 lines
fix the remaining bugs in fuel support
now we need item models, and items that do:
- "fuel":
  - increase ammo_fuel
  - set pauserotfuel_finished
- "jetpack":
  - increase ammo_fuel
  - set pauserotfuel_finished
  - add IT_JETPACK to the items
r6361 | div0 | 2009-03-30 10:57:10 +0200 (Mon, 30 Mar 2009) | 7 lines
I forgot an item we need:
"Fuel Regenerator" - makes fuel able to regenerate
g_jetpack already gives this item, but without this mutator, it might be good
to have an item that enables regeneration
r6362 | div0 | 2009-03-30 11:17:28 +0200 (Mon, 30 Mar 2009) | 2 lines
more consistency regarding fuel
r6365 | div0 | 2009-03-30 12:37:13 +0200 (Mon, 30 Mar 2009) | 2 lines
no-operation change to pave the way for fuel and jetpack pickups
r6366 | div0 | 2009-03-30 12:54:05 +0200 (Mon, 30 Mar 2009) | 4 lines
item_fuel
item_jetpack (alias: item_flight from Q3A)
item_fuel_regen
r6368 | div0 | 2009-03-30 13:00:10 +0200 (Mon, 30 Mar 2009) | 2 lines
g_pickup_fuel_jetpack (make jetpack come with more fuel than a single fuel pickup)
r6370 | div0 | 2009-03-30 13:11:07 +0200 (Mon, 30 Mar 2009) | 2 lines
make jetpack and fuel regenerator have the powerup respawn time (mapper can override it anyway if he insists)
r6371 | div0 | 2009-03-30 13:24:00 +0200 (Mon, 30 Mar 2009) | 2 lines
make jetpack and fuel regen use the large bbox
r6372 | div0 | 2009-03-30 13:47:13 +0200 (Mon, 30 Mar 2009) | 2 lines
add a fuel icon to the sbar
r6373 | div0 | 2009-03-30 13:50:40 +0200 (Mon, 30 Mar 2009) | 2 lines
fix sb_fuel image
r6374 | div0 | 2009-03-30 13:52:10 +0200 (Mon, 30 Mar 2009) | 2 lines
fix display bug in sbar_hudsleector 0
r6377 | div0 | 2009-03-30 15:10:13 +0200 (Mon, 30 Mar 2009) | 2 lines
jetpack: item_jetpack now has a model
r6379 | div0 | 2009-03-30 15:33:29 +0200 (Mon, 30 Mar 2009) | 2 lines
fuel and fuel regen models :)
r6380 | div0 | 2009-03-30 15:39:35 +0200 (Mon, 30 Mar 2009) | 2 lines
make fuel regen un-confusable :P
r6381 | div0 | 2009-03-30 15:46:07 +0200 (Mon, 30 Mar 2009) | 2 lines
entities.def


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/.patchsets	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6357,6363-6364,6367-6367,6375-6376
+revisions_applied = 1-6381

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-30 13:47:02 UTC (rev 6382)
@@ -24,7 +24,7 @@
 seta g_configversion 0	"Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1  Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
 
 // default.cfg versioning (update using update-cvarcount.sh, run that every time after adding a new cvar)
-set cvar_check_default 11669b91ec9e0214a0e0ac37a3573c1a
+set cvar_check_default 779a1c2f508f65a13bad23ce1758beb8
 
 // Nexuiz version (formatted for machines)
 // used to determine if a client version is compatible
@@ -256,6 +256,7 @@
 set g_warmup_start_ammo_nails 150
 set g_warmup_start_ammo_rockets 50
 set g_warmup_start_ammo_cells 50
+set g_warmup_start_ammo_fuel 0
 
 set g_chat_nospectators 0	"if 0 spec/observer chat is always visible to the player, if 1 it is never visible to players, if 2 it is only visible to players during warmup stage"
 set sv_vote_nospectators 0	"if set only players can call a vote (thus spectators and observers can't call a vote)"
@@ -612,6 +613,7 @@
 set g_lms_start_ammo_nails 150
 set g_lms_start_ammo_rockets 50
 set g_lms_start_ammo_cells 50
+set g_lms_start_ammo_fuel 0
 set g_lms_regenerate 0
 set g_lms_campcheck_interval 10
 set g_lms_campcheck_message "^1Don't	camp!"
@@ -925,11 +927,13 @@
 set g_balance_nixnex_ammo_nails 45
 set g_balance_nixnex_ammo_rockets 15
 set g_balance_nixnex_ammo_cells 15
+set g_balance_nixnex_ammo_fuel 0
 // ammo increment per second
 set g_balance_nixnex_ammoincr_shells 2
 set g_balance_nixnex_ammoincr_nails 6
 set g_balance_nixnex_ammoincr_rockets 2
 set g_balance_nixnex_ammoincr_cells 2
+set g_balance_nixnex_ammoincr_fuel 2
 
 // score log
 set sv_logscores_console 0	"print scores to server console"
@@ -1423,8 +1427,18 @@
 set g_jetpack_acceleration_up 600 "acceleration of the jetpack in z direction (note: you have to factor in gravity here, if antigravity is not 1)"
 set g_jetpack_maxspeed_side 1500 "max speed of the jetpack in xy direction"
 set g_jetpack_maxspeed_up 600 "max speed of the jetpack in z direction"
-set g_jetpack_ammo 3 "cells per second for jetpack" 
+set g_jetpack_fuel 5 "fuel per second for jetpack" 
 
+set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
+set g_balance_fuel_rot 0.1
+set g_balance_fuel_regenlinear 0
+set g_balance_fuel_rotlinear 0
+set g_balance_fuel_stable 100
+set g_balance_fuel_limit 999
+set g_balance_pause_fuel_regen 1 // other than this, fuel uses the health regen counter
+set g_balance_pause_fuel_rot 5
+set g_balance_pause_fuel_rot_spawn 10
+
 set cl_effects_lightningarc_simple 0
 set cl_effects_lightningarc_segmentlength 64
 set cl_effects_lightningarc_drift_start 0.45

Copied: branches/nexuiz-2.0/data/gfx/sb_fuel.tga (from rev 6374, trunk/data/gfx/sb_fuel.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/items/g_fuel.md3 (from rev 6381, trunk/data/models/items/g_fuel.md3)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/items/g_fuelregen.md3 (from rev 6381, trunk/data/models/items/g_fuelregen.md3)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/items/g_jetpack.md3 (from rev 6381, trunk/data/models/items/g_jetpack.md3)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/items/jetpack.tga (from rev 6381, trunk/data/models/items/jetpack.tga)
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1722,12 +1722,52 @@
 	drawpic(pos + ' 65   32   0', "gfx/keys/key_right.tga",    ' 32 32 0', '1 1 1', .5 * ((pressedkeys & KEY_RIGHT) + 1), DRAWFLAG_NORMAL);
 }
 
+float GetAmmoStat(float i)
+{
+	switch(i)
+	{
+		case 0: return STAT_SHELLS;
+		case 1: return STAT_NAILS;
+		case 2: return STAT_ROCKETS;
+		case 3: return STAT_CELLS;
+		case 4: return STAT_FUEL;
+		default: return -1;
+	}
+}
+
+float GetAmmoItemCode(float i)
+{
+	switch(i)
+	{
+		case 0: return IT_SHELLS;
+		case 1: return IT_NAILS;
+		case 2: return IT_ROCKETS;
+		case 3: return IT_CELLS;
+		case 4: return IT_FUEL;
+		default: return -1;
+	}
+}
+
+string GetAmmoPicture(float i)
+{
+	switch(i)
+	{
+		case 0: return "gfx/sb_shells";
+		case 1: return "gfx/sb_bullets";
+		case 2: return "gfx/sb_rocket";
+		case 3: return "gfx/sb_cells";
+		case 4: return "gfx/sb_fuel";
+		default: return "";
+	}
+}
+
 void Sbar_Draw (void)
 {
 	float i;
 	float x, fade;
 	float stat_items, stat_weapons;
 	vector o; o = '1 0 0' * vid_conwidth;
+	vector v;
 	string s;
 
 	sbar_fontsize = Sbar_GetFontsize("sbar_fontsize");
@@ -1967,44 +2007,18 @@
 				}
 
 				// ammo
-				if (stat_items & IT_SHELLS)
-					x = getstati(STAT_SHELLS);
-				else if (stat_items & IT_NAILS)
-					x = getstati(STAT_NAILS);
-				else if (stat_items & IT_ROCKETS)
-					x = getstati(STAT_ROCKETS);
-				else if (stat_items & IT_CELLS)
-					x = getstati(STAT_CELLS);
-				else
-					x = 0;
-				if ((stat_items & IT_AMMO) || x != 0)
-				{
-					if (stat_items & IT_SHELLS)
-						drawpic(sbar + '296 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_NAILS)
-						drawpic(sbar + '296 0 0', "gfx/sb_bullets", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_ROCKETS)
-						drawpic(sbar + '296 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_CELLS)
-						drawpic(sbar + '296 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
-					if(x > 10)
-						Sbar_DrawXNum('224 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
-					else
-						Sbar_DrawXNum('224 0 0', x, 3, 24, '0.7 0 0', 1, 0);
-				}
+				for(i = 0, v = '0 0 0'; (x = GetAmmoStat(i)) >= 0; ++i)
+					if(stat_items & GetAmmoItemCode(i))
+					{
+						x = getstati(x);
+						drawpic(sbar + '296 0 0' + v, GetAmmoPicture(i), '24 24 0', '1 1 1', sbar_alpha_fg, 0);
+						if(x > 10)
+							Sbar_DrawXNum('224 0 0' + v, x, 3, 24, '0.6 0.7 0.8', 1, 0);
+						else
+							Sbar_DrawXNum('224 0 0' + v, x, 3, 24, '0.7 0 0', 1, 0);
+						v_y -= 30;
+					}
 
-				// jetpack cells
-				if(stat_items & IT_USING_JETPACK)
-				if not(stat_items & IT_CELLS)
-				{
-					x = getstati(STAT_CELLS);
-					drawpic(sbar + '296 -30 0', "gfx/sb_cells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
-					if(x > 10)
-						Sbar_DrawXNum('224 -30 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
-					else
-						Sbar_DrawXNum('224 -30 0', x, 3, 24, '0.7 0 0', 1, 0);
-				}
-
 				if (sbar_x + 320 + 160 <= vid_conwidth)
 					Sbar_MiniDeathmatchOverlay(sbar + '320 0 0');
 				if (sbar_x > 0)
@@ -2055,45 +2069,19 @@
 				else
 					Sbar_DrawXNum('81 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
 
-				if (stat_items & IT_SHELLS)
-					x = getstati(STAT_SHELLS);
-				else if (stat_items & IT_NAILS)
-					x = getstati(STAT_NAILS);
-				else if (stat_items & IT_ROCKETS)
-					x = getstati(STAT_ROCKETS);
-				else if (stat_items & IT_CELLS)
-					x = getstati(STAT_CELLS);
-				else
-					x = 0;
-				if ((stat_items & IT_AMMO) || x != 0)
-				{
-					// (519-3*24) = 447
-					if (stat_items & IT_SHELLS)
-						drawpic(sbar + '519 0 0', "gfx/sb_shells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_NAILS)
-						drawpic(sbar + '519 0 0', "gfx/sb_bullets", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_ROCKETS)
-						drawpic(sbar + '519 0 0', "gfx/sb_rocket", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
-					else if (stat_items & IT_CELLS)
-						drawpic(sbar + '519 0 0', "gfx/sb_cells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
-					if(x > 10)
-						Sbar_DrawXNum('447 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
-					else
-						Sbar_DrawXNum('447 12 0', x, 3, 24, '0.7 0 0', 1, 0);
-				}
+				// ammo
+				for(i = 0, v = '0 0 0'; (x = GetAmmoStat(i)) >= 0; ++i)
+					if(stat_items & GetAmmoItemCode(i))
+					{
+						x = getstati(x);
+						drawpic(sbar + '519 0 0' + v, GetAmmoPicture(i), '0 0 0', '1 1 1', sbar_alpha_fg, 0);
+						if(x > 10)
+							Sbar_DrawXNum('447 12 0' + v, x, 3, 24, '0.6 0.7 0.8', 1, 0);
+						else
+							Sbar_DrawXNum('447 12 0' + v, x, 3, 24, '0.7 0 0', 1, 0);
+						v_y -= 40;
+					}
 
-				// jetpack cells
-				if(stat_items & IT_USING_JETPACK)
-				if not(stat_items & IT_CELLS)
-				{
-					x = getstati(STAT_CELLS);
-					drawpic(sbar + '519 -40 0', "gfx/sb_cells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
-					if(x > 10)
-						Sbar_DrawXNum('447 -28 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
-					else
-						Sbar_DrawXNum('447 -28 0', x, 3, 24, '0.7 0 0', 1, 0);
-				}
-
 				if (sb_lines > 24)
 					drawpic(sbar, "gfx/sbar_overlay", '0 0 0', '1 1 1', 1, DRAWFLAG_MODULATE);
 

Modified: branches/nexuiz-2.0/data/qcsrc/common/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-03-30 13:47:02 UTC (rev 6382)
@@ -246,6 +246,7 @@
 const float STAT_INVINCIBLE_FINISHED = 39;
 const float STAT_PRESSED_KEYS = 42;
 const float STAT_ALLOW_OLDNEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config
+const float STAT_FUEL = 44;
 const float CTF_STATE_ATTACK = 1;
 const float CTF_STATE_DEFEND = 2;
 const float CTF_STATE_COMMANDER = 3;

Modified: branches/nexuiz-2.0/data/qcsrc/common/items.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/items.qh	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/common/items.qh	2009-03-30 13:47:02 UTC (rev 6382)
@@ -27,17 +27,17 @@
 // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
 float	IT_UNLIMITED_SUPERWEAPONS = 2;
 // when this bit is set, using a superweapon does not throw it away. Checkpoints can give this powerup.
-float	IT_UNLIMITED_AMMO         = 3;
-// both of these combined
 float	IT_CTF_SHIELDED           = 4; // set for the flag shield
 // using jetpack
-float   IT_USING_JETPACK          = 8;
+float   IT_USING_JETPACK          = 8; // confirmation that button is pressed
+float   IT_JETPACK                = 16; // actual item
+float	IT_FUEL_REGEN             = 32; // fuel regeneration trigger
 float	IT_SHELLS				= 256;
 float	IT_NAILS				= 512;
 float	IT_ROCKETS				= 1024;
 float	IT_CELLS				= 2048;
 float	IT_SUPERWEAPON			= 4096;
-float	IT_AMMO					= 7936;
+float	IT_FUEL					= 128;
 float	IT_STRENGTH				= 8192;
 float	IT_INVINCIBLE			= 16384;
 float	IT_HEALTH				= 32768;
@@ -58,6 +58,10 @@
 float	IT_ARMOR_SHARD			= 2097152;
 float	IT_ARMOR				= 4194304;
 
+float	IT_AMMO					= 8064; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_SUPERWEAPON | IT_FUEL;
+float	IT_PICKUPMASK           = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO;
+float	IT_UNLIMITED_AMMO       = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+
 // variables:
 string weaponpriority_hudselector_0;
 string weaponpriority_hudselector_1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -746,6 +746,7 @@
 			self.ammo_nails = warmup_start_ammo_nails;
 			self.ammo_rockets = warmup_start_ammo_rockets;
 			self.ammo_cells = warmup_start_ammo_cells;
+			self.ammo_fuel = warmup_start_ammo_fuel;
 			self.health = warmup_start_health;
 			self.armorvalue = warmup_start_armorvalue;
 			self.weapons = warmup_start_weapons;
@@ -756,6 +757,7 @@
 			self.ammo_nails = start_ammo_nails;
 			self.ammo_rockets = start_ammo_rockets;
 			self.ammo_cells = start_ammo_cells;
+			self.ammo_fuel = start_ammo_fuel;
 			self.health = start_health;
 			self.armorvalue = start_armorvalue;
 			self.weapons = start_weapons;
@@ -769,6 +771,7 @@
 		self.spawnshieldtime = time + cvar("g_spawnshieldtime");
 		self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
 		self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
+		self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
 		self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
 		//extend the pause of rotting if client was reset at the beginning of the countdown
 		if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted?
@@ -1700,11 +1703,13 @@
 
 void player_regen (void)
 {
-	float maxh, maxa, limith, limita, max_mod, regen_mod, rot_mod, limit_mod;
+	float maxh, maxa, maxf, limith, limita, limitf, max_mod, regen_mod, rot_mod, limit_mod;
 	maxh = cvar("g_balance_health_stable");
 	maxa = cvar("g_balance_armor_stable");
+	maxf = cvar("g_balance_fuel_stable");
 	limith = cvar("g_balance_health_limit");
 	limita = cvar("g_balance_armor_limit");
+	limitf = cvar("g_balance_fuel_limit");
 
 	if (g_minstagib || (g_lms && !cvar("g_lms_regenerate")))
 		return;
@@ -1739,8 +1744,10 @@
 	}
 	maxh = maxh * max_mod;
 	//maxa = maxa * max_mod;
+	//maxf = maxf * max_mod;
 	limith = limith * limit_mod;
 	limita = limita * limit_mod;
+	//limitf = limitf * limit_mod;
 
 	if (self.armorvalue > maxa)
 	{
@@ -1774,11 +1781,32 @@
 			self.health = min(maxh, self.health + regen_mod*cvar("g_balance_health_regenlinear") * frametime);
 		}
 	}
+	if (self.ammo_fuel > maxf)
+	{
+		if (time > self.pauserotfuel_finished)
+		{
+			self.ammo_fuel = max(maxf, self.ammo_fuel + (maxf - self.ammo_fuel) * rot_mod*cvar("g_balance_fuel_rot") * frametime);
+			self.ammo_fuel = max(maxf, self.ammo_fuel - rot_mod*cvar("g_balance_fuel_rotlinear") * frametime);
+		}
+	}
+	else if (self.ammo_fuel < maxf)
+	{
+		if(self.items & IT_FUEL_REGEN)
+		{
+			if (time > self.pauseregen_finished)
+			{
+				self.ammo_fuel = CalcRegen(self.ammo_fuel, maxf, regen_mod * cvar("g_balance_fuel_regen"));
+				self.ammo_fuel = min(maxf, self.ammo_fuel + regen_mod*cvar("g_balance_fuel_regenlinear") * frametime);
+			}
+		}
+	}
 
 	if (self.health > limith)
 		self.health = limith;
 	if (self.armorvalue > limita)
 		self.armorvalue = limita;
+	if (self.ammo_fuel > limitf)
+		self.ammo_fuel = limitf;
 
 	// if player rotted to death...  die!
 	if(self.health < 1)
@@ -1848,6 +1876,7 @@
 	self.ammo_shells = spectatee.ammo_shells;
 	self.ammo_nails = spectatee.ammo_nails;
 	self.ammo_rockets = spectatee.ammo_rockets;
+	self.ammo_fuel = spectatee.ammo_fuel;
 	self.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
 	self.health = spectatee.health;
 	self.impulse = 0;
@@ -2337,8 +2366,15 @@
 		GrapplingHookFrame();
 
 		if(frametime)
+		{
 			W_WeaponFrame();
 
+			self.items &~= IT_FUEL; // TODO don't do this if the current weapon actually USES fuel...
+			if(self.items & IT_JETPACK)
+				if(self.items & IT_FUEL_REGEN || self.ammo_fuel >= 0.01)
+					self.items |= IT_FUEL;
+		}
+
 		player_regen();
 		if(frametime)
 			player_anim();

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -340,10 +340,12 @@
 						self.ammo_nails = g_pickup_nails_max;
 						self.ammo_rockets = g_pickup_rockets_max;
 						self.ammo_cells = g_pickup_cells_max;
+						self.ammo_fuel = g_pickup_fuel_max;
 						self.health = g_pickup_healthsmall_max;
 						self.armorvalue = g_pickup_armorsmall_max;
 						self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
 						self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
+						self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
 						self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
 						// precache weapon models/sounds
 						wep = WEP_FIRST;
@@ -379,11 +381,13 @@
 							self.ammo_nails = 999;
 							self.ammo_cells = 999;
 							self.ammo_shells = 999;
+							self.ammo_fuel = 999;
 							self.health = start_health;
 							self.armorvalue = start_armorvalue;
 							self.weapons |= weaponsInMap;
 							self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
 							self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
+							self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
 							self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
 						}
 						else if(self.deadflag != DEAD_NO)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -638,7 +638,7 @@
 				self.velocity = self.velocity + wishdir * min(f, sv_accelerate*maxspd_mod * frametime * wishspeed);
 		}
 	}
-	else if (g_jetpack && self.BUTTON_HOOK && (!cvar("g_jetpack_ammo") || self.ammo_cells >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+	else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
 	{
 		//makevectors(self.v_angle_y * '0 1 0');
 		makevectors(self.v_angle);
@@ -670,13 +670,8 @@
 		wishvel_z = (wishvel_z - sv_gravity) * fz + sv_gravity;
 		fvel = min(1, vlen(wishvel) / fvel);
 
-		if(cvar("g_jetpack_ammo") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
-		{
-			if(self.ammo_cells < 0.01)
-				f = 0;
-			else
-				f = min(1, self.ammo_cells / (cvar("g_jetpack_ammo") * frametime * fvel));
-		}
+		if(cvar("g_jetpack_fuel") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
+			f = min(1, self.ammo_fuel / (cvar("g_jetpack_fuel") * frametime * fvel));
 		else
 			f = 1;
 
@@ -684,15 +679,18 @@
 		{
 			self.velocity = self.velocity + wishvel * f * frametime;
 			if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-				self.ammo_cells -= cvar("g_jetpack_ammo") * frametime * fvel * f;
+				self.ammo_fuel -= cvar("g_jetpack_fuel") * frametime * fvel * f;
 			self.flags &~= FL_ONGROUND;
 			self.items |= IT_USING_JETPACK;
+
+			// jetpack also inhibits health regeneration, but only for 1 second
+			self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
 		}
 	}
 	else if (self.flags & FL_ONGROUND)
 	{
 		// we get here if we ran out of ammo
-		if(g_jetpack && self.BUTTON_HOOK && !(buttons_prev & 32))
+		if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
 			sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
 		// walking
@@ -742,7 +740,7 @@
 	else
 	{
 		// we get here if we ran out of ammo
-		if(g_jetpack && self.BUTTON_HOOK && !(buttons_prev & 32))
+		if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
 			sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
 		if(maxspd_mod < 1)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -436,6 +436,7 @@
 				self.ammo_nails = cvar("g_pickup_nails_max");
 				self.ammo_rockets = cvar("g_pickup_rockets_max");
 				self.ammo_cells = cvar("g_pickup_cells_max");
+				self.ammo_fuel = cvar("g_pickup_fuel_max");
 			}
 			else
 			{
@@ -443,6 +444,7 @@
 				self.ammo_nails = cvar("g_balance_nixnex_ammo_nails");
 				self.ammo_rockets = cvar("g_balance_nixnex_ammo_rockets");
 				self.ammo_cells = cvar("g_balance_nixnex_ammo_cells");
+				self.ammo_fuel = cvar("g_balance_nixnex_ammo_fuel");
 			}
 			self.nixnex_nextincr = time + cvar("g_balance_nixnex_incrtime");
 			if(dt >= 1 && dt <= 5)
@@ -463,6 +465,7 @@
 			self.ammo_nails = self.ammo_nails + cvar("g_balance_nixnex_ammoincr_nails");
 			self.ammo_rockets = self.ammo_rockets + cvar("g_balance_nixnex_ammoincr_rockets");
 			self.ammo_cells = self.ammo_cells + cvar("g_balance_nixnex_ammoincr_cells");
+			self.ammo_fuel = self.ammo_fuel + cvar("g_balance_nixnex_ammoincr_fuel");
 			self.nixnex_nextincr = time + cvar("g_balance_nixnex_incrtime");
 		}
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1,5 +1,5 @@
-string CVAR_CHECK_DEFAULT = "11669b91ec9e0214a0e0ac37a3573c1a";
-string CVAR_CHECK_WEAPONS = "6dd73b6c78519153d50f876be23bfe77";
+string CVAR_CHECK_DEFAULT = "779a1c2f508f65a13bad23ce1758beb8";
+string CVAR_CHECK_WEAPONS = "00219e78f5d78d7d8a1600c4f4c73aa5";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-03-30 13:47:02 UTC (rev 6382)
@@ -190,6 +190,7 @@
 .float pauseregen_finished;
 .float pauserothealth_finished;
 .float pauserotarmor_finished;
+.float pauserotfuel_finished;
 .string item_pickupsound;
 
 // definitions for weaponsystem
@@ -557,3 +558,5 @@
 void Drag_MoveDrag(entity from, entity to);
 
 .entity soundentity;
+
+.float ammo_fuel;

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -408,7 +408,7 @@
 			//self.hook_state &~= HOOK_RELEASING;
 		}
 	}
-	else if(!g_jetpack && !g_grappling_hook && self.switchweapon != WEP_HOOK)
+	else if(!(self.items & IT_JETPACK) && !g_grappling_hook && self.switchweapon != WEP_HOOK)
 	{
 		if(self.BUTTON_HOOK && !self.hook_switchweapon)
 			W_SwitchWeapon(WEP_HOOK);

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -587,8 +587,8 @@
 	
 	addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished);
 	addstat(STAT_INVINCIBLE_FINISHED, AS_FLOAT, invincible_finished);
-
 	addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
+	addstat(STAT_FUEL, AS_INT, ammo_fuel);
 
 	next_pingtime = time + 5;
 	InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -701,6 +701,9 @@
 float g_pickup_rockets_max;
 float g_pickup_cells;
 float g_pickup_cells_max;
+float g_pickup_fuel;
+float g_pickup_fuel_jetpack;
+float g_pickup_fuel_max;
 float g_pickup_armorsmall;
 float g_pickup_armorsmall_max;
 float g_pickup_armormedium;
@@ -726,6 +729,7 @@
 float start_ammo_nails;
 float start_ammo_rockets;
 float start_ammo_cells;
+float start_ammo_fuel;
 float start_health;
 float start_armorvalue;
 float warmup_start_weapons;
@@ -733,6 +737,7 @@
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
 float warmup_start_ammo_cells;
+float warmup_start_ammo_fuel;
 float warmup_start_health;
 float warmup_start_armorvalue;
 float g_weapon_stay;
@@ -816,6 +821,7 @@
 		start_ammo_shells = 999;
 		start_ammo_cells = 999;
 		start_ammo_nails = 999;
+		start_ammo_fuel = 999;
 		start_items |= IT_UNLIMITED_AMMO;
 	}
 	else if(g_nixnex)
@@ -838,6 +844,7 @@
 		weapon_action(WEP_MINSTANEX, WR_PRECACHE);
 		start_ammo_cells = cvar("g_minstagib_ammo_start");
 		g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
+		start_ammo_fuel = cvar("g_start_ammo_fuel");
 
 		if(g_minstagib_invis_alpha <= 0)
 			g_minstagib_invis_alpha = -1;
@@ -850,6 +857,7 @@
 			start_ammo_nails = cvar("g_lms_start_ammo_nails");
 			start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
 			start_ammo_cells = cvar("g_lms_start_ammo_cells");
+			start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
 			start_health = cvar("g_lms_start_health");
 			start_armorvalue = cvar("g_lms_start_armor");
 		} else if (cvar("g_use_ammunition")) {
@@ -857,11 +865,13 @@
 			start_ammo_nails = cvar("g_start_ammo_nails");
 			start_ammo_rockets = cvar("g_start_ammo_rockets");
 			start_ammo_cells = cvar("g_start_ammo_cells");
+			start_ammo_fuel = cvar("g_start_ammo_fuel");
 		} else {
 			start_ammo_shells = cvar("g_pickup_shells_max");
 			start_ammo_nails = cvar("g_pickup_nails_max");
 			start_ammo_rockets = cvar("g_pickup_rockets_max");
 			start_ammo_cells = cvar("g_pickup_cells_max");
+			start_ammo_fuel = cvar("g_pickup_fuel_max");
 			start_items |= IT_UNLIMITED_AMMO;
 		}
 
@@ -949,12 +959,10 @@
 
 	if(g_jetpack)
 	{
-		if(!start_ammo_cells)
-			start_ammo_cells = g_pickup_cells;
-		if(!warmup_start_ammo_cells)
-			warmup_start_ammo_cells = g_pickup_cells;
-
 		g_grappling_hook = 0; // these two can't coexist, as they use the same button
+		start_items |= IT_JETPACK;
+		start_items |= IT_FUEL_REGEN;
+		start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_stable"));
 	}
 
 	if(g_weapon_stay == 2)
@@ -963,21 +971,25 @@
 		if(!start_ammo_nails) start_ammo_nails = g_pickup_nails;
 		if(!start_ammo_cells) start_ammo_cells = g_pickup_cells;
 		if(!start_ammo_rockets) start_ammo_rockets = g_pickup_rockets;
+		if(!start_ammo_fuel) start_ammo_fuel = g_pickup_fuel;
 		if(!warmup_start_ammo_shells) warmup_start_ammo_shells = g_pickup_shells;
 		if(!warmup_start_ammo_nails) warmup_start_ammo_nails = g_pickup_nails;
 		if(!warmup_start_ammo_cells) warmup_start_ammo_cells = g_pickup_cells;
 		if(!warmup_start_ammo_rockets) warmup_start_ammo_rockets = g_pickup_rockets;
+		if(!warmup_start_ammo_fuel) warmup_start_ammo_fuel = g_pickup_fuel;
 	}
 
 	start_ammo_shells = max(0, start_ammo_shells);
 	start_ammo_nails = max(0, start_ammo_nails);
 	start_ammo_cells = max(0, start_ammo_cells);
 	start_ammo_rockets = max(0, start_ammo_rockets);
+	start_ammo_fuel = max(0, start_ammo_fuel);
 
 	warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
 	warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
 	warmup_start_ammo_cells = max(0, warmup_start_ammo_cells);
 	warmup_start_ammo_rockets = max(0, warmup_start_ammo_rockets);
+	warmup_start_ammo_fuel = max(0, warmup_start_ammo_fuel);
 }
 
 float g_bugrigs;
@@ -1077,6 +1089,9 @@
 	g_pickup_rockets_max               = cvar("g_pickup_rockets_max");
 	g_pickup_cells                     = cvar("g_pickup_cells");
 	g_pickup_cells_max                 = cvar("g_pickup_cells_max");
+	g_pickup_fuel                     = cvar("g_pickup_fuel");
+	g_pickup_fuel_jetpack             = cvar("g_pickup_fuel_jetpack");
+	g_pickup_fuel_max                 = cvar("g_pickup_fuel_max");
 	g_pickup_armorsmall                = cvar("g_pickup_armorsmall");
 	g_pickup_armorsmall_max            = cvar("g_pickup_armorsmall_max");
 	g_pickup_armormedium               = cvar("g_pickup_armormedium");

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -6,6 +6,7 @@
 		case IT_NAILS:       return ammo_nails;
 		case IT_ROCKETS:     return ammo_rockets;
 		case IT_CELLS:       return ammo_cells;
+		case IT_FUEL:        return ammo_fuel;
 		case IT_5HP:         return health;
 		case IT_25HP:        return health;
 		case IT_HEALTH:      return health;
@@ -24,6 +25,7 @@
 		case IT_NAILS:       return "nails";
 		case IT_ROCKETS:     return "rockets";
 		case IT_CELLS:       return "cells";
+		case IT_FUEL:        return "fuel";
 
 		// add more things here (health, armor)
 		default:             error("requested item has no counter field name");
@@ -158,6 +160,13 @@
 			pickedup = TRUE;
 			player.ammo_cells = min (player.ammo_cells + item.ammo_cells, g_pickup_cells_max);
 		}
+		if (item.ammo_fuel)
+		if (player.ammo_fuel < g_pickup_fuel_max)
+		{
+			pickedup = TRUE;
+			player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
+			player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+		}
 
 		if (item.flags & FL_WEAPON)
 		if ((it = item.weapons - (item.weapons & player.weapons)))
@@ -171,6 +180,12 @@
 			}
 		}
 
+		if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
+		{
+			pickedup = TRUE;
+			player.items |= it;
+		}
+
 		if (item.strength_finished)
 		{
 			pickedup = TRUE;
@@ -1162,6 +1177,7 @@
 		target_item_change(0, ammo_nails, target_item_func_set, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_rockets, target_item_func_set, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_cells, target_item_func_set, "misc/itempickup.wav", "");
+		target_item_change(0, ammo_fuel, target_item_func_set, "misc/itempickup.wav", "");
 		target_item_change(0, health, target_item_func_set, "misc/megahealth.wav", "");
 		target_item_change(0, armorvalue, target_item_func_set, "misc/armor25.wav", "");
 		target_item_change(1, items, target_item_func_itembitset, "misc/powerup.wav", "");
@@ -1178,6 +1194,7 @@
 		target_item_change(0, ammo_nails, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_rockets, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_cells, target_item_func_min, "misc/itempickup.wav", "");
+		target_item_change(0, ammo_fuel, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, health, target_item_func_min, "misc/megahealth.wav", "");
 		target_item_change(0, armorvalue, target_item_func_min, "misc/armor25.wav", "");
 		target_item_change(1, items, target_item_func_itemand, "misc/powerup.wav", "");
@@ -1194,6 +1211,7 @@
 		target_item_change(0, ammo_nails, target_item_func_max, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_rockets, target_item_func_max, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_cells, target_item_func_max, "misc/itempickup.wav", "");
+		target_item_change(0, ammo_fuel, target_item_func_max, "misc/itempickup.wav", "");
 		target_item_change(0, health, target_item_func_max, "misc/megahealth.wav", "");
 		target_item_change(0, armorvalue, target_item_func_max, "misc/armor25.wav", "");
 		target_item_change(1, items, target_item_func_or, "misc/powerup.wav", "");
@@ -1210,6 +1228,7 @@
 		target_item_change(0, ammo_nails, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_rockets, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, ammo_cells, target_item_func_min, "misc/itempickup.wav", "");
+		target_item_change(0, ammo_fuel, target_item_func_min, "misc/itempickup.wav", "");
 		target_item_change(0, health, target_item_func_min, "misc/megahealth.wav", "");
 		target_item_change(0, armorvalue, target_item_func_min, "misc/armor25.wav", "");
 		target_item_change(1, items, target_item_func_andnot, "misc/powerup.wav", "");
@@ -1270,6 +1289,8 @@
 		if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
 		if(argv(i) == "strength")               self.items |= IT_STRENGTH;
 		if(argv(i) == "invincible")             self.items |= IT_INVINCIBLE;
+		if(argv(i) == "jetpack")                self.items |= IT_JETPACK;
+		if(argv(i) == "fuel_regen")             self.items |= IT_FUEL_REGEN;
 		for(j = WEP_FIRST; j <= WEP_LAST; ++j)
 		{
 			e = get_weaponinfo(j);
@@ -1282,3 +1303,22 @@
 		}
 	}
 }
+
+void spawnfunc_item_fuel(void)
+{
+	if(!self.ammo_fuel)
+		self.ammo_fuel = g_pickup_fuel;
+	StartItem ("models/items/g_fuel.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, "Fuel", IT_FUEL, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+}
+
+void spawnfunc_item_fuel_regen(void)
+{
+	StartItem ("models/items/g_fuelregen.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, "Fuel regenerator", IT_FUEL_REGEN, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+}
+
+void spawnfunc_item_jetpack(void)
+{
+	if(!self.ammo_fuel)
+		self.ammo_fuel = g_pickup_fuel_jetpack;
+	StartItem ("models/items/g_jetpack.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, "Jet pack", IT_JETPACK, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_quake3.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_quake3.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_quake3.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -52,3 +52,5 @@
 void spawnfunc_team_CTF_blueplayer() { spawnfunc_info_player_team2();  }
 void spawnfunc_team_CTF_redspawn()   { spawnfunc_info_player_team1();  }
 void spawnfunc_team_CTF_bluespawn()  { spawnfunc_info_player_team2();  }
+
+void spawnfunc_item_flight()         { spawnfunc_item_jetpack();       }

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc	2009-03-30 13:47:02 UTC (rev 6382)
@@ -111,7 +111,7 @@
 	}
 	else if (req == WR_THINK)
 	{
-		if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
+		if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
 		{
 			if(!self.hook)
 			if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
@@ -179,7 +179,7 @@
 		if (self.BUTTON_CROUCH)
 		{
 			self.hook_state &~= HOOK_PULLING;
-			if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
+			if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
 				self.hook_state &~= HOOK_RELEASING;
 			else
 				self.hook_state |= HOOK_RELEASING;
@@ -189,7 +189,7 @@
 			self.hook_state |= HOOK_PULLING;
 			self.hook_state &~= HOOK_RELEASING;
 
-			if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
+			if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
 			{
 				// already fired
 				if(self.hook)

Modified: branches/nexuiz-2.0/data/scripts/entities.def
===================================================================
--- branches/nexuiz-2.0/data/scripts/entities.def	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/scripts/entities.def	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1236,12 +1236,13 @@
 You may want to target this by a race checkpoint, a teleporter, or a trigger_multiple with ALLENTS set (so it removes weapons thrown through the field to avoid getting a weapon through it).
 -------- KEYS --------
 targetname: used to trigger this
-netname: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "unlimited_weapon_ammo", "unlimited_superweapons", "invincible" and "strength"
+netname: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "unlimited_weapon_ammo", "unlimited_superweapons", "invincible", "strength", "jetpack" and "fuel_regen"
 message: message to print
 ammo_shells: amount of shells
 ammo_nails: amount of bullets
 ammo_rockets: amount of rockets
 ammo_cells: amount of cells
+ammo_fuel: amount of fuel
 health: amount of health
 armorvalue: amount of armor
 strength_finished: if "strength" is specified, the time in seconds for which the strength will hold
@@ -1455,3 +1456,41 @@
 target: disable/enable all relays with this targetname when triggered
 targetname: name that identifies this entity so it can be triggered
 */
+
+/*QUAKED item_fuel (.3 .3 1) (-30 -30 0) (30 30 32) FLOATING
+Jetpack fuel
+-------- KEYS --------
+ammo_fuel: fuel units gained by this item (if unset, g_pickup_fuel is used)
+respawntime: time till it respawns (default: 15)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_fuel.md3"
+*/
+
+/*QUAKED item_fuel_regen (1 .3 1) (-30 -30 0) (30 30 48) FLOATING
+Fuel regenerator
+-------- KEYS --------
+respawntime: time till it respawns (default: 120)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_fuelregen.md3"
+*/
+
+/*QUAKED item_jetpack (.3 .3 1) (-30 -30 0) (30 30 48) FLOATING
+Jetpack
+-------- KEYS --------
+ammo_fuel: fuel units gained by this item (if unset, g_pickup_fuel_jetpack is used)
+respawntime: time till it respawns (default: 120)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_jetpack.md3"
+*/

Modified: branches/nexuiz-2.0/data/weapons.cfg
===================================================================
--- branches/nexuiz-2.0/data/weapons.cfg	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/weapons.cfg	2009-03-30 13:47:02 UTC (rev 6382)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit weaponsHavoc.cfg too.
 
-set cvar_check_weapons 6dd73b6c78519153d50f876be23bfe77
+set cvar_check_weapons 00219e78f5d78d7d8a1600c4f4c73aa5
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!
@@ -45,6 +45,7 @@
 set g_start_ammo_nails 0
 set g_start_ammo_rockets 0
 set g_start_ammo_cells 0
+set g_start_ammo_fuel 0
 set g_pickup_shells 15
 set g_pickup_shells_max 999
 set g_pickup_nails 80
@@ -53,6 +54,9 @@
 set g_pickup_rockets_max 999
 set g_pickup_cells 25
 set g_pickup_cells_max 999
+set g_pickup_fuel 25
+set g_pickup_fuel_jetpack 50
+set g_pickup_fuel_max 999
 set g_pickup_armorsmall 5
 set g_pickup_armorsmall_max 999
 set g_pickup_armormedium 25

Modified: branches/nexuiz-2.0/data/weaponsHavoc.cfg
===================================================================
--- branches/nexuiz-2.0/data/weaponsHavoc.cfg	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/data/weaponsHavoc.cfg	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1,4 +1,4 @@
-set cvar_check_weapons 6dd73b6c78519153d50f876be23bfe77
+set cvar_check_weapons 00219e78f5d78d7d8a1600c4f4c73aa5
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!
@@ -40,6 +40,7 @@
 set g_start_ammo_nails 0
 set g_start_ammo_rockets 0
 set g_start_ammo_cells 0
+set g_start_ammo_fuel 0
 set g_pickup_shells 30
 set g_pickup_shells_max 120
 set g_pickup_nails 50
@@ -48,6 +49,9 @@
 set g_pickup_rockets_max 120
 set g_pickup_cells 50
 set g_pickup_cells_max 200
+set g_pickup_fuel 25
+set g_pickup_fuel_jetpack 50
+set g_pickup_fuel_max 999
 set g_pickup_armorsmall 5
 set g_pickup_armorsmall_max 200
 set g_pickup_armormedium 25

Copied: branches/nexuiz-2.0/misc/mediasource/models/jetpack.blend (from rev 6381, trunk/misc/mediasource/models/jetpack.blend)
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
===================================================================
--- branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-03-30 13:46:07 UTC (rev 6381)
+++ branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-03-30 13:47:02 UTC (rev 6382)
@@ -1236,12 +1236,13 @@
 You may want to target this by a race checkpoint, a teleporter, or a trigger_multiple with ALLENTS set (so it removes weapons thrown through the field to avoid getting a weapon through it).
 -------- KEYS --------
 targetname: used to trigger this
-netname: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "unlimited_weapon_ammo", "unlimited_superweapons", "invincible" and "strength"
+netname: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "unlimited_weapon_ammo", "unlimited_superweapons", "invincible", "strength", "jetpack" and "fuel_regen"
 message: message to print
 ammo_shells: amount of shells
 ammo_nails: amount of bullets
 ammo_rockets: amount of rockets
 ammo_cells: amount of cells
+ammo_fuel: amount of fuel
 health: amount of health
 armorvalue: amount of armor
 strength_finished: if "strength" is specified, the time in seconds for which the strength will hold
@@ -1455,3 +1456,41 @@
 target: disable/enable all relays with this targetname when triggered
 targetname: name that identifies this entity so it can be triggered
 */
+
+/*QUAKED item_fuel (.3 .3 1) (-30 -30 0) (30 30 32) FLOATING
+Jetpack fuel
+-------- KEYS --------
+ammo_fuel: fuel units gained by this item (if unset, g_pickup_fuel is used)
+respawntime: time till it respawns (default: 15)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_fuel.md3"
+*/
+
+/*QUAKED item_fuel_regen (1 .3 1) (-30 -30 0) (30 30 48) FLOATING
+Fuel regenerator
+-------- KEYS --------
+respawntime: time till it respawns (default: 120)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_fuelregen.md3"
+*/
+
+/*QUAKED item_jetpack (.3 .3 1) (-30 -30 0) (30 30 48) FLOATING
+Jetpack
+-------- KEYS --------
+ammo_fuel: fuel units gained by this item (if unset, g_pickup_fuel_jetpack is used)
+respawntime: time till it respawns (default: 120)
+team: out of items with the same value here, only one (random one) will spawn. Useful to put multiple items on one spot.
+cnt: weight of this item for random selection using "team". Set to a lower value for items you want to see less likely.
+-------- SPAWNFLAGS --------
+FLOATING: the item will float in air, instead of aligning to the floor by falling
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/items/g_jetpack.md3"
+*/



More information about the nexuiz-commits mailing list