r1836 - in trunk/data: gfx qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Mon Aug 21 15:09:29 EDT 2006
Author: esteel
Date: 2006-08-21 15:09:28 -0400 (Mon, 21 Aug 2006)
New Revision: 1836
Added:
trunk/data/gfx/sb_flag_blue_carrying.tga
trunk/data/gfx/sb_flag_blue_lost.tga
trunk/data/gfx/sb_flag_blue_taken.tga
trunk/data/gfx/sb_flag_red_carrying.tga
trunk/data/gfx/sb_flag_red_lost.tga
trunk/data/gfx/sb_flag_red_taken.tga
Modified:
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/constants.qh
trunk/data/qcsrc/server/ctf.qc
Log:
code and icons to display to flag status taken, dropped and carrying for both flags in ctf
Added: trunk/data/gfx/sb_flag_blue_carrying.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_blue_carrying.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/gfx/sb_flag_blue_lost.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_blue_lost.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/gfx/sb_flag_blue_taken.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_blue_taken.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/gfx/sb_flag_red_carrying.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_red_carrying.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/gfx/sb_flag_red_lost.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_red_lost.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/gfx/sb_flag_red_taken.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/sb_flag_red_taken.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2006-08-20 11:53:24 UTC (rev 1835)
+++ trunk/data/qcsrc/server/cl_client.qc 2006-08-21 19:09:28 UTC (rev 1836)
@@ -1291,6 +1291,7 @@
Called every frame for each client before the physics are run
=============
*/
+void() ctf_setstatus;
void PlayerPreThink (void)
{
if(self.classname == "player") {
@@ -1469,6 +1470,8 @@
if (cvar("g_minstagib"))
minstagib_ammocheck();
+ ctf_setstatus();
+
//self.angles_y=self.v_angle_y + 90; // temp
if (self.waterlevel == 2)
Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh 2006-08-20 11:53:24 UTC (rev 1835)
+++ trunk/data/qcsrc/server/constants.qh 2006-08-21 19:09:28 UTC (rev 1836)
@@ -173,6 +173,13 @@
float IT_KEY1 = 131072;
float IT_KEY2 = 262144;
+float IT_RED_FLAG_TAKEN = 32768;
+float IT_RED_FLAG_LOST = 65536;
+float IT_RED_FLAG_CARRING = 98304;
+float IT_BLUE_FLAG_TAKEN = 131072;
+float IT_BLUE_FLAG_LOST = 262144;
+float IT_BLUE_FLAG_CARRING = 393216;
+
float IT_5HP = 524288;
float IT_25HP = 1048576;
float IT_ARMOR_SHARD = 2097152;
Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc 2006-08-20 11:53:24 UTC (rev 1835)
+++ trunk/data/qcsrc/server/ctf.qc 2006-08-21 19:09:28 UTC (rev 1836)
@@ -567,3 +567,37 @@
e.nextthink = time + 0.1;
};
+void(entity flag) ctf_setstatus2 =
+{
+ if (flag) {
+ local float shift;
+ if (flag.team == 5) shift = IT_RED_FLAG_TAKEN;
+ else if (flag.team == 14) shift = IT_BLUE_FLAG_TAKEN;
+ else shift = 0;
+
+ local float status;
+ if (flag.cnt == FLAG_CARRY)
+ if (flag.owner == self) status = 3;
+ else status = 1;
+ else if (flag.cnt == FLAG_DROPPED) status = 2;
+ else status = 0;
+
+ self.items = self.items | (shift * status);
+ }
+};
+
+void() ctf_setstatus =
+{
+ self.items = self.items - (self.items & IT_RED_FLAG_TAKEN);
+ self.items = self.items - (self.items & IT_RED_FLAG_LOST);
+ self.items = self.items - (self.items & IT_BLUE_FLAG_TAKEN);
+ self.items = self.items - (self.items & IT_BLUE_FLAG_LOST);
+
+ if (cvar("g_ctf")) {
+ local entity flag;
+ flag = find(flag, classname, "item_flag_team1");
+ ctf_setstatus2(flag);
+ flag = find(flag, classname, "item_flag_team2");
+ ctf_setstatus2(flag);
+ }
+};
More information about the nexuiz-commits
mailing list