2 void W_Nex_Attack (void)
5 if not(g_minstagib || g_instagib)
6 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
8 W_SetupShot (self, '25 4 -4', TRUE, 5, "weapons/nexfire.wav");
9 //W_SetupShot (self, '25 8 -8', TRUE, 2, "weapons/nexfire.wav"); // TODO: move model down a little
11 // assure that nexdamage is high enough in minstagib
12 if (g_minstagib || g_instagib)
13 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, 800, IT_NEX);
17 FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX);
21 announce(self, "announcer/male/yoda.ogg");
24 pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
27 trailparticles(world, particleeffectnum("nex_beam"), w_shotorg, trace_endpos);
28 // flash and burn the wall
29 if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
30 pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1);
32 PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM);
34 if (cvar("g_use_ammunition") && !g_instagib)
37 self.ammo_cells = self.ammo_cells - 1;
39 self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
44 .float minstagib_nextthink;
45 void minstagib_ammocheck (void)
47 if (time < self.minstagib_nextthink || self.deadflag || gameover)
50 if (self.ammo_cells <= 0)
54 centerprint(self, "you're dead now...\n");
55 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
56 announce(self, "announcer/robotic/terminated.ogg");
58 if (self.health == 10)
60 centerprint(self, "^11^7 second left to find some ammo\n");
61 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
62 announce(self, "announcer/robotic/1.ogg");
64 if (self.health == 20)
66 centerprint(self, "^12^7 seconds left to find some ammo\n");
67 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
68 announce(self, "announcer/robotic/2.ogg");
70 if (self.health == 30)
72 centerprint(self, "^13^7 seconds left to find some ammo\n");
73 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
74 announce(self, "announcer/robotic/3.ogg");
76 if (self.health == 40)
78 centerprint(self, "^14^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/4.ogg");
82 if (self.health == 50)
84 centerprint(self, "^15^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/5.ogg");
88 if (self.health == 60)
90 centerprint(self, "^36^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/6.ogg");
94 if (self.health == 70)
96 centerprint(self, "^37^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/7.ogg");
100 if (self.health == 80)
102 centerprint(self, "^38^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/8.ogg");
106 if (self.health == 90)
108 centerprint(self, "^39^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/9.ogg");
112 if (self.health == 100)
114 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
115 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
116 announce(self, "announcer/robotic/10.ogg");
119 self.minstagib_nextthink = time + 1;
122 float w_nex(float req)
125 self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
126 else if (req == WR_THINK)
128 if (self.BUTTON_ATCK)
132 if (weapon_prepareattack(0, cvar("g_balance_minstagib_nex_refire")))
135 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstagib_nex_animtime"), w_ready);
140 if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
143 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
147 else if (self.BUTTON_ATCK2)
151 if (self.jump_interval <= time)
153 self.jump_interval = time + 0.9;
154 W_Laser_Attack(FALSE);
159 else if (req == WR_PRECACHE)
161 precache_model ("models/nexflash.md3");
162 precache_model ("models/weapons/g_nex.md3");
163 precache_model ("models/weapons/v_nex.md3");
164 precache_model ("models/weapons/w_nex.zym");
165 precache_sound ("weapons/nexfire.wav");
166 precache_sound ("weapons/neximpact.wav");
168 w_laser(WR_PRECACHE);
170 else if (req == WR_SETUP)
171 weapon_setup(WEP_NEX, "nex", IT_CELLS);
172 else if (req == WR_CHECKAMMO1)
175 return self.ammo_cells >= 1;
177 return self.ammo_cells >= cvar("g_balance_nex_ammo");
179 else if (req == WR_CHECKAMMO2)
181 else if (req == WR_REGISTER)
184 weapon_register(WEP_NEX, 1);
186 weapon_register(WEP_NEX, cvar("g_balance_nex_ammo"));