3 void() nex_deselect_01;
9 if (cvar("g_minstagib"))
11 if (self.ammo_cells >= 1)
14 if (self.ammo_cells >= 5)
20 void nex_selfkill (void)
22 if (!cvar("g_minstagib"))
25 if (self.ammo_cells <= 0)
29 centerprint(self, "you're dead now...\n");
30 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
31 // stuffcmd(self, "play2 announcer/robotic/termination.ogg\n");
33 if (self.health == 10)
35 centerprint(self, "^11^7 second left to find some ammo\n");
36 Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
37 // stuffcmd(self, "play2 announcer/robotic/1.ogg\n");
39 if (self.health == 20)
41 centerprint(self, "^12^7 seconds left to find some ammo\n");
42 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
43 // stuffcmd(self, "play2 announcer/robotic/2.ogg\n");
45 if (self.health == 30)
47 centerprint(self, "^13^7 seconds left to find some ammo\n");
48 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
49 // stuffcmd(self, "play2 announcer/robotic/3.ogg\n");
51 if (self.health == 40)
53 centerprint(self, "^14^7 seconds left to find some ammo\n");
54 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
55 // stuffcmd(self, "play2 announcer/robotic/4.ogg\n");
57 if (self.health == 50)
59 centerprint(self, "^15^7 seconds left to find some ammo\n");
60 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
61 // stuffcmd(self, "play2 announcer/robotic/5.ogg\n");
63 if (self.health == 60)
65 centerprint(self, "^36^7 seconds left to find some ammo\n");
66 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
67 // stuffcmd(self, "play2 announcer/robotic/6.ogg\n");
69 if (self.health == 70)
71 centerprint(self, "^37^7 seconds left to find some ammo\n");
72 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
73 // stuffcmd(self, "play2 announcer/robotic/7.ogg\n");
75 if (self.health == 80)
77 centerprint(self, "^38^7 seconds left to find some ammo\n");
78 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
79 // stuffcmd(self, "play2 announcer/robotic/8.ogg\n");
81 if (self.health == 90)
83 centerprint(self, "^39^7 seconds left to find some ammo\n");
84 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
85 // stuffcmd(self, "play2 announcer/robotic/9.ogg\n");
87 if (self.health == 100)
89 weapon_prepareattack(nex_check, nex_check, nex_fire1_01, 1.0);
90 centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
91 Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
92 // stuffcmd(self, "play2 announcer/robotic/10.ogg\n");
96 self.think = nex_selfkill;
97 self.nextthink = time + 1;
101 void(float req) w_nex =
105 else if (req == WR_FIRE1)
106 weapon_prepareattack(nex_check, nex_check, nex_fire1_01, cvar("g_balance_nex_refire"));
107 else if (req == WR_RAISE)
109 else if (req == WR_UPDATECOUNTS)
110 self.currentammo = self.ammo_cells;
111 else if (req == WR_DROP)
113 else if (req == WR_SETUP)
114 weapon_setup(WEP_NEX, "w_nex.zym", IT_CELLS);
115 else if (req == WR_CHECKAMMO)
116 weapon_hasammo = nex_check();
120 void W_Nex_Attack (void)
126 sound (self, CHAN_WEAPON, "weapons/nexfire.ogg", 1, ATTN_NORM);
127 self.punchangle_x = -5;
128 org = self.origin + self.view_ofs + v_forward * 5 + v_right * 14 + v_up * -7;
129 end = self.origin + self.view_ofs + v_forward * 4096;
131 // assure that nexdamage is high enough in minstagib
132 if (cvar("g_minstagib"))
133 FireRailgunBullet (org, end, 200, IT_NEX);
135 FireRailgunBullet (org, end, cvar("g_balance_nex_damage"), IT_NEX);
137 // trace as if shot started inside gun
138 traceline (org, end, TRUE, self);
139 // show as if shot started outside of gun
140 org = self.origin + self.view_ofs + v_forward * 28 + v_right * 14 + v_up * -7;
144 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
145 WriteByte (MSG_BROADCAST, 76);
146 WriteCoord (MSG_BROADCAST, org_x);
147 WriteCoord (MSG_BROADCAST, org_y);
148 WriteCoord (MSG_BROADCAST, org_z);
149 WriteCoord (MSG_BROADCAST, trace_endpos_x);
150 WriteCoord (MSG_BROADCAST, trace_endpos_y);
151 WriteCoord (MSG_BROADCAST, trace_endpos_z);
152 WriteCoord (MSG_BROADCAST, 0);
153 WriteCoord (MSG_BROADCAST, 0);
154 WriteCoord (MSG_BROADCAST, 0);
155 // flash and burn the wall
156 te_plasmaburn (trace_endpos);
158 // flame effect at impact
159 dir = trace_plane_normal * 100;
160 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
161 WriteByte (MSG_BROADCAST, TE_FLAMEJET);
162 WriteCoord (MSG_BROADCAST, trace_endpos_x);
163 WriteCoord (MSG_BROADCAST, trace_endpos_y);
164 WriteCoord (MSG_BROADCAST, trace_endpos_z);
165 WriteCoord (MSG_BROADCAST, dir_x);
166 WriteCoord (MSG_BROADCAST, dir_y);
167 WriteCoord (MSG_BROADCAST, dir_z);
168 WriteByte (MSG_BROADCAST, 255);
171 PointSound (trace_endpos, "weapons/neximpact.ogg", 1, ATTN_NORM);
173 if (cvar("g_use_ammunition") && !cvar("g_instagib"))
175 if (cvar("g_minstagib"))
176 self.ammo_cells = self.ammo_cells - 1;
178 self.ammo_cells = self.ammo_cells - 5;
182 org = self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7;
183 setorigin (flash, org);
184 setmodel (flash, "models/nexflash.md3");
185 flash.velocity = v_forward * 20;
186 flash.angles = vectoangles (flash.velocity);
187 SUB_SetFade (flash, time, 0.4);
188 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
192 void() nex_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, nex_ready_01); self.weaponentity.state = WS_READY;};
193 void() nex_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0'); nex_selfkill();};
194 void() nex_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
195 void() nex_fire1_01 =
197 weapon_doattack(nex_check, nex_check, W_Nex_Attack);
198 weapon_thinkf(WFRAME_FIRE1, 0.3, nex_ready_01);