From df56cf0ff92ccd71ec9a0fc168634bf49a19eb29 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Tue, 30 May 2006 20:01:42 +0000 Subject: [PATCH] -renamed and updated prof.dat files by difficulty level and tons of guns selection -re-sorted shopkeeper items by name, since there were too many to list otherwise. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@138 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 4 +- Tactical/ArmsDealerInvInit.cpp | 157 +++++++++++++++++---------------- Tactical/Soldier Profile.cpp | 34 +++++-- 3 files changed, 109 insertions(+), 86 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 651cc154..35c6909a 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.136" }; + INT16 zVersionLabel[256] = { L"Release v1.13.137" }; #endif -INT8 czVersionNumber[16] = { "Build 06.05.26" }; +INT8 czVersionNumber[16] = { "Build 06.05.30" }; INT16 zTrackingNumber[16] = { L"Z" }; diff --git a/Tactical/ArmsDealerInvInit.cpp b/Tactical/ArmsDealerInvInit.cpp index e3780d33..ce2ce6a2 100644 --- a/Tactical/ArmsDealerInvInit.cpp +++ b/Tactical/ArmsDealerInvInit.cpp @@ -1278,10 +1278,10 @@ int CompareItemsForSorting( UINT16 usItem1Index, UINT16 usItem2Index, UINT8 ubIt { UINT8 ubItem1Category; UINT8 ubItem2Category; - UINT16 usItem1Price; - UINT16 usItem2Price; - UINT8 ubItem1Coolness; - UINT8 ubItem2Coolness; + //UINT16 usItem1Price; + //UINT16 usItem2Price; + //UINT8 ubItem1Coolness; + //UINT8 ubItem2Coolness; ubItem1Category = GetDealerItemCategoryNumber( usItem1Index ); ubItem2Category = GetDealerItemCategoryNumber( usItem2Index ); @@ -1299,85 +1299,90 @@ int CompareItemsForSorting( UINT16 usItem1Index, UINT16 usItem2Index, UINT8 ubIt else { // the same category - if ( Item[ usItem1Index ].usItemClass == IC_AMMO && Item[ usItem2Index ].usItemClass == IC_AMMO ) - { - UINT8 ubItem1Calibre; - UINT8 ubItem2Calibre; - UINT8 ubItem1MagSize; - UINT8 ubItem2MagSize; + //if ( Item[ usItem1Index ].usItemClass == IC_AMMO && Item[ usItem2Index ].usItemClass == IC_AMMO ) + //{ + //UINT8 ubItem1Calibre; + //UINT8 ubItem2Calibre; + //UINT8 ubItem1MagSize; + //UINT8 ubItem2MagSize; // AMMO is sorted by caliber first - ubItem1Calibre = Magazine[ Item[ usItem1Index ].ubClassIndex ].ubCalibre; - ubItem2Calibre = Magazine[ Item[ usItem2Index ].ubClassIndex ].ubCalibre; - if ( ubItem1Calibre > ubItem2Calibre ) - { - return( -1 ); - } - else - if ( ubItem1Calibre < ubItem2Calibre ) - { - return( 1 ); - } - // the same caliber - compare size of magazine, then fall out of if statement - ubItem1MagSize = Magazine[ Item[ usItem1Index ].ubClassIndex ].ubMagSize; - ubItem2MagSize = Magazine[ Item[ usItem2Index ].ubClassIndex ].ubMagSize; - if ( ubItem1MagSize > ubItem2MagSize ) - { - return( -1 ); - } - else - if ( ubItem1MagSize < ubItem2MagSize ) - { - return( 1 ); - } - - } - else - { + //ubItem1Calibre = Magazine[ Item[ usItem1Index ].ubClassIndex ].ubCalibre; + //ubItem2Calibre = Magazine[ Item[ usItem2Index ].ubClassIndex ].ubCalibre; + //if ( ubItem1Calibre > ubItem2Calibre ) + //{ + // return( -1 ); + //} + //else + //if ( ubItem1Calibre < ubItem2Calibre ) + //{ + // return( 1 ); + //} + //// the same caliber - compare size of magazine, then fall out of if statement + //ubItem1MagSize = Magazine[ Item[ usItem1Index ].ubClassIndex ].ubMagSize; + //ubItem2MagSize = Magazine[ Item[ usItem2Index ].ubClassIndex ].ubMagSize; + //if ( ubItem1MagSize > ubItem2MagSize ) + //{ + // return( -1 ); + //} + //else + //if ( ubItem1MagSize < ubItem2MagSize ) + //{ + // return( 1 ); + //} + //} + //else + //{ // items other than ammo are compared on coolness first - ubItem1Coolness = Item[ usItem1Index ].ubCoolness; - ubItem2Coolness = Item[ usItem2Index ].ubCoolness; + //ubItem1Coolness = Item[ usItem1Index ].ubCoolness; + //ubItem2Coolness = Item[ usItem2Index ].ubCoolness; - // higher coolness first - if ( ubItem1Coolness > ubItem2Coolness ) - { - return( -1 ); - } - else - if ( ubItem1Coolness < ubItem2Coolness ) - { - return( 1 ); - } - } + //// higher coolness first + //if ( ubItem1Coolness > ubItem2Coolness ) + //{ + // return( -1 ); + //} + //else + //if ( ubItem1Coolness < ubItem2Coolness ) + //{ + // return( 1 ); + //} + //} // the same coolness/caliber - compare base prices then - usItem1Price = Item[ usItem1Index ].usPrice; - usItem2Price = Item[ usItem2Index ].usPrice; + //usItem1Price = Item[ usItem1Index ].usPrice; + //usItem2Price = Item[ usItem2Index ].usPrice; - // higher price first - if ( usItem1Price > usItem2Price ) - { - return( -1 ); - } - else - if ( usItem1Price < usItem2Price ) - { - return( 1 ); - } - else - { + //// higher price first + //if ( usItem1Price > usItem2Price ) + //{ + // return( -1 ); + //} + //else + //if ( usItem1Price < usItem2Price ) + //{ + // return( 1 ); + //} + //else + //{ // the same price - compare item #s, then - // lower index first - if ( usItem1Index < usItem2Index ) - { - return( -1 ); - } - else - if ( usItem1Index > usItem2Index ) - { - return( 1 ); - } + //// lower index first + //if ( usItem1Index < usItem2Index ) + //{ + // return( -1 ); + //} + //else + //if ( usItem1Index > usItem2Index ) + //{ + // return( 1 ); + //} + + //Madd: sort by name (for now at least): + if (_stricmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) < 0 ) + return -1; + else if (_stricmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) > 0 ) + return 1; else { // same item type = compare item quality, then @@ -1398,7 +1403,7 @@ int CompareItemsForSorting( UINT16 usItem1Index, UINT16 usItem2Index, UINT8 ubIt return( 0 ); } } - } + //} } } @@ -1415,7 +1420,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex ) if ( usItemIndex < MAXITEMS && IsWeapon(usItemIndex) ) { - ubWeaponClass = Weapon[ usItemIndex ].ubWeaponClass; + ubWeaponClass = 0;// Madd: commented out so we can sort guns by name instead ... Weapon[ usItemIndex ].ubWeaponClass; } else { diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index f9a8493b..35944831 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -211,10 +211,16 @@ BOOLEAN LoadMercProfiles(void) // FILE *fptr; HWFILE fptr; char *pFileName = "BINARYDATA\\Prof.dat"; - char *pFileName1 = "BINARYDATA\\Prof1.dat"; - char *pFileName2 = "BINARYDATA\\Prof2.dat"; - char *pFileName3 = "BINARYDATA\\Prof3.dat"; - char *pFileName4 = "BINARYDATA\\Prof4.dat"; + + char *pFileName1_Normal = "BINARYDATA\\Prof_Novice_NormalGuns.dat"; + char *pFileName2_Normal = "BINARYDATA\\Prof_Experienced_NormalGuns.dat"; + char *pFileName3_Normal = "BINARYDATA\\Prof_Expert_NormalGuns.dat"; + char *pFileName4_Normal = "BINARYDATA\\Prof_Insane_NormalGuns.dat"; + + char *pFileName1_Tons = "BINARYDATA\\Prof_Novice_TonsOfGuns.dat"; + char *pFileName2_Tons = "BINARYDATA\\Prof_Experienced_TonsOfGuns.dat"; + char *pFileName3_Tons = "BINARYDATA\\Prof_Expert_TonsOfGuns.dat"; + char *pFileName4_Tons = "BINARYDATA\\Prof_Insane_TonsOfGuns.dat"; UINT32 uiLoop, uiLoop2;//, uiLoop3; UINT16 usItem;//, usNewGun, usAmmo, usNewAmmo; @@ -223,16 +229,28 @@ BOOLEAN LoadMercProfiles(void) switch ( gGameOptions.ubDifficultyLevel) { case DIF_LEVEL_EASY: - fptr = FileOpen(pFileName1, FILE_ACCESS_READ, FALSE ); + if ( gGameOptions.fGunNut ) + fptr = FileOpen(pFileName1_Tons, FILE_ACCESS_READ, FALSE ); + else + fptr = FileOpen(pFileName1_Normal, FILE_ACCESS_READ, FALSE ); break; case DIF_LEVEL_MEDIUM: - fptr = FileOpen(pFileName2, FILE_ACCESS_READ, FALSE ); + if ( gGameOptions.fGunNut ) + fptr = FileOpen(pFileName2_Tons, FILE_ACCESS_READ, FALSE ); + else + fptr = FileOpen(pFileName2_Normal, FILE_ACCESS_READ, FALSE ); break; case DIF_LEVEL_HARD: - fptr = FileOpen(pFileName3, FILE_ACCESS_READ, FALSE ); + if ( gGameOptions.fGunNut ) + fptr = FileOpen(pFileName3_Tons, FILE_ACCESS_READ, FALSE ); + else + fptr = FileOpen(pFileName3_Normal, FILE_ACCESS_READ, FALSE ); break; case DIF_LEVEL_INSANE: - fptr = FileOpen(pFileName4, FILE_ACCESS_READ, FALSE ); + if ( gGameOptions.fGunNut ) + fptr = FileOpen(pFileName4_Tons, FILE_ACCESS_READ, FALSE ); + else + fptr = FileOpen(pFileName4_Normal, FILE_ACCESS_READ, FALSE ); break; default: fptr = FileOpen(pFileName, FILE_ACCESS_READ, FALSE );