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, '25 8 -4', TRUE, 5, "weapons/minstanexfire.wav");
13 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 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);
41 trailparticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, trace_endpos);
42 // flash and burn the wall
43 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
44 pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
46 soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
48 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
51 self.ammo_cells = self.ammo_cells - 1;
53 self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
58 .float minstagib_nextthink;
59 void minstagib_ammocheck (void)
61 if (time < self.minstagib_nextthink || self.deadflag || gameover)
64 if (self.ammo_cells <= 0)
68 centerprint(self, "you're dead now...\n");
69 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
70 announce(self, "announcer/robotic/terminated.wav");
72 if (self.health == 10)
74 centerprint(self, "^11^7 second left to find some ammo\n");
75 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
76 announce(self, "announcer/robotic/1.wav");
78 if (self.health == 20)
80 centerprint(self, "^12^7 seconds left to find some ammo\n");
81 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
82 announce(self, "announcer/robotic/2.wav");
84 if (self.health == 30)
86 centerprint(self, "^13^7 seconds left to find some ammo\n");
87 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
88 announce(self, "announcer/robotic/3.wav");
90 if (self.health == 40)
92 centerprint(self, "^14^7 seconds left to find some ammo\n");
93 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
94 announce(self, "announcer/robotic/4.wav");
96 if (self.health == 50)
98 centerprint(self, "^15^7 seconds left to find some ammo\n");
99 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
100 announce(self, "announcer/robotic/5.wav");
102 if (self.health == 60)
104 centerprint(self, "^36^7 seconds left to find some ammo\n");
105 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
106 announce(self, "announcer/robotic/6.wav");
108 if (self.health == 70)
110 centerprint(self, "^37^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/7.wav");
114 if (self.health == 80)
116 centerprint(self, "^38^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/8.wav");
120 if (self.health == 90)
122 centerprint(self, "^39^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/9.wav");
126 if (self.health == 100)
128 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
129 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
130 announce(self, "announcer/robotic/10.wav");
133 self.minstagib_nextthink = time + 1;
136 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
138 float w_minstanex(float req)
141 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
142 else if (req == WR_THINK)
144 if (self.BUTTON_ATCK)
146 if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
148 W_MinstaNex_Attack();
149 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
152 else if (self.BUTTON_ATCK2)
154 if (self.jump_interval <= time)
156 self.jump_interval = time + 0.9;
157 W_Laser_Attack(FALSE);
161 else if (req == WR_PRECACHE)
163 precache_model ("models/nexflash.md3");
164 precache_model ("models/weapons/g_minstanex.md3");
165 precache_model ("models/weapons/v_minstanex.md3");
166 precache_model ("models/weapons/w_minstanex.zym");
167 precache_sound ("weapons/minstanexfire.wav");
168 precache_sound ("weapons/neximpact.wav");
169 w_laser(WR_PRECACHE);
171 else if (req == WR_SETUP)
173 weapon_setup(WEP_MINSTANEX);
174 self.minstanex_lasthit = 0;
176 else if (req == WR_CHECKAMMO1)
179 return self.ammo_cells >= 1;
181 return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
183 else if (req == WR_CHECKAMMO2)
185 else if (req == WR_SUICIDEMESSAGE)
186 w_deathtypestring = "did the impossible";
187 else if (req == WR_KILLMESSAGE)
188 w_deathtypestring = "has been vaporized by";