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");
4 .float minstanex_lasthit;
6 void W_MinstaNex_Attack (void)
9 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
11 W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", 0);
16 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
21 AnnounceTo(self, "yoda");
26 AnnounceTo(self, "yoda");
29 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
48 case COLOR_TEAM1: // Red
50 trailparticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, trace_endpos);
52 trailparticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, trace_endpos);
54 case COLOR_TEAM2: // Blue
56 trailparticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, trace_endpos);
58 trailparticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, trace_endpos);
60 case COLOR_TEAM3: // Yellow
62 trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, trace_endpos);
64 trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, trace_endpos);
66 case COLOR_TEAM4: // Pink
68 trailparticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, trace_endpos);
70 trailparticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, trace_endpos);
75 trailparticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, trace_endpos);
77 // flash and burn the wall
78 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
79 Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX, self);
81 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
84 self.ammo_cells = self.ammo_cells - 1;
86 self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
91 .float minstagib_nextthink;
92 void minstagib_ammocheck (void)
94 if (time < self.minstagib_nextthink || self.deadflag || gameover)
97 if (self.ammo_cells <= 0)
101 centerprint(self, "you're dead now...\n");
102 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
103 AnnounceTo(self, "terminated");
105 else if (self.health == 10)
107 centerprint(self, "^11^7 second left to find some ammo\n");
108 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
109 AnnounceTo(self, "1");
111 else if (self.health == 20)
113 centerprint(self, "^12^7 seconds left to find some ammo\n");
114 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
115 AnnounceTo(self, "2");
117 else if (self.health == 30)
119 centerprint(self, "^13^7 seconds left to find some ammo\n");
120 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
121 AnnounceTo(self, "3");
123 else if (self.health == 40)
125 centerprint(self, "^14^7 seconds left to find some ammo\n");
126 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
127 AnnounceTo(self, "4");
129 else if (self.health == 50)
131 centerprint(self, "^15^7 seconds left to find some ammo\n");
132 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
133 AnnounceTo(self, "5");
135 else if (self.health == 60)
137 centerprint(self, "^36^7 seconds left to find some ammo\n");
138 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
139 AnnounceTo(self, "6");
141 else if (self.health == 70)
143 centerprint(self, "^37^7 seconds left to find some ammo\n");
144 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
145 AnnounceTo(self, "7");
147 else if (self.health == 80)
149 centerprint(self, "^38^7 seconds left to find some ammo\n");
150 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
151 AnnounceTo(self, "8");
153 else if (self.health == 90)
155 centerprint(self, "^39^7 seconds left to find some ammo\n");
156 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
157 AnnounceTo(self, "9");
159 else if (self.health == 100)
161 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
162 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
163 if not(self.flags & FL_GODMODE)
164 AnnounceTo(self, "10");
167 self.minstagib_nextthink = time + 1;
170 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
172 float w_minstanex(float req)
176 if(self.ammo_cells>0)
177 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
179 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
181 else if (req == WR_THINK)
183 if (self.BUTTON_ATCK)
185 if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
187 W_MinstaNex_Attack();
188 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
191 else if (self.BUTTON_ATCK2)
193 if (self.jump_interval <= time)
195 self.jump_interval = time + 0.9 * W_WeaponRateFactor();
197 // ugly minstagib hack to reuse the fire mode of the laser
200 self.weapon = WEP_LASER;
206 else if (req == WR_PRECACHE)
208 precache_model ("models/nexflash.md3");
209 precache_model ("models/weapons/g_minstanex.md3");
210 precache_model ("models/weapons/v_minstanex.md3");
211 precache_model ("models/weapons/h_minstanex.dpm");
212 precache_sound ("weapons/minstanexfire.wav");
213 precache_sound ("weapons/nexwhoosh1.wav");
214 precache_sound ("weapons/nexwhoosh2.wav");
215 precache_sound ("weapons/nexwhoosh3.wav");
216 w_laser(WR_PRECACHE);
218 else if (req == WR_SETUP)
220 weapon_setup(WEP_MINSTANEX);
221 self.minstanex_lasthit = 0;
223 else if (req == WR_CHECKAMMO1)
226 return self.ammo_cells >= 1;
228 return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
230 else if (req == WR_CHECKAMMO2)
232 else if (req == WR_SUICIDEMESSAGE)
233 w_deathtypestring = "did the impossible";
234 else if (req == WR_KILLMESSAGE)
235 w_deathtypestring = "has been vaporized by";
236 else if (req == WR_RESETPLAYER)
238 self.minstanex_lasthit = 0;