8 // Menus/Menu Input references
\r
9 void () Menu_EngineerFix_Tesla;
\r
10 void (float inp) Menu_EngineerFix_Tesla_Input;
\r
11 void () Menu_Need_TeamNexuiz;
\r
16 if (self.StatusBarSize == TF_FLARE_LIT)
\r
18 CenterPrint(self, "\n");
\r
22 self.StatusRefreshTime = time + 0.1;
\r
24 self.menu_count = 25;
\r
25 self.current_menu = TF_FLARE_OFF;
\r
28 // This calls the function which displays the menu
\r
29 void () Player_Menu =
\r
31 if ((self.menu_count > 25.000000))
\r
33 self.menu_count = 0.000000;
\r
37 self.menu_count = (self.menu_count + 1.000000);
\r
40 if (self.current_menu == 666)
\r
45 else if ((self.current_menu == 18))
\r
47 Menu_EngineerFix_Tesla ();
\r
49 else if (self.current_menu == MENU_NEED_TN)
\r
51 Menu_Need_TeamNexuiz ();
\r
55 self.current_menu = TF_FLARE_LIT;
\r
59 void(float menu_no) DisplayMenu =
\r
61 self.current_menu = menu_no;
\r
64 //Menu_Team(); // menu team & menu class are now handled by GUIs (see cl_client.c)
\r
75 // Menu input (user can press 0 - 9)
\r
76 void(float inp) Menu_Input =
\r
78 if ((self.current_menu == 18))
\r
80 Menu_EngineerFix_Tesla_Input (inp);
\r
85 void () Menu_EngineerFix_Tesla =
\r
87 CenterPrint (self, "Tesla Modification Lab: ^16^7 Upgrades Max\n[^11^7] Upgrade Voltage - 1u\n[^12^7] Upgrade Amperage - 1u\n[^13^7] Upgrade Power Supply - 1u\n[^14^7] Make TeslaTurret(tm) - 2u\n[^15^7] Improved Targeting System - 2u\n[^16^7] Add Spy Detector - 4u\n[^17^7] Repair and Recharge \n[^18^7] Dismantle \n[^19^7] Îïôèéîç ");
\r
90 void () Menu_Need_TeamNexuiz =
\r
92 CenterPrint(self, "^7Hello, welcome to a Team:Nexuiz server version ",TN_VERSION,"\n\n^5If you see this message it means that\n you do not have the Team:Nexuiz mod installed.\n\n^3To get the mod, please follow the instructions at:\nhttp://avirox.devretro.com/temp/teamnexuiz/TN_how_to.txt\n");
\r
96 void (float inp) Menu_EngineerFix_Tesla_Input =
\r
99 local float maxcells;
\r
101 if (((self.classname != "player") || (self.building == world)))
\r
108 if ((self.building.ammo_shells >= 3))
\r
110 sprint (self, "You can only upgrade voltage 3 times\n");
\r
114 if ((self.building.currentammo >= 6))
\r
116 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
120 if ((self.ammo_cells >= 100))
\r
122 self.ammo_cells = (self.ammo_cells - 100);
\r
123 self.building.ammo_shells = (self.building.ammo_shells + 1);
\r
124 self.building.waitmin = ((self.building.ammo_shells + 2) * (self.building.ammo_nails + 2));
\r
125 self.building.currentammo = (self.building.currentammo + 1);
\r
129 sprint (self, "You need more cells to upgrade the tesla\n");
\r
136 if ((self.building.ammo_nails >= 3))
\r
138 sprint (self, "You can only upgrade amperage 3 times\n");
\r
142 if ((self.building.currentammo >= 6))
\r
144 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
148 if ((self.ammo_cells >= 100))
\r
150 self.ammo_cells = (self.ammo_cells - 100);
\r
151 self.building.ammo_nails = (self.building.ammo_nails + 1);
\r
152 self.building.waitmin = ((self.building.ammo_shells + 2) * (self.building.ammo_nails + 2));
\r
153 self.building.currentammo = (self.building.currentammo + 1);
\r
157 sprint (self, "You need more cells to upgrade the tesla\n");
\r
164 if ((self.building.ammo_rockets >= 3))
\r
166 sprint (self, "You can only upgrade the capacitor 3 times\n");
\r
170 if ((self.building.currentammo >= 6))
\r
172 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
176 if ((self.ammo_cells >= 100))
\r
178 self.ammo_cells = (self.ammo_cells - 100);
\r
179 self.building.ammo_rockets = (self.building.ammo_rockets + 1);
\r
180 self.building.currentammo = (self.building.currentammo + 1);
\r
181 if ((self.building.ammo_rockets == 1))
\r
183 self.building.max_health = (self.building.max_health + 100);
\r
184 self.building.health = (self.building.health + 100);
\r
185 self.building.ammo_cells = 120;
\r
189 if ((self.building.ammo_rockets == 2))
\r
191 self.building.max_health = (self.building.max_health + 150);
\r
192 self.building.health = (self.building.health + 150);
\r
193 self.building.ammo_cells = 200;
\r
197 if ((self.building.ammo_rockets == 3))
\r
199 self.building.max_health = (self.building.max_health + 150);
\r
200 self.building.health = (self.building.health + 150);
\r
201 self.building.ammo_cells = 300;
\r
208 sprint (self, "You need more cells to upgrade the tesla\n");
\r
215 if ((self.building.tf_items & 2))
\r
217 sprint (self, "It is already a turret!\n");
\r
221 if ((self.building.currentammo > (6 - 2)))
\r
223 sprint (self, "This requires two upgrades, sorry\n");
\r
227 if ((self.ammo_cells >= (2 * 100)))
\r
229 self.ammo_cells = (self.ammo_cells - (2 * 100));
\r
230 if ((self.ammo_cells < 0))
\r
232 self.ammo_cells = 0;
\r
234 self.building.currentammo = (self.building.currentammo + 2);
\r
235 if ((self.building.tf_items & 2))
\r
237 sprint (self, "Gun is already deployed\n");
\r
241 self.building.origin_z = (self.building.origin_z + 15);
\r
244 sprint (self, "You need a clear area to launch\n");
\r
245 self.building.origin_z = (self.building.origin_z - 15);
\r
249 self.building.origin_z = (self.building.origin_z + 25);
\r
250 sprint (self, "You turretize your tesla\n");
\r
251 self.has_turretized_tesla = 1;
\r
252 self.building.angles_z = 180;
\r
253 self.building.flags = (self.building.flags - (self.building.flags & 512));
\r
254 self.building.movetype = 5;
\r
255 self.building.velocity_z = 200;
\r
256 setsize (self.building, '-16.000000 -16.000000 -40.000000', '16.000000 16.000000 -10.000000');
\r
257 self.building.tf_items = (self.building.tf_items | 2);
\r
263 sprint (self, "You need more cells to upgrade the tesla\n");
\r
270 if ((self.building.tf_items & 1))
\r
272 sprint (self, "It already has an improved targeter\n");
\r
276 if ((self.building.currentammo > (6 - 2)))
\r
278 sprint (self, "This requires two upgrades, hence the '2u'...\n");
\r
282 if ((self.ammo_cells >= (2 * 100)))
\r
284 self.ammo_cells = (self.ammo_cells - (2 * 100));
\r
285 if ((self.ammo_cells < 0))
\r
287 self.ammo_cells = 0;
\r
289 self.building.currentammo = (self.building.currentammo + 2);
\r
290 self.building.tf_items = (self.building.tf_items | 1);
\r
294 sprint (self, "You need more cells to upgrade the tesla\n");
\r
301 if ((self.building.tf_items & 1024))
\r
303 sprint (self, "You already built a spy detector\n");
\r
307 if ((self.building.currentammo > (6 - 4)))
\r
309 sprint (self, "Spy detector takes 4 upgrades\n");
\r
313 if ((self.ammo_cells >= (2 * 100)))
\r
315 self.ammo_cells = (self.ammo_cells - (4 * 100));
\r
316 if ((self.ammo_cells < 0))
\r
318 self.ammo_cells = 0;
\r
320 self.building.currentammo = (self.building.currentammo + 4);
\r
321 self.building.tf_items = (self.building.tf_items | 1024);
\r
325 sprint (self, "You need more cells to upgrade the tesla\n");
\r
332 if ((self.building.health < self.building.max_health))
\r
334 cost = (self.building.max_health - self.building.health) / 2;
\r
335 if ((self.ammo_cells >= cost))
\r
337 self.ammo_cells = (self.ammo_cells - cost);
\r
338 self.building.health = self.building.max_health;
\r
341 if ((self.building.ammo_rockets == 0))
\r
347 if ((self.building.ammo_rockets == 1))
\r
353 if ((self.building.ammo_rockets == 2))
\r
359 if ((self.building.ammo_rockets == 3))
\r
366 cost = maxcells - self.building.ammo_cells;
\r
367 if ((cost > self.ammo_cells))
\r
369 cost = self.ammo_cells;
\r
371 self.ammo_cells = (self.ammo_cells - cost);
\r
372 self.building.ammo_cells = (self.building.ammo_cells + cost);
\r
376 sprint (self, "You dismantle the Tesla Gun.\n");
\r
377 self.ammo_cells = (self.ammo_cells + (150 / 2));
\r
378 self.building.real_owner.has_tesla = 0;
\r
379 self.building.real_owner.has_turretized_tesla = 0;
\r
380 if ((self.building.real_owner.team_no != self.team_no))
\r
382 self.real_frags = (self.real_frags + 1);
\r
383 if (!(toggleflags & 128))
\r
385 self.frags = self.real_frags;
\r
388 if ((self.building.real_owner != self))
\r
390 sprint (self.building.real_owner, self.netname);
\r
391 sprint (self.building.real_owner, " dismantled your Tesla Coil.\n");
\r
392 teamsprint (self.building.real_owner.team_no, self.building.real_owner, self.netname);
\r
393 teamsprint (self.building.real_owner.team_no, self.building.real_owner, " dismantled ");
\r
394 teamsprint (self.building.real_owner.team_no, self.building.real_owner, self.building.real_owner.netname);
\r
395 teamsprint (self.building.real_owner.team_no, self.building.real_owner, "'s Tesla Coil.\n");
\r
397 dremove (self.building);
\r
399 if (((inp >= 1) && (inp <= 9)))
\r
403 bound_other_ammo (self);
\r
404 if ((self.armorvalue == 0))
\r
406 self.armortype = 0;
\r
407 self.armorclass = 0;
\r
408 self.items = (self.items - (self.items & ((8192 | 16384) | 32768)));
\r
410 W_SetCurrentAmmo ();
\r