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, 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 Damage_DamageInfo(trace_endpos, 10000, 0, 0, 800 * w_shotdir, WEP_MINSTANEX);
46 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
49 self.ammo_cells = self.ammo_cells - 1;
51 self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
56 .float minstagib_nextthink;
57 void minstagib_ammocheck (void)
59 if (time < self.minstagib_nextthink || self.deadflag || gameover)
62 if (self.ammo_cells <= 0)
66 centerprint(self, "you're dead now...\n");
67 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
68 announce(self, "announcer/robotic/terminated.wav");
70 if (self.health == 10)
72 centerprint(self, "^11^7 second left to find some ammo\n");
73 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
74 announce(self, "announcer/robotic/1.wav");
76 if (self.health == 20)
78 centerprint(self, "^12^7 seconds left to find some ammo\n");
79 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
80 announce(self, "announcer/robotic/2.wav");
82 if (self.health == 30)
84 centerprint(self, "^13^7 seconds left to find some ammo\n");
85 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
86 announce(self, "announcer/robotic/3.wav");
88 if (self.health == 40)
90 centerprint(self, "^14^7 seconds left to find some ammo\n");
91 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
92 announce(self, "announcer/robotic/4.wav");
94 if (self.health == 50)
96 centerprint(self, "^15^7 seconds left to find some ammo\n");
97 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
98 announce(self, "announcer/robotic/5.wav");
100 if (self.health == 60)
102 centerprint(self, "^36^7 seconds left to find some ammo\n");
103 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
104 announce(self, "announcer/robotic/6.wav");
106 if (self.health == 70)
108 centerprint(self, "^37^7 seconds left to find some ammo\n");
109 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
110 announce(self, "announcer/robotic/7.wav");
112 if (self.health == 80)
114 centerprint(self, "^38^7 seconds left to find some ammo\n");
115 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
116 announce(self, "announcer/robotic/8.wav");
118 if (self.health == 90)
120 centerprint(self, "^39^7 seconds left to find some ammo\n");
121 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
122 announce(self, "announcer/robotic/9.wav");
124 if (self.health == 100)
126 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
127 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
128 announce(self, "announcer/robotic/10.wav");
131 self.minstagib_nextthink = time + 1;
134 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
136 float w_minstanex(float req)
139 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
140 else if (req == WR_THINK)
142 if (self.BUTTON_ATCK)
144 if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
146 W_MinstaNex_Attack();
147 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
150 else if (self.BUTTON_ATCK2)
152 if (self.jump_interval <= time)
154 self.jump_interval = time + 0.9;
155 W_Laser_Attack(FALSE);
159 else if (req == WR_PRECACHE)
161 precache_model ("models/nexflash.md3");
162 precache_model ("models/weapons/g_minstanex.md3");
163 precache_model ("models/weapons/v_minstanex.md3");
164 precache_model ("models/weapons/h_minstanex.dpm");
165 precache_sound ("weapons/minstanexfire.wav");
166 w_laser(WR_PRECACHE);
168 else if (req == WR_SETUP)
170 weapon_setup(WEP_MINSTANEX);
171 self.minstanex_lasthit = 0;
173 else if (req == WR_CHECKAMMO1)
176 return self.ammo_cells >= 1;
178 return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
180 else if (req == WR_CHECKAMMO2)
182 else if (req == WR_SUICIDEMESSAGE)
183 w_deathtypestring = "did the impossible";
184 else if (req == WR_KILLMESSAGE)
185 w_deathtypestring = "has been vaporized by";