[nexuiz-commits] r6365 - in trunk/data/qcsrc: common server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 30 06:37:13 EDT 2009


Author: div0
Date: 2009-03-30 06:37:13 -0400 (Mon, 30 Mar 2009)
New Revision: 6365

Modified:
   trunk/data/qcsrc/common/items.qh
   trunk/data/qcsrc/server/t_items.qc
Log:
no-operation change to pave the way for fuel and jetpack pickups


Modified: trunk/data/qcsrc/common/items.qh
===================================================================
--- trunk/data/qcsrc/common/items.qh	2009-03-30 09:28:46 UTC (rev 6364)
+++ trunk/data/qcsrc/common/items.qh	2009-03-30 10:37:13 UTC (rev 6365)
@@ -27,8 +27,6 @@
 // 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; // confirmation that button is pressed
@@ -40,7 +38,6 @@
 float	IT_CELLS				= 2048;
 float	IT_SUPERWEAPON			= 4096;
 float	IT_FUEL					= 128;
-float	IT_AMMO					= 8064;
 float	IT_STRENGTH				= 8192;
 float	IT_INVINCIBLE			= 16384;
 float	IT_HEALTH				= 32768;
@@ -61,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: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2009-03-30 09:28:46 UTC (rev 6364)
+++ trunk/data/qcsrc/server/t_items.qc	2009-03-30 10:37:13 UTC (rev 6365)
@@ -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,12 @@
 			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);
+		}
 
 		if (item.flags & FL_WEAPON)
 		if ((it = item.weapons - (item.weapons & player.weapons)))
@@ -171,6 +179,12 @@
 			}
 		}
 
+		if((it = (item.items - (item.items & player.items) & IT_PICKUPMASK)))
+		{
+			pickedup = TRUE;
+			player.items |= it;
+		}
+
 		if (item.strength_finished)
 		{
 			pickedup = TRUE;
@@ -1162,6 +1176,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 +1193,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 +1210,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 +1227,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 +1288,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);



More information about the nexuiz-commits mailing list