[nexuiz-commits] r8069 - in branches/nexuiz-2.0: . data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Oct 7 10:53:57 EDT 2009


Author: div0
Date: 2009-10-07 10:53:56 -0400 (Wed, 07 Oct 2009)
New Revision: 8069

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/server/w_laser.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_minstanex.qc
Log:
r8068 | div0 | 2009-10-07 06:35:09 -0400 (Wed, 07 Oct 2009) | 2 lines
minstanex laser: properly notify the laser code that the shot shall have no damage (please test), should close #555
r8068 | div0 | 2009-10-07 06:35:09 -0400 (Wed, 07 Oct 2009) | 2 lines
minstanex laser: properly notify the laser code that the shot shall have no damage (please test), should close #555


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-10-07 10:35:09 UTC (rev 8068)
+++ branches/nexuiz-2.0/.patchsets	2009-10-07 14:53:56 UTC (rev 8069)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-7945,7948-7948,7951-7990,7993-8066
+revisions_applied = 1-7945,7948-7948,7951-7990,7993-8068

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_laser.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_laser.qc	2009-10-07 10:35:09 UTC (rev 8068)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_laser.qc	2009-10-07 14:53:56 UTC (rev 8069)
@@ -18,14 +18,22 @@
 	local entity missile;
 	vector s_forward;
 	float a;
+	float nodamage;
 
-	if (issecondary)
+	if(issecondary == 2) // minstanex shot
+		nodamage = g_minstagib;
+	else
+		nodamage = FALSE;
+
+	if (issecondary == 1)
 		a = cvar("g_balance_laser_secondary_shotangle");
 	else
 		a = cvar("g_balance_laser_primary_shotangle");
 	s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
 
-	if(issecondary)
+	if(nodamage)
+		W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", 0);
+	else if(issecondary == 1)
 		W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_laser_secondary_damage"));
 	else
 		W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", cvar("g_balance_laser_primary_damage"));
@@ -34,23 +42,26 @@
 	missile = spawn ();
 	missile.owner = self;
 	missile.classname = "laserbolt";
-	missile.dmg = issecondary;
-	missile.bot_dodge = TRUE;
-	if (issecondary)
-		missile.bot_dodgerating = cvar("g_balance_laser_secondary_damage");
-	else
-		missile.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+	missile.dmg = (issecondary == 1);
+	if(!nodamage)
+	{
+		missile.bot_dodge = TRUE;
+		if (issecondary == 1)
+			missile.bot_dodgerating = cvar("g_balance_laser_secondary_damage");
+		else
+			missile.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+	}
 
 	missile.movetype = MOVETYPE_FLY;
 	PROJECTILE_MAKETRIGGER(missile);
 	missile.projectiledeathtype = WEP_LASER;
-	if(issecondary)
+	if(issecondary == 1)
 		missile.projectiledeathtype |= HITTYPE_SECONDARY;
 
 	setorigin (missile, w_shotorg);
 	setsize(missile, '0 0 0', '0 0 0');
 
-	if (issecondary)
+	if (issecondary == 1)
 		missile.velocity = w_shotdir * cvar("g_balance_laser_secondary_speed");
 	else
 		missile.velocity = w_shotdir * cvar("g_balance_laser_primary_speed");
@@ -60,7 +71,7 @@
 	//missile.glow_size = 120;
 	missile.touch = W_Laser_Touch;
 	missile.think = SUB_Remove;
-	if (issecondary)
+	if (issecondary == 1)
 		missile.nextthink = time + cvar("g_balance_laser_secondary_lifetime");
 	else
 		missile.nextthink = time + cvar("g_balance_laser_primary_lifetime");
@@ -98,7 +109,7 @@
 		if (self.BUTTON_ATCK)
 		if (weapon_prepareattack(0, cvar("g_balance_laser_primary_refire")))
 		{
-			W_Laser_Attack(FALSE);
+			W_Laser_Attack(0);
 			weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_primary_animtime"), w_ready);
 		}
 		if (self.BUTTON_ATCK2)
@@ -107,7 +118,7 @@
 			{
 				if (weapon_prepareattack(0, cvar("g_balance_laser_secondary_refire")))
 				{
-					W_Laser_Attack(TRUE);
+					W_Laser_Attack(1);
 					weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_laser_secondary_animtime"), w_ready);
 				}
 			}

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_minstanex.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_minstanex.qc	2009-10-07 10:35:09 UTC (rev 8068)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_minstanex.qc	2009-10-07 14:53:56 UTC (rev 8069)
@@ -190,7 +190,13 @@
 			if (self.jump_interval <= time)
 			{
 				self.jump_interval = time + 0.9 * W_WeaponRateFactor();
-				W_Laser_Attack(FALSE);
+
+				// ugly minstagib hack to reuse the fire mode of the laser
+				float w;
+				w = self.weapon;
+				self.weapon = WEP_LASER;
+				W_Laser_Attack(2);
+				self.weapon = w;
 			}
 		}
 	}



More information about the nexuiz-commits mailing list