prozac-qfcc/menu.qc

4712 lines
146 KiB
C++
Raw Normal View History

2001-07-17 05:58:10 +00:00
/*======================================================
MENU.QC Custom TeamFortress v2.3
(c) TeamFortress Software Pty Ltd 29/2/97
(c) William Kerney 4/4/00
(c) Craig Hauser 19/3/00
========================================================
This file handles all menu functions and displays.
======================================================*/
#include "defs.qh"
#include "messages.qh"
#include "menu.qh"
2001-07-17 05:58:10 +00:00
void(vector where) spawnFOG;
void(entity pl, string s1, string s2, string s3, string s4) CenterPrint4;
void(entity pl, string s1, string s2, string s3, string s4, string s5, string s6, string s7) CenterPrint7;
void(entity targ, entity inflictor, entity attacker, float damage, float T_flags, float T_AttackType) TF_T_Damage;
void() W_SetCurrentAmmo;
void(entity p) bound_other_ammo;
float(float tno) TeamFortress_TeamSet;
void(entity p) TeamFortress_SetSkin;
float(float tno) TeamGetColor;
2001-07-17 05:58:10 +00:00
void() TeamFortress_ChangeClass;
void(float type) TeamFortress_DropAmmo;
float() TeamFortress_TeamPutPlayerInTeam;
float(float tno) TeamFortress_TeamIsCivilian;
void(float class) TeamFortress_SpyChangeSkin;
void(float teamno) TeamFortress_SpyChangeColor;
void(float building) TeamFortress_Build;
void(float type) TeamFortress_SpyFeignDeath;
void(entity spy) Spy_RemoveDisguise;
void() lvl1_sentry_stand;
void() lvl2_sentry_stand;
void() lvl3_sentry_stand;
float (float tno) TeamFortress_TeamGetNoPlayers;
float(float myteam) HasFlag;
/* WK void(float menu_no) DisplayMenu; */
// Assorted menus
void() Menu_Team;
void() Menu_Class;
void() Menu_Drop;
void() Menu_Intro;
void() PlayerObserverMode;
// Classhelp
void() Menu_ClassHelp;
void() Menu_ClassHelp2;
void() Menu_StuffClassHelp;
void(float inp) Menu_ClassHelp_Input;
// Bindings
void() Menu_DoBindings;
void() Menu_ShowBindings1;
void() Menu_ShowBindings2;
void() Menu_RepeatHelp;
// Spy
void() Menu_Spy;
void() Menu_Spy_Skin;
void() Menu_Spy_Color;
void(float inp) Menu_Spy_Input;
void(float inp) Menu_Spy_Skin_Input;
void(float inp) Menu_Spy_Color_Input;
// Engineer
void() Menu_Engineer;
void() Menu_EngineerFix_Dispenser;
void() Menu_EngineerFix_SentryGun;
void() Menu_EngineerFix_Tesla;
void() Menu_EngineerFix_Tesla2;
void() Menu_EngineerFix_Camera;
void() Menu_EngineerFix_Sensor;
void() Menu_EngineerFix_Teleporter;
void() Menu_EngineerFix_FieldGen;
void(float inp) Menu_Engineer_Input;
void(float inp) Menu_EngineerFix_Dispenser_Input;
void(float inp) Menu_EngineerFix_SentryGun_Input;
void(float inp) Menu_EngineerFix_Tesla_Input;
void(float inp) Menu_EngineerFix_Tesla_Input2;
void(float inp) Menu_EngineerFix_Camera_Input;
void(float inp) Menu_EngineerFix_Sensor_Input;
void(float inp) Menu_EngineerFix_Teleporter_Input;
void(float inp) Menu_EngineerFix_FieldGen_Input;
// Demons
void() Menu_Demon;
void(float inp) Menu_Demon_Input;
void() kill_my_demon;
// Buildings
void() Menu_Dispenser;
void(float inp) Menu_Dispenser_Input;
void(entity pl, string s1) CenterPrint;
void(entity pl, string s1, string s2) CenterPrint2;
float(entity obj, entity builder) CheckArea;
// WK - Custom Class
void() DropFromCustomClassGen; //Extern
void() PrintMoney;
void(float cost,float type) BuyWeapon;
void(float cost,float type) BuyCuTF;
void(float cost,float type) BuyItem;
void(float cost, float type) BuyJob;
/*void(float cost,float type) BuyGren1;
void(float cost,float type) BuyGren2;*/
void(float in) PrintRefund;
void(float in) PrintNotEnoughMoney;
void() Menu_PrimaryWeapon;
void(float inp) Menu_PrimaryWeapon_Input;
void() Menu_SecondaryWeapon;
void(float inp) Menu_SecondaryWeapon_Input;
//- Ofn -
void() Menu_MiscWeapon;
void(float inp) Menu_MiscWeapon_Input;
void() Menu_Crusader;
void(float inp) Menu_Crusader_Input;
void() Menu_Legs;
void(float inp) Menu_Legs_Input;
void() Menu_Health;
void(float inp) Menu_Health_Input;
void() Menu_Armor;
void(float inp) Menu_Armor_Input;
void() Menu_Special;
void(float inp) Menu_Special_Input;
void() Menu_Special2;
void(float inp) Menu_Special2_Input;
void() Menu_Gren1;
void(float inp) Menu_Gren1_Input;
void() Menu_Gren2;
void(float inp) Menu_Gren2_Input;
void() Menu_Engineering;
void(float inp) Menu_Engineering_Input;
void() Menu_Profession;
void(float inp) Menu_Profession_Input;
void() Menu_Profession2;
void(float inp) Menu_Profession2_Input;
void() Menu_Proficiency;
void(float inp) Menu_Proficiency_Input;
void() Menu_Option;
void(float inp) Menu_Option_Input;
//WK Needed for rotate
float(float v) anglemod;
//WK Needed to det sentries et al.
void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage;
//WK Needed to make a bastard
void(entity bastard,float threshold) createBastard;
//CY Tinker
void() DoTinker;
//WW Needed for the Dismantling
void(entity targ, entity attacker) ClientObituary;
// WK --------------
//- OfN - Warlock menu (now in warlock.qc) --//
void(float inp) Menu_Demon_Input; //
void() Menu_Demon; //
//-------------------------------------------//
//- OfN - Army menu (now in army.qc) --------//
void(float inp) Menu_Army_Input; //
void() Menu_Army; //
//-------------------------------------------//
//- OfN - Hack menu (now in haxxx.qc) -------//
void(float inp) Menu_EnemyHax_Inp; //
void() Menu_Enemy_Hax; //
void(float inp) Menu_FriendHax_Inp; //
void() Menu_Friend_Hax; //
//-------------------------------------------//
float() CheckEnemyDismantle;
void() SBBuildSensor;
void() Tesla_Lose_Glow;
entity(entity OldTesla) TeslaClone;
float(entity theplayer, float grenslot) GetMaxGrens;
void (float cost, float type) BuyGren;
#ifdef FIELD_FORCEMODE
void(float value) SetFieldForcedStatus; // player function (self = player) cuts disabled time also
float() GetFieldForcedStatus; // player
#endif
//------------------------------------------//
void() ResetMenu =
{
if (self.StatusBarSize == 0)
CenterPrint(self, "\n");
else
self.StatusRefreshTime = time + 0.1;
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
};
void() Player_Menu =
{
// loop function
if (self.menu_count > MENU_REFRESH_RATE)
2001-07-17 05:58:10 +00:00
{
self.menu_count = 0;
}
else
{
self.menu_count = self.menu_count + 1;
return;
}
// determine which menu to display
// WK - Check to see if the custom class menu is overriding us
if ((self.done_custom & CUSTOM_BUILDING) && !(self.done_custom & CUSTOM_OVERRIDE) && self.playerclass == PC_CUSTOM) {
self.current_menu = MENU_PRIMARY_WEAPON;
self.done_custom = self.done_custom | CUSTOM_OVERRIDE;
2001-07-17 05:58:10 +00:00
}
//Don't flash status bars
if (self.current_menu >= MENU_PRIMARY_WEAPON && self.current_menu <= MENU_OPTION)
2001-07-17 05:58:10 +00:00
self.StatusRefreshTime = time + 1.5;
//- OfN - Checks for destroyed buildings - NEEDED?
/*if (self.current_menu >= MENU_ENGINEER_FIX_DISPENSER && self.current_menu <= MENU_ENGINEER_FIX_FIELDGEN && self.building == world)
2001-07-17 05:58:10 +00:00
{
ResetMenu();
return;
}*/
if (self.current_menu == MENU_INTRO)
2001-07-17 05:58:10 +00:00
{
Menu_Intro();
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else if (self.current_menu == MENU_CLASSHELP)
2001-07-17 05:58:10 +00:00
{
Menu_ClassHelp();
if (self.menu_displaytime > 8)
{
Menu_StuffClassHelp();
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else
self.menu_displaytime = self.menu_displaytime + 1;
}
else if (self.current_menu == MENU_CLASSHELP2)
2001-07-17 05:58:10 +00:00
{
Menu_ClassHelp2();
if (self.menu_displaytime > 5)
{
Menu_StuffClassHelp();
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else
self.menu_displaytime = self.menu_displaytime + 1;
}
else if (self.current_menu == MENU_SHOWBINDS1)
2001-07-17 05:58:10 +00:00
{
Menu_ShowBindings1();
if (self.menu_displaytime > 8)
{
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else
self.menu_displaytime = self.menu_displaytime + 1;
}
else if (self.current_menu == MENU_SHOWBINDS2)
2001-07-17 05:58:10 +00:00
{
Menu_ShowBindings2();
if (self.menu_displaytime > 8)
{
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else
self.menu_displaytime = self.menu_displaytime + 1;
}
else if (self.current_menu == MENU_DROP)
2001-07-17 05:58:10 +00:00
{
Menu_Drop();
}
else if (self.current_menu == MENU_SPY)
2001-07-17 05:58:10 +00:00
{
Menu_Spy();
}
else if (self.current_menu == MENU_SPY_SKIN)
2001-07-17 05:58:10 +00:00
{
Menu_Spy_Skin();
}
else if (self.current_menu == MENU_SPY_COLOR)
2001-07-17 05:58:10 +00:00
{
Menu_Spy_Color();
}
else if (self.current_menu == MENU_ENGINEER)
2001-07-17 05:58:10 +00:00
{
Menu_Engineer();
}
else if (self.current_menu == MENU_ENGINEER_FIX_DISPENSER)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Dispenser();
}
else if (self.current_menu == MENU_ENGINEER_FIX_SENTRYGUN)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_SentryGun();
}
else if (self.current_menu == MENU_ENGINEER_FIX_TESLA)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Tesla();
}
else if (self.current_menu == MENU_ENGINEER_FIX_TESLA2)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Tesla2();
}
else if (self.current_menu == MENU_ENGINEER_FIX_CAMERA)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Camera();
}
else if (self.current_menu == MENU_ENGINEER_FIX_SENSOR)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Sensor();
}
else if (self.current_menu == MENU_ENGINEER_FIX_TELEPORTER)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_Teleporter();
}
else if (self.current_menu == MENU_ENGINEER_FIX_FIELDGEN)
2001-07-17 05:58:10 +00:00
{
Menu_EngineerFix_FieldGen();
}
else if (self.current_menu == MENU_DISPENSER)
2001-07-17 05:58:10 +00:00
{
Menu_Dispenser();
}
else if (self.current_menu == MENU_REPEATHELP)
2001-07-17 05:58:10 +00:00
{
Menu_RepeatHelp();
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
else if (self.current_menu == MENU_PICKBINDS)
2001-07-17 05:58:10 +00:00
{
Menu_DoBindings();
}
else if (self.current_menu == MENU_DEMON)
2001-07-17 05:58:10 +00:00
{
Menu_Demon();
}
else if (self.current_menu == MENU_ARMY) //- OfN
2001-07-17 05:58:10 +00:00
{
Menu_Army();
}
else if (self.current_menu == MENU_E_HACK) //- OfN
2001-07-17 05:58:10 +00:00
{
Menu_Enemy_Hax();
}
else if (self.current_menu == MENU_F_HACK) //- OfN
2001-07-17 05:58:10 +00:00
{
Menu_Friend_Hax();
}
else if (self.current_menu == MENU_CRUSADER)
2001-07-17 05:58:10 +00:00
{
Menu_Crusader();
}
//WK ------------------
else if (self.current_menu == MENU_PRIMARY_WEAPON)
2001-07-17 05:58:10 +00:00
{
Menu_PrimaryWeapon();
}
else if (self.current_menu == MENU_SECONDARY_WEAPON)
2001-07-17 05:58:10 +00:00
{
Menu_SecondaryWeapon();
}
else if (self.current_menu == MENU_MISC_WEAPON)
2001-07-17 05:58:10 +00:00
{
Menu_MiscWeapon();
}
else if (self.current_menu == MENU_LEGS)
2001-07-17 05:58:10 +00:00
{
Menu_Legs();
}
else if (self.current_menu == MENU_HEALTH)
2001-07-17 05:58:10 +00:00
{
Menu_Health();
}
else if (self.current_menu == MENU_ARMOR)
2001-07-17 05:58:10 +00:00
{
Menu_Armor();
}
else if (self.current_menu == MENU_SPECIAL)
2001-07-17 05:58:10 +00:00
{
Menu_Special();
}
else if (self.current_menu == MENU_SPECIAL2)
2001-07-17 05:58:10 +00:00
{
Menu_Special2();
}
else if (self.current_menu == MENU_GREN1)
2001-07-17 05:58:10 +00:00
{
Menu_Gren1();
}
else if (self.current_menu == MENU_GREN2)
2001-07-17 05:58:10 +00:00
{
Menu_Gren2();
}
else if (self.current_menu == MENU_ENGINEERING)
2001-07-17 05:58:10 +00:00
{
Menu_Engineering();
}
else if (self.current_menu == MENU_PROFESSION)
2001-07-17 05:58:10 +00:00
{
Menu_Profession();
}
else if (self.current_menu == MENU_PROFESSION2)
2001-07-17 05:58:10 +00:00
{
Menu_Profession2();
}
else if (self.current_menu == MENU_PROFICIENCY)
2001-07-17 05:58:10 +00:00
{
Menu_Proficiency();
}
else if (self.current_menu == MENU_OPTION)
2001-07-17 05:58:10 +00:00
{
Menu_Option();
}
//WK ----------------
else if (self.team_no == 0 && teamplay && (self.lives != 0))
{
if (self.motd >= MOTD_FINISHED) {
self.current_menu = MENU_TEAM;
2001-07-17 05:58:10 +00:00
Menu_Team();
}
}
//WK Default to custom class gen - OfN - nope!
else if (self.playerclass == PC_UNDEFINED && (self.lives != 0))
2001-07-17 05:58:10 +00:00
{
//- OfN - stock_mode applies
if (stock_mode < 2) {
self.current_menu = MENU_CLASS;//-was commented
2001-07-17 05:58:10 +00:00
Menu_Class();//-was commented
}
else
{
self.impulse = PC_CUSTOM + TF_CHANGEPC; //-wasnt commented
2001-07-17 05:58:10 +00:00
TeamFortress_ChangeClass();//-wasnt commented
}
}
else
self.current_menu = 0;
};
//WK What the hell is this for?
/*
void(float menu_no) DisplayMenu =
{
self.current_menu = menu_no;
if (menu_no == MENU_TEAM)
2001-07-17 05:58:10 +00:00
{
Menu_Team();
}
else if (menu_no == MENU_CLASS)
2001-07-17 05:58:10 +00:00
{
Menu_Class();
}
};
*/
void(float inp) Menu_Team_Input;
void() Menu_Team =
{
if ((toggleflags & TFLAG_AUTOTEAM) && teamplay)
2001-07-17 05:58:10 +00:00
{
// assign player a team
if (TeamFortress_TeamPutPlayerInTeam())
return;
}
// The Detection entity may have specified a Team Menu String
if (team_menu_string != string_null)
{
CenterPrint(self, team_menu_string);
return;
}
if (CTF_Map == TRUE)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Blue Team \n<EFBFBD>.. Red Team \n\n\n\n<EFBFBD>.. Bind my keys for me!\n\nFor full details on this patch:\nhttp://www.telefragged.com/teamfortress/\n");
else if (number_of_teams == 1)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Team One \n");
else if (number_of_teams == 2)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n \n \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n");
else if (number_of_teams == 3)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n<EFBFBD>.. Team Three\n \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n");
else // if (number_of_teams == 4)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n<EFBFBD>.. Team Three\n<EFBFBD>.. Team Four \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n");
};
void(float inp) Menu_Team_Input =
{
//WK Remove starting observer gravity. It might come right back.
self.gravity = 1;
if (inp == 5) // auto team
TeamFortress_TeamPutPlayerInTeam();
else if (inp <= number_of_teams && inp > 0)
TeamFortress_TeamSet(inp);
else if (number_of_teams == 0 && inp <= TM_MAX_NO)
2001-07-17 05:58:10 +00:00
TeamFortress_TeamSet(inp);
else //- OfN
{
//ResetMenu();
self.impulse = 0;
return;
}
/*else if (inp == 7)
self.current_menu = MENU_PICKBINDS;
2001-07-17 05:58:10 +00:00
else if (inp == 8)
PlayerObserverMode();*/
if (custom_mode!=2) sprint(self, PRINT_MEDIUM, "Press <20> for a custom player class\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
};
void() Menu_Class =
{
local entity AD;
AD = find(world, classname, "info_tfdetect");
if (AD)
{
if (self.team_no == 1)
{
if (AD.noise1 != string_null)
{
CenterPrint(self, AD.noise1);
return;
}
}
else if (self.team_no == 2)
{
if (AD.noise2 != string_null)
{
CenterPrint(self, AD.noise2);
return;
}
}
else if (self.team_no == 3)
{
if (AD.noise3 != string_null)
{
CenterPrint(self, AD.noise3);
return;
}
}
else if (self.team_no == 4)
{
if (AD.noise4 != string_null)
{
CenterPrint(self, AD.noise4);
return;
}
}
}
if (custom_mode!=2)
{
if (TeamFortress_TeamIsCivilian(self.team_no))
CenterPrint(self, "Your team can only be Civilians.\n");
else if (spy_off == TRUE)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Scout \n<EFBFBD>.. Sniper \n<EFBFBD>.. Soldier \n<EFBFBD>.. Demoman \n<EFBFBD>.. Medic \n<EFBFBD>.. Hvwep \n<EFBFBD>.. Pyro \n<EFBFBD>.. Engineer\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! \n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Scout \n<EFBFBD>.. Sniper \n<EFBFBD>.. Soldier \n<EFBFBD>.. Demoman \n<EFBFBD>.. Medic \n<EFBFBD>.. Hvwep \n<EFBFBD>.. Pyro \n<EFBFBD>.. Spy \n<EFBFBD>.. Engineer\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! \n");
}
else
{
if (TeamFortress_TeamIsCivilian(self.team_no))
CenterPrint(self, "Your team can only be Civilians.\n");
else if (spy_off == TRUE)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Scout \n<EFBFBD>.. Sniper \n<EFBFBD>.. Soldier \n<EFBFBD>.. Demoman \n<EFBFBD>.. Medic \n<EFBFBD>.. Hvwep \n<EFBFBD>.. Pyro \n<EFBFBD>.. Engineer\n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>\n\n<EFBFBD>.. Scout \n<EFBFBD>.. Sniper \n<EFBFBD>.. Soldier \n<EFBFBD>.. Demoman \n<EFBFBD>.. Medic \n<EFBFBD>.. Hvwep \n<EFBFBD>.. Pyro \n<EFBFBD>.. Spy \n<EFBFBD>.. Engineer\n");
}
};
void(float inp) Menu_Class_Input =
{
if (inp > 10 || inp < 1)
return;
if (inp==10 && custom_mode==2)
{
self.impulse = 0;
return;
}
self.impulse = inp + TF_CHANGEPC;
2001-07-17 05:58:10 +00:00
if (inp == 10) //We picked custom, chnage it from random
self.impulse = PC_CUSTOM + TF_CHANGEPC;
2001-07-17 05:58:10 +00:00
//WK Default to Custom class. TODO: Make this a serverside option - OfN - done!
// self.impulse = PC_CUSTOM + TF_CHANGEPC;
2001-07-17 05:58:10 +00:00
TeamFortress_ChangeClass();
ResetMenu();
if ( DISPLAY_CLASS_HELP )
self.current_menu = MENU_CLASSHELP;
2001-07-17 05:58:10 +00:00
else
self.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
self.impulse = 0;
};
void () Menu_Drop =
{
if (self.weapons_carried & WEAP_SPANNER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Shells \n<EFBFBD>.. Nails \n<EFBFBD>.. Rockets \n<EFBFBD>.. Cells \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Shells \n<EFBFBD>.. Nails \n<EFBFBD>.. Rockets \n<EFBFBD>.. Cells \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
};
void () Menu_RepeatHelp =
{
CenterPrint(self, "Press <20> to see this help again\n");
};
void(float inp) Menu_Drop_Input =
{
if ((inp > 0) && (inp < 5))
{
TeamFortress_DropAmmo(inp);
}
if ((inp > 0) && (inp < 6))
ResetMenu();
self.impulse = 0;
};
void(float inp) Menu_DoBindings_Input =
{/*- unusefull
local string st;
if (inp < 4)
{
self.impulse = 0;
if (inp == 1)
{
// Flag info
stuffcmd(self, "bind q \"impulse 23\"\n");
// Hook
stuffcmd(self, "bind e \"impulse 22\"\n");
// Grenade 1
stuffcmd(self, "bind r \"+gren1\"\n");
// Grenade 2
stuffcmd(self, "bind f \"+gren2\"\n");
// Detonate Pipebombs
stuffcmd(self, "bind v \"detpipe\"\n");
// Drop ammo
stuffcmd(self, "bind c \"dropammo\"\n");
// Scan
stuffcmd(self, "bind x \"scan50\"\n");
// Showclasses
stuffcmd(self, "bind g \"showclasses\"\n");
// Inventory
stuffcmd(self, "bind z \"inv\"\n");
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_SHOWBINDS1;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
return;
}
else if (inp == 2)
{
// Flag info
stuffcmd(self, "bind s \"impulse 23\"\n");
// Hook
stuffcmd(self, "bind x \"impulse 22\"\n");
// Grenade 1
stuffcmd(self, "bind d \"+gren1\"\n");
// Grenade 2
stuffcmd(self, "bind c \"+gren2\"\n");
// Detonate Pipebombs
stuffcmd(self, "bind f \"detpipe\"\n");
// Drop ammo
stuffcmd(self, "bind v \"dropammo\"\n");
// Scan
stuffcmd(self, "bind b \"scan50\"\n");
// Showclasses
stuffcmd(self, "bind g \"showclasses\"\n");
// Inventory
stuffcmd(self, "bind n \"inv\"\n");
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_SHOWBINDS2;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
return;
}
ResetMenu();
}*///- save space
};
void(float inp) Menu_Input =
{
if (self.current_menu == MENU_TEAM)
2001-07-17 05:58:10 +00:00
Menu_Team_Input(inp);
else if (self.current_menu == MENU_CLASS)
2001-07-17 05:58:10 +00:00
Menu_Class_Input(inp);
else if (self.current_menu == MENU_DROP)
2001-07-17 05:58:10 +00:00
Menu_Drop_Input(inp);
else if (self.current_menu == MENU_SPY)
2001-07-17 05:58:10 +00:00
Menu_Spy_Input(inp);
else if (self.current_menu == MENU_SPY_SKIN)
2001-07-17 05:58:10 +00:00
Menu_Spy_Skin_Input(inp);
else if (self.current_menu == MENU_SPY_COLOR)
2001-07-17 05:58:10 +00:00
Menu_Spy_Color_Input(inp);
else if (self.current_menu == MENU_ENGINEER)
2001-07-17 05:58:10 +00:00
Menu_Engineer_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_DISPENSER)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Dispenser_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_TESLA)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Tesla_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_TESLA2)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Tesla_Input2(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_SENTRYGUN)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_SentryGun_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_CAMERA)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Camera_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_SENSOR)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Sensor_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_TELEPORTER)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_Teleporter_Input(inp);
else if (self.current_menu == MENU_ENGINEER_FIX_FIELDGEN)
2001-07-17 05:58:10 +00:00
Menu_EngineerFix_FieldGen_Input(inp);
else if (self.current_menu == MENU_DISPENSER)
2001-07-17 05:58:10 +00:00
Menu_Dispenser_Input(inp);
else if (self.current_menu == MENU_CLASSHELP)
2001-07-17 05:58:10 +00:00
Menu_ClassHelp_Input(inp);
else if (self.current_menu == MENU_PICKBINDS)
2001-07-17 05:58:10 +00:00
Menu_DoBindings_Input(inp);
else if (self.current_menu == MENU_DEMON)
2001-07-17 05:58:10 +00:00
Menu_Demon_Input(inp);
else if (self.current_menu == MENU_ARMY)
2001-07-17 05:58:10 +00:00
Menu_Army_Input(inp);
else if (self.current_menu == MENU_E_HACK)
2001-07-17 05:58:10 +00:00
Menu_EnemyHax_Inp(inp);
else if (self.current_menu == MENU_F_HACK)
2001-07-17 05:58:10 +00:00
Menu_FriendHax_Inp(inp);
else if (self.current_menu == MENU_CRUSADER)
2001-07-17 05:58:10 +00:00
Menu_Crusader_Input(inp);
else if (self.current_menu == MENU_PRIMARY_WEAPON) //WK --
2001-07-17 05:58:10 +00:00
Menu_PrimaryWeapon_Input(inp);
else if (self.current_menu == MENU_SECONDARY_WEAPON)
2001-07-17 05:58:10 +00:00
Menu_SecondaryWeapon_Input(inp);
else if (self.current_menu == MENU_MISC_WEAPON)
2001-07-17 05:58:10 +00:00
Menu_MiscWeapon_Input(inp);
else if (self.current_menu == MENU_LEGS)
2001-07-17 05:58:10 +00:00
Menu_Legs_Input(inp);
else if (self.current_menu == MENU_HEALTH)
2001-07-17 05:58:10 +00:00
Menu_Health_Input(inp);
else if (self.current_menu == MENU_ARMOR)
2001-07-17 05:58:10 +00:00
Menu_Armor_Input(inp);
else if (self.current_menu == MENU_SPECIAL)
2001-07-17 05:58:10 +00:00
Menu_Special_Input(inp);
else if (self.current_menu == MENU_SPECIAL2)
2001-07-17 05:58:10 +00:00
Menu_Special2_Input(inp);
else if (self.current_menu == MENU_GREN1)
2001-07-17 05:58:10 +00:00
Menu_Gren1_Input(inp);
else if (self.current_menu == MENU_GREN2)
2001-07-17 05:58:10 +00:00
Menu_Gren2_Input(inp);
else if (self.current_menu == MENU_ENGINEERING)
2001-07-17 05:58:10 +00:00
Menu_Engineering_Input(inp);
else if (self.current_menu == MENU_PROFESSION)
2001-07-17 05:58:10 +00:00
Menu_Profession_Input(inp);
else if (self.current_menu == MENU_PROFESSION2)
2001-07-17 05:58:10 +00:00
Menu_Profession2_Input(inp);
else if (self.current_menu == MENU_PROFICIENCY)
2001-07-17 05:58:10 +00:00
Menu_Proficiency_Input(inp);
else if (self.current_menu == MENU_OPTION)
2001-07-17 05:58:10 +00:00
Menu_Option_Input(inp); //WK --
};
void() Menu_Intro =
{
CenterPrint2(self, MSG_INTRO, MSG_INTRO2);
2001-07-17 05:58:10 +00:00
};
void() Menu_ClassHelp =
{
if (self.menu_displaytime < 5)
{
if (self.playerclass == PC_SCOUT)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Shotgun \n4.. Nailgun \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SNIPER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Sniper Rifle/Auto Rifle \n4.. Nailgun \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SOLDIER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Shotgun \n3.. Super Shotgun \n7.. Rocket Launcher \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_DEMOMAN)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Shotgun \n6.. Grenade/Pipebomb Launcher\n \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_MEDIC)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n1.. Medikit/BioWeapon \n2.. Shotgun \n3.. Super Shotgun \n5.. Super Nailgun \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_HVYWEAP)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Shotgun \n3.. Super Shotgun \n7.. Assault Cannon \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_PYRO)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Shotgun \n6.. Flamethrower \n7.. Incendiary Cannon \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SPY)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n2.. Tranquiliser Gun \n3.. Super Shotgun \n4.. Nailgun \n\nPress <20> for alias help\n");
else if (self.playerclass == PC_ENGINEER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details: \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n1.. Spanner \n2.. RailGun \n3.. Super Shotgun \n\nPress <20> for alias help\n");
}
else
{
if (self.playerclass == PC_SCOUT)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nFlash Grenade \nConcussion Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nScanner: scan10,scan50,scan250\nHolograph: holo \n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SNIPER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nFlare \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nautozoom : Toggle Rifle Autozooming\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SOLDIER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nNail Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nNone\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_DEMOMAN)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nMirv Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nThe Detpack : det5,det20,det50\nDetonate Pipebombs : detpipe \n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_MEDIC)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nConcussion Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nNone\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_HVYWEAP)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nMirv Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nNone\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_PYRO)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nNapalm Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nNone\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_SPY)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nHallucinogen Grenade\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nGo Undercover : disguise\nStart feigning: feign\n\n\nPress <20> for alias help\n");
else if (self.playerclass == PC_ENGINEER)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nHand Grenade \nEMP Grenade \n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nStart Building : build \n\n\nPress <20> for alias help\n");
/* WK Stop GRENADES - Build your own class from appearing
else if (self.playerclass == PC_CUSTOM)
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \nBuild your own class!\n\n");
*/
}
};
void() Menu_StuffClassHelp =
{
/*
if (self.playerclass == PC_SCOUT)
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Shotgun\n 4.. Nailgun\n");
sprint(self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Concussion Grenade\n Flare\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
sprint(self, PRINT_HIGH, "Scanner: scan10,scan30,scan100\nHolograph: holo\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_SNIPER)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Sniper Rifle/Auto Rifle\n");
sprint (self, PRINT_HIGH, "4.. Nailgun\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
sprint (self, PRINT_HIGH, " autozoom : Toggle Rifle Autozooming\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_SOLDIER)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Shotgun\n 3.. Super Shotgun\n");
sprint (self, PRINT_HIGH, " 7.. Rocket Launcher\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n Nail Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n None\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_DEMOMAN)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Shotgun\n 6.. Grenade/Pipebomb Launcher\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n Mirv Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n The Detpack : det5,det20,det50\n Detonate Pipebombs : detpipe\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_MEDIC)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 1.. Medikit/BioWeapon\n 2.. Shotgun\n 3.. Super Shotgun\n");
sprint (self, PRINT_HIGH, " 5.. Super Nailgun\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n Concussion Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n None\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_HVYWEAP)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Shotgun\n 3.. Super Shotgun\n");
sprint (self, PRINT_HIGH, " 7.. Assault Cannon\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n");
sprint (self, PRINT_HIGH, " Mirv Grenade\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n None\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_PYRO)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Shotgun\n 6.. Flamethrower\n 7.. Incendiary Cannon\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n Napalm Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n None\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_SPY)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 2.. Tranquiliser Gun\n 3.. Super Shotgun\n 4.. Nailgun\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n Hallucinogenic Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Go Undercover : disguise\n Start feigning: feign\n\n\n");
2001-07-17 05:58:10 +00:00
}
else if (self.playerclass == PC_ENGINEER)
2001-07-17 05:58:10 +00:00
{
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Details:\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n 1.. Spanner\n 2.. RailGun\n 3.. Super Shotgun\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Hand Grenade\n EMP Grenade\n");
sprint (self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n Start Building : build\n\n\n");
2001-07-17 05:58:10 +00:00
}
*/
};
void() Menu_ClassHelp2 =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\ninv : Show inventory \n+gren1 : Throw grenade 1\n+gren2 : Throw Grenade 2\nreload : Force a reload \ndropammo : drop some ammo \nskill : use job ability\ntaunt1 : taunts(also 2,3,4)\n");
}; // \nskill : use job ability
void(float inp) Menu_ClassHelp_Input =
{
if (self.playerclass == PC_UNDEFINED) return;
2001-07-17 05:58:10 +00:00
//CH changed inp from 8 to 9, lgun uses 8
if (inp == 9)
{
Menu_ClassHelp2();
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_CLASSHELP2;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
self.impulse = 0;
}
// Otherwise, the impulse is passed on
};
void() Menu_DoBindings =
{
//CenterPrint(self, "<22>.. Use keys: E R F V C Q X G Z\n<>.. Use keys: S X D C F V B G N\n<>.. Don't make bindings \n");
};
void() Menu_ShowBindings1 =
{
//CenterPrint(self, "<22>.. Flaginfo \n<>.. Hook \n<>.. Throw Gren 1 \n<>.. Throw Gren 2 \n<>.. Det. Pipebombs\n<>.. Drop ammo \n<>.. Use Scanner \n<>.. Showclasses \n<>.. inventory \n");
};
void() Menu_ShowBindings2 =
{
//CenterPrint(self, "<22>.. Flaginfo \n<>.. Hook \n<>.. Throw Gren 1 \n<>.. Throw Gren 2 \n<>.. Det. Pipebombs\n<>.. Drop ammo \n<>.. Use Scanner \n<>.. Showclasses \n<>.. inventory \n");
};
//============================================================================
// SPY menus for the Skin and Color changing ability
void() Menu_Spy =
{
if (self.is_feigning)
{
if (self.undercover_team != 0 && self.undercover_skin != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Stop Feigning \n<EFBFBD>.. Reset Skin and Color \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else if (self.undercover_team != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Stop Feigning \n<EFBFBD>.. Reset Color \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else if (self.undercover_skin != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Stop Feigning \n<EFBFBD>.. Reset Skin \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Stop Feigning \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
}
else
{
if (self.undercover_team != 0 && self.undercover_skin != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Start Feigning \n<EFBFBD>.. Reset Skin and Color \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else if (self.undercover_team != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Start Feigning \n<EFBFBD>.. Reset Color \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else if (self.undercover_skin != 0)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Start Feigning \n<EFBFBD>.. Reset Skin \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Change Skin \n<EFBFBD>.. Change Color \n<EFBFBD>.. Start Feigning \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
}
};
void(float inp) Menu_Spy_Input =
{
local float tc;
local string st;
if (inp == 1 || inp == 2)
{
if (self.effects & (EF_DIMLIGHT | EF_BRIGHTLIGHT))
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You can't go undercover while glowing.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
return;
}
if (self.is_unabletospy == 1)
{
sprint(self, PRINT_HIGH, "You can't go undercover right now.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
return;
}
}
if (inp == 1)
{
Menu_Spy_Skin();
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_SPY_SKIN;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
self.impulse = 0;
}
else if (inp == 2)
{
Menu_Spy_Color();
self.menu_count = MENU_REFRESH_RATE;
self.current_menu = MENU_SPY_COLOR;
2001-07-17 05:58:10 +00:00
self.menu_displaytime = 0;
self.impulse = 0;
}
else if (inp == 3)
{
TeamFortress_SpyFeignDeath(1); //CH Normal feign
ResetMenu();
self.impulse = 0;
}
else if (inp == 4)
{
Spy_RemoveDisguise(self);
ResetMenu();
self.impulse = 0;
}
else if (inp == 5 && (self.undercover_team != 0 || self.undercover_skin != 0))
{
ResetMenu();
self.impulse = 0;
}
// Otherwise, the impulse is passed on
};
void() Menu_Spy_Skin =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>:\n\n<EFBFBD>.. Scout \n<EFBFBD>.. Sniper \n<EFBFBD>.. Soldier \n<EFBFBD>.. Demoman \n<EFBFBD>.. Medic \n<EFBFBD>.. Hvwep \n<EFBFBD>.. Pyro \n<EFBFBD>.. Spy \n<EFBFBD>.. Engineer\n\n");
};
void(float inp) Menu_Spy_Skin_Input =
{
if (inp < 10 && inp > 0)
{
TeamFortress_SpyChangeSkin(inp);
ResetMenu();
self.impulse = 0;
}
// Otherwise, the impulse is passed on
};
void() Menu_Spy_Color =
{
if (number_of_teams == 0)
{
sprint(self, PRINT_HIGH, "No Color changing allowed in deathmatch.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
return;
}
if (number_of_teams == 1)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>:\n\n<EFBFBD>.. Team One \n\n");
else if (number_of_teams == 2)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>:\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n\n");
else if (number_of_teams == 3)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>:\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n<EFBFBD>.. Team Three\n\n");
else // if (number_of_teams == 4)
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>:\n\n<EFBFBD>.. Team One \n<EFBFBD>.. Team Two \n<EFBFBD>.. Team Three\n<EFBFBD>.. Team Four \n\n");
};
void(float inp) Menu_Spy_Color_Input =
{
if (inp >= 1 && inp <= number_of_teams)
{
TeamFortress_SpyChangeColor(inp);
ResetMenu();
self.impulse = 0;
}
// Otherwise, the impulse is passed on
};
//============================================================================
// ENGINEER menus for the building ability
//WK Rewritten for better extensibility and less lines of code
void() Menu_Engineer =
{
//Set up empty menu
local string line1;
local string line2;
local string line3;
local string line4;
local string line5;
local string line6;
local string line7;
//Check line for Dispenser
if (self.has_dispenser == TRUE)
2001-07-17 05:58:10 +00:00
line1 = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD><EFBFBD><EFBFBD> Destroy Dispenser \n";
else if (self.ammo_cells >= BUILD_COST_DISPENSER && (self.cutf_items & CUTF_DISPENSER))//SB
2001-07-17 05:58:10 +00:00
line1 = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Build Dispenser \n";
else
line1 = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n \n";
if (self.has_sentry == TRUE)
2001-07-17 05:58:10 +00:00
line2 = "<EFBFBD><EFBFBD><EFBFBD> Destroy Sentry Gun \n";
else if (self.ammo_cells >= BUILD_COST_SENTRYGUN && self.cutf_items & CUTF_SENTRYGUN)
2001-07-17 05:58:10 +00:00
line2 = "<EFBFBD>.. Build Sentry Gun \n";
else
line2 = " \n";
if (self.has_tesla == TRUE)
2001-07-17 05:58:10 +00:00
line3 = "<EFBFBD><EFBFBD><EFBFBD> Destroy Tesla Sentry \n";
else if (self.ammo_cells >= BUILD_COST_TESLA && self.tf_items & NIT_TESLA)
2001-07-17 05:58:10 +00:00
line3 = "<EFBFBD>.. Build Tesla Sentry \n";
else
line3 = " \n";
if (self.has_camera == TRUE)
2001-07-17 05:58:10 +00:00
line4 = "<16><> Destroy Security Camera \n"; //CH impulse 4 for both
else if (self.ammo_cells >= BUILD_COST_CAMERA && self.tf_items & NIT_SECURITY_CAMERA)
2001-07-17 05:58:10 +00:00
line4 = ".. Launch Security Camera \n";
else
line4 = " \n";
if (self.has_teleporter != 0) //CH messy, yes
{
if (self.has_teleporter == 1 && self.ammo_cells >= BUILD_COST_TELEPORTER)
2001-07-17 05:58:10 +00:00
line5 = ".. Build a Teleporter Pad \n<18><> Destroy a Teleporter Pad \n"; //ofn the number is 5
else if (self.has_teleporter == 1 && self.ammo_cells < BUILD_COST_TELEPORTER)
2001-07-17 05:58:10 +00:00
line5 = "<18><> Destroy a Teleporter Pad \n"; // 6
if (self.has_teleporter == 2)
line5 = "<18><> Destroy Both Teleporter Pads \n"; // 6
}
else if (self.ammo_cells >= BUILD_COST_TELEPORTER && self.tf_items & NIT_TELEPORTER)
2001-07-17 05:58:10 +00:00
line5 = ".. Build a Teleporter Pad \n";
else
line5 = " \n";
if (self.has_sensor==TRUE)
2001-07-17 05:58:10 +00:00
{
line6 = "<EFBFBD><EFBFBD><EFBFBD> Destroy Motion Sensor \n";
}
else if (self.ammo_cells >= BUILD_COST_SENSOR && self.cutf_items & CUTF_SENSOR)
2001-07-17 05:58:10 +00:00
{
line6 = "<EFBFBD>.. Deploy Motion Sensor \n";
}
else
{
line6 = " \n";
}
if (self.has_fieldgen != 0) //CH messy, yes
{
if (self.has_fieldgen == 1 && self.ammo_cells >= BUILD_COST_FIELDGEN)
2001-07-17 05:58:10 +00:00
line7 = "<EFBFBD>.. Build a Field Generator \n<EFBFBD><EFBFBD><EFBFBD> Destroy a Field Generator \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n"; //ofn the number is 5
else if (self.has_fieldgen == 1 && self.ammo_cells < BUILD_COST_FIELDGEN)
2001-07-17 05:58:10 +00:00
line7 = "<EFBFBD><EFBFBD><EFBFBD> Destroy a Field Generator \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n"; // 6
#ifdef FIELD_FORCEMODE
if (self.has_fieldgen >= 2)
{
if (GetFieldForcedStatus())
line7 = "<EFBFBD>.. Force field: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n<EFBFBD><EFBFBD><EFBFBD> Destroy Both Field Generators \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n";
else
line7 = "<EFBFBD>.. Force field: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n<EFBFBD><EFBFBD><EFBFBD> Destroy Both Field Generators \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n";
}
#else
if (self.has_fieldgen >= 2)
line7 = "<EFBFBD><EFBFBD><EFBFBD> Destroy Both Field Generators \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n"; // 6
#endif
}
else if (self.ammo_cells >= BUILD_COST_FIELDGEN && self.cutf_items & CUTF_FIELDGEN)
2001-07-17 05:58:10 +00:00
line7 = "<EFBFBD>.. Build a Field Generator \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n";
else
line7 = " \n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n";
//Finally, we output the menu...
CenterPrint7(self,line1,line2,line3,line4,line5,line6,line7);
};
void(float inp) Menu_Engineer_Input =
{
local entity te;
if (inp == 1 && self.ammo_cells >= BUILD_COST_DISPENSER && self.has_dispenser == FALSE)
2001-07-17 05:58:10 +00:00
{
if (!self.has_dispenser) TeamFortress_Build(BUILD_DISPENSER);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
else if (inp == 2 && self.ammo_cells >= BUILD_COST_SENTRYGUN && self.has_sentry == FALSE)
2001-07-17 05:58:10 +00:00
{
if (HasFlag(self.team_no) == FALSE) {
2001-07-17 05:58:10 +00:00
CenterPrint(self, "No building until your team has the flag!\n");
return;
}
TeamFortress_Build(BUILD_SENTRYGUN);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
else if (inp == 3 && self.ammo_cells >= BUILD_COST_TESLA && self.has_tesla == FALSE)
2001-07-17 05:58:10 +00:00
{
if (HasFlag(self.team_no) == FALSE) {
2001-07-17 05:58:10 +00:00
CenterPrint(self, "No building until your team has the flag!\n");
return;
}
TeamFortress_Build(BUILD_TESLA);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
else if (inp == 4)
{
if (!self.has_camera)
TeamFortress_Build(BUILD_SECURITY_CAMERA);
2001-07-17 05:58:10 +00:00
else
{
if (self.option < time)
Find_And_Dmg("building_camera", self, 1);
else
{
self.impulse = 0;
return;
}
}
ResetMenu();
self.impulse = 0;
}
//CH uses 5 and 6
else if (inp == 5 && (self.has_teleporter == 0 || self.has_teleporter == 1) && self.ammo_cells >= BUILD_COST_TELEPORTER) //ch if have one out, can build
2001-07-17 05:58:10 +00:00
{
if (HasFlag(self.team_no) == FALSE) {
2001-07-17 05:58:10 +00:00
CenterPrint(self, "No building until your team has the flag!\n");
return;
}
if (self.has_teleporter == 1)
{
local float r;
te = find(world, classname, "building_teleporter");
while (te)
{
if (te.real_owner == self)
{
r = vlen(te.origin - self.origin);
if (r > TELEPORTER_RANGE && !(te.num_mines & IMPROVED_FOUR))
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "Other Teleporter is too far away\n");
2001-07-17 05:58:10 +00:00
}
else
{
TeamFortress_Build(BUILD_TELEPORTER);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
}
te = find(te, classname, "building_teleporter");
}
}
else
{
TeamFortress_Build(BUILD_TELEPORTER);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
}
else if (inp == 6 && (self.has_teleporter == 1 || self.has_teleporter == 2)) //ch if have one out. can destroy
{
Find_And_Dmg("building_teleporter", self, 1);
ResetMenu();
self.impulse = 0;
}
else if (inp == 7 && (self.ammo_cells >= BUILD_COST_SENSOR || self.has_sensor) && self.cutf_items & CUTF_SENSOR)
2001-07-17 05:58:10 +00:00
{
SBBuildSensor();
ResetMenu();
self.impulse = 0;
}
//CH uses 5 and 6
else if (inp == 8) //ch if have one out, can build
{
if ((self.has_fieldgen == 0 || self.has_fieldgen == 1) && self.ammo_cells >= BUILD_COST_FIELDGEN)
2001-07-17 05:58:10 +00:00
{
if (HasFlag(self.team_no) == FALSE) {
2001-07-17 05:58:10 +00:00
CenterPrint(self, "No building until your team has the flag!\n");
return;
}
// find if there are other generators too close, if this is our first generator only - nope
if (infokey(world, "fieldtest") != "1")
{
local float r, mindist;
mindist = 3000;
te = find(world, classname, "building_fieldgen");
while (te)
{
if (te.real_owner != self)
{
r = vlen(te.origin - self.origin);
if (r < mindist)
mindist = r;
}
te = find(te, classname, "building_fieldgen");
}
if (mindist < FIELDGEN_HACKEDRANGE) // * 2
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "There are interferences with other field generators here!\n");
2001-07-17 05:58:10 +00:00
}
else
{
TeamFortress_Build(BUILD_FIELDGEN);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
}
else
{
TeamFortress_Build(BUILD_FIELDGEN);
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
}
}
#ifdef FIELD_FORCEMODE
else if (self.has_fieldgen > 1)
{
if (GetFieldForcedStatus())
{
SetFieldForcedStatus(FALSE);
sprint(self,PRINT_HIGH,"You set the force field to Intelligent Mode\n");
2001-07-17 05:58:10 +00:00
}
else
{
SetFieldForcedStatus(TRUE);
sprint(self,PRINT_HIGH,"You set the force field to Closed Mode\n");
2001-07-17 05:58:10 +00:00
}
ResetMenu();
self.impulse = 0;
}
#endif
}
else if (inp == 9 && (self.has_fieldgen >= 1)) //ch if have one out. can destroy
{
Find_And_Dmg("building_fieldgen", self, 1);
self.has_fieldgen = 0; // FIXME: shouldnt be needed
ResetMenu();
self.impulse = 0;
}
//-----------------------------------------------------------------//
else if (inp == 1 && self.has_dispenser == TRUE)
2001-07-17 05:58:10 +00:00
{
Find_And_Dmg("building_dispenser", self, 1);
ResetMenu();
self.impulse = 0;
}
else if (inp == 2 && self.has_sentry == TRUE)
2001-07-17 05:58:10 +00:00
{
Find_And_Dmg("building_sentrygun", self, 1);
ResetMenu();
self.impulse = 0;
}
else if (inp == 3 && self.has_tesla == TRUE)
2001-07-17 05:58:10 +00:00
{
te = find(world, classname, "building_tesla");
while (te)
{
if (te.real_owner == self)
{
if (te.tf_items & NIT_SECURITY_CAMERA) {
sprint(self, PRINT_HIGH, "Can't detonate a rogue tesla. Sorry, it's not that easy.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
return;
}
}
te = find(te, classname, "building_tesla");
}
Find_And_Dmg("building_tesla", self, 1);
ResetMenu();
self.impulse = 0;
}
else if (inp == 10) //CH was 4
{
ResetMenu();
self.impulse = 0;
}
// Otherwise, the impulse is passed on
};
//CH to reduce code.
void(entity person, string build) Add_Building_Teamkill =
{
local string st;
local float threshold;
threshold = 0;
bprint (PRINT_HIGH, person.netname);
bprint (PRINT_HIGH, " has dismantled a friendly ");
bprint (PRINT_HIGH, build);
bprint (PRINT_HIGH, "!\n");
2001-07-17 05:58:10 +00:00
st = infokey(world, "curse");
if (st != string_null)
threshold = stof(st);
2001-07-17 05:58:10 +00:00
person.ff_count = person.ff_count + 2; //Increase their bastard rating
//Increase the engineers bastard rating so they
//can't block everyone.
person.building.real_owner.ff_count = person.building.real_owner.ff_count + 0.5;
if (threshold >= 1)
{
if (person.ff_count >= threshold)
createBastard(person,threshold);
if (person.building.real_owner.ff_count >= threshold)
createBastard(person.building.real_owner,threshold);
2001-07-17 05:58:10 +00:00
if ((person.ff_count == threshold - 2) || (person.ff_count == threshold - 1.5) || (person.ff_count == threshold - 1) || (person.ff_count == threshold - 0.5))
{
sprint (person, PRINT_MEDIUM, "One more dismantling and you will be cursed.\n");
2001-07-17 05:58:10 +00:00
}
}
};
//============================================================================
// ENGINEER menus for fixing buildings
void() Menu_EngineerFix_Dispenser =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Put Ammo into Dispenser \n<EFBFBD>.. Put Armor into Dispenser \n<EFBFBD>.. Repair Dispenser \n<EFBFBD>.. Dismantle Dispenser \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
};
void(float inp) Menu_EngineerFix_Dispenser_Input =
{
local float metalcost;
local float am;
if (self.classname != "player" || self.building == world)
return;
local float iI; // is Improved?
iI=1;
if (self.building.num_mines & IMPROVED_ONE)
2001-07-17 05:58:10 +00:00
iI=2;
if (inp == 1)
{
// shells
am = (DROP_SHELLS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_shells)
am = self.ammo_shells;
if (am > (BUILD_DISPENSER_MAX_SHELLS*iI - self.building.ammo_shells))
am = BUILD_DISPENSER_MAX_SHELLS*iI - self.building.ammo_shells;
2001-07-17 05:58:10 +00:00
self.ammo_shells = self.ammo_shells - am;
self.building.ammo_shells = self.building.ammo_shells + am;
// nails
am = (DROP_NAILS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_nails)
am = self.ammo_nails;
if (am > (BUILD_DISPENSER_MAX_NAILS*iI - self.building.ammo_nails))
am = BUILD_DISPENSER_MAX_NAILS*iI - self.building.ammo_nails;
2001-07-17 05:58:10 +00:00
self.ammo_nails = self.ammo_nails - am;
self.building.ammo_nails = self.building.ammo_nails + am;
// rockets
am = (DROP_ROCKETS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_rockets)
am = self.ammo_rockets;
if (am > (BUILD_DISPENSER_MAX_ROCKETS*iI - self.building.ammo_rockets))
am = BUILD_DISPENSER_MAX_ROCKETS*iI - self.building.ammo_rockets;
2001-07-17 05:58:10 +00:00
self.ammo_rockets = self.ammo_rockets - am;
self.building.ammo_rockets = self.building.ammo_rockets + am;
// cells
am = (DROP_CELLS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_cells)
am = self.ammo_cells;
if (am > (BUILD_DISPENSER_MAX_CELLS*iI - self.building.ammo_cells))
am = BUILD_DISPENSER_MAX_CELLS*iI - self.building.ammo_cells;
2001-07-17 05:58:10 +00:00
self.ammo_cells = self.ammo_cells - am;
self.building.ammo_cells = self.building.ammo_cells + am;
}
else if (inp == 2)
{
// armor
am = (DROP_ARMOR * 2);
2001-07-17 05:58:10 +00:00
if (am > self.armorvalue)
am = self.armorvalue;
if (am > (BUILD_DISPENSER_MAX_ARMOR*iI - self.building.armorvalue))
am = BUILD_DISPENSER_MAX_ARMOR*iI - self.building.armorvalue;
2001-07-17 05:58:10 +00:00
self.armorvalue = self.armorvalue - am;
self.building.armorvalue = self.building.armorvalue + am;
}
else if (inp == 3)
{
local string f1;
metalcost = (self.building.max_health - self.building.health) / 5;
if (metalcost > self.ammo_cells)
metalcost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 5);
}
else if (inp == 4)
{
if (CheckEnemyDismantle()==FALSE) {ResetMenu(); self.impulse=0; return;}
2001-07-17 05:58:10 +00:00
sprint (self, PRINT_HIGH, "You dismantle the Dispenser.\n");
self.ammo_cells = self.ammo_cells + (BUILD_COST_DISPENSER / 2.0);
2001-07-17 05:58:10 +00:00
///////////////////////////
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "dispenser");
}
self.building.health=0; // - OfN aborts hacks on it
self.building.real_owner.has_dispenser = FALSE;
2001-07-17 05:58:10 +00:00
dremove(self.building);
}
if (inp >= 1 && inp <= 5)
{
ResetMenu();
self.impulse = 0;
self.building = world;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
// Otherwise, the impulse is passed on
};
void() Menu_EngineerFix_SentryGun =
{
if (self.building.weapon < 3 && self.ammo_cells >= BUILD_COST_SENTRYGUN)
2001-07-17 05:58:10 +00:00
{
if (!(self.tf_items & NIT_TURRET)) // TODO: Action --> OfteN's sentry gun
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Put Ammo into Sentry Gun \n.. Upgrade Sentry Gun \n<EFBFBD>.. Repair Sentry Gun \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Dismantle Sentry Gun \n<EFBFBD>.. Rotate Clockwise \n<EFBFBD>.. Rotate Counter-Clockwise \n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Put Ammo into Sentry Gun \n.. Upgrade Sentry Gun \n<EFBFBD>.. Repair Sentry Gun \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Dismantle Sentry Gun \n<EFBFBD>.. Rotate Clockwise \n<EFBFBD>.. Rotate Counter-Clockwise \n<EFBFBD>.. Create Turret \n");
}
else
{
if (!(self.tf_items & NIT_TURRET))
2001-07-17 05:58:10 +00:00
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Put Ammo into Sentry Gun \n<EFBFBD>.. Repair Sentry Gun \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Dismantle Sentry Gun \n<EFBFBD>.. Rotate Clockwise \n<EFBFBD>.. Rotate Counter-Clockwise \n");
else
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Put Ammo into Sentry Gun \n<EFBFBD>.. Repair Sentry Gun \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Dismantle Sentry Gun \n<EFBFBD>.. Rotate Clockwise \n<EFBFBD>.. Rotate Counter-Clockwise \n<EFBFBD>.. Create Turret \n");
}
};
void(float inp) Menu_EngineerFix_SentryGun_Input =
{
local float am, metalcost;
local string st;
if (self.classname != "player" || self.building == world)
return;
if (inp == 1)
{
// shells
am = (DROP_SHELLS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_shells)
am = self.ammo_shells;
if (am > (self.building.maxammo_shells - self.building.ammo_shells))
am = (self.building.maxammo_shells - self.building.ammo_shells);
self.ammo_shells = self.ammo_shells - am;
self.building.ammo_shells = self.building.ammo_shells + am;
// If it's level 3, put some rockets in too
if (self.building.weapon == 3)
{
am = (DROP_ROCKETS * 2);
2001-07-17 05:58:10 +00:00
if (am > self.ammo_rockets)
am = self.ammo_rockets;
if (am > (self.building.maxammo_rockets - self.building.ammo_rockets))
am = (self.building.maxammo_rockets - self.building.ammo_rockets);
self.ammo_rockets = self.ammo_rockets - am;
self.building.ammo_rockets = self.building.ammo_rockets + am;
}
}
else if (self.building.weapon < 3 && inp == 2 && self.ammo_cells >= BUILD_COST_SENTRYGUN)
2001-07-17 05:58:10 +00:00
{
self.ammo_cells = self.ammo_cells - BUILD_COST_SENTRYGUN;
2001-07-17 05:58:10 +00:00
self.building.weapon = self.building.weapon + 1;
local float HPfactor,AMMOfactor;
if (self.building.num_mines & IMPROVED_THREE)
2001-07-17 05:58:10 +00:00
HPfactor=2;
else
HPfactor=1;
if (self.building.num_mines & IMPROVED_ONE)
2001-07-17 05:58:10 +00:00
AMMOfactor=2;
else
AMMOfactor=1;
// more health
//self.building.max_health = self.building.max_health * 1.2;
//self.building.health = self.building.max_health;
// more ammo capability
//self.building.maxammo_shells = self.building.maxammo_shells * 1.2;
// Change the skin and frames
if (self.building.weapon == 2)
{
sound (self.building, CHAN_ITEM, "weapons/turrset.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +00:00
self.building.think = lvl2_sentry_stand;
//self.building.skin = 1;
self.building.max_health = 180 * HPfactor;
self.building.maxammo_shells = 120 * AMMOfactor;
}
else // if (self.building.weapon == 3)
{
sound (self.building, CHAN_ITEM, "weapons/turrset.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +00:00
self.building.think = lvl3_sentry_stand;
//self.building.skin = 2;
self.building.max_health = 220 * HPfactor;
self.building.maxammo_shells = 144 * AMMOfactor;
}
self.building.health = self.building.max_health;
sprint(self, PRINT_HIGH, "You upgrade the Sentry Gun to level ");
2001-07-17 05:58:10 +00:00
st = ftos(self.building.weapon);
sprint(self, PRINT_HIGH, st);
sprint(self, PRINT_HIGH, "\n");
2001-07-17 05:58:10 +00:00
}
else if (inp == 3)
{
metalcost = (self.building.max_health - self.building.health) / 5;
if (metalcost > self.ammo_cells)
metalcost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 5);
}
else if (inp == 5)
{
if (CheckEnemyDismantle()==FALSE) return;
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Sentry Gun.\n");
2001-07-17 05:58:10 +00:00
//CH give .5 of build cost====give 25*level
self.ammo_cells = self.ammo_cells + (BUILD_COST_SENTRYGUN / 2.0) + (self.building.weapon * 25);
2001-07-17 05:58:10 +00:00
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "sentry gun");
}
self.building.real_owner.has_sentry = FALSE;
2001-07-17 05:58:10 +00:00
dremove(self.building.trigger_field);
self.building.health=0; // - OfN aborts hacks on it
dremove(self.building);
}
else if (inp == 6) //WK
{
sprint(self, PRINT_HIGH, "You rotate it clockwise 45 degrees\n");
2001-07-17 05:58:10 +00:00
self.building.angles_y = anglemod(self.building.angles_y - 45);
self.building.angles_y = ((ceil(self.building.angles_y / 10)) * 10); //CH set last int to 0
self.building.waitmin = anglemod(self.building.angles_y - 50);
self.building.waitmax = anglemod(self.building.angles_y + 50);
self.building.heat = 0;
}
else if (inp == 7) //WK
{
sprint(self, PRINT_HIGH, "You rotate it counter-clockwise 45 degrees\n");
2001-07-17 05:58:10 +00:00
self.building.angles_y = anglemod(self.building.angles_y + 45);
self.building.angles_y = ((ceil(self.building.angles_y / 10)) * 10); //CH set last int to 0
self.building.waitmin = anglemod(self.building.angles_y - 50);
self.building.waitmax = anglemod(self.building.angles_y + 50);
self.building.heat = 1;
}
//Detachable sentry!
else if (inp == 8)
{
if (self.building.tf_items & NIT_TURRET) {
sprint(self, PRINT_HIGH, "Gun is already deployed\n");
2001-07-17 05:58:10 +00:00
}
else if (!(self.tf_items & NIT_TURRET)) {
sprint(self, PRINT_HIGH, "You need to purchase the turret upgrade\n");
2001-07-17 05:58:10 +00:00
}
else if (self.ammo_cells < BUILD_COST_TURRET)
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "Creating a turret costs BUILD_COST_TURRET metal\n");
2001-07-17 05:58:10 +00:00
}
else {
self.building.origin_z = self.building.origin_z + 15; //Elevate for the check
//Make sure the launch area is clear
if (CheckArea(self.building,self) == FALSE) {
sprint(self, PRINT_HIGH, "You need a clear area to launch\n");
2001-07-17 05:58:10 +00:00
self.building.origin_z = self.building.origin_z - 15; //Set back down
}
else {
self.building.origin_z = self.building.origin_z + 25; //Finish liftoff
sprint(self, PRINT_HIGH, "You launch the sentrygun\n");
self.ammo_cells = self.ammo_cells - BUILD_COST_TURRET;
2001-07-17 05:58:10 +00:00
self.building.angles_z = 180;
setmodel(self.building.trigger_field,string_null);
self.building.trigger_field.solid = SOLID_NOT;
self.building.flags = self.building.flags - (self.building.flags & FL_ONGROUND);
self.building.movetype = MOVETYPE_FLY;
2001-07-17 05:58:10 +00:00
self.building.velocity_z = 200;
setsize (self.building, '-16 -16 -40', '16 16 -10'); //WK -40, -10
self.building.tf_items = self.building.tf_items | NIT_TURRET;
2001-07-17 05:58:10 +00:00
}
}
}
if (inp >= 1 && inp <= 8)
{
ResetMenu();
self.impulse = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
};
void() Menu_EngineerFix_Sensor =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Repair Sensor \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n.. Dismantle \n");
};
void(float inp) Menu_EngineerFix_Sensor_Input =
{
//*ch
local float am, metalcost;
local string st;
if (self.classname != "player" || self.building == world)
return;
if (inp == 1)
{
metalcost = (self.building.max_health - self.building.health) / 10;
if (metalcost > self.ammo_cells)
metalcost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 10);
}
else if (inp == 3)
{
if (CheckEnemyDismantle() == FALSE) return; //- OfN - ICE avoids enemy dismantle (see often.qc)
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Motion Sensor.\n");
2001-07-17 05:58:10 +00:00
//CH will give you half of cost + max of 20
self.ammo_cells = self.ammo_cells + (BUILD_COST_SENSOR * 0.5) + floor(self.building.health / 40);
self.building.real_owner.has_sensor = FALSE;
2001-07-17 05:58:10 +00:00
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "motion sensor");
}
self.building.health=0; // - OfN aborts hacks on it
dremove(self.building);
}
if (inp >= 1 && inp <= 3)
{
ResetMenu();
self.impulse = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
};
void() Menu_EngineerFix_Camera =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Repair Camera \n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n.. Dismantle \n");
};
void(float inp) Menu_EngineerFix_Camera_Input =
{
//*ch
local float am, metalcost;
local string st;
if (self.classname != "player" || self.building == world)
return;
if (inp == 1)
{
metalcost = (self.building.max_health - self.building.health) / 10;
if (metalcost > self.ammo_cells)
metalcost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 10);
}
else if (inp == 3)
{
if (CheckEnemyDismantle() == FALSE) return; //- OfN - ICE avoids enemy dismantle (see often.qc)
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Security Camera.\n");
2001-07-17 05:58:10 +00:00
//CH will give you half of cost + max of 20
self.ammo_cells = self.ammo_cells + (BUILD_COST_CAMERA * 0.5) + floor(self.building.health / 40);
self.building.real_owner.has_camera = FALSE;
2001-07-17 05:58:10 +00:00
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "security camera");
}
self.building.health=0; // - OfN aborts hacks on it
dremove(self.building);
}
if (inp >= 1 && inp <= 3)
{
ResetMenu();
self.impulse = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
};
void() Menu_EngineerFix_Teleporter =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Repair Teleporter \n.. Recharge Teleporter\n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n.. Dismantle \n");
};
void(float inp) Menu_EngineerFix_Teleporter_Input =
{
//*ch
local float am, metalcost;
local string st;
if (self.classname != "player" || self.building == world)
return;
if (inp == 1)
{
metalcost = (self.building.max_health - self.building.health) / 5;
if (metalcost > self.ammo_cells)
metalcost = ceil(self.ammo_cells);
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 5);
}
else if (inp == 2)
{
metalcost = (self.building.maxammo_cells - self.building.ammo_cells);
if (metalcost > self.ammo_cells)
metalcost = ceil(self.ammo_cells);
self.ammo_cells = self.ammo_cells - metalcost;
self.building.ammo_cells = self.building.ammo_cells + metalcost;
if (self.building.ammo_cells > self.building.maxammo_cells)
self.building.ammo_cells = self.building.maxammo_cells;
}
else if (inp == 4)
{
if (CheckEnemyDismantle() == FALSE) return; //- OfN - ICE avoids enemy dismantle (see often.qc)
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Teleporter Pad.\n");
2001-07-17 05:58:10 +00:00
//CH will give you half of cost + max of 20
self.ammo_cells = self.ammo_cells + (BUILD_COST_TELEPORTER * 0.5) + floor(self.building.health / 15);
2001-07-17 05:58:10 +00:00
self.building.real_owner.has_teleporter = (self.building.real_owner.has_teleporter - 1);
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "teleporter");
}
self.building.health=0; // - OfN aborts hacks on it
dremove(self.building);
}
if (inp >= 1 && inp <= 4)
{
ResetMenu();
self.impulse = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
};
//=========================================================================
// field generator
void() Menu_EngineerFix_FieldGen =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Repair Field Generator \n.. Recharge Field Generator\n\n.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n.. Dismantle \n");
};
void(float inp) Menu_EngineerFix_FieldGen_Input =
{
local float am, metalcost;
local string st;
if (self.classname != "player" || self.building == world)
return;
if (inp == 1)
{
metalcost = (self.building.max_health - self.building.health) / 5;
if (metalcost > self.ammo_cells)
metalcost = ceil(self.ammo_cells);
self.ammo_cells = self.ammo_cells - metalcost;
self.building.health = self.building.health + (metalcost * 5);
}
else if (inp == 2)
{
metalcost = (self.building.maxammo_cells - self.building.ammo_cells);
if (metalcost > self.ammo_cells)
metalcost = ceil(self.ammo_cells);
self.ammo_cells = self.ammo_cells - metalcost;
self.building.ammo_cells = self.building.ammo_cells + metalcost;
if (self.building.ammo_cells > self.building.maxammo_cells)
self.building.ammo_cells = self.building.maxammo_cells;
}
else if (inp == 4)
{
if (CheckEnemyDismantle() == FALSE) return; //- OfN - ICE avoids enemy dismantle (see often.qc)
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Field Generator.\n");
2001-07-17 05:58:10 +00:00
//CH will give you half of cost + max of 20
self.ammo_cells = self.ammo_cells + (BUILD_COST_FIELDGEN * 0.5) + floor(self.building.health / 15);
2001-07-17 05:58:10 +00:00
self.building.real_owner.has_fieldgen = (self.building.real_owner.has_fieldgen - 1);
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "field generator");
}
self.building.health=0; // - OfN aborts hacks on it
dremove(self.building);
}
if (inp >= 1 && inp <= 4)
{
ResetMenu();
self.impulse = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
};
//CH
string(float num) Return_Colored_Num =
{
if (num == 0)
return "<EFBFBD>";
else if (num == 1)
return "<EFBFBD>";
else if (num == 2)
return "<EFBFBD>";
else if (num == 3)
return "<EFBFBD>";
else if (num == 4)
return "<EFBFBD>";
else if (num == 5)
return "<EFBFBD>";
else if (num == 6)
return "<EFBFBD>";
else if (num == 7)
return "<EFBFBD>";
else if (num == 8)
return "<EFBFBD>";
else if (num == 9)
return "<EFBFBD>";
else
return "<EFBFBD>"; //Should never happen // OfN - It does when a tesla is in upgrade for frags
};
//Upgrades tesla, type 1=volt 2=amps 3=health 4=spy 5=kevlar 6=blast 7=turret 8=improve 9=cloak
//menu 0=normal 1=misc
float(float ups, entity person, entity sent, float type, float menu) Check_Tesla_Ups =
{
local float upgrades;
if (menu == 1)
upgrades = sent.has_tesla; //misc
else
upgrades = sent.has_sentry; //normal
if (ups > upgrades) {//not enough upgrades
sprint(person,PRINT_HIGH,"You do not have enough upgrades to improve the tesla\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
if (type == 4 || type == 5) { //Spy detector and frag to upgrade
if (person.ammo_cells < (ups / 2) * UPGRADE) {//not enough cells
sprint(person,PRINT_HIGH,"You need more cells to upgrade the tesla\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
}
else
{
if (person.ammo_cells < ups * UPGRADE) {//not enough cells
sprint(person,PRINT_HIGH,"You need more cells to upgrade the tesla\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==1)
{
if (sent.ammo_shells >= 3) {
sprint(self,PRINT_HIGH,"You can only upgrade voltage 3 times\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==2)
{
if (sent.ammo_nails >= 3) {
sprint(person,PRINT_HIGH,"You can only upgrade amperage 3 times\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==3)
{
if (sent.ammo_rockets >= 3) {
sprint(person,PRINT_HIGH,"You can only upgrade the capacitor 3 times\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==4)
{
if (sent.tf_items & NIT_AUTOID) {
sprint(person,PRINT_HIGH,"You already built a spy detector\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==5)
{
if (sent.tf_items & NIT_TELEPORTER) {
sprint(person,PRINT_HIGH,"You already have the upgrade\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==6)
{
if (sent.tf_items & NIT_KEVLAR) {
sprint(person,PRINT_HIGH,"The Tesla already has Kevlar Armor\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==7)
{
if (sent.tf_items & NIT_BLAST) {
sprint(person,PRINT_HIGH,"The Tesla already has Blast Armor\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==8)
{
if (sent.tf_items & NIT_ASBESTOS) {
sprint(person,PRINT_HIGH,"The Tesla already has Asbestos Armor\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==9)
{
if (sent.tf_items & NIT_TURRET) {
sprint(person,PRINT_HIGH,"The Tesla is already a turret!\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==10)
{
if (sent.tf_items & NIT_SCANNER) {
sprint(person,PRINT_HIGH,"The Tesla already has an improved targeter\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
if (type ==11)
{
//sprint(person,PRINT_HIGH,"Not implemented yet!\n");
// return FALSE;
if (sent.tf_items & NIT_TESLA_CLOAKING) {
sprint(person,PRINT_HIGH,"The Tesla already has a cloaking device\n");
return FALSE;
2001-07-17 05:58:10 +00:00
}
else {
self.ammo_cells = self.ammo_cells - (ups * UPGRADE);
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla - ups;
return TRUE;
2001-07-17 05:58:10 +00:00
}
}
return FALSE; //Should not happen
2001-07-17 05:58:10 +00:00
};
//Cause its used 2x
void() Menu_EngineerRepair_Tesla =
{
local float cost;
local float maxcells;
if (self.building.health < self.building.max_health) //CH allow repair with limited cells
{
cost = (self.building.max_health - self.building.health) / 2;
if (cost > self.ammo_cells)
cost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - cost;
self.building.health = self.building.health + (cost * 2);
if (self.building.health >= self.building.max_health)
self.building.health = self.building.max_health;
}
maxcells = self.building.maxammo_cells;
cost = maxcells - self.building.ammo_cells;
if (cost > self.ammo_cells) cost = self.ammo_cells;
self.ammo_cells = self.ammo_cells - cost;
self.building.ammo_cells = self.building.ammo_cells + cost;
if (self.building.ammo_cells >= maxcells)
self.building.ammo_cells = maxcells;
};
void() Menu_EngineerDismantle_Tesla =
{
if (!self.building)
return;
if (self.building.tf_items & NIT_SECURITY_CAMERA) {
sprint(self, PRINT_HIGH, "You can't dismantle it. It's not that easy!\n");
2001-07-17 05:58:10 +00:00
return;
}
if (CheckEnemyDismantle() == FALSE) return;
2001-07-17 05:58:10 +00:00
sprint(self, PRINT_HIGH, "You dismantle the Tesla Gun.\n");
2001-07-17 05:58:10 +00:00
//CH give .5 of ammount of build====give 25*health level (0-3)====give .5 of cells
self.ammo_cells = self.ammo_cells + (BUILD_COST_TESLA / 2.0) + (self.building.ammo_rockets * 25) + (self.building.ammo_cells / 2);
self.building.real_owner.has_tesla = FALSE;
2001-07-17 05:58:10 +00:00
if (Teammate(self.building.real_owner.team_no,self.team_no) && teamplay != 0 && self.building.real_owner != self) { //Boot em if they dismantle too many
Add_Building_Teamkill (self, "tesla");
}
dremove(self.building);
};
//CH does random and picks what upgrade to give
void(entity sent, entity who) Tesla_Add_Rand_Upgrade =
{
local float num;
num = random();
if (num <= 0.8) //give them a normal upgrade
{
sprint(who,PRINT_HIGH,"The tesla got a normal upgrade!\n");
2001-07-17 05:58:10 +00:00
sent.has_sentry = sent.has_sentry + 1;
}
else
{
sprint(who,PRINT_HIGH,"The tesla got a misc upgrade!\n");
2001-07-17 05:58:10 +00:00
sent.has_tesla = sent.has_tesla + 1;
}
};
void() Menu_EngineerFix_Tesla =
{
local string l1,l2;
l1 = Return_Colored_Num(self.building.has_sentry);
l2 = "<EFBFBD>.. Upgrade Voltage <20> 1u\n<EFBFBD>.. Upgrade Amperage <20> 1u\n<EFBFBD>.. Upgrade Power Supply <20> 1u\n<EFBFBD>.. Add Spy Detector <20> 4u\n<EFBFBD>.. Upgrades from frags <20> 3u\n<EFBFBD>.. Tinker \n<EFBFBD>.. Repair and Recharge \n<EFBFBD>.. Dismantle \n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Misc Upgrades \n";
CenterPrint4(self, "Tesla <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>: ",l1, " Upgrades Left\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Normal Tesla Upgrades <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n" ,l2);
};
void(float inp) Menu_EngineerFix_Tesla_Input =
{
local string temp;
local float cost = 0;
local float maxcells;
if (self.classname != "player" || self.building == world)
return;
if (inp <= 10 && inp >= 1)
{
if (self.building.real_owner != self && (inp < 7 || inp == 10) ) {
sprint(self,PRINT_HIGH,"Sorry, only the owner can do that\n");
2001-07-17 05:58:10 +00:00
return;
}
if (inp == 1) { //Upgrade volt
if (Check_Tesla_Ups(1, self, self.building, 1, 0))
{
self.building.ammo_shells = self.building.ammo_shells + 1;
self.building.waitmin = (self.building.ammo_shells + 2) * (self.building.ammo_nails + 2); //Ammo consumption
}
}
if (inp == 2) { //Upgrade amperage
if (Check_Tesla_Ups(1, self, self.building, 2, 0))
{
self.building.ammo_nails = self.building.ammo_nails + 1;
self.building.waitmin = (self.building.ammo_shells + 2) * (self.building.ammo_nails + 2); //Ammo consumption
}
}
if (inp == 3) { //Upgrade power supply
if (Check_Tesla_Ups(1, self, self.building, 3, 0))
{
local float HPfactor,num,AMMOfactor;
if (self.building.num_mines & IMPROVED_THREE)
2001-07-17 05:58:10 +00:00
HPfactor=2;
else
HPfactor=1;
if (self.building.num_mines & IMPROVED_ONE)
2001-07-17 05:58:10 +00:00
AMMOfactor=2;
else
AMMOfactor=1;
num=self.building.health/self.building.max_health;
self.building.ammo_rockets = self.building.ammo_rockets + 1;
//Upgrade them //- OfN - teslas start with 150 hp
if (self.building.ammo_rockets == 1) {
//self.building.max_health = self.building.max_health + 75; // 225
self.building.max_health = 225*HPfactor;
//self.building.health = self.building.health + 75;
self.building.maxammo_cells = (MAXCELLS0 + ADDCELLS1) * AMMOfactor;
2001-07-17 05:58:10 +00:00
self.building.ammo_cells = self.building.maxammo_cells;
}
else if (self.building.ammo_rockets == 2) {
//self.building.max_health = self.building.max_health + 100;// 325
self.building.max_health = 325*HPfactor;// 325
//self.building.health = self.building.health + 100;
//self.building.maxammo_cells = self.building.maxammo_cells + ADDCELLS2; //Add
self.building.maxammo_cells = (MAXCELLS0 + ADDCELLS1 + ADDCELLS2)*AMMOfactor;
2001-07-17 05:58:10 +00:00
self.building.ammo_cells = self.building.maxammo_cells;
}
else if (self.building.ammo_rockets == 3) {
//self.building.max_health = self.building.max_health + 75; // 400
self.building.max_health = 400*HPfactor; // 400
//self.building.health = self.building.health + 75;
self.building.maxammo_cells = (MAXCELLS0 + ADDCELLS1 + ADDCELLS2 + ADDCELLS3)*AMMOfactor; //Add
2001-07-17 05:58:10 +00:00
self.building.ammo_cells = self.building.maxammo_cells;
}
self.building.health=self.building.max_health*num;
}
}
if (inp == 4) { //Spy Detector
if (Check_Tesla_Ups(4, self, self.building, 4, 0))
{
self.building.tf_items = self.building.tf_items | NIT_AUTOID;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 5) { //CH Get frags for upgrades
if (Check_Tesla_Ups(3, self, self.building, 5, 0))
{
self.building.tf_items = self.building.tf_items | NIT_TELEPORTER;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 6){ // Tinker by Cyt0 Remade by CH to fit with new code
if (self.building.tf_items & NIT_TELEPORTER) //- ofn - workaround to solve the HP/cells increase by tinker combined with the hack
2001-07-17 05:58:10 +00:00
{
sprint(self,PRINT_HIGH,"You can't tinker a tesla in upgrade from frags mode!\n");
2001-07-17 05:58:10 +00:00
}
else
{
DoTinker();
}
}
if (inp == 7) { //Repair and Rearm
Menu_EngineerRepair_Tesla();
}
if (inp == 8) {
Menu_EngineerDismantle_Tesla();
}
// if (inp == 9) {
// }
if (inp == 10) {
self.impulse = 0;
Menu_EngineerFix_Tesla2();
self.current_menu = MENU_ENGINEER_FIX_TESLA2;
2001-07-17 05:58:10 +00:00
}
if (inp >= 1 && inp <= 9)
{
ResetMenu();
self.impulse = 0;
if (self.ammo_cells < 0) self.ammo_cells = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
}
};
void() Menu_EngineerFix_Tesla2 =
{
local string l1,l2;
l1 = Return_Colored_Num(self.building.has_tesla);
//l2 = "<22>.. Cloaking Tesla <20> 2u";
l2 = "<EFBFBD>.. Kevlar Armor <20> 1u\n<EFBFBD>.. Blast Armor <20> 1u\n<EFBFBD>.. Asbestos Armor <20> 1u\n<EFBFBD>.. Make TeslaTurret(tm) <20> 1u\n<EFBFBD>.. Improved Targeting System <20> 1u\n<EFBFBD>.. Cloaking Device <20> 1u\n<EFBFBD>.. Repair and Recharge \n<EFBFBD>.. Dismantle \n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<EFBFBD>.. Normal Upgrades\n";
//l2 = "<22>.. Kevlar Armor <20> 1u\n<>.. Blast Armor <20> 1u\n<>.. Asbestos Armor <20> 1u\n<>.. Make TeslaTurret(tm) <20> 1u\n<>.. Improved Targeting System <20> 1u\n\n<>.. Repair and Recharge \n<>.. Dismantle \n<>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n<>.. Normal Upgrades\n";
CenterPrint4(self, "Tesla <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>: ",l1, " Upgrades Left\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Misc Tesla Upgrades <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n" ,l2);
};
void(float inp) Menu_EngineerFix_Tesla_Input2 =
{
local string temp;
local float cost = 0;
local float maxcells;
if (self.classname != "player" || self.building == world)
return;
if (inp <= 10 && inp >= 1)
{
if (inp == 1) { //Kevlar
if (Check_Tesla_Ups(1, self, self.building, 6, 1))
{
self.building.tf_items = self.building.tf_items | NIT_KEVLAR;
self.building.armorclass = self.building.armorclass | AT_SAVESHOT;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 2) { //Blast
if (Check_Tesla_Ups(1, self, self.building, 7, 1))
{
self.building.tf_items = self.building.tf_items | NIT_BLAST;
self.building.armorclass = self.building.armorclass | AT_SAVEEXPLOSION;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 3) { //Blast
if (Check_Tesla_Ups(1, self, self.building, 8, 1))
{
self.building.tf_items = self.building.tf_items | NIT_ASBESTOS;
self.building.armorclass = self.building.armorclass | AT_SAVEFIRE;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 4) { //Tesla Turret(tm)
if (Check_Tesla_Ups(1, self, self.building, 9, 1))
{
if (self.building.tf_items & NIT_TURRET) {
sprint(self, PRINT_HIGH, "Gun is already deployed\n");
2001-07-17 05:58:10 +00:00
}
else {
self.building.origin_z = self.building.origin_z + 15; // +15//Elevate for the check
//Make sure the launch area is clear
if (FALSE) {
//if (CheckArea(self.building,self) == FALSE) {
sprint(self, PRINT_HIGH, "You need a clear area to launch\n");
2001-07-17 05:58:10 +00:00
self.building.origin_z = self.building.origin_z - 15; //-15//Set back down
}
else {
//self.building.origin_z = self.building.origin_z + 25; //+ 25 //Finish liftoff
self.building.origin_z = self.building.origin_z - 25; //often fixes tesla not touchin ceiling//+ 25 //Finish liftoff
sprint(self, PRINT_HIGH, "You turretize the tesla\n");
2001-07-17 05:58:10 +00:00
if (self.building.job == 1 && self.building.tf_items & NIT_TESLA_CLOAKING)
2001-07-17 05:58:10 +00:00
{
local entity TSelf, OSelfB;
OSelfB=self.building;
TSelf=TeslaClone(OSelfB);
dremove(OSelfB);
self.building=TSelf; // NEEDED? teslaclone should have updated this pointer anyway..
spawnFOG(self.building.origin);
sound (self.building, CHAN_MISC, "misc/r_tele4.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +00:00
}
self.building.angles_z = 180;
self.building.flags = self.building.flags - (self.building.flags & FL_ONGROUND);
self.building.movetype = MOVETYPE_FLY;
2001-07-17 05:58:10 +00:00
self.building.velocity_z = 200;
setsize (self.building, '-16 -16 10', '16 16 40');//35');//'-16 -16 -40', '16 16 -10'); //WK -40, -10
self.building.tf_items = self.building.tf_items | NIT_TURRET;
2001-07-17 05:58:10 +00:00
self.building.is_haxxxoring=1; //flag determines if flying and it's used for cloaking teslas, set to 0 when landed
}
}
}
}
if (inp == 5) { //Improved Targeter
if (Check_Tesla_Ups(1, self, self.building, 10, 1))
{
self.building.tf_items = self.building.tf_items | NIT_SCANNER;
2001-07-17 05:58:10 +00:00
}
}
//CH its commented out here and in the centerprint - OfN nomore!
if (inp == 6) { //Cloaking tesla
if (Check_Tesla_Ups(1, self, self.building, 11, 1))
{
self.building.tf_items = self.building.tf_items | NIT_TESLA_CLOAKING;
2001-07-17 05:58:10 +00:00
if (self.building.job == 1)
{
local entity oself;
oself=self;
self=self.building;
self.job=3; //- OfN - this flag indicates it must skip condition on lose_glow
Tesla_Lose_Glow();
self=oself;
}
}
}
if (inp == 7) { //Repair and Rearm
Menu_EngineerRepair_Tesla();
}
if (inp == 8) {
Menu_EngineerDismantle_Tesla();
}
// if (inp == 9) {
// }
if (inp == 10) {
self.impulse = 0;
Menu_EngineerFix_Tesla();
self.current_menu = MENU_ENGINEER_FIX_TESLA;
2001-07-17 05:58:10 +00:00
}
if (inp >= 1 && inp <= 9)
{
ResetMenu();
self.impulse = 0;
if (self.ammo_cells < 0) self.ammo_cells = 0;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
}
};
//============================================================================
// Menu for using buildings
void() Menu_Dispenser =
{
CenterPrint(self, "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n<EFBFBD>.. Withdraw some ammo \n<EFBFBD>.. Withdraw some Armor \n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n");
};
void(float inp) Menu_Dispenser_Input =
{
if (self.classname != "player" || self.building == world)
return;
local float am, empty;
empty = FALSE;
2001-07-17 05:58:10 +00:00
if (inp == 1)
{
if (self.building.ammo_shells == 0 && self.building.ammo_nails == 0 &&
self.building.ammo_rockets == 0 && self.building.ammo_cells == 0)
{
empty = TRUE;
2001-07-17 05:58:10 +00:00
}
else
{
// shells
am = self.maxammo_shells - self.ammo_shells;
if (am > self.building.ammo_shells)
am = self.building.ammo_shells;
self.building.ammo_shells = self.building.ammo_shells - am;
self.ammo_shells = self.ammo_shells + am;
// nails
am = self.maxammo_nails - self.ammo_nails;
if (am > self.building.ammo_nails)
am = self.building.ammo_nails;
self.building.ammo_nails = self.building.ammo_nails - am;
self.ammo_nails = self.ammo_nails + am;
// rockets
am = self.maxammo_rockets - self.ammo_rockets;
if (am > self.building.ammo_rockets)
am = self.building.ammo_rockets;
self.building.ammo_rockets = self.building.ammo_rockets - am;
self.ammo_rockets = self.ammo_rockets + am;
// cells
am = self.maxammo_cells - self.ammo_cells;
if (am > self.building.ammo_cells)
am = self.building.ammo_cells;
self.building.ammo_cells = self.building.ammo_cells - am;
self.ammo_cells = self.ammo_cells + am;
// SB gren1s
local float grenammo;
/*if (self.tf_items & NIT_AMMO_BANDOLIER)
2001-07-17 05:58:10 +00:00
grenammo = 5;
else
grenammo = 4;*/
grenammo = GetMaxGrens(self,1);
am = grenammo - self.no_grenades_1;
if (am*15 > self.building.ammo_rockets)
am = floor(self.building.ammo_rockets / 15);
self.building.ammo_rockets = self.building.ammo_rockets - am * 15;
self.no_grenades_1 = self.no_grenades_1 + am;
// SB gren2s
grenammo = GetMaxGrens(self,2);
am = grenammo - self.no_grenades_2;
if (am*15 > self.ammo_rockets)
am = floor(self.ammo_rockets / 15);
self.building.ammo_rockets = self.building.ammo_rockets - am * 15;
self.no_grenades_2 = self.no_grenades_2 + am;
}
}
else if (inp == 2)
{
if (self.building.is_malfunctioning & SCREWUP_FOUR)
2001-07-17 05:58:10 +00:00
{
sprint(self,PRINT_HIGH,"Trapped dispenser, have a nice day!\n");
TF_T_Damage(self.building, self.building, self.building, 500, 0, TF_TD_OTHER);
2001-07-17 05:58:10 +00:00
return;
}
if (self.building.armorvalue == 0)
{
empty = TRUE;
2001-07-17 05:58:10 +00:00
}
else
{
// armor
am = self.maxarmor - self.armorvalue;
if (am > self.building.armorvalue)
am = self.building.armorvalue;
if (self.armortype == 0)
{
self.armortype = self.armor_allowed;
//self.items = self.items | IT_ARMOR1;
2001-07-17 05:58:10 +00:00
W_SetCurrentAmmo();
}
self.building.armorvalue = self.building.armorvalue - am;
self.armorvalue = self.armorvalue + am;
}
}
if (inp >= 1 && inp <= 3)
{
if (empty)
sprint(self, PRINT_HIGH, "The dispenser is empty.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.impulse = 0;
self.building = world;
self.building_wait = time + 0.5;
bound_other_ammo(self);
if (self.armorvalue == 0)
{
self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
2001-07-17 05:58:10 +00:00
}
W_SetCurrentAmmo();
}
// Otherwise, the impulse is passed on
};
//----------------------------------------------------------------------
// Rod May kk@rod.net
// mstr and mstr2 and eqstr only exist to cut down on a crap load of code.
//
string(float v,float m1,float m2,string s1,string s2,string s3,string s4) mstr =
{
// return string for matching masks (m1 and m2) on value v.
// neither match: s1, first only: s2, second only: s3, both: s4
if ((v & m1) && (v & m2)) return s4;
if (v & m1) return s2;
if (v & m2) return s3;
return s1;
};
string(float v1,float v2,float m1,float m2,string s1,string s2,string s3,string s4) mstr2 =
{
// same func as above but with a value for each mask.
// return string for matching mask m1 on value v1, and m2 on v2.
if ((v1 & m1) && (v2 & m2)) return s4;
if (v1 & m1) return s2;
if (v2 & m2) return s3;
return s1;
};
string(float v,float v1,float v2,string s1,string s2,string s3) eqstr =
{
// return string based on v equals values v1 OR v2
// neither equal: s1, first only: s2, second only: s3
if (v == v1) return s2;
if (v == v2) return s3;
return s1;
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//WK =====================================================================
// Prints Menu of Primary Weapons Available
// =====================================================================
void() Menu_PrimaryWeapon =
{
local string temp;
temp = ftos(self.money);
local string msg_custom;
local string msg_upgrade;
local string l1,l2,l3,l4;
l1 = mstr(self.weapons_carried, WEAP_SNIPER_RIFLE, WEAP_ASSAULT_CANNON,
2001-07-17 05:58:10 +00:00
" .. Sniper Rifle <20> 4000\n .. Assault Cannon <20> 3000\n",
"* .. Sniper Rifle <20> 4000\n .. Assault Cannon <20> 3000\n",
" .. Sniper Rifle <20> 4000\n* .. Assault Cannon <20> 3000\n",
"* .. Sniper Rifle <20> 4000\n* .. Assault Cannon <20> 3000\n");
l2 = mstr(self.weapons_carried, WEAP_ROCKET_LAUNCHER, WEAP_INCENDIARY,
2001-07-17 05:58:10 +00:00
" <20>.. Rocket Launcher <20> 3000\n <20>.. Pyro Toys <20> 3000\n",
"* <20>.. Rocket Launcher <20> 3000\n <20>.. Pyro Toys <20> 3000\n",
" <20>.. Rocket Launcher <20> 3000\n* <20>.. Pyro Toys <20> 3000\n",
"* <20>.. Rocket Launcher <20> 3000\n* <20>.. Pyro Toys <20> 3000\n");
l3 = mstr(self.weapons_carried, WEAP_GRENADE_LAUNCHER, WEAP_LIGHTNING,
2001-07-17 05:58:10 +00:00
" <20>.. Grenade Set <20> 2200\n <20>.. Lightning Gun <20> 2200\n",
"* <20>.. Grenade Set <20> 2200\n <20>.. Lightning Gun <20> 2200\n",
" <20>.. Grenade Set <20> 2200\n* <20>.. Lightning Gun <20> 2200\n",
"* <20>.. Grenade Set <20> 2200\n* <20>.. Lightning Gun <20> 2200\n");
l4 = " <20>.. Light Assault <20> 1800\n<EFBFBD>.. \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.weapons_carried & WEAP_LIGHT_ASSAULT)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Light Assault <20> 1800\n<EFBFBD>.. \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.done_custom & CUSTOM_SELLING)
2001-07-17 05:58:10 +00:00
msg_custom = " dollars left\n\n*CURRENTLY SELLING FRAGS*\nTyping <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> again will waste your cash\n";
else
msg_custom = " dollars left\n\nUse the <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> command to start over\nUse the <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> command to sell frags\n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Primary Weapons <11><>\n\n",l1,l2,l3,l4,temp,msg_custom);
}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void(float inp) Menu_PrimaryWeapon_Input =
{
local string st;
st = infokey(world, "no_spam");
if (inp <= 10 && inp >= 1)
{
//Snipe
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 4000
if (inp == 1)
if (self.weapons_carried & WEAP_SNIPER_RIFLE) //Already have it
2001-07-17 05:58:10 +00:00
{
PrintRefund(PRICE);
self.weapons_carried = self.weapons_carried - WEAP_SNIPER_RIFLE;
self.weapons_carried = self.weapons_carried - WEAP_AUTO_RIFLE;
2001-07-17 05:58:10 +00:00
self.maxammo_shells = self.maxammo_shells - 75;
}
else if (self.money >= PRICE) {
self.money = self.money - PRICE;
self.weapons_carried = self.weapons_carried | WEAP_SNIPER_RIFLE | WEAP_AUTO_RIFLE;
2001-07-17 05:58:10 +00:00
self.maxammo_shells = self.maxammo_shells + 75;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
if (inp == 2)
{
if (st == "on") //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyWeapon(3000,WEAP_ASSAULT_CANNON);
2001-07-17 05:58:10 +00:00
}
if (inp == 3)
{
BuyWeapon(3000,WEAP_ROCKET_LAUNCHER);
2001-07-17 05:58:10 +00:00
}
//IC
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 3000
if (inp == 4)
{
if (self.weapons_carried & WEAP_INCENDIARY) //Already have it
2001-07-17 05:58:10 +00:00
{
//Clean up asbestos armor
if (!(self.tf_items & NIT_ASBESTOS))
2001-07-17 05:58:10 +00:00
self.money = self.money - 750; //Sync this with asbestos
self.tf_items = self.tf_items - (self.tf_items & NIT_ASBESTOS);
2001-07-17 05:58:10 +00:00
PrintRefund(PRICE);
self.weapons_carried = self.weapons_carried - WEAP_INCENDIARY;
self.weapons_carried = self.weapons_carried - WEAP_FLAMETHROWER;
2001-07-17 05:58:10 +00:00
self.maxammo_cells = self.maxammo_cells - 200;
self.maxammo_rockets = self.maxammo_rockets - 60;
}
else if (self.money >= PRICE)
2001-07-17 05:58:10 +00:00
{
self.money = self.money - PRICE;
self.weapons_carried = self.weapons_carried | WEAP_INCENDIARY | WEAP_FLAMETHROWER;
2001-07-17 05:58:10 +00:00
//Give em asbestos armor, and a refund if they have it
if (self.tf_items & NIT_ASBESTOS)
2001-07-17 05:58:10 +00:00
self.money = self.money + 750; //Sync this with asbestos price
self.tf_items = self.tf_items | NIT_ASBESTOS;
2001-07-17 05:58:10 +00:00
self.maxammo_cells = self.maxammo_cells + 200;
self.maxammo_rockets = self.maxammo_rockets + 60;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
//}
}
if (inp == 5)
{
BuyWeapon(2200,WEAP_GRENADE_LAUNCHER);
2001-07-17 05:58:10 +00:00
}
if (inp == 6)
{
BuyWeapon(2200,WEAP_LIGHTNING);
2001-07-17 05:58:10 +00:00
}
if (inp == 7)
{
BuyWeapon(1800,WEAP_LIGHT_ASSAULT);
2001-07-17 05:58:10 +00:00
}
// if (inp == 8) {
// centerprint(self, "No previous menu\n");
// }
if (inp == 9)
{
Menu_SecondaryWeapon();
self.current_menu = MENU_SECONDARY_WEAPON;
2001-07-17 05:58:10 +00:00
}
if (inp == 10)
{
DropFromCustomClassGen();
}
self.impulse = 0;
}
// Otherwise, the impulse is passed on
// SB to where, nobody knows
};
// ====================================================================
// Prints Menu of Secondary Weapons Available
// ====================================================================
void() Menu_SecondaryWeapon =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
/*l1 = mstr2(self.weapons_carried,self.cutf_items, WEAP_DAEDALUS, CUTF_KNIFE,
2001-07-17 05:58:10 +00:00
" .. Impulse Rifle <20> 1400\n .. Knife <20> 650\n",
"* .. Impulse Rifle <20> 1400\n .. Knife <20> 650\n",
" .. Impulse Rifle <20> 1400\n* .. Knife <20> 650\n",
"* .. Impulse Rifle <20> 1400\n* .. Knife <20> 650\n");*/
l1 = mstr2(self.weapons_carried,self.cutf_items, WEAP_SNG, CUTF_KNIFE,
2001-07-17 05:58:10 +00:00
" .. Super Nailgun <20> 800\n .. Knife <20> 650\n",
"* .. Super Nailgun <20> 800\n .. Knife <20> 650\n",
" .. Super Nailgun <20> 800\n* .. Knife <20> 650\n",
"* .. Super Nailgun <20> 800\n* .. Knife <20> 650\n");
l2 = mstr(self.weapons_carried, WEAP_SUPER_SHOTGUN, WEAP_LASER,
2001-07-17 05:58:10 +00:00
" <20>.. Double Barrel <20> 575\n <20>.. Rail Gun <20> 500\n",
"* <20>.. Double Barrel <20> 575\n <20>.. Rail Gun <20> 500\n",
" <20>.. Double Barrel <20> 575\n* <20>.. Rail Gun <20> 500\n",
"* <20>.. Double Barrel <20> 575\n* <20>.. Rail Gun <20> 500\n");
l3 = mstr(self.weapons_carried, WEAP_NAILGUN, WEAP_TRANQ,
2001-07-17 05:58:10 +00:00
" <20>.. Nail Gun <20> 400\n <20>.. Tranquilizer <20> 300\n",
"* <20>.. Nail Gun <20> 400\n <20>.. Tranquilizer <20> 300\n",
" <20>.. Nail Gun <20> 400\n* <20>.. Tranquilizer <20> 300\n",
"* <20>.. Nail Gun <20> 400\n* <20>.. Tranquilizer <20> 300\n");
l4 = " <20>.. Single Barrel <20> 50\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.weapons_carried & WEAP_SHOTGUN)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Single Barrel <20> 50\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD><EFBFBD> Secondary Weapons <11><>\n\n",l1,l2,l3,l4,temp," dollars left\n");
}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void(float inp) Menu_SecondaryWeapon_Input =
{
if (inp <= 10 && inp >= 1)
{
if (inp == 1) {
//BuyWeapon(1400, WEAP_DAEDALUS);
BuyWeapon(800,WEAP_SNG);
2001-07-17 05:58:10 +00:00
//self.maxammo_
}
//Knife
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 650
if (inp == 2) {
if (self.cutf_items & CUTF_KNIFE) //Already have it
2001-07-17 05:58:10 +00:00
{
//Clean up knife-less warlocks (sync this with Custom.qc)
if (self.job & JOB_WARLOCK) { // OfN Fix getting extra money with demon lore
sprint(self, PRINT_HIGH, "You will need this knife being a warlock!\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
PrintRefund(PRICE);
self.cutf_items = self.cutf_items - CUTF_KNIFE;
2001-07-17 05:58:10 +00:00
}
else if (self.money >= PRICE) {
self.money = self.money - PRICE;
self.cutf_items = self.cutf_items | CUTF_KNIFE;
2001-07-17 05:58:10 +00:00
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyWeapon(575,WEAP_SUPER_SHOTGUN);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyWeapon(500,WEAP_LASER);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyWeapon(400,WEAP_NAILGUN);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyWeapon(300,WEAP_TRANQ);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyWeapon(50,WEAP_SHOTGUN);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_PrimaryWeapon();
self.current_menu = MENU_PRIMARY_WEAPON;
2001-07-17 05:58:10 +00:00
}
if (inp == 9)
{
Menu_MiscWeapon();
self.current_menu = MENU_MISC_WEAPON;
2001-07-17 05:58:10 +00:00
}
if (inp == 10)
{
DropFromCustomClassGen();
}
self.impulse = 0;
}
};
// ====================================================================
// Prints Menu of Secondary Weapons Available
// ====================================================================
void() Menu_MiscWeapon =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.weapons_carried, WEAP_MAUSER, WEAP_AIRF,
2001-07-17 05:58:10 +00:00
" .. Mauser <20> 2400\n .. Air-Fist <20> 1600\n",
"* .. Mauser <20> 2400\n .. Air-Fist <20> 1600\n",
" .. Mauser <20> 2400\n* .. Air-Fist <20> 1600\n",
"* .. Mauser <20> 2400\n* .. Air-Fist <20> 1600\n");
l2 = mstr2(self.weapons_carried, self.weapons_carried, WEAP_DAEDALUS, WEAP_LASERCANNON,
2001-07-17 05:58:10 +00:00
" <20>.. Impulse Rifle <20> 1500\n <20>.. Laser Cannon <20> 1200\n",
"* <20>.. Impulse Rifle <20> 1500\n <20>.. Laser Cannon <20> 1200\n",
" <20>.. Impulse Rifle <20> 1500\n* <20>.. Laser Cannon <20> 1200\n",
"* <20>.. Impulse Rifle <20> 1500\n* <20>.. Laser Cannon <20> 1200\n");
l3="\n\n"; l4="\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
/*l3 = mstr(self.weapons_carried, WEAP_LASER, WEAP_NAILGUN,
2001-07-17 05:58:10 +00:00
" <20>.. Railgun <20> 500\n <20>.. Nailgun <20> 800\n",
"* <20>.. Railgun <20> 500\n <20>.. Nailgun <20> 800\n",
" <20>.. Railgun <20> 500\n* <20>.. Nailgun <20> 800\n",
"* <20>.. Railgun <20> 500\n* <20>.. Nailgun <20> 800\n");
l2 = " <20>.. Impulse Rifle <20> 1500\n\n\n\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.weapons_carried & WEAP_DAEDALUS)
2001-07-17 05:58:10 +00:00
l2 = "* <20>.. Impulse Rifle <20> 1500\n\n\n\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";*/
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD><EFBFBD> Misc<73>Extra Weapons <11><>\n\n",l1,l2,l3,l4,temp," dollars left\n");
}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void(float inp) Menu_MiscWeapon_Input =
{
if (inp <= 10 && inp >= 1)
{
if (inp == 1) {
BuyWeapon(2400, WEAP_MAUSER);
//sprint(self, PRINT_HIGH, "Unfortunately all stocks of this item have been requisitioned to increase the glory of the Queen. God save the Queen!\n");
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyWeapon(1600,WEAP_AIRF);
//sprint(self, PRINT_HIGH, "Unfortunately all stocks of this item have been requisitioned to increase the glory of the Queen. God save the Queen!\n");
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyWeapon(1500,WEAP_DAEDALUS);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
if (no_laser)
{
sprint(self,PRINT_HIGH,"Laser cannon is disabled, sorry.\n");
2001-07-17 05:58:10 +00:00
self.impulse = 0;
return;
}
BuyWeapon(1200,WEAP_LASERCANNON);
2001-07-17 05:58:10 +00:00
}/*
if (inp == 5) {
BuyWeapon(500,WEAP_LASER);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyWeapon(800,WEAP_NAILGUN);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyWeapon(300,WEAP_TRANQ);
2001-07-17 05:58:10 +00:00
}*/
if (inp == 8) {
Menu_SecondaryWeapon();
self.current_menu = MENU_SECONDARY_WEAPON;
2001-07-17 05:58:10 +00:00
}
if (inp == 9)
{
Menu_Legs();
self.current_menu = MENU_LEGS;
2001-07-17 05:58:10 +00:00
}
if (inp == 10)
{
DropFromCustomClassGen();
}
self.impulse = 0;
}
};
// =============================
// Prints Menu of Legs for Sale
// =============================
void() Menu_Legs =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = " .. Cheetah <20> 9000\n .. Cougar <20> 6000\n";
l2 = " <20>.. White Rhino <20> 3250\n <20>.. Scrub Jay <20> 2500\n";
l3 = " <20>.. KGB Officer <20> 1250\n <20>.. Black Mamba <20> 500\n";
l4 = " <20>.. ImperialPenguin <20> 0\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
/*
650 9000
420 6000
330 3250
310 2500
290 1250
270 500
250 0
*/
if (self.custom_speed == 650 )
l1 = "* .. Cheetah <20> 9000\n .. Cougar <20> 6000\n";
else if (self.custom_speed == 420 )
l1 = " .. Cheetah <20> 9000\n* .. Cougar <20> 6000\n";
else if (self.custom_speed == 330 )
l2 = "* <20>.. White Rhino <20> 3250\n <20>.. Scrub Jay <20> 2500\n";
else if (self.custom_speed == 310 )
l2 = " <20>.. White Rhino <20> 3250\n* <20>.. Scrub Jay <20> 2500\n";
else if (self.custom_speed == 290)
l3 = "* <20>.. KGB Officer <20> 1250\n <20>.. Black Mamba <20> 500\n";
else if (self.custom_speed == 270)
l3 = " <20>.. KGB Officer <20> 1250\n* <20>.. Black Mamba <20> 500\n";
else
l4 = "* <20>.. ImperialPenguin <20> 0\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD><EFBFBD> Leg Enhancements <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
}; //<2F><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void(float inp) Menu_Legs_Input =
{
//First, prevent them from getting high speed while upgraded
if (inp < 3 && self.done_custom & CUSTOM_SELLING)
2001-07-17 05:58:10 +00:00
{
sprint(self,PRINT_HIGH,"The upgraded CustomTF soldier is a fighting machine. He doesn't have access to fast legs\n");
2001-07-17 05:58:10 +00:00
self.impulse = 0;
return;
}
//Second, sell off our current legs
if (inp < 8) {
if (self.custom_speed == 650) {
PrintRefund(9000);
self.custom_speed = 250;
if (self.impulse == 1) {self.impulse = 0; return;}
}
else if (self.custom_speed == 420) {
PrintRefund(6000);
self.custom_speed = 250;
if (self.impulse == 2) {self.impulse = 0; return;}
}
else if (self.custom_speed == 330) {
PrintRefund(3250);
self.custom_speed = 250;
if (self.impulse == 3) {self.impulse = 0; return;}
}
else if (self.custom_speed == 310) {
PrintRefund(2500);
self.custom_speed = 250;
if (self.impulse == 4) {self.impulse = 0; return;}
}
else if (self.custom_speed == 290) {
PrintRefund(1250);
self.custom_speed = 250;
if (self.impulse == 5) {self.impulse = 0; return;}
}
else if (self.custom_speed == 270) {
PrintRefund(500);
self.custom_speed = 250;
if (self.impulse == 6) {self.impulse = 0; return;}
}
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 9000
if (inp == 1) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 650;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 6000
if (inp == 2) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 420;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 3250
if (inp == 3) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 330;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 2500
if (inp == 4) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 310;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 1250
if (inp == 5) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 290;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 500
if (inp == 6) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 270;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 0
if (inp == 7) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.custom_speed = 250;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_MiscWeapon();
self.current_menu = MENU_MISC_WEAPON;
2001-07-17 05:58:10 +00:00
}
if (inp == 9)
{
Menu_Health();
self.current_menu = MENU_HEALTH;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ==========================================
// Prints Menu of Armor and Health Available
// ==========================================
void() Menu_Health =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = eqstr(self.maxarmor, 75, 100,
" .. 75 Green armor <20> 200\n .. 100 Yellow <20> 700\n",
"* .. 75 Green armor <20> 200\n .. 100 Yellow <20> 700\n",
" .. 75 Green armor <20> 200\n* .. 100 Yellow <20> 700\n");
l2 = eqstr(self.maxarmor, 150, 200,
" <20>.. 150 Red <20> 1400\n <20>.. 200 Red <20> 2200\n",
"* <20>.. 150 Red <20> 1400\n <20>.. 200 Red <20> 2200\n",
" <20>.. 150 Red <20> 1400\n* <20>.. 200 Red <20> 2200\n");
l3 = " <20>.. 300 Red <20> 3600\n";
if (self.maxarmor == 300 )
l3 = "* <20>.. 300 Red <20> 3600\n";
l4 = " <20>.. +50 Health <20> 1000\n <20>.. +5 Health <20> 100\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Armor and Health <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Health_Input =
{
//Fix multiple armor buy bug
//WW: Modded to allow to sell armor back
if (inp >= 1 && inp <= 5 && self.maxarmor > 0) {
if (self.maxarmor == 75)
{
if (inp == 1) {
inp = 0;
PrintRefund(200);
}
else
self.money = self.money + 200;
}
else if (self.maxarmor == 100)
{
if (inp == 2) {
inp = 0;
PrintRefund(700);
}
else
self.money = self.money + 700;
}
else if (self.maxarmor == 150)
{
if (inp == 3) {
inp = 0;
PrintRefund(1400);
}
else
self.money = self.money + 1400;
}
else if (self.maxarmor == 200)
{
if (inp == 4) {
inp = 0;
PrintRefund(2200);
}
else
self.money = self.money + 2200;
}
else if (self.maxarmor == 300)
{
if (inp == 5) {
inp = 0;
PrintRefund(3600);
}
else
self.money = self.money + 3600;
}
self.armor_allowed = self.armorvalue = self.maxarmor = 0;
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 200
if (inp == 1) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.maxarmor = 75;
self.armorvalue = self.maxarmor;
self.armortype = 0.3; // Green
self.armor_allowed = 0.3; //Green max
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 700
if (inp == 2) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.maxarmor = 100;
self.armorvalue = self.maxarmor;
self.armortype = 0.6; // Yellow
self.armor_allowed = 0.6; //Yellow max
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 1400
if (inp == 3) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.maxarmor = 150;
self.armorvalue = self.maxarmor;
self.armortype = 0.8; //Red armor
self.armor_allowed = 0.8; //Max
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 2200
if (inp == 4) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.maxarmor = 200;
self.armorvalue = self.maxarmor;
self.armortype = 0.8; //Red armor
self.armor_allowed = 0.8; //Red max
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 3600
if (inp == 5) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.maxarmor = 300;
self.armorvalue = self.maxarmor;
self.armortype = 0.8; //Red armor (used to be 0.9)
self.armor_allowed = 0.8; //Red max
PrintMoney();
W_SetCurrentAmmo ();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 1000
if (inp == 6) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.max_health = self.max_health + 50;
self.health = self.max_health;
PrintMoney();
}
else
{
// WW: Modded to allow to sell health back
// Buying #6 with <#7 money resets hp
if (self.money < 100)
{
self.money = self.money + ((self.max_health - 50) / 5) * 100;
self.max_health = 50;
self.health = self.max_health;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 100
if (inp == 7) {
if (self.money >= PRICE) {
self.money = self.money - PRICE;
2001-07-17 05:58:10 +00:00
self.max_health = self.max_health + 5;
self.health = self.max_health;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
if (inp == 8)
{
Menu_Legs();
self.current_menu = MENU_LEGS;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Armor();
self.current_menu = MENU_ARMOR;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ==========================================
// Prints Menu of Special Armor and Ammo
// ==========================================
void() Menu_Armor =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.tf_items, NIT_CERAMIC, NIT_GEL,
2001-07-17 05:58:10 +00:00
" .. Ceramic Armor <20> 575\n .. Impact Armor <20> 625\n",
"* .. Ceramic Armor <20> 575\n .. Impact Armor <20> 625\n",
" .. Ceramic Armor <20> 575\n* .. Impact Armor <20> 625\n",
"* .. Ceramic Armor <20> 575\n* .. Impact Armor <20> 625\n");
l2 = mstr(self.tf_items, NIT_ASBESTOS, NIT_KEVLAR,
2001-07-17 05:58:10 +00:00
" <20>.. Asbestos Armor <20> 750\n <20>.. Kevlar Armor <20> 1200\n",
"* <20>.. Asbestos Armor <20> 750\n <20>.. Kevlar Armor <20> 1200\n",
" <20>.. Asbestos Armor <20> 750\n* <20>.. Kevlar Armor <20> 1200\n",
"* <20>.. Asbestos Armor <20> 750\n* <20>.. Kevlar Armor <20> 1200\n");
l3 = mstr(self.tf_items, NIT_BLAST, NIT_AMMO_BACKPACK,
2001-07-17 05:58:10 +00:00
" <20>.. Blast Armor <20> 1500\n <20>.. Ammo Backpack <20> 300\n",
"* <20>.. Blast Armor <20> 1500\n <20>.. Ammo Backpack <20> 300\n",
" <20>.. Blast Armor <20> 1500\n* <20>.. Ammo Backpack <20> 300\n",
"* <20>.. Blast Armor <20> 1500\n* <20>.. Ammo Backpack <20> 300\n");
l4 = " <20>.. Ammo Bandolier <20> 200\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tf_items & NIT_AMMO_BANDOLIER)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Ammo Bandolier <20> 200\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Special Armor<6F>Ammo <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Armor_Input =
{
if (inp == 1) {
BuyItem(575,NIT_CERAMIC);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyItem(625, NIT_GEL);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyItem(750,NIT_ASBESTOS);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyItem(1200,NIT_KEVLAR);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyItem(1500,NIT_BLAST);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyItem(300,NIT_AMMO_BACKPACK);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyItem(200,NIT_AMMO_BANDOLIER);
2001-07-17 05:58:10 +00:00
}
if (inp == 8)
{
Menu_Health();
self.current_menu = MENU_HEALTH;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Special();
self.current_menu = MENU_SPECIAL;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ==================================
// Prints Menu of Specials Available
// ==================================
void() Menu_Special =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.tf_items, NIT_SCANNER, NIT_AUTOSCANNER,
2001-07-17 05:58:10 +00:00
" .. Scanner <20> 650\n .. Auto-Scanner <20> 250\n",
"* .. Scanner <20> 650\n .. Auto-Scanner <20> 250\n",
" .. Scanner <20> 650\n* .. Auto-Scanner <20> 250\n",
"* .. Scanner <20> 650\n* .. Auto-Scanner <20> 250\n");
l2 = mstr2(self.cutf_items, self.weapons_carried, CUTF_DETPACK, WEAP_MEDIKIT,
2001-07-17 05:58:10 +00:00
" <20>.. Detpack <20> 800\n <20>.. Medikit <20> 1550\n",
"* <20>.. Detpack <20> 800\n <20>.. Medikit <20> 1550\n",
" <20>.. Detpack <20> 800\n* <20>.. Medikit <20> 1550\n",
"* <20>.. Detpack <20> 800\n* <20>.. Medikit <20> 1550\n");
l3 = mstr2(self.cutf_items, self.tf_items, CUTF_SPY_KIT, NIT_SCUBA,
2001-07-17 05:58:10 +00:00
" <20>.. Spy Kit <20> 2000\n <20>.. Scuba Gear <20> 1000\n",
"* <20>.. Spy Kit <20> 2000\n <20>.. Scuba Gear <20> 1000\n",
" <20>.. Spy Kit <20> 2000\n* <20>.. Scuba Gear <20> 1000\n",
"* <20>.. Spy Kit <20> 2000\n* <20>.. Scuba Gear <20> 1000\n");
l4 = " <20>.. Grapple <20> 3000\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.weapons_carried & WEAP_HOOK)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Grapple <20> 3000\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Special Items <11><>\n\n",l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Special_Input =
{
local string st2;
//Scanner
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 650
//st = infokey(world, "no_grapple");
st2 = infokey(world, "no_spam");
if (inp == 1) {
if (self.tf_items & NIT_SCANNER)
2001-07-17 05:58:10 +00:00
{
//Clean up auto-medic (sync this with Custom.qc)
if (self.tf_items & NIT_AUTOSCANNER)
2001-07-17 05:58:10 +00:00
self.money = self.money + 250; //Sync this with price below
self.tf_items = self.tf_items - (self.tf_items & NIT_AUTOSCANNER);
2001-07-17 05:58:10 +00:00
PrintRefund(PRICE);
self.tf_items = self.tf_items - NIT_SCANNER;
self.tf_items_flags = self.tf_items_flags - (self.tf_items & NIT_SCANNER_ENEMY);
2001-07-17 05:58:10 +00:00
}
else if (self.money >= PRICE) {
self.money = self.money - PRICE;
self.tf_items = self.tf_items | NIT_SCANNER;
self.tf_items_flags = self.tf_items_flags | NIT_SCANNER_ENEMY;
2001-07-17 05:58:10 +00:00
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) { //Sync this with scanner above
BuyItem(250,NIT_AUTOSCANNER);
2001-07-17 05:58:10 +00:00
}
//Detpack
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 800
if (inp == 3) {
if (st2 == "on") {//If admin disable it
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
// self.impulse=0;
return;
}
if (self.cutf_items & CUTF_DETPACK) //Already have it
2001-07-17 05:58:10 +00:00
{
PrintRefund(PRICE);
self.cutf_items = self.cutf_items - CUTF_DETPACK;
2001-07-17 05:58:10 +00:00
self.maxammo_detpack = self.maxammo_detpack - 1;
}
else if (self.money >= PRICE) {
self.money = self.money - PRICE;
self.cutf_items = self.cutf_items | CUTF_DETPACK;
2001-07-17 05:58:10 +00:00
self.maxammo_detpack = self.maxammo_detpack + 1;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
#undef PRICE
2001-07-17 05:58:10 +00:00
#define PRICE 1550
if (inp == 4) {
if (self.weapons_carried & WEAP_MEDIKIT)
2001-07-17 05:58:10 +00:00
{
PrintRefund(PRICE);
self.weapons_carried = self.weapons_carried - WEAP_MEDIKIT;
2001-07-17 05:58:10 +00:00
self.maxammo_medikit = self.maxammo_medikit - 80;
}
else if (self.money >= PRICE) {
self.money = self.money - PRICE;
self.weapons_carried = self.weapons_carried | WEAP_MEDIKIT;
2001-07-17 05:58:10 +00:00
self.maxammo_medikit = self.maxammo_medikit + 80;
PrintMoney();
}
else
PrintNotEnoughMoney(PRICE);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyCuTF(2000,CUTF_SPY_KIT);
2001-07-17 05:58:10 +00:00
}
//Self-Contained Underwater Breathing Apparatus
if (inp == 6) {
BuyItem(1000,NIT_SCUBA);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
if (no_grapple == 1) //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled the grapple on this map.\n");
2001-07-17 05:58:10 +00:00
self.impulse = 0;
return;
}
else if (allow_hook) //If map allows it...
sprint(self,PRINT_HIGH,"You can't sell your grapple on this map!\n");
2001-07-17 05:58:10 +00:00
else
BuyWeapon(3000,WEAP_HOOK);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Armor();
self.current_menu = MENU_ARMOR;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Special2();
self.current_menu = MENU_SPECIAL2;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ============================================//
// Prints Menu of Specials Available //
// ============================================//
void() Menu_Special2 =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.cutf_items, CUTF_JAMMER, CUTF_CYBERAUG,
2001-07-17 05:58:10 +00:00
" .. Scanner Jammer <20> 1000\n .. CyberAug Unit <20> 800\n",
"* .. Scanner Jammer <20> 1000\n .. CyberAug Unit <20> 800\n",
" .. Scanner Jammer <20> 1000\n* .. CyberAug Unit <20> 800\n",
"* .. Scanner Jammer <20> 1000\n* .. CyberAug Unit <20> 800\n");
/*
l2 = mstr(self.cutf_items, CUTF_SENSOR, CUTF_HOLO,
2001-07-17 05:58:10 +00:00
" <20>.. Motion sensor <20> 450\n <20>.. Holo device <20> 600\n",
"* <20>.. Motion sensor <20> 450\n <20>.. Holo device <20> 600\n",
" <20>.. Motion sensor <20> 450\n* <20>.. Holo device <20> 600\n",
"* <20>.. Motion sensor <20> 450\n* <20>.. Holo device <20> 600\n");
*/
l2 = mstr(self.cutf_items, CUTF_SENSOR, CUTF_FIELDGEN,
2001-07-17 05:58:10 +00:00
" <20>.. Motion Sensor <20> 450\n <20>.. Field Generator <20> 1600\n",
"* <20>.. Motion Sensor <20> 450\n <20>.. Field Generator <20> 1600\n",
" <20>.. Motion Sensor <20> 450\n* <20>.. Field Generator <20> 1600\n",
"* <20>.. Motion Sensor <20> 450\n* <20>.. Field Generator <20> 1600\n");
l3 = mstr(self.cutf_items, CUTF_FULLARMOUR, CUTF_TOSSABLEDET,
2001-07-17 05:58:10 +00:00
" <20>.. Full Armour <20> 250\n <20>.. C4 Tossable Det <20> 1200\n",
"* <20>.. Full Armour <20> 250\n <20>.. C4 Tossable Det <20> 1200\n",
" <20>.. Full Armour <20> 250\n* <20>.. C4 Tossable Det <20> 1200\n",
"* <20>.. Full Armour <20> 250\n* <20>.. C4 Tossable Det <20> 1200\n");
l4 = " <20>.. Dispenser <20> 600\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.cutf_items & CUTF_DISPENSER)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Dispenser <20> 600\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> More Special Items <11><>\n\n",l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Special2_Input =
{
local string st;
st = infokey(world, "no_spam");
if (inp == 1)//SB Jammer
BuyCuTF(1000, CUTF_JAMMER);
2001-07-17 05:58:10 +00:00
else if (inp == 2)//SB cybernetic augmentation
{
if (self.cutf_items & CUTF_CYBERAUG)
2001-07-17 05:58:10 +00:00
{
self.maxammo_medikit = self.maxammo_medikit - 80;
self.maxammo_cells = self.maxammo_cells - 80;
}
else
{
self.maxammo_medikit = self.maxammo_medikit + 80;
self.maxammo_cells = self.maxammo_cells + 80;
}
BuyCuTF(800,CUTF_CYBERAUG);
2001-07-17 05:58:10 +00:00
}
else if (inp == 3)//SB motion sensor
{
BuyCuTF(450,CUTF_SENSOR);
2001-07-17 05:58:10 +00:00
}
else if (inp == 4)//SB hax0r tool
{
BuyCuTF(1600,CUTF_FIELDGEN);
//BuyCuTF(600,CUTF_HOLO);
//sprint(self, PRINT_HIGH, "Activate the holograph with the 'holo' command.\n");
2001-07-17 05:58:10 +00:00
}
else if (inp == 5)//SB full armour
{
BuyCuTF(250,CUTF_FULLARMOUR);
2001-07-17 05:58:10 +00:00
}
else if (inp == 6)//SB C4 tossable detpack
{
if (no_c4==1)
{
sprint(self,PRINT_HIGH,"The C4 is disabled, sorry\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
else
{
BuyCuTF(1200,CUTF_TOSSABLEDET);
sprint(self, PRINT_HIGH, "Type 'throwdet' to throw the detpack.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (inp == 7)
BuyCuTF(600,CUTF_DISPENSER);
2001-07-17 05:58:10 +00:00
else if (inp == 8) {
Menu_Special();
self.current_menu = MENU_SPECIAL;
2001-07-17 05:58:10 +00:00
}
else if (inp == 9) {
Menu_Gren1();
self.current_menu = MENU_GREN1;
2001-07-17 05:58:10 +00:00
}
else if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
////////////////////////////////////////////////////////////////////////
string(float v1, float v2, string s1, string s2, string s3, string s4, string s5, string s6) grenstr =
{
// Return string based on how values compare to gren1 and gren2
if ((self.tp_grenades_1 != v1 && self.tp_grenades_2 != v1) && (self.tp_grenades_1 != v2 && self.tp_grenades_2 != v2)) return s1;
// If we have one gren1 and no gren2s, return s2
if ((self.tp_grenades_1 == v1 || self.tp_grenades_2 == v1) && (self.tp_grenades_1 != v2 && self.tp_grenades_2 != v2) && self.tp_grenades_1 != self.tp_grenades_2) return s2;
// If no gren1 and one gren2, return s3
if ((self.tp_grenades_1 != v1 && self.tp_grenades_2 != v1) && (self.tp_grenades_1 == v2 || self.tp_grenades_2 == v2) && self.tp_grenades_1 != self.tp_grenades_2) return s3;
// If one of both, return s4...
if ((self.tp_grenades_1 == v1 || self.tp_grenades_2 == v1) && (self.tp_grenades_1 == v2 || self.tp_grenades_2 == v2)) return s4;
// If two gren1s, return s5
if (self.tp_grenades_1 == v1 && self.tp_grenades_2 == v1) return s5;
// If two gren2s, return s6
if (self.tp_grenades_1 == v2 && self.tp_grenades_2 == v2) return s6;
return "BUG on grenstr()\n";
};
/*
0 0
1 0
0 1
1 1
2 0
0 2
*/
// ====================================
// Prints Menu of Grenade-1s Available
// ====================================
void() Menu_Gren1 =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = grenstr(GR_TYPE_NORMAL, GR_TYPE_FLAME,
2001-07-17 05:58:10 +00:00
" .. Normal <20> 500\n .. Flame <20> 750\n",
"1 .. Normal <20> 500\n .. Flame <20> 750\n",
" .. Normal <20> 500\n1 .. Flame <20> 750\n",
"1 .. Normal <20> 500\n1 .. Flame <20> 750\n",
"2 .. Normal <20> 500\n .. Flame <20> 750\n",
" .. Normal <20> 500\n2 .. Flame <20> 750\n");
l2 = grenstr(GR_TYPE_GAS, GR_TYPE_EMP,
2001-07-17 05:58:10 +00:00
" <20>.. Gas <20> 1200\n <20>.. EMP <20> 1200\n",
"1 <20>.. Gas <20> 1200\n <20>.. EMP <20> 1200\n",
" <20>.. Gas <20> 1200\n1 <20>.. EMP <20> 1200\n",
"1 <20>.. Gas <20> 1200\n1 <20>.. EMP <20> 1200\n",
"2 <20>.. Gas <20> 1200\n <20>.. EMP <20> 1200\n",
" <20>.. Gas <20> 1200\n2 <20>.. EMP <20> 1200\n");
l3 = grenstr(GR_TYPE_FRAG, GR_TYPE_NAIL,
2001-07-17 05:58:10 +00:00
" <20>.. Frag <20> 1300\n <20>.. Nail <20> 1400\n",
"1 <20>.. Frag <20> 1300\n <20>.. Nail <20> 1400\n",
" <20>.. Frag <20> 1300\n1 <20>.. Nail <20> 1400\n",
"1 <20>.. Frag <20> 1300\n1 <20>.. Nail <20> 1400\n",
"2 <20>.. Frag <20> 1300\n <20>.. Nail <20> 1400\n",
" <20>.. Frag <20> 1300\n2 <20>.. Nail <20> 1400\n");
l4 = " <20>.. MIRV <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tp_grenades_1 == GR_TYPE_MIRV && self.tp_grenades_2 == GR_TYPE_MIRV)
2001-07-17 05:58:10 +00:00
l4 = "2 <20>.. MIRV <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
else if (self.tp_grenades_2 == GR_TYPE_MIRV || self.tp_grenades_1 == GR_TYPE_MIRV)
2001-07-17 05:58:10 +00:00
l4 = "1 <20>.. MIRV <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
//l4 = "\n<>.. <20><><EFBFBD><EFBFBD> \n<>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Grenades <20> Combat <11><>\n\n",l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Gren1_Input =
{
local string st, st2;
st = infokey(world, "no_gasgren");
st2 = infokey (world, "no_spam");
if (inp == 1)
BuyGren(500,GR_TYPE_NORMAL);
2001-07-17 05:58:10 +00:00
else if (inp == 2)
BuyGren(750,GR_TYPE_FLAME);
2001-07-17 05:58:10 +00:00
else if (inp == 3)
{
if (st == "on")
{
sprint(self, PRINT_HIGH, "The admin has disabled gas grens on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (st2 == "on") //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren(1200,GR_TYPE_GAS);
2001-07-17 05:58:10 +00:00
}
else if (inp == 4)
{
if (st2 == "on") //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren(1200,GR_TYPE_EMP);
2001-07-17 05:58:10 +00:00
}
else if (inp == 5)
{
if (st2 == "on") //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren(1300,GR_TYPE_FRAG);
2001-07-17 05:58:10 +00:00
}
else if (inp == 6)
{
BuyGren(1400,GR_TYPE_NAIL);
2001-07-17 05:58:10 +00:00
}
if (inp == 7)
{
if (st2 == "on") //If admin disable it
{
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren(1500,GR_TYPE_MIRV);
2001-07-17 05:58:10 +00:00
}
if (inp == 8)
{
Menu_Special2();
self.current_menu = MENU_SPECIAL2;
2001-07-17 05:58:10 +00:00
}
if (inp == 9)
{
Menu_Gren2();
self.current_menu = MENU_GREN2;
2001-07-17 05:58:10 +00:00
}
else if (inp == 10)
DropFromCustomClassGen();
self.impulse = 0;
};
// ====================================
// Prints Menu of Grenade-2s Available
// ====================================
void() Menu_Gren2 =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = grenstr(GR_TYPE_FLARE, GR_TYPE_CALTROP,
2001-07-17 05:58:10 +00:00
" .. Flare <20> 300\n .. Caltrop <20> 500\n",
"1 .. Flare <20> 300\n .. Caltrop <20> 500\n",
" .. Flare <20> 300\n1 .. Caltrop <20> 500\n",
"1 .. Flare <20> 300\n1 .. Caltrop <20> 500\n",
"2 .. Flare <20> 300\n .. Caltrop <20> 500\n",
" .. Flare <20> 300\n2 .. Caltrop <20> 500\n");
l2 = grenstr(GR_TYPE_CONCUSSION, GR_TYPE_FLASH,
2001-07-17 05:58:10 +00:00
" <20>.. Concussion <20> 1000\n <20>.. Flash <20> 1000\n",
"1 <20>.. Concussion <20> 1000\n <20>.. Flash <20> 1000\n",
" <20>.. Concussion <20> 1000\n1 <20>.. Flash <20> 1000\n",
"1 <20>.. Concussion <20> 1000\n1 <20>.. Flash <20> 1000\n",
"2 <20>.. Concussion <20> 1000\n <20>.. Flash <20> 1000\n",
" <20>.. Concussion <20> 1000\n2 <20>.. Flash <20> 1000\n");
l3 = grenstr(GR_TYPE_ANTIGRAV, GR_TYPE_BIO,
2001-07-17 05:58:10 +00:00
" <20>.. AntiGrav <20> 1000\n <20>.. Bio-Infection <20> 1450\n",
"1 <20>.. AntiGrav <20> 1000\n <20>.. Bio-Infection <20> 1450\n",
" <20>.. AntiGrav <20> 1000\n1 <20>.. Bio-Infection <20> 1450\n",
"1 <20>.. AntiGrav <20> 1000\n1 <20>.. Bio-Infection <20> 1450\n",
"2 <20>.. AntiGrav <20> 1000\n <20>.. Bio-Infection <20> 1450\n",
" <20>.. AntiGrav <20> 1000\n2 <20>.. Bio-Infection <20> 1450\n");
//.. Flash <20> 1000
//.. Krac <20> 1500
l4 = " <20>.. Krac <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tp_grenades_1 == GR_TYPE_KRAC && self.tp_grenades_2 == GR_TYPE_KRAC)
2001-07-17 05:58:10 +00:00
l4 = "2 <20>.. Krac <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
else if (self.tp_grenades_1 == GR_TYPE_KRAC || self.tp_grenades_2 == GR_TYPE_KRAC)
2001-07-17 05:58:10 +00:00
l4 = "1 <20>.. Krac <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
//l4 = "\n<>.. <20><><EFBFBD><EFBFBD> \n<>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Grenades <20> Utility <11><>\n\n",l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Gren2_Input =
{
local string st, st2;
st = infokey(world, "no_antigrav");
st2 = infokey(world, "no_spam");
//WK I should have done all the buy menus like this
//SB I reckon - this one actually looks nice and makes sense
if (inp == 1)
{
BuyGren(300, GR_TYPE_FLARE);
2001-07-17 05:58:10 +00:00
}
if (inp == 2)
{
if (st2 == "on")
sprint(self, PRINT_HIGH, "The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
else
BuyGren(500, GR_TYPE_CALTROP);
2001-07-17 05:58:10 +00:00
}
if (inp == 3)
{
BuyGren(1000, GR_TYPE_CONCUSSION);
2001-07-17 05:58:10 +00:00
}
if (inp == 4)
{
BuyGren(1000,GR_TYPE_FLASH);
2001-07-17 05:58:10 +00:00
}
if (inp == 5)
{
if (st == "on")
sprint(self, PRINT_HIGH, "The admin has disabled anti-grav grens on this map.\n");
2001-07-17 05:58:10 +00:00
else
BuyGren(1000, GR_TYPE_ANTIGRAV);
2001-07-17 05:58:10 +00:00
}
if (inp == 6)
{
BuyGren(1450, GR_TYPE_BIO);
2001-07-17 05:58:10 +00:00
}
if (inp == 7)
{
BuyGren(1500, GR_TYPE_KRAC);
2001-07-17 05:58:10 +00:00
}
else if (inp == 8)
{
Menu_Gren1();
self.current_menu = MENU_GREN1;
2001-07-17 05:58:10 +00:00
}
else if (inp == 9)
{
Menu_Engineering();
self.current_menu = MENU_ENGINEERING;
2001-07-17 05:58:10 +00:00
}
if (inp == 10)
{
DropFromCustomClassGen();
}
self.impulse = 0;
};
//////////////////////////////////////////////////////////////////////////////
// ====================================
// Prints Menu of Grenade-1s Available
// ====================================
/*void() Menu_Gren1 =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = eqstr(self.tp_grenades_1, GR_TYPE_NORMAL, GR_TYPE_FLASH,
2001-07-17 05:58:10 +00:00
" .. Normal <20> 500\n .. Flash <20> 1000\n",
"* .. Normal <20> 500\n .. Flash <20> 1000\n",
" .. Normal <20> 500\n* .. Flash <20> 1000\n");
l2 = eqstr(self.tp_grenades_1, GR_TYPE_ANTIGRAV, GR_TYPE_EMP,
2001-07-17 05:58:10 +00:00
" <20>.. AntiGrav <20> 1200\n <20>.. EMP <20> 1200\n",
"* <20>.. AntiGrav <20> 1200\n <20>.. EMP <20> 1200\n",
" <20>.. AntiGrav <20> 1200\n* <20>.. EMP <20> 1200\n");
if (allow_antigrav==0) {
l2 = eqstr(self.tp_grenades_1, GR_TYPE_CONCUSSION, GR_TYPE_EMP,
2001-07-17 05:58:10 +00:00
" <20>.. Concussion <20> 1000\n <20>.. EMP <20> 1200\n",
"* <20>.. Concussion <20> 1000\n <20>.. EMP <20> 1200\n",
" <20>.. Concussion <20> 1000\n* <20>.. EMP <20> 1200\n");
}
l3 = eqstr(self.tp_grenades_1, GR_TYPE_FRAG, GR_TYPE_FLAME,
2001-07-17 05:58:10 +00:00
" <20>.. Frag <20> 1425\n <20>.. Flame <20> 1425\n",
"* <20>.. Frag <20> 1425\n <20>.. Flame <20> 1425\n",
" <20>.. Frag <20> 1425\n* <20>.. Flame <20> 1425\n");
l4 = " <20>.. Krac <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tp_grenades_1 == GR_TYPE_KRAC)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Krac <20> 1500\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Grenades - 1st Slot<11><>\n\n",l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Gren1_Input =
{
local string st2, st3;
st2 = infokey(world, "no_spam");
if (inp <= 10 && inp >= 1)
{
//WK I should have done all the buy menus like this
//SB I reckon - this one actually looks nice and makes sense
if (inp == 1) {
BuyGren1(500,GR_TYPE_NORMAL);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyGren1(1000,GR_TYPE_FLASH);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
if (allow_antigrav == 0)
//sprint(self,PRINT_HIGH,"The admin has disabled anti-grav grens on this map.\n");
BuyGren1(1000,GR_TYPE_CONCUSSION);
2001-07-17 05:58:10 +00:00
else
BuyGren1(1200,GR_TYPE_ANTIGRAV);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyGren1(1200,GR_TYPE_EMP);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
if (st2 == "on") {//If admin disable it
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren1(1425,GR_TYPE_FRAG);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyGren1(1425,GR_TYPE_FLAME);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyGren1(1500,GR_TYPE_KRAC);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Special2();
self.current_menu = MENU_SPECIAL2;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Gren2();
self.current_menu = MENU_GREN2;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
}
};
// ====================================
// Prints Menu of Grenade-2s Available
// ====================================
void() Menu_Gren2 =
{
local string temp,st;
temp = ftos(self.money);
st = infokey(world, "no_flare");
local string l1,l2,l3,l4;
l1 = eqstr(self.tp_grenades_2, GR_TYPE_FLARE, GR_TYPE_CONCUSSION,
2001-07-17 05:58:10 +00:00
" .. Flare <20> 400\n .. Concussion <20> 1000\n",
"* .. Flare <20> 400\n .. Concussion <20> 1000\n",
" .. Flare <20> 400\n* .. Concussion <20> 1000\n");
if (st == "on" || st == "1") {
l1 = eqstr(self.tp_grenades_2, GR_TYPE_NORMAL, GR_TYPE_CONCUSSION,
2001-07-17 05:58:10 +00:00
" .. Normal <20> 500\n .. Concussion <20> 1000\n",
"* .. Normal <20> 500\n .. Concussion <20> 1000\n",
" .. Normal <20> 500\n* .. Concussion <20> 1000\n");
}
l2 = eqstr(self.tp_grenades_2, GR_TYPE_GAS, GR_TYPE_EMP,
2001-07-17 05:58:10 +00:00
" <20>.. Gas <20> 1200\n <20>.. EMP <20> 1200\n",
"* <20>.. Gas <20> 1200\n <20>.. EMP <20> 1200\n",
" <20>.. Gas <20> 1200\n* <20>.. EMP <20> 1200\n");
l3 = eqstr(self.tp_grenades_2, GR_TYPE_MIRV, GR_TYPE_FLAME,
2001-07-17 05:58:10 +00:00
" <20>.. MIRV <20> 1200\n <20>.. Flame <20> 1425\n",
"* <20>.. MIRV <20> 1200\n <20>.. Flame <20> 1425\n",
" <20>.. MIRV <20> 1200\n* <20>.. Flame <20> 1425\n");
l4 = " <20>.. Nail <20> 2000\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tp_grenades_2 == GR_TYPE_NAIL)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Nail <20> 2000\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Grenades - 2nd Slot<11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Gren2_Input =
{
local string st, st2,st3;
st = infokey(world, "no_gasgren");
st2 = infokey (world, "no_spam");
st3 = infokey(world, "no_flare");
if (inp <= 10 && inp >= 1)
{
if (inp == 1) {
if (st3 == "on" || st3 == "1")
BuyGren2(500,GR_TYPE_NORMAL);
2001-07-17 05:58:10 +00:00
else
BuyGren2(400,GR_TYPE_FLARE);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyGren2(1000,GR_TYPE_CONCUSSION);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
if (st == "on"){
sprint(self,PRINT_HIGH,"The admin has disabled gas grens on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (st2 == "on") {//If admin disable it
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren2(1200,GR_TYPE_GAS);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyGren2(1200,GR_TYPE_EMP);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
if (st2 == "on") {//If admin disable it
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren2(1200,GR_TYPE_MIRV);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyGren2(1425,GR_TYPE_FLAME);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
if (st2 == "on") {//If admin disable it
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
2001-07-17 05:58:10 +00:00
return;
}
BuyGren2(2000,GR_TYPE_NAIL);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Gren1();
self.current_menu = MENU_GREN1;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Engineering();
self.current_menu = MENU_ENGINEERING;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
}
};*/
// ====================================
// Prints Menu of Optional Items Here
// ====================================
void() Menu_Engineering =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr2(self.weapons_carried,self.cutf_items,WEAP_SPANNER,CUTF_SENTRYGUN,
2001-07-17 05:58:10 +00:00
" .. Spanner <20> 1200\n .. Build Sentrygun <20> 1500\n",
"* .. Spanner <20> 1200\n .. Build Sentrygun <20> 1500\n",
" .. Spanner <20> 1200\n* .. Build Sentrygun <20> 1500\n",
"* .. Spanner <20> 1200\n* .. Build Sentrygun <20> 1500\n");
l2 = mstr(self.tf_items,NIT_TURRET,NIT_TESLA,
2001-07-17 05:58:10 +00:00
" <20>.. Turret Upgrade <20> 700\n <20>.. Build Tesla <20> 1350\n",
"* <20>.. Turret Upgrade <20> 700\n <20>.. Build Tesla <20> 1350\n",
" <20>.. Turret Upgrade <20> 700\n* <20>.. Build Tesla <20> 1350\n",
"* <20>.. Turret Upgrade <20> 700\n* <20>.. Build Tesla <20> 1350\n");
l3 = mstr(self.tf_items, NIT_TESLA_UPGRADE, NIT_SECURITY_CAMERA,
2001-07-17 05:58:10 +00:00
" <20>.. Tesla Upgrade <20> 1650\n <20>.. Build Camera <20> 350\n",
"* <20>.. Tesla Upgrade <20> 1650\n <20>.. Build Camera <20> 350\n",
" <20>.. Tesla Upgrade <20> 1650\n* <20>.. Build Camera <20> 350\n",
"* <20>.. Tesla Upgrade <20> 1650\n* <20>.. Build Camera <20> 350\n");
l4 = " <20>.. BuildTeleporter <20> 1100\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tf_items & NIT_TELEPORTER)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. BuildTeleporter <20> 1100\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Engineering Items <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Engineering_Input =
{
if (inp == 1) {
BuyWeapon(1200,WEAP_SPANNER);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyCuTF(1500,CUTF_SENTRYGUN);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyItem(700,NIT_TURRET);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyItem(1350,NIT_TESLA);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyItem(1650,NIT_TESLA_UPGRADE);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyItem(350,NIT_SECURITY_CAMERA);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyItem(1100,NIT_TELEPORTER);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Gren2();
self.current_menu = MENU_GREN2;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
if (custom_mode!=1)
{
Menu_Profession();
self.current_menu = MENU_PROFESSION;
2001-07-17 05:58:10 +00:00
}
else
{
Menu_Proficiency();
self.current_menu = MENU_PROFICIENCY;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// =====================================
// Prints Menu of Professions Available
// =====================================
void() Menu_Profession =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = eqstr(self.job, JOB_THIEF, JOB_RUNNER,
2001-07-17 05:58:10 +00:00
" .. Thief <20>Hide<64><65> 950\n .. Runner <20>Sprint<6E><74> 400\n",
"* .. Thief <20>Hide<64><65> 950\n .. Runner <20>Sprint<6E><74> 400\n",
" .. Thief <20>Hide<64><65> 950\n* .. Runner <20>Sprint<6E><74> 400\n");
l2 = eqstr(self.job, JOB_WARLOCK, JOB_CHAPLAN,
2001-07-17 05:58:10 +00:00
" <20>.. Warlock <20>Summon<6F><6E> 1350\n <20>.. Chaplan<61>Inspire<72><65> 1200\n",
"* <20>.. Warlock <20>Summon<6F><6E> 1350\n <20>.. Chaplan<61>Inspire<72><65> 1200\n",
" <20>.. Warlock <20>Summon<6F><6E> 1350\n* <20>.. Chaplan<61>Inspire<72><65> 1200\n");
l3 = eqstr(self.job, JOB_BERSERKER, JOB_GUERILLA,
2001-07-17 05:58:10 +00:00
" <20>.. Berserker <20>Fury<72><79> 1200\n <20>.. Guerilla <20>Mines<65><73> 1500\n",
"* <20>.. Berserker <20>Fury<72><79> 1200\n <20>.. Guerilla <20>Mines<65><73> 1500\n",
" <20>.. Berserker <20>Fury<72><79> 1200\n* <20>.. Guerilla <20>Mines<65><73> 1500\n");
l4 = " <20>.. Judoka <20>Disarm<72><6D> 700\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.job == JOB_JUDOKA)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Judoka <20>Disarm<72><6D> 700\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Skilled Profession <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n\nUse <20><><EFBFBD><EFBFBD><EFBFBD> to trigger ability\n");
};
void(float inp) Menu_Profession_Input =
{
if (inp == 1) {
BuyJob( 950,JOB_THIEF);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyJob( 400,JOB_RUNNER);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) { //Sync this with price in knife
BuyJob( 1350,JOB_WARLOCK);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
if (no_chaplan)
{
sprint(self,PRINT_HIGH,"Chaplan is disabled, sorry.\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
BuyJob(1200,JOB_CHAPLAN);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyJob(1200,JOB_BERSERKER);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyJob(1500,JOB_GUERILLA);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyJob( 700,JOB_JUDOKA);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Engineering();
self.current_menu = MENU_ENGINEERING;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Profession2();
self.current_menu = MENU_PROFESSION2;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ==================================
// Prints Second page of Professions
// ==================================
void() Menu_Profession2 =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = eqstr(self.job, JOB_ARMY, JOB_HACKER,
2001-07-17 05:58:10 +00:00
" .. Army <20>Soldier<65><72> 1250\n .. CyberNet <20>Hack<63><6B> 1200\n",
"* .. Army <20>Soldier<65><72> 1250\n .. CyberNet <20>Hack<63><6B> 1200\n",
" .. Army <20>Soldier<65><72> 1250\n* .. CyberNet <20>Hack<63><6B> 1200\n");
l2 = eqstr(self.job, JOB_MARTYR, JOB_CRUSADER,
2001-07-17 05:58:10 +00:00
" <20>.. Martyr <20>Suicide<64><65> 1000\n <20>.. Crusader <20>Auras<61><73> 1600\n",
"* <20>.. Martyr <20>Suicide<64><65> 1000\n <20>.. Crusader <20>Auras<61><73> 1600\n",
" <20>.. Martyr <20>Suicide<64><65> 1000\n* <20>.. Crusader <20>Auras<61><73> 1600\n");
/*l2 = eqstr(self.job, JOB_MARTYR, JOB_MYSTIC,
2001-07-17 05:58:10 +00:00
" <20>.. Martyr <20>Suicide<64><65> 1000\n <20>.. Mystic <20>Regen<65><6E> 1000\n",
"* <20>.. Martyr <20>Suicide<64><65> 1000\n <20>.. Mystic <20>Regen<65><6E> 1000\n",
" <20>.. Martyr <20>Suicide<64><65> 1000\n* <20>.. Mystic <20>Regen<65><6E> 1000\n");*/
/*l3 = eqstr(self.job, JOB_BERSERKER, JOB_GUERILLA,
2001-07-17 05:58:10 +00:00
" -.. Berserker <20>Fury<72>- 1200\n <20>.. Guerilla <20>Mines<65>- 1500\n",
"* -.. Berserker <20>Fury<72>- 1200\n <20>.. Guerilla <20>Mines<65>- 1500\n",
" -.. Berserker <20>Fury<72>- 1200\n* <20>.. Guerilla <20>Mines<65>- 1500\n");*/
l4 = "\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
//l3 = "\n\n";
l3 = "\n\n";
/*l2 = " <20>.. Martyr <20>Suicide<64><65> 1000";
if (self.job == JOB_MARTYR)
2001-07-17 05:58:10 +00:00
l2 = "* <20>.. Martyr <20>Suicide<64><65> 1000";*/
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> More Professions <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n\nUse <20><><EFBFBD><EFBFBD><EFBFBD> to trigger ability\n");
};
void(float inp) Menu_Profession2_Input =
{
if (inp == 1) {
if (no_army==1)
{
sprint(self,PRINT_HIGH,"Army job is disabled\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
else
BuyJob( 1250,JOB_ARMY);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyJob( 1200,JOB_HACKER);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyJob( 1000,JOB_MARTYR);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyJob(1600,JOB_CRUSADER);
2001-07-17 05:58:10 +00:00
}
/*
if (inp == 5) {
BuyJob(1200,JOB_BERSERKER);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyJob(1500,JOB_GUERILLA);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyJob( 700,JOB_JUDOKA);
2001-07-17 05:58:10 +00:00
}*/
if (inp == 8) {
Menu_Profession();
self.current_menu = MENU_PROFESSION;
2001-07-17 05:58:10 +00:00
}
if (inp == 9) {
Menu_Proficiency();
self.current_menu = MENU_PROFICIENCY;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// =====================================
// Prints Menu of Proficiencies Available
// =====================================
void() Menu_Proficiency =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.cutf_items, CUTF_STEALTH, CUTF_HIGHJUMP,
2001-07-17 05:58:10 +00:00
" .. Stealth <20> 400\n .. Highjump <20> 200\n",
"* .. Stealth <20> 400\n .. Highjump <20> 200\n",
" .. Stealth <20> 400\n* .. Highjump <20> 200\n",
"* .. Stealth <20> 400\n* .. Highjump <20> 200\n");
l2 = mstr(self.cutf_items, CUTF_HWGUY, CUTF_EXPBODY,
2001-07-17 05:58:10 +00:00
" <20>.. Aspect of HWGuy <20> 450\n <20>.. Exp. Body <20> 1200\n",
"* <20>.. Aspect of HWGuy <20> 450\n <20>.. Exp. Body <20> 1200\n",
" <20>.. Aspect of HWGuy <20> 450\n* <20>.. Exp. Body <20> 1200\n",
"* <20>.. Aspect of HWGuy <20> 450\n* <20>.. Exp. Body <20> 1200\n");
l3 = mstr(self.cutf_items, CUTF_GYMNAST, CUTF_DEMONLORE,
2001-07-17 05:58:10 +00:00
" <20>.. Gymnast <20> 450\n <20>.. Demon Lore <20> 300\n",
"* <20>.. Gymnast <20> 450\n <20>.. Demon Lore <20> 300\n",
" <20>.. Gymnast <20> 450\n* <20>.. Demon Lore <20> 300\n",
"* <20>.. Gymnast <20> 450\n* <20>.. Demon Lore <20> 300\n");
l4 = " <20>.. Close Combat <20> 600\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.cutf_items & CUTF_CLOSECOMBAT)
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Close Combat <20> 600\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Proficiency <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Proficiency_Input =
{
if (inp == 1) {
BuyCuTF( 400,CUTF_STEALTH);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyCuTF( 200,CUTF_HIGHJUMP);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
if (self.cutf_items & CUTF_GYMNAST)
sprint(self, PRINT_HIGH, "Having Gymnast and Aspect of HWGuy proficiencies is illogical.\n");
2001-07-17 05:58:10 +00:00
else
BuyCuTF( 450,CUTF_HWGUY);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyCuTF(1200,CUTF_EXPBODY);
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
if (self.cutf_items & CUTF_HWGUY)
sprint(self, PRINT_HIGH, "Trust me, you don't want Aspect of HWGuy AND Gymnast.\n");
2001-07-17 05:58:10 +00:00
else
BuyCuTF( 450,CUTF_GYMNAST);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
BuyCuTF( 300,CUTF_DEMONLORE);
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
BuyCuTF( 600,CUTF_CLOSECOMBAT);
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
if (custom_mode!=1)
{
Menu_Profession2();
self.current_menu = MENU_PROFESSION2;
2001-07-17 05:58:10 +00:00
}
else
{
Menu_Engineering();
self.current_menu = MENU_ENGINEERING;
2001-07-17 05:58:10 +00:00
}
}
if (inp == 9) {
Menu_Option();
self.current_menu = MENU_OPTION;
2001-07-17 05:58:10 +00:00
}
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// ====================================
// Prints Menu of Optional Items Here
// ====================================
void() Menu_Option =
{
local string temp;
temp = ftos(self.money);
local string l1,l2,l3,l4;
l1 = mstr(self.tf_items, NIT_AUTOID, NIT_RESPAWN_GUARD,
2001-07-17 05:58:10 +00:00
" .. Auto-ID <20> 25\n .. Respawn Guard <20> 25\n",
"* .. Auto-ID <20> 25\n .. Respawn Guard <20> 25\n",
" .. Auto-ID <20> 25\n* .. Respawn Guard <20> 25\n",
"* .. Auto-ID <20> 25\n* .. Respawn Guard <20> 25\n");
//l2 = mstr2(self.cutf_items,self.tf_items,CUTF_OTR,NIT_HOVER_BOOTS,
l2 = mstr(self.tf_items,NIT_HOVER_BOOTS, NIT_HOVER_BOOTS_UPGRADE,
2001-07-17 05:58:10 +00:00
" <20>.. Hover Boots <20> 850\n <20>.. Boot Upgrade <20> 350\n",
"* <20>.. Hover Boots <20> 850\n <20>.. Boot Upgrade <20> 350\n",
" <20>.. Hover Boots <20> 850\n* <20>.. Boot Upgrade <20> 350\n",
"* <20>.. Hover Boots <20> 850\n* <20>.. Boot Upgrade <20> 350\n");
l3 = mstr2(self.tf_items, self.cutf_items, NIT_RL_LASER_SIGHT, CUTF_OTR,
2001-07-17 05:58:10 +00:00
" <20>.. Laser Guided RL <20> 1000\n <20>.. OTR Bullets <20> 1850\n",
"* <20>.. Laser Guided RL <20> 1000\n <20>.. OTR Bullets <20> 1850\n", //.. Boot Upgrade <20> 350
" <20>.. Laser Guided RL <20> 1000\n* <20>.. OTR Bullets <20> 1850\n",
"* <20>.. Laser Guided RL <20> 1000\n* <20>.. OTR Bullets <20> 1850\n");
l4 = " <20>.. Cluster Rockets <20> 3250\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. \n.. <20><><EFBFBD><EFBFBD>! \n";
if (self.tf_items & NIT_CLUSTER_ROCKETS )
2001-07-17 05:58:10 +00:00
l4 = "* <20>.. Cluster Rockets <20> 3250\n<EFBFBD>.. <20><><EFBFBD><EFBFBD> \n<EFBFBD>.. \n.. <20><><EFBFBD><EFBFBD>! \n";
centerprint(self, "<EFBFBD><EFBFBD><EFBFBD> C<>s<EFBFBD>o<EFBFBD>i<EFBFBD>e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <11><>\n<EFBFBD><EFBFBD> Optional Equipment <11><>\n\n", l1,l2,l3,l4, temp," dollars left\n");
};
void(float inp) Menu_Option_Input =
{
if (inp == 1) {
BuyItem(25,NIT_AUTOID);
2001-07-17 05:58:10 +00:00
}
if (inp == 2) {
BuyItem(25,NIT_RESPAWN_GUARD);
2001-07-17 05:58:10 +00:00
}
if (inp == 6) {
if (no_otr==1)
{
sprint(self,PRINT_HIGH,"OTR bullets are disabled\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
else
BuyCuTF(1850,CUTF_OTR);
2001-07-17 05:58:10 +00:00
}
if (inp == 3) {
BuyItem(850,NIT_HOVER_BOOTS);
2001-07-17 05:58:10 +00:00
}
if (inp == 4) {
BuyItem(350, NIT_HOVER_BOOTS_UPGRADE); //sync price with buyitem
2001-07-17 05:58:10 +00:00
}
if (inp == 5) {
BuyItem(1000, NIT_RL_LASER_SIGHT); //sync with RL
2001-07-17 05:58:10 +00:00
}
if (inp == 7) {
if (no_clusters==1)
{
sprint(self,PRINT_HIGH,"Cluster rockets are disabled\n");
2001-07-17 05:58:10 +00:00
self.impulse=0;
return;
}
else
BuyItem(3250, NIT_CLUSTER_ROCKETS); //sync with RL
2001-07-17 05:58:10 +00:00
}
if (inp == 8) {
Menu_Proficiency();
self.current_menu = MENU_PROFICIENCY;
2001-07-17 05:58:10 +00:00
}
// if (inp == 9) {
// centerprint(self, "No next menu\n");
// }
if (inp == 10) {
DropFromCustomClassGen();
}
self.impulse = 0;
};
// SB - crusader ability menu
void(entity pl, string s1, string s2, string s3) CenterPrint3;
/*
#define AURA_POWER 1
#define AURA_RESISTANCE 2
#define AURA_HASTE 3
#define AURA_INVIS 4
*/
void(float aur) AddAura;
void() CrusaderAddInvisibility;
void() CrusaderMassHeal;
void() CrusaderMassCure;
void() CrusaderDispel;
void() Menu_Crusader =
{
local string str1;
local float amount;
amount = time - self.job_finished;
if (amount > 60)
amount = 60;
str1 = ftos(floor(amount));
if (self.weapons_carried & WEAP_MEDIKIT)
2001-07-17 05:58:10 +00:00
CenterPrint3(self, " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Aura of Power <20>15 mana<6E>\n.. Aura of Resistance <20>15 mana<6E>\n<EFBFBD>.. Aura of Haste <20>15 mana<6E>\n<EFBFBD>.. Aura of Invisibility <20>45 mana<6E>\n<EFBFBD>.. Dispel Evil <20>30 mana<6E>\n<EFBFBD>.. Mass healing <20>20 mana<6E>\n<EFBFBD>.. Mass cure <20>20 mana<6E>\n<EFBFBD>.. Sing <20> 0 mana<6E>\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: ", str1,"\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
else
CenterPrint3(self, " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n.. Aura of Power <20>15 mana<6E>\n.. Aura of Resistance <20>15 mana<6E>\n<EFBFBD>.. Aura of Haste <20>15 mana<6E>\n<EFBFBD>.. Aura of Invisibility <20>45 mana<6E>\n<EFBFBD>.. Dispel Evil <20>30 mana<6E>\n<EFBFBD>.. Sing <20> 0 mana<6E>\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: ", str1,"\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
self.StatusRefreshTime = time + 1;
};
void(float inp) Menu_Crusader_Input =
{
// If you read this, this is how you should be doing menus. HEAR ME?? No? Well I assume you
// are reading it so that'll have to do.
if (inp == 1)
AddAura(AURA_POWER);
2001-07-17 05:58:10 +00:00
else if (inp == 2)
AddAura(AURA_RESISTANCE);
2001-07-17 05:58:10 +00:00
else if (inp == 3)
AddAura(AURA_HASTE);
2001-07-17 05:58:10 +00:00
else if (inp == 4)
CrusaderAddInvisibility();
else if (inp == 5)
CrusaderDispel();
else if (inp == 6)
CrusaderMassHeal();
else if (inp == 7)
CrusaderMassCure();
else if (inp == 8)
sound (self, CHAN_MUSIC, "ambience/orff.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +00:00
else if (inp == 10)
inp = 0;
else
return;
self.impulse = 0;
ResetMenu();
};