[nexuiz-commits] r7090 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jun 23 16:21:37 EDT 2009


Author: div0
Date: 2009-06-23 16:21:37 -0400 (Tue, 23 Jun 2009)
New Revision: 7090

Modified:
   trunk/data/qcsrc/server/t_items.qc
Log:
use a healthbar for powerup respawns


Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2009-06-23 20:15:10 UTC (rev 7089)
+++ trunk/data/qcsrc/server/t_items.qc	2009-06-23 20:21:37 UTC (rev 7090)
@@ -1,6 +1,8 @@
+#define ITEM_RESPAWN_TICKS 10
+
 #define ITEM_RESPAWNTIME(i)         ((i).respawntime + crandom() * (i).respawntimejitter)
 	// range: respawntime - respawntimejitter .. respawntime + respawntimejitter
-#define ITEM_RESPAWNTIME_INITIAL(i) (10 + random() * ((i).respawntime + (i).respawntimejitter - 10))
+#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS))
 	// range: 10 .. respawntime + respawntimejitter
 
 floatfield Item_CounterField(float it)
@@ -57,7 +59,7 @@
 
 void Item_RespawnCountdown (void)
 {
-	if(self.count >= 5)
+	if(self.count >= ITEM_RESPAWN_TICKS)
 	{
 		if(self.waypointsprite_attached)
 			WaypointSprite_Kill(self.waypointsprite_attached);
@@ -98,12 +100,18 @@
 			{
 				WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, FALSE);
 				if(self.waypointsprite_attached)
+				{
 					WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb);
+					WaypointSprite_UpdateMaxHealth(self.waypointsprite_attached, ITEM_RESPAWN_TICKS + 1);
+				}
 			}
 		}
 		sound (self, CHAN_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM);	// play respawn sound
 		if(self.waypointsprite_attached)
+		{
 			WaypointSprite_Ping(self.waypointsprite_attached);
+			WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count);
+		}
 	}
 }
 
@@ -112,7 +120,7 @@
 	if(e.flags & FL_POWERUP)
 	{
 		e.think = Item_RespawnCountdown;
-		e.nextthink = time + max(0, t - 5);
+		e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
 		e.count = 0;
 	}
 	else



More information about the nexuiz-commits mailing list