From 9373054e9e91cd2f15b9c84811f5ec08a04a3c98 Mon Sep 17 00:00:00 2001 From: avirox Date: Sun, 22 Jan 2006 00:41:22 +0000 Subject: [PATCH] - A message is centerprinted to players who join where to download Team:Nexuiz using the menu system. - Constants updated with menu section - Teammate icon code updated - Added a version string to tfdefs git-svn-id: svn://svn.icculus.org/nexuiz/trunk@868 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/cl_client.c | 4 ++ TeamNexuiz/game/gamec/tf_constants.c | 4 ++ TeamNexuiz/game/gamec/tfclient.c | 8 ++-- TeamNexuiz/game/gamec/tfdefs.c | 8 ++++ TeamNexuiz/game/gamec/tffunctions.c | 25 +++++++++- TeamNexuiz/game/gamec/tfitems.c | 71 +++++++++++++++++++++++++++- TeamNexuiz/game/gamec/tfmenus.c | 10 ++++ TeamNexuiz/game/gamec/tfq3fitems.c | 4 +- 8 files changed, 127 insertions(+), 7 deletions(-) diff --git a/TeamNexuiz/game/gamec/cl_client.c b/TeamNexuiz/game/gamec/cl_client.c index f70a7ddb7..1a3ba726c 100644 --- a/TeamNexuiz/game/gamec/cl_client.c +++ b/TeamNexuiz/game/gamec/cl_client.c @@ -211,6 +211,8 @@ entity () SelectSpawnPoint = if (self.team_no < 1) { // self.origin_z = self.origin_z + 30; + self.current_menu = MENU_NEED_TN; + stuffcmd(self, "alias menu_showteamselect \"set scmenu_directmenu TeamSelect; togglemenu\"\n"); stuffcmd(self, "set scmenu_directmenu TeamSelect; togglemenu\n"); @@ -485,6 +487,7 @@ void PutClientInServer (void) self.poison_rate = 0; self.is_feigning = 0; + self.current_menu = 0; // if the player is supposed to change model (and hence class) on respawn, do it. if(self.change_mdl_on_respawn != "") @@ -1277,6 +1280,7 @@ void SV_ParseClientCommand (string s) sprint(self, "You must select a team to join first!\n"); return; } + CenterPrint(self, ""); // clear any centerprint messages if (self.playerclass > 0) // if a class is already chosen { self.tfstate = self.tfstate - (self.tfstate & 8); diff --git a/TeamNexuiz/game/gamec/tf_constants.c b/TeamNexuiz/game/gamec/tf_constants.c index d09d229c6..30f9b90ce 100644 --- a/TeamNexuiz/game/gamec/tf_constants.c +++ b/TeamNexuiz/game/gamec/tf_constants.c @@ -21,6 +21,10 @@ float PISTOL_BODYSHOT = 306; // no chest shot death msg for pistol float PISTOL_LEGSHOT = 307; //308? +/******************** Menus *******************/ +//////////////////////////////////////////////// +/**********************************************/ +float MENU_NEED_TN = 90; /***************** misc constants **********************/ ///////////////////////////////////////////////////////// diff --git a/TeamNexuiz/game/gamec/tfclient.c b/TeamNexuiz/game/gamec/tfclient.c index 7a6c721d2..fb3cdb53b 100644 --- a/TeamNexuiz/game/gamec/tfclient.c +++ b/TeamNexuiz/game/gamec/tfclient.c @@ -122,7 +122,7 @@ void() TeamBubbleThink = remove(self); return; } - setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); + //setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); //bandwidth hax if (self.owner.buttonchat || self.owner.deadflag) self.model = ""; else @@ -134,7 +134,6 @@ void() TeamBubbleThink = float() ChatBubble_customizeentityforclient = {return (self.owner.team_no == other.team_no && other.killcount > -666);}; - void() UpdateTeamBubble = { if (!self.modelindex || !cvar("teamplay")) @@ -148,7 +147,10 @@ void() UpdateTeamBubble = self.teambubble_friendly.think = TeamBubbleThink; self.teambubble_friendly.nextthink = time; setmodel(self.teambubble_friendly, "models/team/team.sp2"); - setorigin(self.teambubble_friendly, self.origin + '0 0 15' + self.maxs_z * '0 0 1'); +// setorigin(self.teambubble_friendly, self.origin + '0 0 15' + self.maxs_z * '0 0 1'); + setorigin(self.teambubble_friendly, self.teambubble_friendly.origin + '0 0 10' + self.maxs_z * '0 0 1'); + setattachment(self.teambubble_friendly, self, ""); + self.teambubble_friendly.scale = .07; self.teambubble_friendly.mdl = self.teambubble_friendly.model; self.teambubble_friendly.model = self.teambubble_friendly.mdl; self.teambubble_friendly.customizeentityforclient = ChatBubble_customizeentityforclient; diff --git a/TeamNexuiz/game/gamec/tfdefs.c b/TeamNexuiz/game/gamec/tfdefs.c index 625f19882..e36a13346 100644 --- a/TeamNexuiz/game/gamec/tfdefs.c +++ b/TeamNexuiz/game/gamec/tfdefs.c @@ -3,6 +3,8 @@ *************************************/ /********************* General ***************************/ +string TN_VERSION = "alpha .01"; + float TF_FLARE_LIT = 0; // Woes of a decompiler, eh? float TF_FLARE_OFF = 1; //// float CTF_Map; @@ -33,6 +35,12 @@ float illegalclasses3; float illegalclasses4; float civilianteams; +//These are the "Map_Rules" entity's class restricts. +.float team1_scout, team1_soldier, team1_medic, team1_pyro, team1_spy, team1_engineer; +.float team2_scout, team2_soldier, team2_medic, team2_pyro, team2_spy, team2_engineer; +.float team3_scout, team3_soldier, team3_medic, team3_pyro, team3_spy, team3_engineer; +.float team4_scout, team4_soldier, team4_medic, team4_pyro, team4_spy, team4_engineer; + // Last Spawn Place of Team entity lastspawn_team1; entity lastspawn_team2; diff --git a/TeamNexuiz/game/gamec/tffunctions.c b/TeamNexuiz/game/gamec/tffunctions.c index 03b49ed7a..a97c31463 100644 --- a/TeamNexuiz/game/gamec/tffunctions.c +++ b/TeamNexuiz/game/gamec/tffunctions.c @@ -1558,10 +1558,33 @@ float (float tno) TeamFortress_TeamGetIllegalClasses = }; // Check if legal class +float (float pc, float tno, entity chkr) Check_Class_Scout = +{ + if (tno == 1 ) + { + } + +}; + +float (float pc, float tno, entity chkr) Check_Class_Soldier = +{ +}; + float (float pc) IsLegalClass = { local float bit; +// Team:Nexuiz class check + local entity findme; + local float yesorno; + + findme = find (world,classname,"class_restrictions"); + if (pc == TF_CLASS_SCOUT) + yesorno = Check_Class_Scout(pc, self.team_no, findme); + else if (pc == TF_CLASS_SOLDIER) + yesorno = Check_Class_Soldier(pc, self.team_no, findme); + + /* if (((spy_off == 1) && (pc == 8))) { return (0); @@ -1768,7 +1791,7 @@ void() TeamFortress_ChangeClass = return; } /* tc = IsRestrictedClass(self.impulse - 100); // TBA ADD THIS FUNCTION - if (tc != 0) // it's actually a megatf fucntion + if (tc != 0) // it's actually a megatf function { // -- gonna need cvars for it if (tc > 0) { diff --git a/TeamNexuiz/game/gamec/tfitems.c b/TeamNexuiz/game/gamec/tfitems.c index 04dfb00f3..c44fc57fe 100644 --- a/TeamNexuiz/game/gamec/tfitems.c +++ b/TeamNexuiz/game/gamec/tfitems.c @@ -37,4 +37,73 @@ float (entity e, float healamount, float ignore) T_Heal = TeamFortress_SetSpeed (e); }*/ return (1); -}; \ No newline at end of file +}; + +// Pre-Packed TeamNexuiz items/entities :) +//backpack +.string cells; +.string shells; +.string rockets; +.string nails; +.string grenade1; +.string grenade2; +.string armor; + +// TF Map rules +.string team1limit; +.string team2limit; +.string team3limit; +.string team4limit; + +// Moved the below to tfdefs. These are the "Map_Rules" entity's class restricts. +/*.float team1_scout, team1_soldier, team1_medic, team1_pyro, team1_spy, team1_engineer; +.float team2_scout, team2_soldier, team2_medic, team2_pyro, team2_spy, team2_engineer; +.float team3_scout, team3_soldier, team3_medic, team3_pyro, team3_spy, team3_engineer; +.float team4_scout, team4_soldier, team4_medic, team4_pyro, team4_spy, team4_engineer;*/ + +void () Map_Rules = +{ + local entity infoent; // our class restricts info entity is spaned here + infoent = spawn(); + infoent.classname = "class_restrictions"; + copyentity (self, infoent); + + // Amount of teams available on a map are determined by spawn points + if (self.team1limit) + self.ammo_medikit = stof(self.team1limit); + if (self.team2limit) + self.ammo_detpack = stof(self.team2limit); + if (self.team3limit) + self.maxammo_medikit = stof(self.team3limit); + if (self.team4limit) + self.maxammo_detpack = stof(self.team4limit); + + info_tfdetect(); +}; + +// Team:Nexuiz backpack +void () item_backpack = +{ + if ((!self.mdl) && (!self.model)) + { + self.model = "models/objects/backpack/backpack.md3"; + } + if (self.cells) + self.ammo_cells = stof(self.cells); + if (self.shells) + self.ammo_shells = stof(self.shells); + if (self.rockets) + self.ammo_rockets = stof(self.rockets); + if (self.nails) + self.ammo_nails = stof(self.nails); + if (self.grenade1) + self.no_grenades_1 = stof(self.grenade1); + if (self.grenade2) + self.no_grenades_2 = stof(self.grenade2); + if (self.armor) + self.armorvalue = stof(self.armor); + if ((!self.delay) && (!self.wait)) + self.wait = 10; // next time item can be used + + ConvertToBackPack(); // finish conversion using q3f conversion func +}; diff --git a/TeamNexuiz/game/gamec/tfmenus.c b/TeamNexuiz/game/gamec/tfmenus.c index e98faa0df..a60c9364b 100644 --- a/TeamNexuiz/game/gamec/tfmenus.c +++ b/TeamNexuiz/game/gamec/tfmenus.c @@ -8,6 +8,7 @@ // Menus/Menu Input references void () Menu_EngineerFix_Tesla; void (float inp) Menu_EngineerFix_Tesla_Input; +void () Menu_Need_TeamNexuiz; // Resets the menu void() ResetMenu = @@ -45,6 +46,10 @@ void () Player_Menu = { Menu_EngineerFix_Tesla (); } + else if (self.current_menu == MENU_NEED_TN) + { + Menu_Need_TeamNexuiz (); + } else { self.current_menu = TF_FLARE_LIT; @@ -82,6 +87,11 @@ void () Menu_EngineerFix_Tesla = CenterPrint (self, "Tesla Modification Lab: ^16^7 Upgrades Max\n[^11^7] Upgrade Voltage - 1u\n[^12^7] Upgrade Amperage - 1u\n[^13^7] Upgrade Power Supply - 1u\n[^14^7] Make TeslaTurret(tm) - 2u\n[^15^7] Improved Targeting System - 2u\n[^16^7] Add Spy Detector - 4u\n[^17^7] Repair and Recharge \n[^18^7] Dismantle \n[^19^7] Îïôèéîç "); }; +void () Menu_Need_TeamNexuiz = +{ + CenterPrint(self, "^7Hello, welcome to a Team:Nexuiz server version ",TN_VERSION,"\n\n^5If you see this message it means that\n you do not have the Team:Nexuiz mod installed.\n\n^3To get the mod, please follow the instructions at:\nhttp://avirox.devretro.com/temp/teamnexuiz/TN_how_to.txt\n"); +} + // Tesla Menu Input void (float inp) Menu_EngineerFix_Tesla_Input = { diff --git a/TeamNexuiz/game/gamec/tfq3fitems.c b/TeamNexuiz/game/gamec/tfq3fitems.c index 6c74e29f4..e5fdd2379 100644 --- a/TeamNexuiz/game/gamec/tfq3fitems.c +++ b/TeamNexuiz/game/gamec/tfq3fitems.c @@ -88,7 +88,8 @@ void (float tno) ConvertToFlag = self.goal_no = 100; // Temp Goal Number, can be overridden by a "goal" def in the entity } self.classname = "item_tfgoal"; - self.message = self.carried_message; + if (self.carried_message) + self.message = self.carried_message; self.d_t = "the ÅÎÅÍÙ ìïóô your flag!\n"; // The enemy stole your flag msg self.b_o = "Your flag has been stolen!\n"; @@ -200,7 +201,6 @@ void () ConvertToBackPack = if (!(self.ammo_nails || self.ammo_cells || self.ammo_rockets || self.health)) { self.health = 50; - self.ammo_nails = 50; self.ammo_shells = 20; self.ammo_nails = 100; self.ammo_rockets = 15; -- 2.39.2