2 REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_CANCLIMB | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", "MinstaNex");
5 .float minstanex_lasthit;
7 void W_MinstaNex_Attack (void)
10 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
12 W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CHAN_WEAPON, 10000);
17 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
22 AnnounceTo(self, "yoda");
27 AnnounceTo(self, "yoda");
30 AnnounceTo(self, "headshot");
32 if(damage_goodhits && self.minstanex_lasthit)
34 if(AnnounceTo(self, "impressive"))
35 damage_goodhits = 0; // only every second time
39 self.minstanex_lasthit = damage_goodhits;
41 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
43 // teamcolor / hit beam effect
45 v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
50 case COLOR_TEAM1: // Red
52 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
54 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
56 case COLOR_TEAM2: // Blue
58 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
60 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
62 case COLOR_TEAM3: // Yellow
64 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
66 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
68 case COLOR_TEAM4: // Pink
70 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
72 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
77 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
79 // flash and burn the wall
80 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
81 Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX, self);
83 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
86 self.ammo_cells = self.ammo_cells - 1;
88 self.ammo_cells = self.ammo_cells - autocvar_g_balance_minstanex_ammo;
93 .float minstagib_nextthink;
94 void minstagib_ammocheck (void)
96 if (time < self.minstagib_nextthink || self.deadflag || gameover)
99 if (self.ammo_cells <= 0)
101 if (self.health == 5)
103 centerprint(self, "you're dead now...\n");
104 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
105 AnnounceTo(self, "terminated");
107 else if (self.health == 10)
109 centerprint(self, "^11^7 second left to find some ammo\n");
110 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
111 AnnounceTo(self, "1");
113 else if (self.health == 20)
115 centerprint(self, "^12^7 seconds left to find some ammo\n");
116 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
117 AnnounceTo(self, "2");
119 else if (self.health == 30)
121 centerprint(self, "^13^7 seconds left to find some ammo\n");
122 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
123 AnnounceTo(self, "3");
125 else if (self.health == 40)
127 centerprint(self, "^14^7 seconds left to find some ammo\n");
128 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
129 AnnounceTo(self, "4");
131 else if (self.health == 50)
133 centerprint(self, "^15^7 seconds left to find some ammo\n");
134 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
135 AnnounceTo(self, "5");
137 else if (self.health == 60)
139 centerprint(self, "^36^7 seconds left to find some ammo\n");
140 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
141 AnnounceTo(self, "6");
143 else if (self.health == 70)
145 centerprint(self, "^37^7 seconds left to find some ammo\n");
146 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
147 AnnounceTo(self, "7");
149 else if (self.health == 80)
151 centerprint(self, "^38^7 seconds left to find some ammo\n");
152 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
153 AnnounceTo(self, "8");
155 else if (self.health == 90)
157 centerprint(self, "^39^7 seconds left to find some ammo\n");
158 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
159 AnnounceTo(self, "9");
161 else if (self.health == 100)
163 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
164 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
165 if not(self.flags & FL_GODMODE)
166 AnnounceTo(self, "10");
169 self.minstagib_nextthink = time + 1;
172 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
174 float w_minstanex(float req)
178 if(self.ammo_cells>0)
179 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
181 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
183 else if (req == WR_THINK)
185 if (self.BUTTON_ATCK)
187 if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire))
189 W_MinstaNex_Attack();
190 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_minstanex_animtime, w_ready);
193 else if (self.BUTTON_ATCK2)
195 if (self.jump_interval <= time)
197 self.jump_interval = time + autocvar_g_balance_laser_primary_refire * W_WeaponRateFactor();
199 // ugly minstagib hack to reuse the fire mode of the laser
202 self.weapon = WEP_LASER;
208 else if (req == WR_PRECACHE)
210 precache_model ("models/nexflash.md3");
211 precache_model ("models/weapons/g_minstanex.md3");
212 precache_model ("models/weapons/v_minstanex.md3");
213 precache_model ("models/weapons/h_minstanex.iqm");
214 precache_sound ("weapons/minstanexfire.wav");
215 precache_sound ("weapons/nexwhoosh1.wav");
216 precache_sound ("weapons/nexwhoosh2.wav");
217 precache_sound ("weapons/nexwhoosh3.wav");
218 w_laser(WR_PRECACHE);
220 else if (req == WR_SETUP)
222 weapon_setup(WEP_MINSTANEX);
223 self.minstanex_lasthit = 0;
225 else if (req == WR_CHECKAMMO1)
228 return self.ammo_cells >= 1;
230 return self.ammo_cells >= autocvar_g_balance_minstanex_ammo;
232 else if (req == WR_CHECKAMMO2)
234 else if (req == WR_RESETPLAYER)
236 self.minstanex_lasthit = 0;
242 float w_minstanex(float req)
244 if(req == WR_IMPACTEFFECT)
247 org2 = w_org + w_backoff * 6;
248 pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
250 sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
252 else if(req == WR_PRECACHE)
254 precache_sound("weapons/neximpact.wav");
256 else if (req == WR_SUICIDEMESSAGE)
257 w_deathtypestring = "%s did the impossible";
258 else if (req == WR_KILLMESSAGE)
259 w_deathtypestring = "%s has been vaporized by %s";