1 .float minstanex_lasthit;
3 void W_MinstaNex_Attack (void)
6 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
8 W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", 0);
13 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
18 announce(self, "announcer/male/yoda.wav");
23 announce(self, "announcer/male/yoda.wav");
26 announce(self, "announcer/male/headshot.wav");
29 if(damage_goodhits && self.minstanex_lasthit)
31 if(announce(self, "announcer/male/impressive.wav"))
32 damage_goodhits = 0; // only every second time
36 self.minstanex_lasthit = damage_goodhits;
38 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
40 // teamcolor / hit beam effect
45 case COLOR_TEAM1: // Red
47 trailparticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, trace_endpos);
49 trailparticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, trace_endpos);
51 case COLOR_TEAM2: // Blue
53 trailparticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, trace_endpos);
55 trailparticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, trace_endpos);
57 case COLOR_TEAM3: // Yellow
59 trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, trace_endpos);
61 trailparticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, trace_endpos);
63 case COLOR_TEAM4: // Pink
65 trailparticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, trace_endpos);
67 trailparticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, trace_endpos);
72 trailparticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, trace_endpos);
74 // flash and burn the wall
75 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
76 Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX, self);
78 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
81 self.ammo_cells = self.ammo_cells - 1;
83 self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
88 .float minstagib_nextthink;
89 void minstagib_ammocheck (void)
91 if (time < self.minstagib_nextthink || self.deadflag || gameover)
94 if (self.ammo_cells <= 0)
98 centerprint(self, "you're dead now...\n");
99 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
100 announce(self, "announcer/robotic/terminated.wav");
102 else if (self.health == 10)
104 centerprint(self, "^11^7 second left to find some ammo\n");
105 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
106 announce(self, "announcer/robotic/1.wav");
108 else if (self.health == 20)
110 centerprint(self, "^12^7 seconds left to find some ammo\n");
111 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
112 announce(self, "announcer/robotic/2.wav");
114 else if (self.health == 30)
116 centerprint(self, "^13^7 seconds left to find some ammo\n");
117 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
118 announce(self, "announcer/robotic/3.wav");
120 else if (self.health == 40)
122 centerprint(self, "^14^7 seconds left to find some ammo\n");
123 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
124 announce(self, "announcer/robotic/4.wav");
126 else if (self.health == 50)
128 centerprint(self, "^15^7 seconds left to find some ammo\n");
129 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
130 announce(self, "announcer/robotic/5.wav");
132 else if (self.health == 60)
134 centerprint(self, "^36^7 seconds left to find some ammo\n");
135 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
136 announce(self, "announcer/robotic/6.wav");
138 else if (self.health == 70)
140 centerprint(self, "^37^7 seconds left to find some ammo\n");
141 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
142 announce(self, "announcer/robotic/7.wav");
144 else if (self.health == 80)
146 centerprint(self, "^38^7 seconds left to find some ammo\n");
147 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
148 announce(self, "announcer/robotic/8.wav");
150 else if (self.health == 90)
152 centerprint(self, "^39^7 seconds left to find some ammo\n");
153 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
154 announce(self, "announcer/robotic/9.wav");
156 else if (self.health == 100)
158 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
159 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
160 if not(self.flags & FL_GODMODE)
161 announce(self, "announcer/robotic/10.wav");
164 self.minstagib_nextthink = time + 1;
167 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
169 float w_minstanex(float req)
173 if(self.ammo_cells>0)
174 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
176 self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
178 else if (req == WR_THINK)
180 if (self.BUTTON_ATCK)
182 if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
184 W_MinstaNex_Attack();
185 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
188 else if (self.BUTTON_ATCK2)
190 if (self.jump_interval <= time)
192 self.jump_interval = time + 0.9 * W_WeaponRateFactor();
194 // ugly minstagib hack to reuse the fire mode of the laser
197 self.weapon = WEP_LASER;
203 else if (req == WR_PRECACHE)
205 precache_model ("models/nexflash.md3");
206 precache_model ("models/weapons/g_minstanex.md3");
207 precache_model ("models/weapons/v_minstanex.md3");
208 precache_model ("models/weapons/h_minstanex.dpm");
209 precache_sound ("weapons/minstanexfire.wav");
210 precache_sound ("weapons/nexwhoosh1.wav");
211 precache_sound ("weapons/nexwhoosh2.wav");
212 precache_sound ("weapons/nexwhoosh3.wav");
213 w_laser(WR_PRECACHE);
215 else if (req == WR_SETUP)
217 weapon_setup(WEP_MINSTANEX);
218 self.minstanex_lasthit = 0;
220 else if (req == WR_CHECKAMMO1)
223 return self.ammo_cells >= 1;
225 return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
227 else if (req == WR_CHECKAMMO2)
229 else if (req == WR_SUICIDEMESSAGE)
230 w_deathtypestring = "did the impossible";
231 else if (req == WR_KILLMESSAGE)
232 w_deathtypestring = "has been vaporized by";
233 else if (req == WR_RESETPLAYER)
235 self.minstanex_lasthit = 0;