9 // Menus/Menu Input references
\r
10 void () Menu_EngineerFix_Tesla;
\r
11 void (float inp) Menu_EngineerFix_Tesla_Input;
\r
12 void () Menu_Need_TeamNexuiz;
\r
13 void () Menu_Engineer;
\r
14 void () Menu_EngineerFix_Extractor;
\r
15 void (float inp) Menu_EngineerFix_Extractor_Input;
\r
20 if (self.StatusBarSize == TF_FLARE_LIT)
\r
22 CenterPrint(self, "\n");
\r
26 self.StatusRefreshTime = time + 0.1;
\r
28 self.menu_count = 25;
\r
29 self.current_menu = TF_FLARE_OFF;
\r
32 // This calls the function which displays the menu
\r
33 void () Player_Menu =
\r
35 if ((self.menu_count > 25.000000))
\r
37 self.menu_count = 0.000000;
\r
41 self.menu_count = (self.menu_count + 1.000000);
\r
44 if (self.current_menu == 666)
\r
49 else if ((self.current_menu == 18))
\r
51 Menu_EngineerFix_Tesla ();
\r
53 else if (self.current_menu == MENU_NEED_TN)
\r
55 Menu_Need_TeamNexuiz ();
\r
57 else if (self.current_menu == MENU_ENGINEER_BUILD)
\r
61 else if (self.current_menu == MENU_EXTRACTOR)
\r
63 Menu_EngineerFix_Extractor ();
\r
68 self.current_menu = TF_FLARE_LIT;
\r
72 void(float menu_no) DisplayMenu =
\r
74 self.current_menu = menu_no;
\r
77 //Menu_Team(); // menu team & menu class are now handled by GUIs (see cl_client.c)
\r
88 // Menu input (user can press 0 - 9)
\r
89 void(float inp) Menu_Input =
\r
91 if (self.current_menu == 18)
\r
93 Menu_EngineerFix_Tesla_Input (inp);
\r
95 if (self.current_menu == MENU_EXTRACTOR)
\r
97 Menu_EngineerFix_Extractor_Input (inp);
\r
102 void () Menu_EngineerFix_Tesla =
\r
104 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
107 void () Menu_Need_TeamNexuiz =
\r
109 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
112 // Tesla Menu Input
\r
113 void (float inp) Menu_EngineerFix_Tesla_Input =
\r
116 local float maxcells;
\r
118 if (((self.classname != "player") || (self.building == world)))
\r
125 if ((self.building.ammo_shells >= 3))
\r
127 sprint (self, "You can only upgrade voltage 3 times\n");
\r
131 if ((self.building.currentammo >= 6))
\r
133 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
137 if ((self.ammo_cells >= 100))
\r
139 self.ammo_cells = (self.ammo_cells - 100);
\r
140 self.building.ammo_shells = (self.building.ammo_shells + 1);
\r
141 self.building.waitmin = ((self.building.ammo_shells + 2) * (self.building.ammo_nails + 2));
\r
142 self.building.currentammo = (self.building.currentammo + 1);
\r
146 sprint (self, "You need more cells to upgrade the tesla\n");
\r
153 if ((self.building.ammo_nails >= 3))
\r
155 sprint (self, "You can only upgrade amperage 3 times\n");
\r
159 if ((self.building.currentammo >= 6))
\r
161 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
165 if ((self.ammo_cells >= 100))
\r
167 self.ammo_cells = (self.ammo_cells - 100);
\r
168 self.building.ammo_nails = (self.building.ammo_nails + 1);
\r
169 self.building.waitmin = ((self.building.ammo_shells + 2) * (self.building.ammo_nails + 2));
\r
170 self.building.currentammo = (self.building.currentammo + 1);
\r
174 sprint (self, "You need more cells to upgrade the tesla\n");
\r
181 if ((self.building.ammo_rockets >= 3))
\r
183 sprint (self, "You can only upgrade the capacitor 3 times\n");
\r
187 if ((self.building.currentammo >= 6))
\r
189 sprint (self, "You can only have
\98 upgrades on the gun\n");
\r
193 if ((self.ammo_cells >= 100))
\r
195 self.ammo_cells = (self.ammo_cells - 100);
\r
196 self.building.ammo_rockets = (self.building.ammo_rockets + 1);
\r
197 self.building.currentammo = (self.building.currentammo + 1);
\r
198 if ((self.building.ammo_rockets == 1))
\r
200 self.building.max_health = (self.building.max_health + 100);
\r
201 self.building.health = (self.building.health + 100);
\r
202 self.building.ammo_cells = 120;
\r
206 if ((self.building.ammo_rockets == 2))
\r
208 self.building.max_health = (self.building.max_health + 150);
\r
209 self.building.health = (self.building.health + 150);
\r
210 self.building.ammo_cells = 200;
\r
214 if ((self.building.ammo_rockets == 3))
\r
216 self.building.max_health = (self.building.max_health + 150);
\r
217 self.building.health = (self.building.health + 150);
\r
218 self.building.ammo_cells = 300;
\r
225 sprint (self, "You need more cells to upgrade the tesla\n");
\r
232 if ((self.building.tf_items & 2))
\r
234 sprint (self, "It is already a turret!\n");
\r
238 if ((self.building.currentammo > (6 - 2)))
\r
240 sprint (self, "This requires two upgrades, sorry\n");
\r
244 if ((self.ammo_cells >= (2 * 100)))
\r
246 self.ammo_cells = (self.ammo_cells - (2 * 100));
\r
247 if ((self.ammo_cells < 0))
\r
249 self.ammo_cells = 0;
\r
251 self.building.currentammo = (self.building.currentammo + 2);
\r
252 if ((self.building.tf_items & 2))
\r
254 sprint (self, "Gun is already deployed\n");
\r
258 self.building.origin_z = (self.building.origin_z + 15);
\r
261 sprint (self, "You need a clear area to launch\n");
\r
262 self.building.origin_z = (self.building.origin_z - 15);
\r
266 self.building.origin_z = (self.building.origin_z + 25);
\r
267 sprint (self, "You turretize your tesla\n");
\r
268 self.has_turretized_tesla = 1;
\r
269 self.building.angles_z = 180;
\r
270 self.building.flags = (self.building.flags - (self.building.flags & 512));
\r
271 self.building.movetype = 5;
\r
272 self.building.velocity_z = 200;
\r
273 setsize (self.building, '-16.000000 -16.000000 -40.000000', '16.000000 16.000000 -10.000000');
\r
274 self.building.tf_items = (self.building.tf_items | 2);
\r
280 sprint (self, "You need more cells to upgrade the tesla\n");
\r
287 if ((self.building.tf_items & 1))
\r
289 sprint (self, "It already has an improved targeter\n");
\r
293 if ((self.building.currentammo > (6 - 2)))
\r
295 sprint (self, "This requires two upgrades, hence the '2u'...\n");
\r
299 if ((self.ammo_cells >= (2 * 100)))
\r
301 self.ammo_cells = (self.ammo_cells - (2 * 100));
\r
302 if ((self.ammo_cells < 0))
\r
304 self.ammo_cells = 0;
\r
306 self.building.currentammo = (self.building.currentammo + 2);
\r
307 self.building.tf_items = (self.building.tf_items | 1);
\r
311 sprint (self, "You need more cells to upgrade the tesla\n");
\r
318 if ((self.building.tf_items & 1024))
\r
320 sprint (self, "You already built a spy detector\n");
\r
324 if ((self.building.currentammo > (6 - 4)))
\r
326 sprint (self, "Spy detector takes 4 upgrades\n");
\r
330 if ((self.ammo_cells >= (2 * 100)))
\r
332 self.ammo_cells = (self.ammo_cells - (4 * 100));
\r
333 if ((self.ammo_cells < 0))
\r
335 self.ammo_cells = 0;
\r
337 self.building.currentammo = (self.building.currentammo + 4);
\r
338 self.building.tf_items = (self.building.tf_items | 1024);
\r
342 sprint (self, "You need more cells to upgrade the tesla\n");
\r
349 if ((self.building.health < self.building.max_health))
\r
351 cost = (self.building.max_health - self.building.health) / 2;
\r
352 if ((self.ammo_cells >= cost))
\r
354 self.ammo_cells = (self.ammo_cells - cost);
\r
355 self.building.health = self.building.max_health;
\r
358 if ((self.building.ammo_rockets == 0))
\r
364 if ((self.building.ammo_rockets == 1))
\r
370 if ((self.building.ammo_rockets == 2))
\r
376 if ((self.building.ammo_rockets == 3))
\r
383 cost = maxcells - self.building.ammo_cells;
\r
384 if ((cost > self.ammo_cells))
\r
386 cost = self.ammo_cells;
\r
388 self.ammo_cells = (self.ammo_cells - cost);
\r
389 self.building.ammo_cells = (self.building.ammo_cells + cost);
\r
393 sprint (self, "You dismantle the Tesla Gun.\n");
\r
394 self.ammo_cells = (self.ammo_cells + (150 / 2));
\r
395 self.building.real_owner.has_tesla = 0;
\r
396 self.building.real_owner.has_turretized_tesla = 0;
\r
397 if ((self.building.real_owner.team_no != self.team_no))
\r
399 self.real_frags = (self.real_frags + 1);
\r
400 if (!(toggleflags & 128))
\r
402 self.frags = self.real_frags;
\r
405 if ((self.building.real_owner != self))
\r
407 sprint (self.building.real_owner, self.netname);
\r
408 sprint (self.building.real_owner, " dismantled your Tesla Coil.\n");
\r
409 teamsprint (self.building.real_owner.team_no, self.building.real_owner, self.netname);
\r
410 teamsprint (self.building.real_owner.team_no, self.building.real_owner, " dismantled ");
\r
411 teamsprint (self.building.real_owner.team_no, self.building.real_owner, self.building.real_owner.netname);
\r
412 teamsprint (self.building.real_owner.team_no, self.building.real_owner, "'s Tesla Coil.\n");
\r
414 dremove (self.building);
\r
416 if (((inp >= 1) && (inp <= 9)))
\r
420 bound_other_ammo (self);
\r
421 if ((self.armorvalue == 0))
\r
423 self.armortype = 0;
\r
424 self.armorclass = 0;
\r
425 self.items = (self.items - (self.items & ((8192 | 16384) | 32768)));
\r
427 W_SetCurrentAmmo ();
\r
431 // Engineer extractor
\r
432 void () Menu_EngineerFix_Extractor =
\r
434 local string level;
\r
436 local string obj_metal;
\r
438 level = ftos(self.building.ammo_cells + 1);
\r
439 hp = ftos(self.building.health);
\r
440 obj_metal = ftos(self.building.ammo_metal);
\r
442 CenterPrint (self, "^7[^6Metal Extractor^7]\n^1Level: ^3",level,"\n^1Health: ^3",hp,"\n^1Metal: ^3",obj_metal,"\n\n[^11^7] Extract Metal\n[^12^7] Repair Extractor\n[^13^7] Nothing\n");
\r
445 void (float inp) Menu_EngineerFix_Extractor_Input =
\r
449 if (self.building.ammo_metal > 0)
\r
451 local float tmp_flt;
\r
452 tmp_flt = self.maxammo_metal - self.ammo_metal;
\r
454 sprint(self, "You have reached your carrying capacity for metal\n");
\r
457 if (tmp_flt > self.building.ammo_metal)
\r
459 self.ammo_metal = self.ammo_metal + self.building.ammo_metal;
\r
460 self.building.ammo_metal = 0;
\r
464 if ((self.ammo_metal + self.building.ammo_metal) > self.maxammo_metal)
\r
466 self.building.ammo_metal = self.building.ammo_metal - (self.maxammo_metal - self.ammo_metal);
\r
467 self.ammo_metal = self.maxammo_metal;
\r
471 self.ammo_metal = self.ammo_metal + self.building.ammo_metal;
\r
472 self.building.ammo_metal = 0;
\r
479 sprint(self, "There is no metal to extract from this unit\n");
\r
483 if ((inp >= 1) && (inp <= 9))
\r
487 W_SetCurrentAmmo();
\r
490 // Engineer build menu
\r
491 void () Menu_Engineer =
\r
493 local string line1;
\r
494 local string line2;
\r
495 local string line3;
\r
496 local string line4;
\r
497 local string line5;
\r
498 local string costline;
\r
499 local string cost1;
\r
500 local string cost2;
\r
502 /* if (self.has_dispenser == 1)
\r
504 line1 = "
\93.. Destroy Dispenser \n";
\r
508 // line1 = "
\93.. Build Ammo&Armor Dispenser \n";
\r
510 if (self.ammo_cells < BUILDING_DISPENSER_NEEDCELLS)
\r
512 cost1 = strcat(cost1," cells^7: ",ftos(BUILDING_DISPENSER_NEEDCELLS), "\n");
\r
514 line1 = strcat("
\93.. Build Ammo&Armor Dispenser \n",costline,"\n");
\r
516 if (self.has_sentry == 1)
\r
518 line2 = "[^12^7] Destroy Sentry Gun \n";
\r
522 //if (self.ammo_cells >= BUILDING_SENTRY_NEEDCELLS && self.ammo_metal >= BUILDING_SENTRY_NEEDMETAL)
\r
526 if (self.ammo_cells < BUILDING_SENTRY_NEEDCELLS)
\r
528 cost1 = strcat(cost1," cells^7: ",ftos(BUILDING_SENTRY_NEEDCELLS));
\r
529 if (self.ammo_metal < BUILDING_SENTRY_NEEDMETAL)
\r
531 cost2 = strcat(cost2," metal^7: ",ftos(BUILDING_SENTRY_NEEDMETAL), "\n");
\r
532 costline = strcat(cost1," ",cost2);
\r
533 line2 = strcat("[^12^7] Build Sentry Gun \n",costline);
\r
536 if (self.has_tesla == 1)
\r
538 line3 = "[^13^7] Destroy Tesla Sentry Gun \n";
\r
542 // if (self.ammo_cells >= BUILDING_TESLA_NEEDCELLS && self.ammo_metal >= BUILDING_TESLA_NEEDMETAL)
\r
546 if (self.ammo_cells < BUILDING_TESLA_NEEDCELLS)
\r
548 cost1 = strcat(cost1," cells^7: ",ftos(BUILDING_TESLA_NEEDCELLS));
\r
549 if (self.ammo_metal < BUILDING_TESLA_NEEDMETAL)
\r
551 cost2 = strcat(cost2," metal^7: ",ftos(BUILDING_TESLA_NEEDMETAL), "\n");
\r
552 costline = strcat(cost1," ",cost2);
\r
553 line3 = strcat("[^13^7] Build Tesla Sentry Gun \n",costline);
\r
556 if (self.has_teleporter != 0) //CH messy, yes
\r
558 if (self.has_teleporter == 1 && self.ammo_cells >= BUILDING_TELEPAD_NEEDCELLS && self.ammo_metal >= BUILDING_TELEPAD_NEEDMETAL)
\r
559 line4 = "... Build a Teleporter Pad \n.®® Destroy a Teleporter Pad \n";
\r
560 else if (self.has_teleporter == 1 && self.ammo_cells >= BUILDING_TELEPAD_NEEDCELLS && self.ammo_metal >= BUILDING_TELEPAD_NEEDMETAL)
\r
561 line4 = ".®® Destroy a Teleporter Pad \n";
\r
562 if (self.has_teleporter == 2)
\r
563 line4 = ".®® Destroy Both Teleporter Pads \n";
\r
565 // else if (self.ammo_cells >= 90 && self.tf_items & 131072)
\r
566 else if (self.ammo_cells >= BUILDING_TELEPAD_NEEDCELLS && self.ammo_metal >= BUILDING_TELEPAD_NEEDMETAL)
\r
567 line4 = "... Build a Teleporter Pad \n \n";
\r
571 // if (self.ammo_cells >= BUILDING_EXTRACTOR_NEEDCELLS)
\r
572 // if (self.has_extractor > 3)
\r
573 // line5 = "^1... Build Metal Extractor \n";
\r
576 if (self.ammo_cells < BUILDING_EXTRACTOR_NEEDCELLS)
\r
578 cost1 = strcat(cost1," cells^7: ",ftos(BUILDING_EXTRACTOR_NEEDCELLS)," ");
\r
580 if (self.has_extractor >= 3)
\r
581 line5 = strcat("[^16^7] ^1Build Metal Extractor \n",costline,"\n\n");
\r
583 line5 = strcat("[^16^7] Build Metal Extractor \n",costline,"\n\n");
\r
586 local string metalcnt;
\r
587 metalcnt = ftos(self.ammo_metal);
\r
589 // Dispenser moved down here
\r
590 if (self.has_dispenser == 1)
\r
592 line1 = "[^11^7] Destroy Dispenser \n";
\r
597 if (self.ammo_cells < BUILDING_DISPENSER_NEEDCELLS)
\r
599 cost1 = strcat(cost1," cells^7: ",ftos(BUILDING_DISPENSER_NEEDCELLS)," ");
\r
601 line1 = strcat("^7[^11^7] Build Ammo&Armor Dispenser \n",costline,"\n");
\r
604 strn = strcat("^7Engineer Build Menu\n ^3Metal: [",metalcnt,"]\n^3Cells: [",ftos(self.ammo_cells),"]\n\n", line1, strcat(line2, line3, line4), strcat(line5, "... Nothing \n\n"));
\r
605 CenterPrint(self, strn);
\r