.float minstanex_lasthit; void W_MinstaNex_Attack (void) { float flying; flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", 0); yoda = 0; damage_goodhits = 0; headshot = 0; FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX); if(g_minstagib) { if(yoda) announce(self, "announcer/male/yoda.wav"); } else { if(yoda && flying) announce(self, "announcer/male/yoda.wav"); if(headshot) { announce(self, "announcer/male/headshot.wav"); print("h\n"); } if(damage_goodhits && self.minstanex_lasthit) { if(announce(self, "announcer/male/impressive.wav")) damage_goodhits = 0; // only every second time } } self.minstanex_lasthit = damage_goodhits; pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); // teamcolor / hit beam effect if(teamplay) { switch(self.team) { case COLOR_TEAM1: // Red if(damage_goodhits) trailparticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, trace_endpos); else trailparticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, trace_endpos); break; case COLOR_TEAM2: // Blue if(damage_goodhits) trailparticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, trace_endpos); else trailparticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, trace_endpos); break; case COLOR_TEAM3: // Yellow if(damage_goodhits) trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, trace_endpos); else trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, trace_endpos); break; case COLOR_TEAM4: // Pink if(damage_goodhits) trailparticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, trace_endpos); else trailparticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, trace_endpos); break; } } else trailparticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, trace_endpos); // flash and burn the wall if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX, self); if not(self.items & IT_UNLIMITED_WEAPON_AMMO) { 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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.wav"); } else 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'); if not(self.flags & FL_GODMODE) announce(self, "announcer/robotic/10.wav"); } } self.minstagib_nextthink = time + 1; } void spawnfunc_weapon_minstanex (void); // defined in t_items.qc float w_minstanex(float req) { if (req == WR_AIM) { if(self.ammo_cells>0) self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE); else self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE); } else if (req == WR_THINK) { if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire"))) { W_MinstaNex_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_WeaponRateFactor(); // 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; } } } else if (req == WR_PRECACHE) { precache_model ("models/nexflash.md3"); precache_model ("models/weapons/g_minstanex.md3"); precache_model ("models/weapons/v_minstanex.md3"); precache_model ("models/weapons/h_minstanex.dpm"); precache_sound ("weapons/minstanexfire.wav"); precache_sound ("weapons/nexwhoosh1.wav"); precache_sound ("weapons/nexwhoosh2.wav"); precache_sound ("weapons/nexwhoosh3.wav"); w_laser(WR_PRECACHE); } else if (req == WR_SETUP) { weapon_setup(WEP_MINSTANEX); self.minstanex_lasthit = 0; } 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 TRUE; 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_RESETPLAYER) { self.minstanex_lasthit = 0; } return TRUE; };