From 8d9c94f61dd6f16187d656e23217154cb94cd4f4 Mon Sep 17 00:00:00 2001 From: lalien Date: Mon, 24 Apr 2006 21:34:16 +0000 Subject: [PATCH] ********************************************************* * 2006/04/19 * * Madd_Mugsy * * Developed in VS 2003 * ********************************************************* - Restored the "accurate" and "inaccurate" strings that Rowa21 overwrote ;) - Added code to use the Accuracy tag in Weapons.xml - IMP.dat file changed to save a different file for each IMP - Different existing IMPs can be loaded by typing their names in the IMP webpage - Reverted changes to font.cpp due to Ivan's text not being displayed properly - Added an AutoPenalty stat to Weapons.xml to complement BurstPenalty - Added a NoSemiAuto stat to Weapons.xml to enable weapons that are Full-Auto only, code also added for AI to not use NoSemiAuto weapons in semi-auto mode - Added an APBonus stat to Items.xml to enable items to give you an APBonus/Penalty (ie: heavy armour) - Added code to enable the AimBonus and ToHitBonus stats to be read in from worn gear - Added Lesh's burst sound externalization code, added SilencedBurstSound tag to weapons.xml - Changed required camouflage amount to show merc as camo'd to 50%, due to some new items affecting the camouflage % - Added two new Merge options: Use_Item (6) and Use_Item_Hard (7), which enable the use of a single item on another single item. The hard one performs a mechanics check. Use_Item_Hard can be used for caliber conversion kits, etc. (But I need to add code to dump the old ammo still). - Use_Item can be used for things like opening your bullets up w/a knife to empty out some of the powder, for cold-loaded ammo. To Do: enable deterioration of the using item, figure out a way to enable multiple resultant items. - Commented out all the Air Strike code. - Changed the air strike options to be: "tons of guns" and "10 tons of guns" - Used the BigGunList stat in Items.xml to determine whether items can show up depending on the selection from #9 - Completely redid all the existing weapons' stats (and a couple images). - Changed some weapons' calibers, such as the SVD dragunov to 7.62x54r and the Type-85 to 7.62x25mm. Eliminated some types of ammo that do not exist (at least according to my source - so correct me if this is wrong and I'll add them back in): HP ammo in 7.62x39mm, 5.45mm, and 5.7mm. - Moved most of the old 1.13 specific weapons around in Items.xml to new spots. The items.xml file now goes to over 1000 (w/some "nothing" entries for organization) - Kept all the UB weapons, and some new weapons/items inside the old 350 item limit, so they can be assigned using ProEdit. To Do: Alter the binary files so pro-edit can see the right item names. - Throwing knife code changed, so that we can have more than one type of throwing knife. For now, this means that tossing your knife into the dirt won't un-bloody it. To Do: fix this later. - New weapon sounds (swiped from various mods) TODO: Incorporate Corpse's new weapon sounds - Reinstated 5% to-hit bonus for using a pistol w/two hands (nothing in offhand) and 5% to-hit penalty for using an SMG w/one hand (this one might've already been in, I forget) that the devs commented out - On top of those items added to 1.13 already, I've added/am in the process of adding: 200+ new guns, 30+ new grenades, 9+ new grenade launchers, 4 new rocket launchers, 8 new knives, a new throwing knife, 2 new armour attachments, 50+ new armours, 10+ new misc. items, 6+ new weapon attachments, 15+ new ammo calibers & 12+ new types of ammo (including cold-loaded variants) - resulting in 240+ new ammo items, and I'm probably missing stuff - Not all the images are in yet - will add as I get them done. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@38 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- JA2.suo | Bin 72704 -> 71168 bytes Laptop/IMP Confirm.cpp | 50 ++++++++++++++++++++++++++++++++++------ Laptop/IMP Confirm.h | 1 + Laptop/IMP HomePage.cpp | 15 ++++++++---- Laptop/IMP HomePage.h | 2 ++ Laptop/laptop.cpp | 4 ++-- 6 files changed, 59 insertions(+), 13 deletions(-) diff --git a/JA2.suo b/JA2.suo index 07b589185e97c44e6b557116f523dae43def2be5..1a56a8c028830c02094a61b8bf715bd7696db4d8 100644 GIT binary patch delta 918 zcmZ8fO-NKx6u#%ZJI|-{-W%utIgX5phzd<=Y8zXaMIlC$SgRHzLQzSLHjDg&5h8-1 z9}jf1Rk$r7dFHf|zzQ@AY8wP@qDAxrE-YoHb4SOd3*Wovedjwr_uQL#!81?!vkt`@ zVT^eRenKvv&j;|N5;n`|uaXcYR5?S+CRpX}1Nz#)8&HXQc^gOhvI$aBLZG-je&Ds3 zcAYX=IWfv!Hsj{F;W_~^r&Cij6RaKQzc3?V$h?w}OXhOc4GTP+0Wfxh@Q9$I*Ya18 zkPT9SHri#>G}%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K^3YQPFLS0`5ke6lbc;5L?@d3i{VTO8I>^Myr= s-(;~%Zw;!C!G55Al^umoe?qLTKQCuO+#>G=`Id;9e)*okEz3>(AAJ#HXaE2J diff --git a/Laptop/IMP Confirm.cpp b/Laptop/IMP Confirm.cpp index 5705cc3d..88fc2de6 100644 --- a/Laptop/IMP Confirm.cpp +++ b/Laptop/IMP Confirm.cpp @@ -651,13 +651,40 @@ INT32 FirstFreeBigEnoughPocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem) void WriteOutCurrentImpCharacter( INT32 iProfileId ) +{ + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: IMP.dat")); + char zImpFileName[12]; + strcat(zImpFileName,IMP_MERC_FILENAME); + strcat(zImpFileName,IMP_FILENAME_SUFFIX); + WriteOutCurrentImpCharacter ( iProfileId, zImpFileName); + + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat")); + + char zFileName[12]; + char temp; + + for(int i=0;i < 8;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead + { + temp = (char) gMercProfiles[iProfileId].zNickname[i]; + zFileName[i] = temp; + } + + strcat(zFileName,IMP_FILENAME_SUFFIX); + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", zFileName)); + WriteOutCurrentImpCharacter ( iProfileId, zFileName); +} + +void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName ) { // grab the profile number and write out what is contained there in HWFILE hFile; UINT32 uiBytesWritten = 0; // open the file for writing - hFile = FileOpen(strcat((STR)(&gMercProfiles[iProfileId].zNickname),IMP_FILENAME_SUFFIX), FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE); + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", fileName)); + hFile = FileOpen(fileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE); // write out the profile id if (!FileWrite(hFile, &iProfileId, sizeof( INT32 ), &uiBytesWritten)) @@ -685,11 +712,15 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId ) BOOLEAN ImpExists ( STR nickName ) { - DWORD attribs = GetFileAttributes(strcat(nickName,IMP_FILENAME_SUFFIX)); - if ( attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY) ) - return TRUE; - - return FALSE; + char zFileName[12]; + + strcpy(zFileName,nickName); + strcat(zFileName,IMP_FILENAME_SUFFIX); + + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %s", (STR) zFileName)); + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %d", FileExistsNoDB(zFileName) )); + + return FileExistsNoDB(zFileName); } void LoadImpCharacter( STR nickName ) @@ -698,8 +729,13 @@ void LoadImpCharacter( STR nickName ) HWFILE hFile; UINT32 uiBytesRead = 0; + char zFileName[12]; + + strcpy(zFileName,nickName); + strcat(zFileName,IMP_FILENAME_SUFFIX); + // open the file for writing - hFile = FileOpen(strcat(nickName,IMP_FILENAME_SUFFIX), FILE_ACCESS_READ, FALSE); + hFile = FileOpen(zFileName, FILE_ACCESS_READ, FALSE); // valid file? if( hFile == -1 ) diff --git a/Laptop/IMP Confirm.h b/Laptop/IMP Confirm.h index 283f49f4..9ae17f33 100644 --- a/Laptop/IMP Confirm.h +++ b/Laptop/IMP Confirm.h @@ -9,6 +9,7 @@ void HandleIMPConfirm( void ); BOOLEAN AddCharacterToPlayersTeam( void ); void LoadImpCharacter( STR fileName ); void WriteOutCurrentImpCharacter( INT32 iProfileId ); +void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName ); void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID ); diff --git a/Laptop/IMP HomePage.cpp b/Laptop/IMP HomePage.cpp index fa2b0e00..b8bb03f8 100644 --- a/Laptop/IMP HomePage.cpp +++ b/Laptop/IMP HomePage.cpp @@ -342,7 +342,7 @@ void HandleTextEvent( UINT32 uiKey ) uiKey == '_' || uiKey == '.' ) { // if the current string position is at max or great, do nothing - if( iStringPos >= 6 ) + if( iStringPos >= 8 ) { break; } @@ -387,6 +387,9 @@ void ProcessPlayerInputActivationString( void ) if( NumberOfMercsOnPlayerTeam() >= 18 ) return; + char charPlayerActivationString[32]; + wcstombs(charPlayerActivationString,pPlayerActivationString,32); + //Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) { @@ -397,10 +400,14 @@ void ProcessPlayerInputActivationString( void ) } //Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) ) - // Madd: load characters by name: - else if ( ImpExists( (STR)pPlayerActivationString ) ) + else if( wcscmp(pPlayerActivationString, L"90210") == 0 ) { - LoadImpCharacter( (STR)pPlayerActivationString ); + LoadImpCharacter( IMP_MERC_FILENAME ); + } + // Madd: load characters by name + else if ( ImpExists( charPlayerActivationString ) ) + { + LoadImpCharacter( charPlayerActivationString ); } else diff --git a/Laptop/IMP HomePage.h b/Laptop/IMP HomePage.h index 500ba641..c6d657b8 100644 --- a/Laptop/IMP HomePage.h +++ b/Laptop/IMP HomePage.h @@ -12,5 +12,7 @@ void HandleImpHomePage( void ); #define MIN_GLOW_DELTA 100 #define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6 +#define IMP_MERC_FILENAME "IMP" + extern INT32 GlowColorsList[][3]; #endif \ No newline at end of file diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index 316c3941..9fe6e72f 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -4519,8 +4519,8 @@ BOOLEAN DisplayTitleBarMaximizeGraphic(BOOLEAN fForward, BOOLEAN fInit, UINT16 u sPosBottomY = LAPTOP_TITLE_BAR_HEIGHT; - SrcRect.iLeft = iScreenWidthOffset; - SrcRect.iTop = iScreenHeightOffset; + SrcRect.iLeft = 0; + SrcRect.iTop = 0; SrcRect.iRight = LAPTOP_TITLE_BAR_WIDTH; SrcRect.iBottom = LAPTOP_TITLE_BAR_HEIGHT;