r3129 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 12 03:30:55 EST 2008


Author: div0
Date: 2008-01-12 03:30:52 -0500 (Sat, 12 Jan 2008)
New Revision: 3129

Modified:
   trunk/data/qcsrc/server/cl_client.qc
   trunk/data/qcsrc/server/g_damage.qc
   trunk/data/qcsrc/server/t_items.qc
   trunk/data/qcsrc/server/w_electro.qc
   trunk/data/qcsrc/server/w_nex.qc
Log:
- make Yoda harder to get
- direct hit with electro with enemy in air = electrobitch


Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc	2008-01-11 22:14:45 UTC (rev 3128)
+++ trunk/data/qcsrc/server/cl_client.qc	2008-01-12 08:30:52 UTC (rev 3129)
@@ -1237,7 +1237,7 @@
 		{
 			self.respawn_countdown = number - 1;
 			if(ceil(self.death_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
-				play2(self, strcat("announcer/robotic/", ftos(number), ".ogg"));
+				play2(self, strcat("announcer/robotic/", ftos(number), "announcer/.ogg"));
 		}
 	}
 }

Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc	2008-01-11 22:14:45 UTC (rev 3128)
+++ trunk/data/qcsrc/server/g_damage.qc	2008-01-12 08:30:52 UTC (rev 3129)
@@ -1,6 +1,37 @@
 
 float checkrules_firstblood;
 
+.float announcetime;
+float yoda;
+void announce(entity player, string msg)
+{
+	if(time > player.announcetime)
+	{
+		player.announcetime = time + 0.3;
+		play2(player, msg);
+	}
+}
+
+float IsDifferentTeam(entity a, entity b)
+{
+	if(teams_matter)
+		if(a.team == b.team)
+			return 0;
+	return 1;
+}
+
+float IsFlying(entity a)
+{
+	if(a.flags & FL_ONGROUND)
+		return 0;
+	if(a.waterlevel >= 2)
+		return 0;
+	traceline(a.origin, a.origin - '0 0 48', MOVE_NORMAL, a);
+	if(trace_fraction < 1)
+		return 0;
+	return 1;
+}
+
 void(entity player, float f) UpdateFrags =
 {
 	player.frags += f;
@@ -237,37 +268,37 @@
 				if (attacker.killcount == 3)
 				{
 					bprint (a,"^7 made a ^1TRIPLE FRAG\n");
-					play2(attacker, "announcer/male/03kills.ogg");
+					announce(attacker, "announcer/male/03kills.ogg");
 				}
 				else if (attacker.killcount == 5)
 				{
 					bprint (a,"^7 made a ^1FIVE FRAG COMBO\n");
-					play2(attacker, "announcer/male/05kills.ogg");
+					announce(attacker, "announcer/male/05kills.ogg");
 				}
 				else if (attacker.killcount == 10)
 				{
 					bprint (a,"^7 is on a ^1RAGE\n");
-					play2(attacker, "announcer/male/10kills.ogg");
+					announce(attacker, "announcer/male/10kills.ogg");
 				}
 				else if (attacker.killcount == 15)
 				{
 					bprint (a,"^7 has done a ^1MASSACRE!\n");
-					play2(attacker, "announcer/male/15kills.ogg");
+					announce(attacker, "announcer/male/15kills.ogg");
 				}
 				else if (attacker.killcount == 20)
 				{
 					bprint (a,"^7 is ^1UNHUMAN!\n");
-					play2(attacker, "announcer/male/20kills.ogg");
+					announce(attacker, "announcer/male/20kills.ogg");
 				}
 				else if (attacker.killcount == 25)
 				{
 					bprint (a,"^7 is a ^1DEATH INCARNATION!\n");
-					play2(attacker, "announcer/male/25kills.ogg");
+					announce(attacker, "announcer/male/25kills.ogg");
 				}
 				else if (attacker.killcount == 30)
 				{
 					bprint (a,"^7 is maybe a ^1AIMBOTTER?!\n");
-					play2(attacker, "announcer/male/30kills.ogg");
+					announce(attacker, "announcer/male/30kills.ogg");
 				}
 			}
 		}
@@ -292,7 +323,7 @@
 				bprint ("^1",s, "^1 died\n");
 			GiveFrags(targ, targ, -1);
 			if(targ.frags == -5) {
-				play2(targ, "announcer/male/botlike.ogg");
+				announce(targ, "announcer/male/botlike.ogg");
 			}
 
 			if (targ.killcount > 2)
@@ -416,7 +447,10 @@
 			}
 			else if (deathtype == IT_NEX && targ.items & IT_STRENGTH)
 			{
-				if(clienttype(attacker) == CLIENTTYPE_REAL) play2(attacker, "announcer/male/yoda.ogg");
+				if(clienttype(attacker) == CLIENTTYPE_REAL)
+				{
+					announce(attacker, "announcer/male/yoda.ogg");
+				}
 			}
 			if (deathtype == IT_LASER)
 			{
@@ -433,10 +467,10 @@
 				}
 			}
 		} else {
-			if (deathtype == IT_NEX && !targ.deadflag && !(attacker.flags & FL_ONGROUND) && !(targ.flags & FL_ONGROUND) && attacker.waterlevel < 2 && targ.waterlevel < 2 && attacker.killcount != 3 && attacker.killcount != 5 && attacker.killcount != 10 && attacker.killcount != 15 && attacker.killcount != 20 && attacker.killcount != 25 && attacker.killcount != 30)
-			{
-				if(clienttype(attacker) == CLIENTTYPE_REAL)  play2(attacker, "announcer/male/yoda.ogg");
-			}
+			if (!targ.deadflag)
+				if(IsFlying(targ))
+					if(IsDifferentTeam(self, targ))
+						yoda = 1;
 		}
 
 		// apply strength multiplier

Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2008-01-11 22:14:45 UTC (rev 3128)
+++ trunk/data/qcsrc/server/t_items.qc	2008-01-12 08:30:52 UTC (rev 3129)
@@ -54,9 +54,9 @@
 			// play some cool sounds ;)
 			centerprint(other, "\n");
 			if(other.health <= 5)
