From 741e5c03bf0c3016e3a452aa7bf3322e0195a797 Mon Sep 17 00:00:00 2001 From: haydent Date: Sun, 18 May 2008 02:53:59 +0000 Subject: [PATCH] added slay > $$$ 4 iggy fixed coop stopped speck talking preopened merc account CREATURE_ENABLED = 0 no longer has any effect u can remove it from ur ini ALLOW_CUSTOM_NIV = 1 -> new server ini variable, please add added gear cost to MERC's please feel free to make suggestion on MERC NPC costs... git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2178 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/mercs Files.cpp | 17 +++++++++++++++-- Laptop/mercs.cpp | 6 ++++++ Laptop/mercs.h | 5 ++--- MainMenuScreen.cpp | 4 ++-- Multiplayer/client.cpp | 35 ++++++++++++++++++++++++++--------- Multiplayer/network.h | 3 ++- Multiplayer/server.cpp | 22 +++++++++++++++------- 7 files changed, 68 insertions(+), 24 deletions(-) diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 25d0ff71..5422f38e 100644 --- a/Laptop/mercs Files.cpp +++ b/Laptop/mercs Files.cpp @@ -535,6 +535,7 @@ void DisplayMercsStats( UINT8 ubMercID ) { UINT16 usPosY, usPosX; CHAR16 sString[128]; + CHAR16 NsString[128]; usPosY = MERC_HEALTH_Y; @@ -599,7 +600,10 @@ void DisplayMercsStats( UINT8 ubMercID ) usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT) + 1; swprintf(sString, L"%d %s", gMercProfiles[ ubMercID ].sSalary, MercInfo[MERC_FILES_PER_DAY]); + swprintf(NsString, L"+ %d gear.",gMercProfiles[ ubMercID ].usOptionalGearCost); + DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); + if(is_networked && ALLOW_EQUIP)DrawTextToScreen( NsString, usPosX, usPosY+MERC_SPACE_BN_LINES, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); } @@ -608,6 +612,7 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) { MERC_HIRE_STRUCT HireMercStruct; INT8 bReturnCode; + INT32 Namount=0; memset(&HireMercStruct, 0, sizeof(MERC_HIRE_STRUCT)); @@ -652,7 +657,11 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) //Set the time and ID of the last hired merc will arrive // LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = HireMercStruct.ubProfileID; // LaptopSaveInfo.sLastHiredMerc.uiArrivalTime = HireMercStruct.uiTimeTillMercArrives; - if(is_networked && (gMercProfiles[ ubMercID ].sSalary > LaptopSaveInfo.iCurrentBalance) ) + + Namount += gMercProfiles[ ubMercID ].sSalary * (-1); + if(ALLOW_EQUIP)Namount += gMercProfiles[ubMercID].usOptionalGearCost * (-1); + + if(is_networked && (Namount*(-1) > LaptopSaveInfo.iCurrentBalance)) { DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); return(FALSE);//not enough big ones $$$sATMText @@ -673,7 +682,11 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) { //take off nominal fee: hayden, if (is_networked) - AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), gMercProfiles[ ubMercID ].sSalary * (-1) ); + { + + + AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount ); + } //if we succesfully hired the merc return(TRUE); } diff --git a/Laptop/mercs.cpp b/Laptop/mercs.cpp index abce0e75..affe1984 100644 --- a/Laptop/mercs.cpp +++ b/Laptop/mercs.cpp @@ -27,6 +27,7 @@ #include "Quests.h" #endif +#include "connect.h" UINT8 NUMBER_OF_MERCS; UINT8 LAST_MERC_ID; @@ -362,6 +363,7 @@ void GameInitMercs() gubMercArray[ 24 ] = 69; gubMercArray[ 25 ] = 70; gubMercArray[ 26 ] = 72; + gubMercArray[ 27 ] = 64; LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_NO_ACCOUNT; gubCurMercIndex = 0; @@ -1068,6 +1070,8 @@ void InitMercVideoFace() BOOLEAN StartSpeckTalking(UINT16 usQuoteNum) { + + if(is_networked)return( FALSE ); if( usQuoteNum == MERC_VIDEO_SPECK_SPEECH_NOT_TALKING || usQuoteNum == MERC_VIDEO_SPECK_HAS_TO_TALK_BUT_QUOTE_NOT_CHOSEN_YET ) return( FALSE ); @@ -2161,6 +2165,8 @@ BOOLEAN ShouldSpeckStartTalkingDueToActionOnSubPage() BOOLEAN ShouldSpeckSayAQuote() { + + //if we are entering from anywhere except a sub page, and we should say the opening quote if( gfJustEnteredMercSite && gubArrivedFromMercSubSite == MERC_CAME_FROM_OTHER_PAGE ) { diff --git a/Laptop/mercs.h b/Laptop/mercs.h index 70f29929..ab406c90 100644 --- a/Laptop/mercs.h +++ b/Laptop/mercs.h @@ -8,9 +8,8 @@ extern UINT8 NUMBER_OF_MERCS; extern UINT8 LAST_MERC_ID; -#define MAX_NUMBER_OF_MERCS 27 -//#define NUMBER_OF_MERCS 27//hayden -//#define LAST_MERC_ID 26//hayden +#define MAX_NUMBER_OF_MERCS 28 + #define NUMBER_OF_BAD_MERCS 5 #define NUMBER_MERCS_AFTER_FIRST_MERC_ARRIVES 6 #define NUMBER_MERCS_AFTER_SECOND_MERC_ARRIVES 8 diff --git a/MainMenuScreen.cpp b/MainMenuScreen.cpp index f0a25107..157dd3ae 100644 --- a/MainMenuScreen.cpp +++ b/MainMenuScreen.cpp @@ -395,8 +395,8 @@ void InitDependingGameStyleOptions(BOOLEAN isNetworked) if (isNetworked) { - NUMBER_OF_MERCS = 27; - LAST_MERC_ID = 26; + NUMBER_OF_MERCS = 28; + LAST_MERC_ID = 27; } else { diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp index 07b7b40f..c866956c 100644 --- a/Multiplayer/client.cpp +++ b/Multiplayer/client.cpp @@ -241,6 +241,7 @@ char ckbag[100]; int REPORT_NAME; int WEAPON_READIED_BONUS; + int ALLOW_CUSTOM_NIV; int ENEMY_ENABLED; int CREATURE_ENABLED; @@ -567,6 +568,15 @@ void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLen SOLDIERTYPE *pSoldier = MercPtrs[ iNewIndex ]; pSoldier->ubStrategicInsertionCode=(atoi(SECT_EDGE)); // this sets the param read from the ini for your starting sector edge... + if(ubCurrentSoldier==64)//slay + { + pSoldier->ubBodyType = REGMALE; + //pSoldier->EVENT_InitNewSoldierAnim( STANDING, 0 , TRUE ); + gMercProfiles[ pSoldier->ubProfile ].ubBodyType = REGMALE; + + } + + ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[44], pSoldier->name); @@ -645,13 +655,18 @@ void recieveHIRE(RPCParameters *rpcParameters) gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED; if(!SAME_MERC)gMercProfiles[ pSoldier->ubProfile ].bMercStatus = MERC_WORKING_ELSEWHERE; pSoldier->bSide=0; //default coop only + + if(MercCreateStruct.ubProfile==64)//slay + { + pSoldier->ubBodyType = REGMALE; + //pSoldier->EVENT_InitNewSoldierAnim( STANDING, 0 , TRUE ); + gMercProfiles[ pSoldier->ubProfile ].ubBodyType = REGMALE; + + } + if(PLAYER_BSIDE==0)//all vs all only { pSoldier->bSide=1; - //if(MercCreateStruct.bTeam==6)pSoldier->bSide=OP_TEAM_1; - // if(MercCreateStruct.bTeam==7)pSoldier->bSide=OP_TEAM_2; - // if(MercCreateStruct.bTeam==8)pSoldier->bSide=OP_TEAM_3; - // if(MercCreateStruct.bTeam==9)pSoldier->bSide=OP_TEAM_4; } if(PLAYER_BSIDE==1) //allow teams @@ -1846,7 +1861,7 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve gGameOptions.fIronManMode=cl_lan->sofIronManMode; gGameOptions.ubBobbyRay=cl_lan->soubBobbyRay; - //gGameOptions.ubInventorySystem=cl_lan->sofNewInv; + if(!cl_lan->soDis_Bobby)LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE; @@ -1879,6 +1894,8 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve InitNewGameClock( ); WEAPON_READIED_BONUS=cl_lan->WEAPON_READIED_BONUS; + ALLOW_CUSTOM_NIV=cl_lan->ALLOW_CUSTOM_NIV; + if(ALLOW_CUSTOM_NIV==0)gGameOptions.ubInventorySystem=cl_lan->sofNewInv; ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[26],cl_lan->client_num,szDefault,cl_lan->cl_edge,cl_lan->team ); @@ -2598,10 +2615,7 @@ void connect_client ( void ) gTacticalStatus.uiFlags&= (~SHOW_ALL_MERCS ); memset( &readyteamreg , 0 , sizeof (int) * 10); - ENEMY_ENABLED=0; - CREATURE_ENABLED=0; - MILITIA_ENABLED=0; - CIV_ENABLED=0; + //retrieve settings from Ja2_mp.ini char ip[30]; @@ -2688,6 +2702,8 @@ void connect_client ( void ) LaptopSaveInfo.gubLastMercIndex = LAST_MERC_ID; LaptopSaveInfo.ubLastMercAvailableId = 7; + gGameExternalOptions.fEnableSlayForever =1; + LaptopSaveInfo.gubPlayersMercAccountStatus = 4; extern BOOLEAN gfTemporaryDisablingOfLoadPendingFlag; gfTemporaryDisablingOfLoadPendingFlag = TRUE; @@ -2703,6 +2719,7 @@ void connect_client ( void ) gMercProfiles[ 64 ].sSalary = 1500; gMercProfiles[ 72 ].sSalary = 1000; gMercProfiles[ 148 ].sSalary = 100; + gMercProfiles[ 68 ].sSalary = 2200; //iggy; //********************** diff --git a/Multiplayer/network.h b/Multiplayer/network.h index bab8bb89..7a483aca 100644 --- a/Multiplayer/network.h +++ b/Multiplayer/network.h @@ -36,7 +36,7 @@ typedef struct BOOLEAN sofTurnTimeLimit; BOOLEAN sofIronManMode; UINT8 soubBobbyRay; - //BOOLEAN sofNewInv; // WANNE - MP: New inventory: Removed, so now each client can decide if playing with old or new inventory + BOOLEAN sofNewInv; INT32 gsMAX_MERCS; UINT8 client_num; char client_name[30]; @@ -50,6 +50,7 @@ typedef struct int cl_edge; float TIME; int WEAPON_READIED_BONUS; + int ALLOW_CUSTOM_NIV; } settings_struct; //typedef struct diff --git a/Multiplayer/server.cpp b/Multiplayer/server.cpp index 03b35f38..0539ba41 100644 --- a/Multiplayer/server.cpp +++ b/Multiplayer/server.cpp @@ -48,6 +48,7 @@ INT32 gssecs_per_tick; INT32 gsstarting_balance; float TIME; int sWEAPON_READIED_BONUS; +int sALLOW_CUSTOM_NIV; unsigned char SGetPacketIdentifier(Packet *p); unsigned char SpacketIdentifier; @@ -342,7 +343,7 @@ void requestSETTINGS(RPCParameters *rpcParameters ) lan.sofIronManMode=gGameOptions.fIronManMode; lan.starting_balance=gsstarting_balance; - //lan.sofNewInv=gGameOptions.ubInventorySystem; + lan.sofNewInv=gGameOptions.ubInventorySystem; lan.soDis_Bobby=gsDis_Bobby; lan.soDis_Equip=gsDis_Equip; @@ -351,17 +352,15 @@ void requestSETTINGS(RPCParameters *rpcParameters ) memcpy( lan.client_names , client_names, sizeof( char ) * 4 * 30 ); lan.team=clinf->team; - //lan.cl_ops[0]=clinf->cl_ops[0]; - //lan.cl_ops[1]=clinf->cl_ops[1]; - //lan.cl_ops[2]=clinf->cl_ops[2]; - //lan.cl_ops[3]=clinf->cl_ops[3]; - //memcpy(lan.cl_ops,clinf->cl_ops,sizeof(int)*4); -//// + + lan.TESTING=gsTESTING; lan.cl_edge=clinf->cl_edge; lan.TIME=TIME; lan.WEAPON_READIED_BONUS=sWEAPON_READIED_BONUS; + lan.ALLOW_CUSTOM_NIV=sALLOW_CUSTOM_NIV; + server->RPC("recieveSETTINGS",(const char*)&lan, (int)sizeof(settings_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0); @@ -474,6 +473,11 @@ void start_server (void) gsPLAYER_BSIDE = atoi(player_bside); + ENEMY_ENABLED=0; + CREATURE_ENABLED=0; + MILITIA_ENABLED=0; + CIV_ENABLED=0; + if(gsPLAYER_BSIDE==2)//only enable ai during coop { ENEMY_ENABLED =atoi(bteam1_enabled); @@ -499,6 +503,10 @@ if(gsPLAYER_BSIDE==2)//only enable ai during coop GetPrivateProfileString( "Ja2_mp Settings","WEAPON_READIED_BONUS", "", wpr, MAX_PATH, "..\\Ja2_mp.ini" ); sWEAPON_READIED_BONUS=atoi(wpr); + char acniv[30]; + GetPrivateProfileString( "Ja2_mp Settings","ALLOW_CUSTOM_NIV", "", acniv, MAX_PATH, "..\\Ja2_mp.ini" ); + sALLOW_CUSTOM_NIV=atoi(acniv); + //**********************