r4309 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Sep 3 09:58:18 EDT 2008


Author: div0
Date: 2008-09-03 09:58:17 -0400 (Wed, 03 Sep 2008)
New Revision: 4309

Added:
   trunk/data/qcsrc/server/w_minstanex.qc
Log:
argh


Added: trunk/data/qcsrc/server/w_minstanex.qc
===================================================================
--- trunk/data/qcsrc/server/w_minstanex.qc	                        (rev 0)
+++ trunk/data/qcsrc/server/w_minstanex.qc	2008-09-03 13:58:17 UTC (rev 4309)
@@ -0,0 +1,167 @@
+void W_MinstaNex_Attack (void)
+{
+	float flying;
+	flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+
+	W_SetupShot (self, '25 4 -4', TRUE, 5, "weapons/nexfire.wav");
+
+	yoda = 0;
+	FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, 800, WEP_MINSTANEX);
+
+	if(!g_minstagib)
+	if(yoda)
+	if(flying)
+		announce(self, "announcer/male/yoda.ogg");
+
+	pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+	// beam effect
+	trailparticles(world, particleeffectnum("nex_beam"), w_shotorg, trace_endpos);
+	// flash and burn the wall
+	if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
+		pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
+	// play a sound
+	soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+
+	if (cvar("g_use_ammunition"))
+	{
+		if (g_minstagib)
+			self.ammo_cells = self.ammo_cells - 1;
+		else
+			self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
+	}
+}
+
+
+.float minstagib_nextthink;
+void minstagib_ammocheck (void)
+{
+	if (time < self.minstagib_nextthink || self.deadflag || gameover)
+		return;
+
+	if (self.ammo_cells <= 0)
+	{
+		if (self.health == 5)
+		{
+			centerprint(self, "you're dead now...\n");
+			Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
+			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');
+			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');
+			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');
+			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');
+			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');
+			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');
+			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');
+			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');
+			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');
+			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');
+			announce(self, "announcer/robotic/10.ogg");
+		}
+	}
+	self.minstagib_nextthink = time + 1;
+}
+
+void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
+
+float w_minstanex(float req)
+{
+	if (req == WR_AIM)
+		self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
+	else if (req == WR_THINK)
+	{
+		if (self.BUTTON_ATCK)
+		{
+			if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
+			{
+				W_Nex_Attack();
+				weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
+			}
+		}
+		else if (self.BUTTON_ATCK2)
+		{
+			if (self.jump_interval <= time)
+			{
+				self.jump_interval = time + 0.9;
+				W_Laser_Attack(FALSE);
+			}
+		}
+	}
+	else if (req == WR_PRECACHE)
+	{
+		precache_model ("models/nexflash.md3");
+		precache_model ("models/weapons/g_nex.md3");
+		precache_model ("models/weapons/v_nex.md3");
+		precache_model ("models/weapons/w_nex.zym");
+		precache_sound ("weapons/nexfire.wav");
+		precache_sound ("weapons/neximpact.wav");
+		w_laser(WR_PRECACHE);
+	}
+	else if (req == WR_SETUP)
+		weapon_setup(WEP_MINSTANEX);
+	else if (req == WR_CHECKAMMO1)
+	{
+		if (g_minstagib)
+			return self.ammo_cells >= 1;
+		else
+			return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
+	}
+	else if (req == WR_CHECKAMMO2)
+		return FALSE;
+	else if (req == WR_SUICIDEMESSAGE)
+		w_deathtypestring = "did the impossible";
+	else if (req == WR_KILLMESSAGE)
+		w_deathtypestring = "has been vaporized by";
+	else if (req == WR_SPAWNFUNC)
+		spawnfunc_weapon_minstanex();
+	return TRUE;
+};




More information about the nexuiz-commits mailing list