-				play2(other, "announcer/robotic/lastsecond.ogg");
+				announce(other, "announcer/robotic/lastsecond.ogg");
 			else if(other.health < 50)
-				play2(other, "announcer/robotic/narrowly.ogg");
+				announce(other, "announcer/robotic/narrowly.ogg");
 			// sound not available
 			// else if(self.items == IT_CELLS)
 			//	play2(other, "announce/robotic/ammo.ogg");

Modified: trunk/data/qcsrc/server/w_electro.qc
===================================================================
--- trunk/data/qcsrc/server/w_electro.qc	2008-01-11 22:14:45 UTC (rev 3128)
+++ trunk/data/qcsrc/server/w_electro.qc	2008-01-12 08:30:52 UTC (rev 3129)
@@ -39,6 +39,7 @@
 
 void W_Plasma_Touch (void)
 {
+	entity o;
 	if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
 	{
 		sound (self, CHAN_BODY, "misc/null.wav", 1, ATTN_NORM);
@@ -46,7 +47,12 @@
 		return;
 	}
 	if (other.takedamage == DAMAGE_AIM) {
+		o = self.owner;
 		W_Plasma_Explode ();
+		if(!other.deadflag)
+			if(IsDifferentTeam(o, other))
+				if(IsFlying(other))
+					announce(o, "announcer/male/electrobitch.ogg");
 	} else {
 		sound (self, CHAN_IMPACT, "weapons/electro_bounce.wav", 1, ATTN_NORM);
 	}
@@ -54,13 +60,20 @@
 
 void W_Plasma_TouchExplode (void)
 {
+	entity o;
 	if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
 	{
 		sound (self, CHAN_BODY, "misc/null.wav", 1, ATTN_NORM);
 		remove(self);
 		return;
 	}
+	o = self.owner;
 	W_Plasma_Explode ();
+	if(other.takedamage == DAMAGE_AIM)
+		if(!other.deadflag)
+			if(IsDifferentTeam(o, other))
+				if(IsFlying(other))
+					announce(o, "announcer/male/electrobitch.ogg");
 }
 
 void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)

Modified: trunk/data/qcsrc/server/w_nex.qc
===================================================================
--- trunk/data/qcsrc/server/w_nex.qc	2008-01-11 22:14:45 UTC (rev 3128)
+++ trunk/data/qcsrc/server/w_nex.qc	2008-01-12 08:30:52 UTC (rev 3129)
@@ -8,7 +8,13 @@
 	if (g_minstagib)
 		FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, 800, IT_NEX);
 	else
+	{
+		yoda = 0;
 		FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX);
+		if(yoda)
+			if(IsFlying(self))
+				announce(self, "announcer/male/yoda.ogg");
+	}
 
 	pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg + v_forward * 32, v_forward * 1000, 1);
 
@@ -61,67 +67,67 @@
 		{
 			centerprint(self, "you're dead now...\n");
 			Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/terminated.ogg");
+			announce(self, "announcer/robotic/terminated.ogg");
 		}
 		if (self.health == 10)
 		{
 			centerprint(self, "^11^7 second left to find some ammo\n");
 			Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/1.ogg");
+			announce(self, "announcer/robotic/1.ogg");
 		}
 		if (self.health == 20)
 		{
 			centerprint(self, "^12^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/2.ogg");
+			announce(self, "announcer/robotic/2.ogg");
 		}
 		if (self.health == 30)
 		{
 			centerprint(self, "^13^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/3.ogg");
+			announce(self, "announcer/robotic/3.ogg");
 		}
 		if (self.health == 40)
 		{
 			centerprint(self, "^14^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/4.ogg");
+			announce(self, "announcer/robotic/4.ogg");
 		}
 		if (self.health == 50)
 		{
 			centerprint(self, "^15^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/5.ogg");
+			announce(self, "announcer/robotic/5.ogg");
 		}
 		if (self.health == 60)
 		{
 			centerprint(self, "^36^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/6.ogg");
+			announce(self, "announcer/robotic/6.ogg");
 		}
 		if (self.health == 70)
 		{
 			centerprint(self, "^37^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/7.ogg");
+			announce(self, "announcer/robotic/7.ogg");
 		}
 		if (self.health == 80)
 		{
 			centerprint(self, "^38^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/8.ogg");
+			announce(self, "announcer/robotic/8.ogg");
 		}
 		if (self.health == 90)
 		{
 			centerprint(self, "^39^7 seconds left to find some ammo\n");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/9.ogg");
+			announce(self, "announcer/robotic/9.ogg");
 		}
 		if (self.health == 100)
 		{
 			centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
 			Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-			play2(self, "announcer/robotic/10.ogg");
+			announce(self, "announcer/robotic/10.ogg");
 		}
 	}
 	self.minstagib_nextthink = time + 1;




More information about the nexuiz-commits mailing list