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", 0);
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");
33 if(damage_goodhits && self.minstanex_lasthit)
35 if(AnnounceTo(self, "impressive"))
36 damage_goodhits = 0; // only every second time
40 self.minstanex_lasthit = damage_goodhits;
42 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
44 // teamcolor / hit beam effect
46 v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
51 case COLOR_TEAM1: // Red
53 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
55 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
57 case COLOR_TEAM2: // Blue
59 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
61 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
63 case COLOR_TEAM3: // Yellow
65 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
67 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
69 case COLOR_TEAM4: // Pink
71 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
73 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
78 WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
80 // flash and burn the wall
81 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
82 Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX, self);
84 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
87 self.ammo_cells = self.ammo_cells - 1;
89 self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
94 .float minstagib_nextthink;
95 void minstagib_ammocheck (void)
97 if (time < self.minstagib_nextthink || self.deadflag || gameover)
100 if (self.ammo_cells <= 0)
102 if (self.health == 5)
104 centerprint(self, "you're dead now...\n");
105 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
106 AnnounceTo(self, "terminated");
108 else if (self.health == 10)
110 centerprint(self, "^11^7 second left to find some ammo\n");
111 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
112 AnnounceTo(self, "1");
114 else if (self.health == 20)
116 centerprint(self, "^12^7 seconds left to find some ammo\n");
117 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
118 AnnounceTo(self, "2");
120 else if (self.health == 30)
122 centerprint(self, "^13^7 seconds left to find some ammo\n");
123 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
124 AnnounceTo(self, "3");
126 else if (self.health == 40)
128 centerprint(self, "^14^7 seconds left to find some ammo\n");
129 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
130 AnnounceTo(self, "4");
132 else if (self.health == 50)
134 centerprint(self, "^15^7 seconds left to find some ammo\n");
135 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
136 AnnounceTo(self, "5");
138 else if (self.health == 60)
140 centerprint(self, "^36^7 seconds left to find some ammo\n");
141 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
142 AnnounceTo(self, "6");
144 else if (self.health == 70)
146 centerprint(self, "^37^7 seconds left to find some ammo\n");
147 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
148 AnnounceTo(self, "7");
150 else if (self.health == 80)
152 centerprint(self, "^38^7 seconds left to find some ammo\n");
153 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
154 AnnounceTo(self, "8");
156 else if (self.health == 90)
158 centerprint(self, "^39^7 seconds left to find some ammo\n");
159 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
160 AnnounceTo(self, "9");
162 else if (self.health == 100)
164 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
165 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
166 if not(self.flags & FL_GODMODE)
167 AnnounceTo(self, "10");
170 self.minstagib_nextthink = time + 1;
173 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
175 float w_minstanex(float req)
179 if(self.ammo_cells>0)
180 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
182 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
184 else if (req == WR_THINK)
186 if (self.BUTTON_ATCK)
188 if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
190 W_MinstaNex_Attack();
191 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
194 else if (self.BUTTON_ATCK2)
196 if (self.jump_interval <= time)
198 self.jump_interval = time + cvar("g_balance_laser_primary_refire") * W_WeaponRateFactor();
200 // ugly minstagib hack to reuse the fire mode of the laser
203 self.weapon = WEP_LASER;
209 else if (req == WR_PRECACHE)
211 precache_model ("models/nexflash.md3");
212 precache_model ("models/weapons/g_minstanex.md3");
213 precache_model ("models/weapons/v_minstanex.md3");
214 precache_model ("models/weapons/h_minstanex.iqm");
215 precache_sound ("weapons/minstanexfire.wav");
216 precache_sound ("weapons/nexwhoosh1.wav");
217 precache_sound ("weapons/nexwhoosh2.wav");
218 precache_sound ("weapons/nexwhoosh3.wav");
219 w_laser(WR_PRECACHE);
221 else if (req == WR_SETUP)
223 weapon_setup(WEP_MINSTANEX);
224 self.minstanex_lasthit = 0;
226 else if (req == WR_CHECKAMMO1)
229 return self.ammo_cells >= 1;
231 return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
233 else if (req == WR_CHECKAMMO2)
235 else if (req == WR_RESETPLAYER)
237 self.minstanex_lasthit = 0;
243 float w_minstanex(float req)
245 if(req == WR_IMPACTEFFECT)
248 org2 = w_org + w_backoff * 6;
249 pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
251 sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
253 else if(req == WR_PRECACHE)
255 precache_sound("weapons/neximpact.wav");
257 else if (req == WR_SUICIDEMESSAGE)
258 w_deathtypestring = "%s did the impossible";
259 else if (req == WR_KILLMESSAGE)
260 w_deathtypestring = "%s has been vaporized by %s";