diff --git a/Strategic/Map Screen Interface Map Inventory.h b/Strategic/Map Screen Interface Map Inventory.h index 3b97350f6..86abd206e 100644 --- a/Strategic/Map Screen Interface Map Inventory.h +++ b/Strategic/Map Screen Interface Map Inventory.h @@ -58,6 +58,8 @@ extern INT32 sObjectSourceGridNo; extern INT32 iCurrentInventoryPoolPage; extern INT32 iLastInventoryPoolPage; extern BOOLEAN fMapInventoryItemCompatable[ ]; +// anv: extern'd this for use in Interface Enhanced.cpp +extern BOOLEAN gfCheckForCursorOverMapSectorInventoryItem; // HEADROCK HAM 5: Same idea as above, this flags items as being candidates for appearing in Zoomed mode. extern BOOLEAN gfMapInventoryItemToZoom[ ]; extern INT32 MAP_INVENTORY_POOL_SLOT_COUNT; diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 0ca0e4bec..3a653194c 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -4217,14 +4217,29 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) INT16 sOffsetY = 1; UINT8 ubNumLine; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; if (gubDescBoxPage == 1) { + // anv: if alt is pressed in map inventory, show comparison with selected weapon + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + //////////////////// ACCURACY - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { if (UsingNewCTHSystem() == true) { @@ -4238,14 +4253,16 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } //////////////////// DAMAGE - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) ) { ubNumLine = 1; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 5, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// RANGE - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) ) { if (UsingNewCTHSystem() == true) { @@ -4259,14 +4276,16 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } //////////////////// GUN HANDLING - if ( UsingNewCTHSystem() == TRUE && Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if ( ( UsingNewCTHSystem() == TRUE && Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && UsingNewCTHSystem() == TRUE && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { ubNumLine = 3; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 33, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// ALLOWED AIM LEVELS - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) ) { if (UsingNewCTHSystem() == true) { @@ -4280,23 +4299,28 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } //////////////////// OCTH AIMING BONUS - if ( UsingNewCTHSystem() == false && - (GetFlatAimBonus( gpItemDescObject ) != 0 || Item[gpItemDescObject->usItem].aimbonus != 0) ) + if ( ( UsingNewCTHSystem() == false && + (GetFlatAimBonus( gpItemDescObject ) != 0 || Item[gpItemDescObject->usItem].aimbonus != 0) ) || + ( fComparisonMode && UsingNewCTHSystem() == false && + (GetFlatAimBonus( gpComparedItemDescObject ) != 0 || Item[gpComparedItemDescObject->usItem].aimbonus != 0) ) ) { ubNumLine = 4; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 15, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// SCOPE MAGNIFICATION - if ( UsingNewCTHSystem() == true && Item[ gpItemDescObject->usItem ].usItemClass & IC_GUN ) + if ( ( UsingNewCTHSystem() == true && Item[ gpItemDescObject->usItem ].usItemClass & IC_GUN ) || + ( fComparisonMode && UsingNewCTHSystem() == true && Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_GUN ) ) { ubNumLine = 5; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 15, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// OCTH MINIMUM RANGE FOR AIMING BONUS - if( UsingNewCTHSystem() == false && - ( Item[gpItemDescObject->usItem].minrangeforaimbonus > 0 || GetMinRangeForAimBonus( NULL, gpItemDescObject ) > 0 ) ) + if( (UsingNewCTHSystem() == false && + ( Item[gpItemDescObject->usItem].minrangeforaimbonus > 0 || GetMinRangeForAimBonus( NULL, gpItemDescObject ) > 0 ) ) || + ( fComparisonMode &&UsingNewCTHSystem() == false && + ( Item[gpComparedItemDescObject->usItem].minrangeforaimbonus > 0 || GetMinRangeForAimBonus( NULL, gpComparedItemDescObject ) > 0 ) ) ) { ubNumLine = 5; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 27, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4304,33 +4328,42 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) //////////////////// PROJECTION FACTOR // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor but we use the same icon - if (UsingNewCTHSystem() == true && + if ( (UsingNewCTHSystem() == true && ( (Item[gpItemDescObject->usItem].projectionfactor > 1.0 || GetProjectionFactor( gpItemDescObject ) > 1.0) || ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpItemDescObject ) > 0 - && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) || + ( fComparisonMode && UsingNewCTHSystem() == true && + ( (Item[gpComparedItemDescObject->usItem].projectionfactor > 1.0 || GetProjectionFactor( gpComparedItemDescObject ) > 1.0) || + ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpComparedItemDescObject ) > 0 + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) ) { ubNumLine = 6; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 14, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// OCTH TO=HIT BONUS - if (UsingNewCTHSystem() == false && - (Item[gpItemDescObject->usItem].tohitbonus != 0 || GetFlatToHitBonus( gpItemDescObject ) != 0) ) + if ( (UsingNewCTHSystem() == false && + (Item[gpItemDescObject->usItem].tohitbonus != 0 || GetFlatToHitBonus( gpItemDescObject ) != 0) ) || + ( fComparisonMode && UsingNewCTHSystem() == false && + (Item[gpComparedItemDescObject->usItem].tohitbonus != 0 || GetFlatToHitBonus( gpComparedItemDescObject ) != 0) ) ) { ubNumLine = 6; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 13, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// OCTH BEST LASER RANGE - if (UsingNewCTHSystem() == false && - (Item[gpItemDescObject->usItem].bestlaserrange > 0 || GetAverageBestLaserRange( gpItemDescObject ) > 0 ) ) + if ( (UsingNewCTHSystem() == false && + (Item[gpItemDescObject->usItem].bestlaserrange > 0 || GetAverageBestLaserRange( gpItemDescObject ) > 0 ) ) || + ( fComparisonMode && UsingNewCTHSystem() == false && + (Item[gpComparedItemDescObject->usItem].bestlaserrange > 0 || GetAverageBestLaserRange( gpComparedItemDescObject ) > 0 ) ) ) { ubNumLine = 7; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 14, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// FLASH SUPPRESSION - if (IsFlashSuppressorAlt( gpItemDescObject )) + if (IsFlashSuppressorAlt( gpItemDescObject ) || + ( fComparisonMode && IsFlashSuppressorAlt( gpComparedItemDescObject ) ) ) { if (UsingNewCTHSystem() == true) { @@ -4345,7 +4378,7 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } //////////////////// LOUDNESS - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + //if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) { if (UsingNewCTHSystem() == true) { @@ -4382,7 +4415,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) ubNumLine = 11; } - if ( !Item[gpItemDescObject->usItem].repairable ) + if ( !Item[gpItemDescObject->usItem].repairable || + ( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[ubNumLine][0].sLeft + sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } @@ -4398,20 +4432,22 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } //////////////////// DRAW COST - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem].rocketlauncher ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem].rocketlauncher ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem].rocketlauncher ) ) { ubNumLine = 13; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 1, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } //////////////////// SINGLE SHOT COST - GUN - if ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) ) { ubNumLine = 14; // "NO SINGLE-SHOT" ICON BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 19, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); - if ( !Weapon[gpItemDescObject->usItem].NoSemiAuto ) + if ( ( !Weapon[gpItemDescObject->usItem].NoSemiAuto && !fComparisonMode ) || ( fComparisonMode && !Weapon[gpItemDescObject->usItem].NoSemiAuto ) ) { // SINGLE SHOT AP ICON overwrites shadow BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 0, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX+1, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4419,7 +4455,8 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } /////////////////// SINGLE SHOT COST - ROCKET - if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpItemDescObject->usItem].rocketlauncher ) + if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpItemDescObject->usItem].rocketlauncher && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && Item[gpComparedItemDescObject->usItem].rocketlauncher ) ) { ubNumLine = 14; // SINGLE ROCKET-LAUNCH AP ICON @@ -4427,42 +4464,48 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } /////////////////// SINGLE SHOT COST - GRENADE LAUNCHER - if ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher - && !Weapon[gpItemDescObject->usItem].NoSemiAuto ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher + && !Weapon[gpItemDescObject->usItem].NoSemiAuto && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpComparedItemDescObject->usItem].rocketlauncher + && !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) ) { ubNumLine = 14; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 24, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } /////////////////// SINGLE SHOT COST - THROWING KNIFE - if ( Item[gpItemDescObject->usItem].usItemClass == IC_THROWING_KNIFE ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_THROWING_KNIFE && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_THROWING_KNIFE ) ) { ubNumLine = 14; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 22, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } /////////////////// SINGLE SHOT COST - STABBING KNIFE - if ( Item[gpItemDescObject->usItem].usItemClass == IC_BLADE ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_BLADE && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_BLADE ) ) { ubNumLine = 14; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 20, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } /////////////////// SINGLE SHOT COST - BLUNT WEAPON - if ( Item[gpItemDescObject->usItem].usItemClass == IC_PUNCH ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_PUNCH && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_PUNCH ) ) { ubNumLine = 14; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 26, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } /////////////////// BURST COST - GUN - if ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) ) { ubNumLine = 15; // "NO BURST" ICON BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 11, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); - if (GetShotsPerBurst(gpItemDescObject)> 0) + if ( ( GetShotsPerBurst(gpItemDescObject)> 0 && !fComparisonMode ) || ( fComparisonMode && GetShotsPerBurst(gpComparedItemDescObject)> 0 ) ) { for ( cnt = 0; cnt < GetShotsPerBurst(gpItemDescObject); cnt++ ) { @@ -4471,23 +4514,25 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } } } - ////////////////// BURST COST - GRENADE LAUNCHER - if ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher - && GetShotsPerBurst(gpItemDescObject)> 0) + else if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher + && GetShotsPerBurst(gpItemDescObject)> 0 ) || + ( fComparisonMode && Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER && !Item[gpItemDescObject->usItem].rocketlauncher + && GetShotsPerBurst(gpItemDescObject)> 0 ) ) { ubNumLine = 15; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 25, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////// AUTOFIRE COST - if ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) + if ( ( Item[gpItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpItemDescObject->usItem].rocketlauncher ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN && !Item[gpComparedItemDescObject->usItem].rocketlauncher ) ) { ubNumLine = 16; // "NO-AUTO" ICON BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 12, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); - if (GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) + if ( ( GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 && !fComparisonMode ) || ( fComparisonMode && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) ) ) { for ( cnt = 0; cnt < 10; cnt++ ) { @@ -4497,16 +4542,20 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } } + ////////////////// RELOAD COST - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) ) { ubNumLine = 17; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 2, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////// MANUAL RELOAD COST - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher - && Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher + && Weapon[gpItemDescObject->usItem].APsToReloadManually > 0 ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher + && Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) ) { ubNumLine = 18; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 3, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4516,8 +4565,10 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) if( UsingNewCTHSystem() == true ) { ubNumLine = 20; - if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher - && ( GetShotsPerBurst(gpItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher + && ( GetShotsPerBurst(gpItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && ( GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) ) ) { // HEADROCK HAM 5: One value to rule them all! Line 19 left empty intentionally. BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 31, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4526,12 +4577,14 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } else ///////////////// BIPOD & BURST PENALTY { - if( GetBurstPenalty(gpItemDescObject) > 0 ) + if( ( GetBurstPenalty(gpItemDescObject) > 0 ) || + ( fComparisonMode && GetBurstPenalty(gpComparedItemDescObject) > 0 ) ) { ubNumLine = 19; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 30, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } - if( GetBipodBonus(gpItemDescObject) > 0) + if( ( GetBipodBonus(gpItemDescObject) > 0 && !fComparisonMode ) || + ( fComparisonMode && GetBipodBonus(gpComparedItemDescObject) > 0 ) ) { ubNumLine = 20; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 16, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4539,15 +4592,18 @@ void DrawWeaponStats( OBJECTTYPE * gpItemDescObject ) } ///////////////// AUTOFIRE SHOTS PER 5 AP ICON - if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher - && GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) + if ( ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpItemDescObject->usItem].rocketlauncher + && GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) ) { ubNumLine = 21; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 7, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ///////////////// AUTOFIRE PENALTY - if( UsingNewCTHSystem() == false && GetAutoPenalty(gpItemDescObject) > 0 ) + if( ( UsingNewCTHSystem() == false && GetAutoPenalty(gpItemDescObject) > 0 ) || + ( fComparisonMode && UsingNewCTHSystem() == false && GetAutoPenalty(gpComparedItemDescObject) > 0 ) ) { ubNumLine = 22; BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 29, gItemDescGenRegions[ubNumLine][0].sLeft+sOffsetX, gItemDescGenRegions[ubNumLine][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4617,71 +4673,105 @@ void DrawExplosiveStats( OBJECTTYPE * gpItemDescObject ) INT16 sOffsetX = 2; INT16 sOffsetY = 1; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; if (gubDescBoxPage == 1) { + + // anv: if alt is pressed in map inventory, show comparison with selected explosives + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_EXPLOSV ) + { + fComparisonMode = TRUE; + } + } + } + ////////////////////// DAMAGE - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDamage > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 0, gItemDescGenRegions[0][0].sLeft+sOffsetX, gItemDescGenRegions[0][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// STUN DAMAGE - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStunDamage > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 1, gItemDescGenRegions[1][0].sLeft+sOffsetX, gItemDescGenRegions[1][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } // HEADROCK HAM 5 ////////////////////// EXPLODE ON IMPACT - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].fExplodeOnImpact ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].fExplodeOnImpact || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].fExplodeOnImpact ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 19, gItemDescGenRegions[2][0].sLeft+sOffsetX, gItemDescGenRegions[2][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// SOUND BLAST - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 5 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 5 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 5 ) ) + { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 6, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// STUN BLAST - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 1 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 1 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 1 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 5, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// OTHER BLASTS - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType != 1 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType != 5 ) + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType != 5 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType != 1 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType != 5 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 4, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// START+END RADIUS: TEAR GAS - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 2 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 2 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 2 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 9, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 10, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// START+END RADIUS: MUSTARD GAS - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 3 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 3 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 3 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 13, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 14, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// START+END RADIUS: LIGHT - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 4 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 4 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 4 ) ) { // Note light is reversed (large to small) BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 18, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); @@ -4689,42 +4779,50 @@ void DrawExplosiveStats( OBJECTTYPE * gpItemDescObject ) } ////////////////////// START+END RADIUS: SMOKE - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 6 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 6 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 6 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 11, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 12, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// START+END RADIUS: NAPALM - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 - && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 8 ) + if ( ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpItemDescObject->usItem].ubClassIndex ].ubType == 8 && !fComparisonMode ) || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 + && Explosive[Item[ gpComparedItemDescObject->usItem].ubClassIndex ].ubType == 8 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 15, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 16, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// DURATION - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 7, gItemDescGenRegions[5][0].sLeft+sOffsetX, gItemDescGenRegions[5][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } // HEADROCK HAM 5: Fragmentation ////////////////////// NUMBER OF FRAGMENTS - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 20, gItemDescGenRegions[6][0].sLeft+sOffsetX, gItemDescGenRegions[6][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// FRAGMENT DAMAGE - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 21, gItemDescGenRegions[7][0].sLeft+sOffsetX, gItemDescGenRegions[7][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////////// FRAGMENT RANGE - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 22, gItemDescGenRegions[8][0].sLeft+sOffsetX, gItemDescGenRegions[8][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } @@ -4735,13 +4833,15 @@ void DrawExplosiveStats( OBJECTTYPE * gpItemDescObject ) } ////////////////////// VOLATILITY - if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubVolatility > 0 ) + if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubVolatility > 0 || + ( fComparisonMode && Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubVolatility > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoExplosiveIcon, 3, gItemDescGenRegions[10][0].sLeft+sOffsetX, gItemDescGenRegions[10][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } ////////////////// REPAIR EASE - if ( !Item[gpItemDescObject->usItem].repairable ) + if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) || + ( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].repairable ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[11][0].sLeft + sOffsetX, gItemDescGenRegions[11][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } @@ -4763,11 +4863,28 @@ void DrawArmorStats( OBJECTTYPE * gpItemDescObject ) INT16 sOffsetX = 2; INT16 sOffsetY = 1; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; if (gubDescBoxPage == 1) { + // anv: if alt is pressed in map inventory, show comparison with selected armor + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_ARMOUR ) + { + if( Armour[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubArmourClass == Armour[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubArmourClass ) + fComparisonMode = TRUE; + } + } + } + /////////////////// PROTECTION VALUE { // HELMET @@ -4812,7 +4929,8 @@ void DrawArmorStats( OBJECTTYPE * gpItemDescObject ) } ////////////////// REPAIR EASE - if ( !Item[gpItemDescObject->usItem].repairable ) + if ( ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode ) || + ( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[3][0].sLeft + sOffsetX, gItemDescGenRegions[3][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } @@ -4847,8 +4965,37 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) INT16 sOffsetX = 0; INT16 sOffsetY = 0; + + OBJECTTYPE *gpComparedItemDescObject = NULL; + // anv: if alt is pressed in map inventory, show comparison with selected item + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpItemDescObject->usItem ].usItemClass == Item[ gpComparedItemDescObject->usItem ].usItemClass ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_AMMO ) + fComparisonMode = TRUE; + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_ARMOUR ) + { + if( Armour[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubArmourClass == Armour[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubArmourClass ) + fComparisonMode = TRUE; + } + else + fComparisonMode = TRUE; + } + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_EXPLOSV && Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV ) + fComparisonMode = TRUE; + if( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + ///////////////////// ACCURACY MODIFIER - if ( GetAccuracyModifier( gpItemDescObject )) + if ( ( GetAccuracyModifier( gpItemDescObject ) ) || + ( fComparisonMode && GetAccuracyModifier( gpComparedItemDescObject ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4861,9 +5008,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// FLAT BASE MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATBASE ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATBASE ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATBASE ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATBASE ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATBASE ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATBASE ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATBASE ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATBASE ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4876,9 +5026,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// PERCENT BASE MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTBASE ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTBASE ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTBASE ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTBASE ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTBASE ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTBASE ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTBASE ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTBASE ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4891,9 +5044,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// FLAT AIM MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATAIM ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATAIM ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATAIM ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATAIM ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATAIM ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATAIM ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATAIM ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATAIM ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4906,9 +5062,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// PERCENT AIM MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTAIM ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTAIM ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTAIM ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTAIM ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTAIM ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTAIM ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTAIM ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTAIM ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4921,9 +5080,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// AIMING LEVELS MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_AIMLEVELS ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_AIMLEVELS ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_AIMLEVELS ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_AIMLEVELS ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_AIMLEVELS ) != 0 ) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -4936,7 +5098,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if(UsingNewCTHSystem() == false) { //if ( GetFlatAimBonus( gpItemDescObject ) != 0 ) - if ( GetAimBonus( gpItemDescSoldier, gpItemDescObject, 100, 1 ) != 0 ) + if ( ( GetAimBonus( gpItemDescSoldier, gpItemDescObject, 100, 1 ) != 0 ) || + ( fComparisonMode && GetAimBonus( gpItemDescSoldier, gpComparedItemDescObject, 100, 1 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -4949,8 +5112,10 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) ///////////////////// TO-HIT MODIFIER if(UsingNewCTHSystem() == false) { - if ( GetToHitBonus( gpItemDescObject, 100, 1, FALSE ) != 0 - || GetToHitBonus( gpItemDescObject, 100, 1, TRUE ) != 0 ) + if ( ( GetToHitBonus( gpItemDescObject, 100, 1, FALSE ) != 0 + || GetToHitBonus( gpItemDescObject, 100, 1, TRUE ) != 0 ) || + ( fComparisonMode && ( GetToHitBonus( gpComparedItemDescObject, 100, 1, FALSE ) != 0 + || GetToHitBonus( gpComparedItemDescObject, 100, 1, TRUE ) != 0 ) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -4961,9 +5126,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// CTH CAP MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTCAP ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTCAP ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTCAP ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTCAP ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTCAP ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTCAP ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTCAP ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTCAP ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4976,9 +5144,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// GUN HANDLING MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTHANDLING ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTHANDLING ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTHANDLING ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTHANDLING ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTHANDLING ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTHANDLING ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTHANDLING ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTHANDLING ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -4991,9 +5162,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DROP COMPENSATION MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_DROPCOMPENSATION ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_DROPCOMPENSATION ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_DROPCOMPENSATION ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_DROPCOMPENSATION ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_DROPCOMPENSATION ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_DROPCOMPENSATION ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_DROPCOMPENSATION ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_DROPCOMPENSATION ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -5005,9 +5179,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } } ///////////////////// TARGET TRACKING MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_TRACKING ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_TRACKING ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_TRACKING ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_TRACKING ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_TRACKING ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_TRACKING ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_TRACKING ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_TRACKING ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -5020,7 +5197,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DAMAGE MODIFIER - if (GetDamageBonus( gpItemDescObject ) != 0 ) + if ( (GetDamageBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetDamageBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5030,7 +5208,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// MELEE DAMAGE MODIFIER - if (GetMeleeDamageBonus( gpItemDescObject ) != 0 ) + if ( (GetMeleeDamageBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetMeleeDamageBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5040,7 +5219,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// RANGE MODIFIER - if (GetRangeBonus( gpItemDescObject ) != 0 ) + if ( (GetRangeBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && (GetRangeBonus( gpComparedItemDescObject ) != 0 ) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5050,7 +5230,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// SCOPE MAGNIFICATION - if (GetHighestScopeMagnificationFactor( gpItemDescObject ) > 1.0 ) + if ( (GetHighestScopeMagnificationFactor( gpItemDescObject ) > 1.0 ) || + ( fComparisonMode && GetHighestScopeMagnificationFactor( gpComparedItemDescObject ) > 1.0 ) ) { if( UsingNewCTHSystem() == true ) { @@ -5064,10 +5245,14 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) ///////////////////// PROJECTION FACTOR // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor but we use the same icon - if (cnt-sFirstLine < sLastLine && + if ( (cnt-sFirstLine < sLastLine && ( GetProjectionFactor( gpItemDescObject ) > 1.0 || ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpItemDescObject ) > 0 - && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) || + ( fComparisonMode && (cnt-sFirstLine < sLastLine && + ( GetProjectionFactor( gpComparedItemDescObject ) > 1.0 || + ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpComparedItemDescObject ) > 0 + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -5080,7 +5265,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// PERCENT RECOIL MODIFIER - if ( GetPercentRecoilModifier( gpItemDescObject ) != 0 ) + if ( ( GetPercentRecoilModifier( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentRecoilModifier( gpComparedItemDescObject ) != 0 ) ) { if ( UsingNewCTHSystem() == true ) { @@ -5094,9 +5280,14 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) FLOAT bRecoilModifierX; FLOAT bRecoilModifierY; + FLOAT bComparedRecoilModifierX; + FLOAT bComparedRecoilModifierY; GetFlatRecoilModifier( gpItemDescObject, &bRecoilModifierX, &bRecoilModifierY ); + if( fComparisonMode ) + GetFlatRecoilModifier( gpComparedItemDescObject, &bComparedRecoilModifierX, &bComparedRecoilModifierY ); ///////////////////// LATERAL RECOIL MODIFIER - if (bRecoilModifierX != 0) + if ( (bRecoilModifierX != 0) || + ( fComparisonMode && bComparedRecoilModifierX != 0) ) { if( UsingNewCTHSystem() == true ) { @@ -5109,7 +5300,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// VERTICAL RECOIL MODIFIER - if (bRecoilModifierY != 0 ) + if ( (bRecoilModifierY != 0 ) || + ( fComparisonMode && bComparedRecoilModifierY != 0 ) ) { if( UsingNewCTHSystem() == true ) { @@ -5123,9 +5315,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) ///////////////////// MAX COUNTER FORCE // HEADROCK HAM 5: Moved here because it makes more sense. - if (CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_STAND ) != 0 + if ( (CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_STAND ) != 0 || CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH ) != 0 - || CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE ) != 0 ) + || CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE ) != 0 ) || + ( fComparisonMode && (CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND ) != 0 + || CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH ) != 0 + || CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE ) != 0 ) ) ) { if( UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) { @@ -5138,9 +5333,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// MAX COUNTER FORCE MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 ) ) ) { if( UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) { @@ -5153,9 +5351,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// COUNTER FORCE ACCURACY MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEACCURACY ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -5168,9 +5369,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// COUNTER FORCE FREQUENCY MODIFIER - if ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 + if ( ( GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 - || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 ) + || GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 ) || + ( fComparisonMode && ( GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 + || GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEFREQUENCY ) != 0 ) ) ) { if( UsingNewCTHSystem() == true ) { @@ -5183,7 +5387,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// AP MODIFIER - if (GetAPBonus( gpItemDescObject ) != 0 ) + if ( (GetAPBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetAPBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5193,7 +5398,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DRAW AP MODIFIER - if (GetPercentReadyTimeAPReduction( gpItemDescObject ) != 0 ) + if ( (GetPercentReadyTimeAPReduction( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentReadyTimeAPReduction( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5203,7 +5409,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// SINGLE-ATTACK AP MODIFIER - if (GetPercentAPReduction( NULL, gpItemDescObject ) != 0 ) + if ( (GetPercentAPReduction( NULL, gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentAPReduction( NULL, gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5213,7 +5420,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// BURST AP MODIFIER - if (GetPercentBurstFireAPReduction( gpItemDescObject ) != 0 ) + if ( (GetPercentBurstFireAPReduction( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentBurstFireAPReduction( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5223,7 +5431,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// AUTOFIRE AP MODIFIER - if (GetPercentAutofireAPReduction( gpItemDescObject ) != 0 ) + if ( (GetPercentAutofireAPReduction( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentAutofireAPReduction( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5233,7 +5442,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// RELOAD AP MODIFIER - if (GetPercentReloadTimeAPReduction( gpItemDescObject ) != 0 ) + if ( (GetPercentReloadTimeAPReduction( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetPercentReloadTimeAPReduction( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5243,7 +5453,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// MAGAZINE SIZE MODIFIER - if (GetMagSizeBonus( gpItemDescObject ) != 0 ) + if ( (GetMagSizeBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetMagSizeBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5253,7 +5464,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// BURST SIZE MODIFIER - if (GetBurstSizeBonus( gpItemDescObject ) != 0 ) + if ( (GetBurstSizeBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetBurstSizeBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5263,7 +5475,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// HIDE MUZZLE FLASH - if (IsFlashSuppressorAlt( gpItemDescObject ) != 0 ) + if ( (IsFlashSuppressorAlt( gpItemDescObject ) != 0 ) || + ( fComparisonMode && IsFlashSuppressorAlt( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5273,7 +5486,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// LOUDNESS MODIFIER - if (GetPercentNoiseVolume( gpItemDescObject )-100 != 0 ) + if ( (GetPercentNoiseVolume( gpItemDescObject )-100 != 0 ) || + ( fComparisonMode && GetPercentNoiseVolume( gpComparedItemDescObject )-100 != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5283,7 +5497,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// ITEM SIZE MODIFIER - if (CalculateItemSize( gpItemDescObject ) - Item[ gpItemDescObject->usItem ].ItemSize != 0 ) + if ( (CalculateItemSize( gpItemDescObject ) - Item[ gpItemDescObject->usItem ].ItemSize != 0 ) || + ( fComparisonMode && ( CalculateItemSize( gpComparedItemDescObject ) - Item[ gpComparedItemDescObject->usItem ].ItemSize ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5293,8 +5508,10 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// RELIABILITY MODIFIER - if (!(Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && - GetReliability( gpItemDescObject ) != 0 ) + if ( (!(Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && + GetReliability( gpItemDescObject ) != 0 ) || + ( fComparisonMode && !(Item[gpComparedItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && + GetReliability( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5304,7 +5521,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// WOODLAND CAMO - if (GetCamoBonus( gpItemDescObject ) != 0 ) + if ( (GetCamoBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetCamoBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5314,7 +5532,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// URBAN CAMO - if (GetUrbanCamoBonus( gpItemDescObject ) != 0 ) + if ( (GetUrbanCamoBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetUrbanCamoBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5324,7 +5543,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DESERT CAMO - if (GetDesertCamoBonus( gpItemDescObject ) != 0 ) + if ( (GetDesertCamoBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetDesertCamoBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5334,7 +5554,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// SNOW CAMO - if (GetSnowCamoBonus( gpItemDescObject ) != 0 ) + if ( (GetSnowCamoBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetSnowCamoBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5344,7 +5565,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// STEALTH MODIFIER - if (GetStealthBonus( gpItemDescObject ) != 0 ) + if ( (GetStealthBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetStealthBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5354,7 +5576,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// HEARING RANGE MODIFIER - if (GetItemHearingRangeBonus( gpItemDescObject ) != 0 ) + if ( (GetItemHearingRangeBonus( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetItemHearingRangeBonus( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5364,7 +5587,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// VISION RANGE MODIFIER - if (GetItemVisionRangeBonus( gpItemDescObject, 0 ) != 0 ) + if ( (GetItemVisionRangeBonus( gpItemDescObject, 0 ) != 0 ) || + ( fComparisonMode && GetItemVisionRangeBonus( gpComparedItemDescObject, 0 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5374,7 +5598,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// NIGHT VISION RANGE MODIFIER - if (GetItemVisionRangeBonus( gpItemDescObject, 2 ) != 0 ) + if ( (GetItemVisionRangeBonus( gpItemDescObject, 2 ) != 0 ) || + ( fComparisonMode && GetItemVisionRangeBonus( gpComparedItemDescObject, 2 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5384,7 +5609,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DAY VISION RANGE MODIFIER - if (GetItemVisionRangeBonus( gpItemDescObject, 1 ) != 0 ) + if ( (GetItemVisionRangeBonus( gpItemDescObject, 1 ) != 0 ) || + ( fComparisonMode && GetItemVisionRangeBonus( gpComparedItemDescObject, 1 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5394,7 +5620,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// BRIGHT LIGHT VISION RANGE MODIFIER - if (GetItemVisionRangeBonus( gpItemDescObject, 3 ) != 0 ) + if ( (GetItemVisionRangeBonus( gpItemDescObject, 3 ) != 0 ) || + ( fComparisonMode && GetItemVisionRangeBonus( gpComparedItemDescObject, 3 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5404,7 +5631,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// CAVE VISION RANGE MODIFIER - if (GetItemVisionRangeBonus( gpItemDescObject, 4 ) != 0 ) + if ( (GetItemVisionRangeBonus( gpItemDescObject, 4 ) != 0 ) || + ( fComparisonMode && GetItemVisionRangeBonus( gpComparedItemDescObject, 4 ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5414,7 +5642,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// PERCENT TUNNEL VISION - if (GetItemPercentTunnelVision( gpItemDescObject ) != 0 ) + if ( (GetItemPercentTunnelVision( gpItemDescObject ) != 0 ) || + ( fComparisonMode && GetItemPercentTunnelVision( gpComparedItemDescObject ) != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5444,7 +5673,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) INT16 fDrawGenIndexes = FALSE; if ( gGameExternalOptions.fWeaponOverheating || gGameExternalOptions.fDirtSystem ) { - if( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpItemDescObject->usItem].barrel == TRUE || ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) + if( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpItemDescObject->usItem].barrel == TRUE || ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) || + ( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpComparedItemDescObject->usItem].barrel == TRUE || ( Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here? } @@ -5453,7 +5683,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) // Flugente if ( gGameExternalOptions.fWeaponOverheating ) { - if( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { ///////////////////// SINGLE SHOT TEMPERATURE if (cnt >= sFirstLine && cnt < sLastLine) @@ -5483,7 +5714,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - else if( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items + if( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // for barrel items + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) ) { ///////////////////// COOLDOWN FACTOR if (cnt >= sFirstLine && cnt < sLastLine) @@ -5494,10 +5726,12 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } // for overheat modifiers on attachments and wherenot - if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) + if ( ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) || + ( fComparisonMode && ( ( Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) ) ) { ///////////////////// TEMPERATURE MODIFICATOR - if ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) + if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5507,7 +5741,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// COOLDOWN FACTOR MODIFICATOR - if ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) + if ( ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5517,7 +5752,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// JAM THRESHOLD MODIFICATOR - if ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) + if ( ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5527,7 +5763,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } ///////////////////// DAMAGE THRESHOLD MODIFICATOR - if ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) + if ( ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -5540,7 +5777,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) ///////////////////// poison percentage // only draw if item is poisoned in any way - if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) ) + if ( ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) ) || + ( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) ) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here? if (cnt >= sFirstLine && cnt < sLastLine) @@ -5552,7 +5790,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if ( gGameExternalOptions.fDirtSystem ) { - if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { ///////////////////// DIRT MODIFICATOR if (cnt >= sFirstLine && cnt < sLastLine) @@ -5565,11 +5804,13 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) if ( gGameOptions.fFoodSystem ) { - if ( Item[gpItemDescObject->usItem].foodtype > 0 ) + if ( ( Item[gpItemDescObject->usItem].foodtype > 0 ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].foodtype > 0 ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here? - if ( (*gpItemDescObject)[0]->data.bTemperature != 0 ) + if ( ( (*gpItemDescObject)[0]->data.bTemperature != 0 ) || + ( fComparisonMode && (*gpComparedItemDescObject)[0]->data.bTemperature != 0 ) ) { //////////////////// POISONED FOOD if (cnt >= sFirstLine && cnt < sLastLine) @@ -5578,7 +5819,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - if ( Food[Item[gpItemDescObject->usItem].foodtype].bFoodPoints > 0 ) + if ( ( Food[Item[gpItemDescObject->usItem].foodtype].bFoodPoints > 0 ) || + ( fComparisonMode && Food[Item[gpComparedItemDescObject->usItem].foodtype].bFoodPoints > 0 ) ) { //////////////////// FOOD POINTS if (cnt >= sFirstLine && cnt < sLastLine) @@ -5587,7 +5829,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - if ( Food[Item[gpItemDescObject->usItem].foodtype].bDrinkPoints > 0 ) + if ( ( Food[Item[gpItemDescObject->usItem].foodtype].bDrinkPoints > 0 ) || + ( fComparisonMode && Food[Item[gpComparedItemDescObject->usItem].foodtype].bDrinkPoints > 0 ) ) { //////////////////// DRINK POINTS if (cnt >= sFirstLine && cnt < sLastLine) @@ -5596,7 +5839,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - if ( Food[Item[gpItemDescObject->usItem].foodtype].ubPortionSize > 0 ) + if ( ( Food[Item[gpItemDescObject->usItem].foodtype].ubPortionSize > 0 ) || + ( fComparisonMode && Food[Item[gpComparedItemDescObject->usItem].foodtype].ubPortionSize > 0 ) ) { //////////////////// PORTION SIZE if (cnt >= sFirstLine && cnt < sLastLine) @@ -5605,7 +5849,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - if ( Food[Item[gpItemDescObject->usItem].foodtype].bMoraleMod > 0 ) + if ( ( Food[Item[gpItemDescObject->usItem].foodtype].bMoraleMod > 0 ) || + ( fComparisonMode && Food[Item[gpComparedItemDescObject->usItem].foodtype].bMoraleMod > 0 ) ) { //////////////////// MORALE MODIFICATOR if (cnt >= sFirstLine && cnt < sLastLine) @@ -5614,7 +5859,8 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject ) } cnt++; } - if ( Food[Item[gpItemDescObject->usItem].foodtype].usDecayRate > 0 ) + if ( ( Food[Item[gpItemDescObject->usItem].foodtype].usDecayRate > 0 ) || + ( fComparisonMode && Food[Item[gpComparedItemDescObject->usItem].foodtype].usDecayRate > 0 ) ) { //////////////////// DECAY RATE if (cnt >= sFirstLine && cnt < sLastLine) @@ -5637,11 +5883,25 @@ void DrawMiscStats( OBJECTTYPE * gpItemDescObject ) if (gubDescBoxPage == 1) { + OBJECTTYPE *gpComparedItemDescObject = NULL; + // anv: if alt is pressed in map inventory, show comparison with selected misc + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass == Item[ gpItemDescObject->usItem ].usItemClass ) + fComparisonMode = TRUE; + } + } + ////////////////// REPAIR EASE // not for weapons. They have this one their primary page if ( !(Item[ gpItemDescObject->usItem ].usItemClass & IC_WEAPON || Item[ gpItemDescObject->usItem ].usItemClass & IC_PUNCH) ) { - if ( !Item[gpItemDescObject->usItem].repairable ) + if ( !Item[gpItemDescObject->usItem].repairable && !fComparisonMode || + ( fComparisonMode && !Item[gpComparedItemDescObject->usItem].repairable ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWeaponIcon, 35, gItemDescGenRegions[0][0].sLeft + sOffsetX, gItemDescGenRegions[0][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); } @@ -5685,13 +5945,42 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) INT32 sOffsetX = 0; INT32 sOffsetY = 0; + OBJECTTYPE *gpComparedItemDescObject = NULL; + // anv: if alt is pressed in map inventory, show comparison with selected item + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpItemDescObject->usItem ].usItemClass == Item[ gpComparedItemDescObject->usItem ].usItemClass ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_AMMO ) + fComparisonMode = TRUE; + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_ARMOUR ) + { + if( Armour[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubArmourClass == Armour[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubArmourClass ) + fComparisonMode = TRUE; + } + else + fComparisonMode = TRUE; + } + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_EXPLOSV && Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV ) + fComparisonMode = TRUE; + if( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + + } + } + ///////////////////////////////////////////////////////////////////////////////// // Start with class-specific secondaries if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_ARMOUR)) { ////////////////// FLAK JACKET - if (Item[ gpItemDescObject->usItem ].flakjacket) + if ( ( Item[ gpItemDescObject->usItem ].flakjacket && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].flakjacket )) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 5, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5701,42 +5990,48 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_AMMO)) { /////////////////// TRACER AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].tracerEffect ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].tracerEffect && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].tracerEffect ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 0, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } /////////////////// ANTI-TANK AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].antiTank ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].antiTank && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].antiTank ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 1, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } /////////////////// IGNORE ARMOR AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].ignoreArmour ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].ignoreArmour && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].ignoreArmour ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 2, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } /////////////////// ACIDIC AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].acidic ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].acidic && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].acidic ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 3, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } /////////////////// LOCKBUSTING AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].lockBustingPower ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].lockBustingPower && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].lockBustingPower ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 4, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } ////////////////// ANTI-MATERIEL AMMO - if ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].ammoflag & AMMO_ANTIMATERIEL ) + if ( ( AmmoTypes[Magazine[Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].ammoflag & AMMO_ANTIMATERIEL && !fComparisonMode ) || + ( fComparisonMode && AmmoTypes[Magazine[Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].ammoflag & AMMO_ANTIMATERIEL ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 36, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5746,7 +6041,8 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_EXPLOSV)) { ////////////////// LOCK BOMB - if (Item[ gpItemDescObject->usItem ].lockbomb) + if ( ( Item[ gpItemDescObject->usItem ].lockbomb && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].lockbomb ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 25, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5757,133 +6053,152 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) // Draw stats that can be had by any item. //////////////////// WATERPROOF - if (!Item[ gpItemDescObject->usItem ].waterdamages) + if ( ( !Item[ gpItemDescObject->usItem ].waterdamages && !fComparisonMode ) || + ( fComparisonMode && !Item[ gpComparedItemDescObject->usItem ].waterdamages ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 6, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// ELECTRONIC - if (Item[ gpItemDescObject->usItem ].electronic) + if ( ( Item[ gpItemDescObject->usItem ].electronic && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].electronic ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 7, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// GAS MASK - if (Item[ gpItemDescObject->usItem ].gasmask) + if ( ( Item[ gpItemDescObject->usItem ].gasmask && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gasmask ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 8, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// NEEDS BATTERIES - if (Item[ gpItemDescObject->usItem ].needsbatteries) + if ( ( Item[ gpItemDescObject->usItem ].needsbatteries && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].needsbatteries ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 9, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// LOCKSMITH'S KIT - if (Item[ gpItemDescObject->usItem ].locksmithkit) + if ( ( Item[ gpItemDescObject->usItem ].locksmithkit && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].locksmithkit ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 10, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// WIRE CUTTERS - if (Item[ gpItemDescObject->usItem ].wirecutters) + if ( ( Item[ gpItemDescObject->usItem ].wirecutters && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].wirecutters ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 11, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// CROWBAR - if (Item[ gpItemDescObject->usItem ].crowbar) + if ( ( Item[ gpItemDescObject->usItem ].crowbar && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].crowbar ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 12, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// CROWBAR - if (Item[ gpItemDescObject->usItem ].metaldetector) + if ( ( Item[ gpItemDescObject->usItem ].metaldetector && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].metaldetector ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 13, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// REMOTE TRIGGER - if (Item[ gpItemDescObject->usItem ].remotetrigger) + if ( ( Item[ gpItemDescObject->usItem ].remotetrigger && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotetrigger ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 14, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// REMOTE DETONATOR - if (Item[ gpItemDescObject->usItem ].remotedetonator) + if ( ( Item[ gpItemDescObject->usItem ].remotedetonator && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].remotedetonator ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 15, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// TIMER DETONATOR - if (Item[ gpItemDescObject->usItem ].detonator) + if ( ( Item[ gpItemDescObject->usItem ].detonator && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].detonator ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 16, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// GAS CAN - if (Item[ gpItemDescObject->usItem ].gascan) + if ( ( Item[ gpItemDescObject->usItem ].gascan && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].gascan ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 17, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// TOOLKIT - if (Item[ gpItemDescObject->usItem ].toolkit) + if ( ( Item[ gpItemDescObject->usItem ].toolkit && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].toolkit ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 18, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// THERMAL OPTICS - if (Item[ gpItemDescObject->usItem ].thermaloptics) + if ( ( Item[ gpItemDescObject->usItem ].thermaloptics && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].thermaloptics ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 19, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// X-RAY DEVICE - if (Item[ gpItemDescObject->usItem ].xray) + if ( ( Item[ gpItemDescObject->usItem ].xray && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].xray ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 20, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// CANTEEN - if (Item[ gpItemDescObject->usItem ].canteen) + if ( ( Item[ gpItemDescObject->usItem ].canteen && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].canteen ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 21, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// ALCOHOL - if (Item[ gpItemDescObject->usItem ].alcohol) + if ( ( Item[ gpItemDescObject->usItem ].alcohol ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].alcohol ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 22, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// FIRST-AID KIT - if (Item[ gpItemDescObject->usItem ].firstaidkit) + if ( ( Item[ gpItemDescObject->usItem ].firstaidkit && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].firstaidkit ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 23, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// MEDICAL KIT - if (Item[ gpItemDescObject->usItem ].medicalkit) + if ( ( Item[ gpItemDescObject->usItem ].medicalkit && !fComparisonMode ) || + ( fComparisonMode && Item[ gpComparedItemDescObject->usItem ].medicalkit ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 24, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5891,15 +6206,21 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) //////////////////// FOOD UINT32 foodtype = Item[gpItemDescObject->usItem].foodtype; - if ( foodtype > 0 ) + UINT32 comparedfoodtype = 0; + if ( fComparisonMode ) + comparedfoodtype = Item[gpComparedItemDescObject->usItem].foodtype; + if ( ( foodtype > 0 && !fComparisonMode ) || + ( fComparisonMode || comparedfoodtype > 0 ) ) { - if ( Food[foodtype].bDrinkPoints > 0 ) + if ( ( Food[foodtype].bDrinkPoints > 0 && !fComparisonMode ) || + ( fComparisonMode && Food[comparedfoodtype].bDrinkPoints ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 26, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } - if ( Food[foodtype].bFoodPoints > 0 ) + if ( ( Food[foodtype].bFoodPoints > 0 && !fComparisonMode ) || + ( fComparisonMode && Food[comparedfoodtype].bFoodPoints ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 27, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5909,12 +6230,14 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) //////////////////// EXTERNAL FEEDING if ( gGameExternalOptions.ubExternalFeeding ) { - if ( HasItemFlag(gpItemDescObject->usItem, AMMO_BELT) ) + if ( ( HasItemFlag(gpItemDescObject->usItem, AMMO_BELT) && !fComparisonMode ) || + ( fComparisonMode && HasItemFlag(gpComparedItemDescObject->usItem, AMMO_BELT) ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 28, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } - else if ( HasItemFlag(gpItemDescObject->usItem, AMMO_BELT_VEST) ) + else if ( ( HasItemFlag(gpItemDescObject->usItem, AMMO_BELT_VEST) && !fComparisonMode ) || + ( fComparisonMode && HasItemFlag(gpComparedItemDescObject->usItem, AMMO_BELT_VEST) ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 29, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5922,49 +6245,56 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) } ////////////////// DEFUSAL KIT //JMich_SkillsModifiers: Still needs a picture, currently using the wirecutters. - if ( Item[gpItemDescObject->usItem].DisarmModifier > 0 ) + if ( ( Item[gpItemDescObject->usItem].DisarmModifier > 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].DisarmModifier > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 11, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// COVERT ITEM - if ( HasItemFlag(gpItemDescObject->usItem, COVERT) ) + if ( ( HasItemFlag(gpItemDescObject->usItem, COVERT) && !fComparisonMode ) || + ( fComparisonMode && HasItemFlag(gpComparedItemDescObject->usItem, COVERT) ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 30, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// NOT DAMAGEABLE - if ( Item[gpItemDescObject->usItem].damageable == 0 ) + if ( ( Item[gpItemDescObject->usItem].damageable == 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].damageable == 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 31, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// METAL - if ( Item[gpItemDescObject->usItem].metal > 0 ) + if ( ( Item[gpItemDescObject->usItem].metal > 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].metal > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 32, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// SINKS - if ( Item[gpItemDescObject->usItem].sinks > 0 ) + if ( ( Item[gpItemDescObject->usItem].sinks > 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].sinks > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 33, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// TWO HANDED - if ( Item[gpItemDescObject->usItem].twohanded > 0 ) + if ( ( Item[gpItemDescObject->usItem].twohanded > 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].twohanded > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 34, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; } //////////////////// BLOCKS IRON SIGHTS - if ( Item[gpItemDescObject->usItem].blockironsight > 0 ) + if ( ( Item[gpItemDescObject->usItem].blockironsight > 0 && !fComparisonMode ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].blockironsight > 0 ) ) { BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 35, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); cnt++; @@ -5982,6 +6312,8 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) INT16 sLeft; INT16 sWidth; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; @@ -5995,9 +6327,21 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) if (gubDescBoxPage == 1) { ////////////////////////////////////////////////// HEADERS - + SetFontForeground( FONT_MCOLOR_WHITE ); + // anv: if alt is pressed in map inventory, show comparison with selected weapon + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + // "PRIMARY" header swprintf( pStr, L"%s", gzItemDescGenHeaders[ 0 ] ); FindFontCenterCoordinates( gItemDescGenHeaderRegions[0].sLeft, gItemDescGenHeaderRegions[0].sTop, gItemDescGenHeaderRegions[0].sRight - gItemDescGenHeaderRegions[0].sLeft, gItemDescGenHeaderRegions[0].sBottom - gItemDescGenHeaderRegions[0].sTop, pStr, BLOCKFONT2, &usX, &usY ); @@ -6011,8 +6355,36 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // "BURST / AUTOFIRE" header swprintf( pStr, L"%s", gzItemDescGenHeaders[ 3 ] ); // If weapon has no burst/autofire, draw in greyish color. - if (GetShotsPerBurst(gpItemDescObject) <= 0 && GetAutofireShotsPerFiveAPs(gpItemDescObject) <= 0) - SetFontForeground( FONT_MCOLOR_DKGRAY ); + if( !fComparisonMode ) + { + if (GetShotsPerBurst(gpItemDescObject) <= 0 && GetAutofireShotsPerFiveAPs(gpItemDescObject) <= 0) + SetFontForeground( FONT_MCOLOR_DKGRAY ); + } + else + { + if (GetShotsPerBurst(gpItemDescObject) <= 0 && GetAutofireShotsPerFiveAPs(gpItemDescObject) <= 0) + { + if (GetShotsPerBurst(gpComparedItemDescObject) <= 0 && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) <= 0) + { + SetFontForeground( FONT_MCOLOR_DKGRAY ); + } + else + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + } + else + { + if (GetShotsPerBurst(gpComparedItemDescObject) <= 0 && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) <= 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else + { + SetFontForeground( FONT_MCOLOR_WHITE ); + } + } + } FindFontCenterCoordinates( gItemDescGenHeaderRegions[2].sLeft, gItemDescGenHeaderRegions[2].sTop, gItemDescGenHeaderRegions[2].sRight - gItemDescGenHeaderRegions[2].sLeft, gItemDescGenHeaderRegions[2].sBottom - gItemDescGenHeaderRegions[2].sTop, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); @@ -6076,7 +6448,28 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iAccuracyValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iAccuracyValue ); + } + else + { + INT8 iComparedAccuracyValue = (UsingNewCTHSystem() == true ? Weapon[ gpComparedItemDescObject->usItem ].nAccuracy : Weapon[ gpComparedItemDescObject->usItem ].bAccuracy); + INT8 iComparedAccuracyDifference = iComparedAccuracyValue - iAccuracyValue; + if ( iComparedAccuracyDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedAccuracyDifference ); + } + else if ( iComparedAccuracyDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedAccuracyDifference ); + } + else + swprintf( pStr, L"=" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6119,6 +6512,25 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + { + if (UsingNewCTHSystem() == true) + ubNumLine = 0; + else + ubNumLine = 2; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT8 iAccuracyValue = (UsingNewCTHSystem() == true ? Weapon[ gpItemDescObject->usItem ].nAccuracy : Weapon[ gpItemDescObject->usItem ].bAccuracy); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iAccuracyValue ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } /////////////// DAMAGE if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_PUNCH|IC_BLADE|IC_THROWING_KNIFE) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) { @@ -6141,7 +6553,27 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iDamageValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iDamageValue ); + } + else + { + INT8 iComparedDamageValue = GetBasicDamage ( gpComparedItemDescObject ); + INT8 iComparedDamageDifference = iComparedDamageValue - iDamageValue; + if ( iComparedDamageDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedDamageDifference ); + } + else if ( iComparedDamageDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedDamageDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6219,7 +6651,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iRangeValue/10 ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iRangeValue/10 ); + } + else + { + INT16 iComparedRangeValue = Weapon[ gpComparedItemDescObject->usItem ].usRange; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_GUN ) + iComparedRangeValue *= ( (FLOAT)(gGameExternalOptions.iGunRangeModifier / 100) * gItemSettings.fRangeModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ] ); + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_LAUNCHER ) + iComparedRangeValue *= ( (FLOAT)(gGameExternalOptions.iGunRangeModifier / 100) * gItemSettings.fRangeModifierLauncher); + INT16 iComparedRangeDifference = iComparedRangeValue/10 - iRangeValue/10; + if ( iComparedRangeDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedRangeDifference ); + } + else if ( iComparedRangeDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedRangeDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6262,6 +6718,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) + { + if (UsingNewCTHSystem() == true) + ubNumLine = 2; + else + ubNumLine = 0; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + UINT16 iRangeValue = Weapon[ gpComparedItemDescObject->usItem ].usRange; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_GUN ) + iRangeValue *= ( (FLOAT)(gGameExternalOptions.iGunRangeModifier / 100) * gItemSettings.fRangeModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ] ); + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_LAUNCHER ) + iRangeValue *= ( (FLOAT)(gGameExternalOptions.iGunRangeModifier / 100) * gItemSettings.fRangeModifierLauncher); + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iRangeValue/10 ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + + } + } /////////////// GUN HANDLING if ( UsingNewCTHSystem() == TRUE && @@ -6291,7 +6772,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iHandlingValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iHandlingValue ); + } + else + { + INT16 iComparedHandlingValue = Weapon[ gpComparedItemDescObject->usItem ].ubHandling; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iComparedHandlingValue *= gItemSettings.fHandlingModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iComparedHandlingValue *= gItemSettings.fHandlingModifierLauncher; + INT16 iComparedHandlingDifference = iComparedHandlingValue - iHandlingValue; + if ( iComparedHandlingDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedHandlingDifference ); + } + else if ( iComparedHandlingDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedHandlingDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6334,6 +6839,27 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + if ( UsingNewCTHSystem() == TRUE && + Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + { + ubNumLine = 3; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + UINT16 iHandlingValue = Weapon[ gpItemDescObject->usItem ].ubHandling; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iHandlingValue *= gItemSettings.fHandlingModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iHandlingValue *= gItemSettings.fHandlingModifierLauncher; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iHandlingValue ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } /////////////// AIM LEVELS if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) @@ -6365,7 +6891,36 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iAimLevelsValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iAimLevelsValue ); + } + else + { + UINT16 iComparedFinalAimLevelsValue = GetAllowedAimingLevelsForItem( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND ); + INT16 iComparedAimLevelsModifier = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ); + iComparedAimLevelsModifier += GetAimLevelsTraitModifier( gpItemDescSoldier, gpComparedItemDescObject ); + UINT16 iComparedAimLevelsValue = iComparedFinalAimLevelsValue - iComparedAimLevelsModifier; + INT16 iComparedAimLevelsDifference = iComparedAimLevelsValue - iAimLevelsValue; + if ( iComparedAimLevelsDifference > 0 ) + { + if (UsingNewCTHSystem() == true) + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + else + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedAimLevelsDifference ); + } + else if ( iComparedAimLevelsDifference < 0 ) + { + if (UsingNewCTHSystem() == true) + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + else + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedAimLevelsDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6408,7 +6963,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } - + else if( fComparisonMode ) + { + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) + { + if (UsingNewCTHSystem() == true) + ubNumLine = 4; + else + ubNumLine = 3; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + UINT16 iFinalAimLevelsValue = GetAllowedAimingLevelsForItem( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND ); + INT16 iAimLevelsModifier = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ); + iAimLevelsModifier += GetAimLevelsTraitModifier( gpItemDescSoldier, gpComparedItemDescObject ); + UINT16 iAimLevelsValue = iFinalAimLevelsValue - iAimLevelsModifier; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (UsingNewCTHSystem() == true) + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + else + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iAimLevelsValue ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////// OCTH AIMING BONUS //if ( UsingNewCTHSystem() == false && // (GetFlatAimBonus( gpItemDescObject ) != 0 || Item[gpItemDescObject->usItem].aimbonus != 0) ) @@ -6432,13 +7011,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iAimBonusValue != 0) + if( !fComparisonMode ) { - swprintf( pStr, L"%d", iAimBonusValue ); + if (iAimBonusValue != 0) + { + swprintf( pStr, L"%d", iAimBonusValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedAimBonusValue = __max(0, Item[ gpComparedItemDescObject->usItem ].aimbonus); + INT16 iComparedAimBonusDifference = iComparedAimBonusValue - iAimBonusValue; + if ( iComparedAimBonusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedAimBonusDifference ); + } + else if ( iComparedAimBonusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedAimBonusDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6472,6 +7071,29 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( UsingNewCTHSystem() == false && GetAimBonus( gpItemDescSoldier, gpComparedItemDescObject, 100, 1 ) != 0 ) + { + ubNumLine = 4; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iAimBonusValue = __max(0, Item[ gpComparedItemDescObject->usItem ].aimbonus); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iAimBonusValue != 0) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iAimBonusValue ); + } + else + { + swprintf( pStr, L"--" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////// SCOPE MAGNIFICATION FACTOR if ( UsingNewCTHSystem() == true && Item[ gpItemDescObject->usItem ].usItemClass & IC_GUN ) @@ -6493,13 +7115,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iScopeMagValue > 1.0f) + if( !fComparisonMode ) { - swprintf( pStr, L"%3.1f", iScopeMagValue ); + if (iScopeMagValue > 1.0f) + { + swprintf( pStr, L"%3.1f", iScopeMagValue ); + } + else + { + swprintf( pStr, L"--"); + } } else { - swprintf( pStr, L"--"); + FLOAT iComparedScopeMagValue = __max(1.0f, Item[ gpComparedItemDescObject->usItem ].scopemagfactor); + FLOAT iComparedScopeMagDifference = iComparedScopeMagValue - iScopeMagValue; + if ( iComparedScopeMagDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedScopeMagDifference ); + } + else if ( iComparedScopeMagDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedScopeMagDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6528,6 +7170,29 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( UsingNewCTHSystem() == true && Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_GUN ) + { + ubNumLine = 5; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + FLOAT iScopeMagValue = __max(1.0f, Item[ gpComparedItemDescObject->usItem ].scopemagfactor); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iScopeMagValue > 1.0f) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.1f", iScopeMagValue ); + } + else + { + swprintf( pStr, L"--"); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } /////////////////// OCTH MINIMUM RANGE FOR AIMING BONUS if( UsingNewCTHSystem() == false && @@ -6552,13 +7217,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iMinRangeForAimBonusValue > 0) + if( !fComparisonMode ) { - swprintf( pStr, L"%d", iMinRangeForAimBonusValue ); + if (iMinRangeForAimBonusValue > 0) + { + swprintf( pStr, L"%d", iMinRangeForAimBonusValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedMinRangeForAimBonusValue = Item[gpComparedItemDescObject->usItem].minrangeforaimbonus / 10; + INT16 iComparedMinRangeForAimBonusDifference = iComparedMinRangeForAimBonusValue - iMinRangeForAimBonusValue; + if ( iComparedMinRangeForAimBonusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedMinRangeForAimBonusDifference ); + } + else if ( iComparedMinRangeForAimBonusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedMinRangeForAimBonusDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6599,6 +7284,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( UsingNewCTHSystem() == false && + ( Item[gpComparedItemDescObject->usItem].minrangeforaimbonus > 0 || GetMinRangeForAimBonus( NULL, gpComparedItemDescObject ) > 0 ) ) + { + ubNumLine = 5; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iMinRangeForAimBonusValue = Item[gpComparedItemDescObject->usItem].minrangeforaimbonus / 10; + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iMinRangeForAimBonusValue > 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iMinRangeForAimBonusValue ); + } + else + { + swprintf( pStr, L"=" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ///////////////// (LASER) PROJECTION FACTOR // with the reworked NCTH code and the laser performance factor we will display BestLaserRange instead of ProjectionFactor @@ -6642,28 +7352,58 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if ( bNewCode ) + if( !fComparisonMode ) { - if (iProjectionValue > 0) + if ( bNewCode ) { - swprintf( pStr, L"%3.0f", iProjectionValue ); + + if (iProjectionValue > 0) + { + swprintf( pStr, L"%3.0f", iProjectionValue ); + } + else + { + swprintf( pStr, L"--"); + } + } else { - swprintf( pStr, L"--"); + if (iProjectionValue > 1.0f) + { + swprintf( pStr, L"%3.1f", iProjectionValue ); + } + else + { + swprintf( pStr, L"--"); + } } - } else { - if (iProjectionValue > 1.0f) + FLOAT iComparedProjectionValue; + if ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpItemDescObject ) > 0 + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) { - swprintf( pStr, L"%3.1f", iProjectionValue ); + iComparedProjectionValue = __max(0, Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE); } else { - swprintf( pStr, L"--"); + iComparedProjectionValue = __max(1.0f, Item[ gpComparedItemDescObject->usItem ].projectionfactor); } + FLOAT iComparedProjectionDifference = iComparedProjectionValue - iProjectionValue; + if ( iComparedProjectionDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedProjectionDifference ); + } + else if ( iComparedProjectionDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedProjectionDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6710,7 +7450,64 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } - + else if( fComparisonMode ) + { + if (UsingNewCTHSystem() == true && + ( (Item[gpComparedItemDescObject->usItem].projectionfactor > 1.0 || GetProjectionFactor( gpComparedItemDescObject ) > 1.0) || + ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpItemDescObject ) > 0 + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) ) ) + { + ubNumLine = 6; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + FLOAT iProjectionValue = 0; + BOOLEAN bNewCode = FALSE; + if ( gGameExternalOptions.fUseNewCTHCalculation && GetBestLaserRange( gpComparedItemDescObject ) > 0 + && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) + { + iProjectionValue = __max(0, Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE); + bNewCode = TRUE; + } + else + { + iProjectionValue = __max(1.0f, Item[ gpComparedItemDescObject->usItem ].projectionfactor); + } + + // Print base value + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if( !fComparisonMode ) + { + if ( bNewCode ) + { + if (iProjectionValue > 0) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.0f", iProjectionValue ); + } + else + { + swprintf( pStr, L"--"); + } + } + else + { + if (iProjectionValue > 1.0f) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.1f", iProjectionValue ); + } + else + { + swprintf( pStr, L"--"); + } + } + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ///////////////// OCTH TO-HIT BONUS if (UsingNewCTHSystem() == false && (Item[gpItemDescObject->usItem].tohitbonus != 0 || GetFlatToHitBonus( gpItemDescObject ) != 0) ) @@ -6732,13 +7529,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iToHitValue != 0) + if( !fComparisonMode ) { - swprintf( pStr, L"%d", iToHitValue ); + if (iToHitValue != 0) + { + swprintf( pStr, L"%d", iToHitValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedToHitValue = Item[ gpComparedItemDescObject->usItem ].tohitbonus; + INT16 iComparedToHitDifference = iComparedToHitValue - iToHitValue; + if ( iComparedToHitDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedToHitDifference ); + } + else if ( iComparedToHitDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedToHitDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6773,6 +7590,36 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if (UsingNewCTHSystem() == false && + (Item[gpComparedItemDescObject->usItem].tohitbonus != 0 || GetFlatToHitBonus( gpComparedItemDescObject ) != 0) ) + { + ubNumLine = 6; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iToHitValue = Item[ gpComparedItemDescObject->usItem ].tohitbonus; + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iToHitValue > 0) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iToHitValue ); + } + else if (iToHitValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iToHitValue ); + } + else + { + swprintf( pStr, L"=" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ///////////////// OCTH BEST LASER RANGE if (UsingNewCTHSystem() == false && @@ -6795,13 +7642,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iBestLaserRangeValue > 0) + if( !fComparisonMode ) { - swprintf( pStr, L"%d", iBestLaserRangeValue ); + if (iBestLaserRangeValue > 0) + { + swprintf( pStr, L"%d", iBestLaserRangeValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedBestLaserRangeValue = Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE; + INT16 iComparedBestLaserRangeDifference = iComparedBestLaserRangeValue - iBestLaserRangeValue; + if ( iComparedBestLaserRangeDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedBestLaserRangeDifference ); + } + else if ( iComparedBestLaserRangeDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedBestLaserRangeDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6835,6 +7702,31 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if (UsingNewCTHSystem() == false && + ( Item[gpComparedItemDescObject->usItem].bestlaserrange > 0 || GetAverageBestLaserRange( gpComparedItemDescObject ) > 0 ) ) + { + ubNumLine = 7; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iBestLaserRangeValue = Item[ gpComparedItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE; + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iBestLaserRangeValue > 0) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iBestLaserRangeValue ); + } + else + { + swprintf( pStr, L"=" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ///////////////// FLASH SUPPRESSION if (IsFlashSuppressorAlt( gpItemDescObject ) == TRUE) @@ -6858,14 +7750,45 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iFlashValue) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"Y" ); + if (iFlashValue) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"Y" ); + } + else + { + swprintf( pStr, L"="); + } } else { - swprintf( pStr, L"--"); + BOOLEAN iComparedFlashValue = Item[ gpItemDescObject->usItem ].hidemuzzleflash; + if ( iFlashValue ) + { + if (iComparedFlashValue) + { + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"N"); + } + } + else + { + if (iComparedFlashValue) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"Y" ); + } + else + { + swprintf( pStr, L"="); + } + } } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6893,9 +7816,35 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } - + else if( fComparisonMode ) + { + if (IsFlashSuppressorAlt( gpComparedItemDescObject ) == TRUE) + { + if (UsingNewCTHSystem() == true) + ubNumLine = 7; + else + ubNumLine = 8; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + BOOLEAN iFlashValue = Item[ gpComparedItemDescObject->usItem ].hidemuzzleflash; + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if (iFlashValue) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"Y" ); + } + else + { + swprintf( pStr, L"="); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ////////////////// LOUDNESS - if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) + //if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) ) { // Set line to draw into if (UsingNewCTHSystem() == true) @@ -6923,7 +7872,27 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iLoudnessValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iLoudnessValue ); + } + else + { + INT16 iComparedLoudnessValue = Weapon[Item[gpComparedItemDescObject->usItem].ubClassIndex].ubAttackVolume; + INT16 iComparedLoudnessDifference = iComparedLoudnessValue - iLoudnessValue; + if ( iComparedLoudnessDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedLoudnessDifference ); + } + else if ( iComparedLoudnessDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedLoudnessDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -6995,21 +7964,40 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iReliabilityValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%d", iReliabilityValue ); - } - else if ( iReliabilityValue > 0 ) - { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iReliabilityValue ); + if (iReliabilityValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iReliabilityValue ); + } + else if ( iReliabilityValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iReliabilityValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedReliabilityValue = Item[ gpComparedItemDescObject->usItem ].bReliability; + INT16 iComparedReliabilityDifference = iComparedReliabilityValue - iReliabilityValue; + if ( iComparedReliabilityDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedReliabilityDifference ); + } + else if ( iComparedReliabilityDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedReliabilityDifference ); + } + else + swprintf( pStr, L"=" ); } - FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7075,19 +8063,39 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iRepairEaseValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%d", iRepairEaseValue ); - } - else if ( iRepairEaseValue > 0 ) - { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iRepairEaseValue ); + if (iRepairEaseValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iRepairEaseValue ); + } + else if ( iRepairEaseValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iRepairEaseValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); + INT16 iComparedRepairEaseValue = Item[ gpComparedItemDescObject->usItem ].bRepairEase; + INT16 iComparedRepairEaseDifference = iComparedRepairEaseValue - iRepairEaseValue; + if ( iComparedRepairEaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedRepairEaseDifference ); + } + else if ( iComparedRepairEaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedRepairEaseDifference ); + } + else + swprintf( pStr, L"=" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7131,7 +8139,27 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iDrawAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iDrawAPCost ); + } + else + { + INT16 iComparedDrawAPCost = Weapon[ gpComparedItemDescObject->usItem ].ubReadyTime; + INT16 iComparedDrawAPDifference = iComparedDrawAPCost - iDrawAPCost; + if ( iComparedDrawAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedDrawAPDifference ); + } + else if ( iComparedDrawAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedDrawAPDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7174,6 +8202,23 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem].rocketlauncher ) + { + ubNumLine = 13; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iDrawAPCost = Weapon[ gpComparedItemDescObject->usItem ].ubReadyTime; + SetFontForeground( 5 ); + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iDrawAPCost ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } ////////////////// SINGLE SHOT AP if ( !Weapon[gpItemDescObject->usItem].NoSemiAuto ) @@ -7197,7 +8242,32 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iSingleAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iSingleAPCost ); + } + else if( !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) + { + INT16 iComparedSingleAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); + INT16 iComparedSingleAPDifference = iComparedSingleAPCost - iSingleAPCost; + if ( iComparedSingleAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedSingleAPDifference ); + } + else if ( iComparedSingleAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedSingleAPDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7240,6 +8310,19 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else + { + if( !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) + { + INT16 iComparedSingleAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedSingleAPCost ); + } + else + { + swprintf( pStr, L"--" ); + } + } /////////////////// BURST AP if (GetShotsPerBurst(gpItemDescObject)> 0) @@ -7263,7 +8346,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iBurstAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iBurstAPCost ); + } + else if( GetShotsPerBurst(gpComparedItemDescObject)> 0 ) + { + INT16 iComparedBurstAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToBurstNoModifier( APBPConstants[DEFAULT_APS], gpComparedItemDescObject ); + INT16 iComparedBurstAPDifference = iComparedBurstAPCost - iBurstAPCost; + if ( iComparedBurstAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedBurstAPDifference ); + } + else if ( iComparedBurstAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedBurstAPDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7306,6 +8415,26 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + ubNumLine = 15; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + if( GetShotsPerBurst(gpComparedItemDescObject)> 0 ) + { + INT16 iComparedBurstAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToBurstNoModifier( APBPConstants[DEFAULT_APS], gpComparedItemDescObject ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedBurstAPCost ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } ////////////////// AUTO AP if (GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0 ) @@ -7329,7 +8458,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iAutoAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iAutoAPCost ); + } + else if( GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) + { + INT16 iComparedAutoAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToAutofireNoModifier( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, 3 ); + INT16 iComparedAutoAPDifference = iComparedAutoAPCost - iAutoAPCost; + if ( iComparedAutoAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedAutoAPDifference ); + } + else if ( iComparedAutoAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedAutoAPDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7372,6 +8527,26 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + ubNumLine = 16; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + if( GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) + { + INT16 iComparedAutoAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToAutofireNoModifier( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, 3 ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedAutoAPCost ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } ///////////////////// RELOAD AP if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher ) @@ -7400,7 +8575,36 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iReloadAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iReloadAPCost ); + } + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) + { + INT16 iComparedReloadAPCost = Weapon[ gpComparedItemDescObject->usItem ].APsToReload; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iComparedReloadAPCost *= gItemSettings.fAPtoReloadModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iComparedReloadAPCost *= gItemSettings.fAPtoReloadModifierLauncher; + INT16 iComparedReloadAPDifference = iComparedReloadAPCost - iReloadAPCost; + if ( iComparedReloadAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedReloadAPDifference ); + } + else if ( iComparedReloadAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedReloadAPDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTPOSITIVE); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7443,6 +8647,29 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + ubNumLine = 17; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher ) + { + INT16 iComparedReloadAPCost = Weapon[ gpComparedItemDescObject->usItem ].APsToReload; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iComparedReloadAPCost *= gItemSettings.fAPtoReloadModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iComparedReloadAPCost *= gItemSettings.fAPtoReloadModifierLauncher; + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedReloadAPCost ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } ///////////////////// MANUAL RELOAD AP if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpItemDescObject->usItem ].singleshotrocketlauncher @@ -7469,7 +8696,37 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iManualReloadAPCost ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iManualReloadAPCost ); + } + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher + && Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) + { + INT16 iComparedManualReloadAPCost = Weapon[ gpComparedItemDescObject->usItem ].APsToReloadManually; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iComparedManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iComparedManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierLauncher; + INT16 iComparedManualReloadAPDifference = iComparedManualReloadAPCost - iManualReloadAPCost; + if ( iComparedManualReloadAPDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedManualReloadAPDifference ); + } + else if ( iComparedManualReloadAPDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedManualReloadAPDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTPOSITIVE); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7491,6 +8748,30 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + ubNumLine = 18; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) && !Item[ gpComparedItemDescObject->usItem ].singleshotrocketlauncher + && Weapon[gpComparedItemDescObject->usItem].APsToReloadManually > 0 ) + { + INT16 iComparedManualReloadAPCost = Weapon[ gpComparedItemDescObject->usItem ].APsToReloadManually; + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + iComparedManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER ) + iComparedManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierLauncher; + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedManualReloadAPCost ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } ///////////////////// RECOIL X/Y if ( UsingNewCTHSystem() == true ) @@ -7534,7 +8815,42 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.1f", dBaseRecoil ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%3.1f", dBaseRecoil ); + } + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject)) + { + FLOAT iComparedRecoilX = Weapon[ gpComparedItemDescObject->usItem ].bRecoilX; + FLOAT iComparedRecoilY = Weapon[ gpComparedItemDescObject->usItem ].bRecoilY; + if (iComparedRecoilX == -127) { iComparedRecoilX = 0; } + if (iComparedRecoilY == -127) { iComparedRecoilY = 0; } + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + { + iComparedRecoilX *= gItemSettings.fRecoilXModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + iComparedRecoilY *= gItemSettings.fRecoilYModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + } + FLOAT dComparedBaseRecoil = sqrt( ((iComparedRecoilX * iComparedRecoilX)+(iComparedRecoilY * iComparedRecoilY)) ); + FLOAT dComparedBaseRecoilDifference = dComparedBaseRecoil - dBaseRecoil; + if ( dComparedBaseRecoilDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%3.1f", dComparedBaseRecoilDifference ); + } + else if ( dComparedBaseRecoilDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.1f", dComparedBaseRecoilDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7634,6 +8950,35 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 6 ); */ } + else if( fComparisonMode ) + { + ubNumLine = 20; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject)) + { + FLOAT iComparedRecoilX = Weapon[ gpComparedItemDescObject->usItem ].bRecoilX; + FLOAT iComparedRecoilY = Weapon[ gpComparedItemDescObject->usItem ].bRecoilY; + if (iComparedRecoilX == -127) { iComparedRecoilX = 0; } + if (iComparedRecoilY == -127) { iComparedRecoilY = 0; } + if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN ) + { + iComparedRecoilX *= gItemSettings.fRecoilXModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + iComparedRecoilY *= gItemSettings.fRecoilYModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + } + FLOAT dComparedBaseRecoil = sqrt( ((iComparedRecoilX * iComparedRecoilX)+(iComparedRecoilY * iComparedRecoilY)) ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%3.1f", dComparedBaseRecoil ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } } else ///////////////// BIPOD & BURST PENALTY { @@ -7669,42 +9014,61 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iBurstValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"=%d", abs(iBurstValue) ); + if (iBurstValue < 0) + { + //SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iBurstValue ); + } + else if ( iBurstValue > 0 ) + { + //SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iBurstValue ); + } + else + { + swprintf( pStr, L"--" ); + } } - else if ( iBurstValue > 0 ) + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetShotsPerBurst(gpComparedItemDescObject)> 0 || GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"-%d", abs(iBurstValue) ); + INT16 iComparedBurstValue = Weapon[gpComparedItemDescObject->usItem].ubBurstPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1); + INT16 iComparedBurstDifference = iComparedBurstValue - iBurstValue; + if ( iComparedBurstDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedBurstDifference ); + } + else if ( iComparedBurstDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iComparedBurstDifference ); + } + else + swprintf( pStr, L"=" ); } else { - swprintf( pStr, L"--" ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-"); } - FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); // Print modifier SetFontForeground( 5 ); - if (iBurstModifier < 0) - { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - } - else if ( iBurstModifier > 0 ) - { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - } // Add positive/negative sign if ( iBurstModifier > 0 ) { - swprintf( pStr, L"-%d", abs(iBurstModifier) ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iBurstModifier ); } else if ( iBurstModifier < 0 ) { - swprintf( pStr, L"+%d", abs(iBurstModifier) ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iBurstModifier ); } else { @@ -7723,6 +9087,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if( GetBurstPenalty(gpComparedItemDescObject) > 0 ) + { + ubNumLine = 19; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + INT16 iComparedBurstValue = Weapon[gpComparedItemDescObject->usItem].ubBurstPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1); + if ( iComparedBurstValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iComparedBurstValue ); + } + else if ( iComparedBurstValue < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedBurstValue ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } if( GetBipodBonus(gpItemDescObject) > 0) { // Set line to draw into @@ -7744,19 +9135,44 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iBipodValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%d", iBipodValue ); + if (iBipodValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iBipodValue ); + } + else if ( iBipodValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iBipodValue ); + } + else + { + swprintf( pStr, L"--" ); + } } - else if ( iBipodValue > 0 ) + else if ( Item[gpComparedItemDescObject->usItem].bipod > 0 ) { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iBipodValue ); + INT16 iComparedBipodValue = Item[gpComparedItemDescObject->usItem].bipod; + INT16 iComparedBipodDifference = iComparedBipodValue - iBipodValue; + if ( iComparedBipodDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedBipodDifference ); + } + else if ( iComparedBipodDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedBipodDifference ); + } + else + swprintf( pStr, L"=" ); } else { - swprintf( pStr, L"--" ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); @@ -7798,6 +9214,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if( GetBipodBonus(gpComparedItemDescObject) > 0) + { + ubNumLine = 20; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + INT16 iComparedBipodValue = Item[gpComparedItemDescObject->usItem].bipod; + if (iComparedBipodValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedBipodValue ); + } + else if ( iComparedBipodValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedBipodValue ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } } /////////////////// AUTOFIRE BULLETS PER 5 AP @@ -7821,11 +9264,38 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iB5AP ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iB5AP ); + } + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) + { + INT16 iComparedB5AP = GetAutofireShotsPerFiveAPs( gpComparedItemDescObject ); + INT16 iComparedB5APDifference = iComparedB5AP - iB5AP; + if ( iComparedB5APDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedB5APDifference ); + } + else if ( iComparedB5APDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedB5APDifference ); + } + else + swprintf( pStr, L"=" ); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); // no modifier + SetFontForeground( 5 ); swprintf( pStr, L"--" ); sLeft = gItemDescGenRegions[ubNumLine][2].sLeft; sWidth = gItemDescGenRegions[ubNumLine][2].sRight - sLeft; @@ -7844,6 +9314,29 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 6 ); } + else if( fComparisonMode ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) + { + ubNumLine = 21; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + INT16 iComparedB5AP = GetAutofireShotsPerFiveAPs( gpComparedItemDescObject ); + if ( iComparedB5AP > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedB5AP ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } /////////////////// AUTOFIRE PENALTY if( UsingNewCTHSystem() == false && GetAutoPenalty(gpItemDescObject) > 0 ) @@ -7878,21 +9371,46 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iAutoValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", abs(iAutoValue) ); + if (iAutoValue < 0) + { + //SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iAutoValue ); + } + else if ( iAutoValue > 0 ) + { + //SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iAutoValue ); + } + else + { + swprintf( pStr, L"--" ); + } } - else if ( iAutoValue > 0 ) + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_GUN && !Item[ gpComparedItemDescObject->usItem].rocketlauncher + && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"-%d", abs(iAutoValue) ); + INT16 iComparedAutoValue = Weapon[gpComparedItemDescObject->usItem].AutoPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1); + INT16 iComparedAutoDifference = iComparedAutoValue - iAutoValue; + if ( iComparedAutoDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedAutoDifference ); + } + else if ( iComparedAutoDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iComparedAutoDifference ); + } + else + swprintf( pStr, L"=" ); } else { - swprintf( pStr, L"--" ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); } - FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -7909,11 +9427,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Add positive/negative sign if ( iAutoModifier > 0 ) { - swprintf( pStr, L"-%d", abs(iAutoModifier) ); + swprintf( pStr, L"+%d", iAutoModifier ); } else if ( iAutoModifier < 0 ) { - swprintf( pStr, L"+%d", abs(iAutoModifier) ); + swprintf( pStr, L"%d", iAutoModifier ); } else { @@ -7932,6 +9450,33 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if( UsingNewCTHSystem() == false && GetAutoPenalty(gpComparedItemDescObject) > 0 ) + { + ubNumLine = 22; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( 5 ); + INT16 iAutoValue = Weapon[gpComparedItemDescObject->usItem].AutoPenalty * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1); + if ( iAutoValue < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", abs(iAutoValue) ); + } + else if ( iAutoValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-%d", abs(iAutoValue) ); + } + else + swprintf( pStr, L"" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } } if (gubDescBoxPage == 2) { @@ -7947,6 +9492,8 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) UINT8 ubNumLine; INT16 sLeft, sTop, sWidth, sHeight; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; @@ -7964,6 +9511,19 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) } else if (gubDescBoxPage == 1) { + + // anv: if alt is pressed in map inventory, show comparison with selected ammo + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_AMMO ) + fComparisonMode = TRUE; + } + } + ////////////////////////////////////////////////// HEADERS SetFontForeground( FONT_MCOLOR_WHITE ); @@ -8011,17 +9571,37 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); - if ( fArmourImpactReduction > 1.0 ) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); + if ( fArmourImpactReduction > 1.0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else if ( fArmourImpactReduction < 1.0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + swprintf( pStr, L"%3.1f", fArmourImpactReduction ); } - else if ( fArmourImpactReduction < 1.0 ) + else { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); + FLOAT fComparedArmourImpactReduction = ((FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].armourImpactReductionMultiplier / (FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].armourImpactReductionDivisor); + FLOAT fComparedArmourImpactDifference = fComparedArmourImpactReduction - fArmourImpactReduction; + if ( fComparedArmourImpactDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%3.1f", fComparedArmourImpactDifference ); + } + else if ( fComparedArmourImpactDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.1f", fComparedArmourImpactDifference ); + } + else + swprintf( pStr, L"=" ); } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.1f", fArmourImpactReduction ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8057,17 +9637,37 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); - if ( fAfterArmourImpactReduction < 1.0 ) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); + if ( fAfterArmourImpactReduction < 1.0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else if ( fAfterArmourImpactReduction > 1.0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + swprintf( pStr, L"%3.1f", fAfterArmourImpactReduction ); } - else if ( fAfterArmourImpactReduction > 1.0 ) + else { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); + FLOAT fComparedAfterArmourImpactReduction = ((FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].afterArmourDamageMultiplier / (FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].afterArmourDamageDivisor); + FLOAT fComparedAfterArmourImpactDifference = fComparedAfterArmourImpactReduction - fAfterArmourImpactReduction; + if ( fComparedAfterArmourImpactDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%3.1f", fComparedAfterArmourImpactDifference ); + } + else if ( fComparedAfterArmourImpactDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%3.1f", fComparedAfterArmourImpactDifference ); + } + else + swprintf( pStr, L"=" ); } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.1f", fAfterArmourImpactReduction ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8104,17 +9704,37 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); - if ( fPreArmourImpactReduction < 1.0 ) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); + if ( fPreArmourImpactReduction < 1.0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else if ( fPreArmourImpactReduction > 1.0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + swprintf( pStr, L"%3.1f", fPreArmourImpactReduction ); } - else if ( fPreArmourImpactReduction > 1.0 ) + else { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); + FLOAT fComparedPreArmourImpactReduction = ((FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].beforeArmourDamageMultiplier / (FLOAT) AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].beforeArmourDamageDivisor); + FLOAT fComparedPreArmourImpactDifference = fComparedPreArmourImpactReduction - fPreArmourImpactReduction; + if ( fComparedPreArmourImpactDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%3.1f", fComparedPreArmourImpactDifference ); + } + else if ( fComparedPreArmourImpactDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%3.1f", fComparedPreArmourImpactDifference ); + } + else + swprintf( pStr, L"=" ); } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.1f", fPreArmourImpactReduction ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8152,17 +9772,37 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); - if ( basevalue > 0.0 ) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); + if ( basevalue > 0.0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else if ( basevalue < 0.0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + swprintf( pStr, L"%3.2f", basevalue ); } - else if ( basevalue < 0.0 ) + else { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); + FLOAT fComparedBaseValue = AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].temperatureModificator; + FLOAT fComparedBaseDifference = fComparedBaseValue - basevalue; + if ( fComparedBaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%3.2f", fComparedBaseDifference ); + } + else if ( fComparedBaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.2f", fComparedBaseDifference ); + } + else + swprintf( pStr, L"=" ); } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.2f", basevalue ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8211,9 +9851,29 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", basevalue ); + } + else + { + INT16 fComparedBaseValue = AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage; + INT16 fComparedBaseDifference = fComparedBaseValue - basevalue; + if ( fComparedBaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", fComparedBaseDifference ); + } + else if ( fComparedBaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", fComparedBaseDifference ); + } + else + swprintf( pStr, L"=" ); + } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", basevalue ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8263,17 +9923,37 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft ) // Print base value SetFontForeground( 5 ); - if ( basevalue > 0.0 ) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); + if ( basevalue > 0.0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + } + else if ( basevalue < 0.0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + } + swprintf( pStr, L"%3.2f", basevalue ); } - else if ( basevalue < 0.0 ) + else { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); + FLOAT fComparedBaseValue = AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].dirtModificator; + FLOAT fComparedBaseDifference = fComparedBaseValue - basevalue; + if ( fComparedBaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%3.2f", fComparedBaseDifference ); + } + else if ( fComparedBaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%3.2f", fComparedBaseDifference ); + } + else + swprintf( pStr, L"=" ); } sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%3.2f", basevalue ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8322,11 +10002,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) UINT8 ubNumLine; INT16 sLeft, sTop, sWidth, sHeight; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; if (gubDescBoxPage == 1) { + // anv: if alt is pressed in map inventory, show comparison with selected explosives + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_EXPLOSV ) + { + fComparisonMode = TRUE; + } + } + } + ////////////////////////////////////////////////// HEADERS SetFontForeground( FONT_MCOLOR_WHITE ); @@ -8378,7 +10074,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iDamage ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iDamage ); + } + else + { + INT16 iComparedDamage = GetModifiedExplosiveDamage( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDamage, 0 ); + INT16 iComparedDamageDifference = iComparedDamage - iDamage; + if ( iComparedDamageDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedDamageDifference ); + } + else if ( iComparedDamageDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedDamageDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8398,6 +10114,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDamage > 0 ) + { + ubNumLine = 0; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalDamage = GetModifiedExplosiveDamage( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDamage, 0 ); + INT16 iDamage = iFinalDamage; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iDamage ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } /////////////////// STUN DAMAGE if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage > 0 ) @@ -8419,7 +10152,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iStunDamage ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iStunDamage ); + } + else + { + INT16 iComparedStunDamage = GetModifiedExplosiveDamage( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStunDamage, 1 ); + INT16 iComparedStunDamageDifference = iComparedStunDamage - iStunDamage; + if ( iComparedStunDamageDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedStunDamageDifference ); + } + else if ( iComparedStunDamageDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedStunDamageDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8439,6 +10192,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStunDamage > 0 ) + { + ubNumLine = 1; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalStunDamage = GetModifiedExplosiveDamage( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStunDamage, 1 ); + INT16 iStunDamage = iFinalStunDamage; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iStunDamage ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } // HEADROCK HAM 5: Pushed everyone one line down to make room for Contact Explosives. @@ -8462,7 +10232,35 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iBlastRadius ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iBlastRadius ); + } + else + { + INT16 iComparedBlastRadius; + if (Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0) + { + iComparedBlastRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + } + else + { + iComparedBlastRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStartRadius; + } + INT16 iComparedBlastRadiusDifference = iComparedBlastRadius - iBlastRadius; + if ( iComparedBlastRadiusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedBlastRadiusDifference ); + } + else if ( iComparedBlastRadiusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedBlastRadiusDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8482,6 +10280,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + //if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0 ) + //{ + // ubNumLine = 3; + // sTop = gItemDescGenRegions[ubNumLine][1].sTop; + // sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + // INT16 iFinalBlastRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + // INT16 iBlastRadius = iFinalBlastRadius; + // sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + // sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + // SetFontForeground( ITEMDESC_FONTPOSITIVE ); + // swprintf( pStr, L"+%d", iBlastRadius ); + // FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + // mprintf( usX, usY, pStr ); + //} + } ////////////////////// PROLONGED EFFECT: START if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 ) @@ -8511,7 +10326,35 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iEffectStartRadius ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iEffectStartRadius ); + } + else + { + INT16 iComparedEffectStartRadius; + if (Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration == 0) + { + iComparedEffectStartRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + } + else + { + iComparedEffectStartRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStartRadius; + } + INT16 iComparedEffectStartRadiusDifference = iComparedEffectStartRadius - iEffectStartRadius; + if ( iComparedEffectStartRadiusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedEffectStartRadiusDifference ); + } + else if ( iComparedEffectStartRadiusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedEffectStartRadiusDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8531,6 +10374,31 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + //if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration> 0 ) + //{ + // ubNumLine = 3; + // sTop = gItemDescGenRegions[ubNumLine][1].sTop; + // sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + // INT16 iFinalEffectStartRadius; + // if (Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubType == 4) + // { + // iFinalEffectStartRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + // } + // else + // { + // iFinalEffectStartRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStartRadius; + // } + // INT16 iEffectStartRadius = iFinalEffectStartRadius; + // sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + // sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + // SetFontForeground( ITEMDESC_FONTPOSITIVE ); + // swprintf( pStr, L"+%d", iEffectStartRadius ); + // FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + // mprintf( usX, usY, pStr ); + //} + } ////////////////////// PROLONGED EFFECT: END if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 ) @@ -8560,7 +10428,35 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iEffectEndRadius ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iEffectEndRadius ); + } + else + { + INT16 iComparedEffectEndRadius; + if (Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubType == 4) + { + iComparedEffectEndRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubStartRadius; + } + else + { + iComparedEffectEndRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + } + INT16 iComparedEffectEndRadiusDifference = iComparedEffectEndRadius - iEffectEndRadius; + if ( iComparedEffectEndRadiusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedEffectEndRadiusDifference ); + } + else if ( iComparedEffectEndRadiusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedEffectEndRadiusDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8580,6 +10476,39 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + + if (Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration > 0) + { + ubNumLine = 4; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iEffectEndRadius = Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubRadius; + INT16 iComparedEffectEndRadius = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubRadius; + INT16 iComparedEffectEndRadiusDifference = iComparedEffectEndRadius - iEffectEndRadius; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + if( iComparedEffectEndRadiusDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedEffectEndRadiusDifference ); + } + else if( iComparedEffectEndRadiusDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedEffectEndRadiusDifference ); + } + else + { + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + + } ////////////////////// PROLONGED EFFECT: DURATION if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDuration > 0 ) @@ -8601,7 +10530,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iEffectDuration ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iEffectDuration ); + } + else + { + INT16 iComparedEffectDuration = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration; + INT16 iComparedEffectDurationDifference = iComparedEffectDuration - iEffectDuration; + if ( iComparedEffectDurationDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedEffectDurationDifference ); + } + else if ( iComparedEffectDurationDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedEffectDurationDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8621,6 +10570,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration> 0 ) + { + ubNumLine = 5; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalEffectDuration = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDuration; + INT16 iEffectDuration = iFinalEffectDuration; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iEffectDuration ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } // HEADROCK HAM 5: FRAGMENTATIONS //////////////////// NUMBER OF FRAGMENTS @@ -8643,7 +10609,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iNumFragments ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iNumFragments ); + } + else + { + INT16 iComparedNumFragments = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments; + INT16 iComparedNumFragmentsDifference = iComparedNumFragments - iNumFragments; + if ( iComparedNumFragmentsDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedNumFragmentsDifference ); + } + else if ( iComparedNumFragmentsDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedNumFragmentsDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8663,6 +10649,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments> 0 ) + { + ubNumLine = 6; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalNumFragments = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments; + INT16 iNumFragments = iFinalNumFragments; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iNumFragments ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////////// FRAGMENT DAMAGE if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) @@ -8684,7 +10687,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iFragDamage ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iFragDamage ); + } + else + { + INT16 iComparedFragDamage = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubFragDamage; + INT16 iComparedFragDamageDifference = iComparedFragDamage - iFragDamage; + if ( iComparedFragDamageDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedFragDamageDifference ); + } + else if ( iComparedFragDamageDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedFragDamageDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8704,6 +10727,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments> 0 ) + { + ubNumLine = 7; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalFragDamage = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubFragDamage; + INT16 iFragDamage = iFinalFragDamage; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iFragDamage ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////////// FRAG RANGE if ( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].usNumFragments > 0 ) @@ -8725,7 +10765,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iFragRange ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iFragRange ); + } + else + { + INT16 iComparedFragRange = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubFragRange / CELL_X_SIZE; + INT16 iComparedFragRangeDifference = iComparedFragRange - iFragRange; + if ( iComparedFragRangeDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedFragRangeDifference ); + } + else if ( iComparedFragRangeDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedFragRangeDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8745,6 +10805,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].usNumFragments> 0 ) + { + ubNumLine = 8; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalFragRange = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubFragRange / CELL_X_SIZE; + INT16 iFragRange = iFinalFragRange; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iFragRange ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////////// LOUDNESS { @@ -8765,7 +10842,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iLoudness ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iLoudness ); + } + else + { + INT16 iComparedLoudness = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubVolume; + INT16 iComparedLoudnessDifference = iComparedLoudness - iLoudness; + if ( iComparedLoudnessDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedLoudnessDifference ); + } + else if ( iComparedLoudnessDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedLoudnessDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8806,7 +10903,27 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iVolatility ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iVolatility ); + } + else + { + INT16 iComparedVolatility = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubVolatility; + INT16 iComparedVolatilityDifference = iComparedVolatility - iVolatility; + if ( iComparedVolatilityDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedVolatilityDifference ); + } + else if ( iComparedVolatilityDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedVolatilityDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8826,6 +10943,23 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if ( Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubVolatility> 0 ) + { + ubNumLine = 10; + sTop = gItemDescGenRegions[ubNumLine][1].sTop; + sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; + INT16 iFinalVolatility = Explosive[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubVolatility; + INT16 iVolatility = iFinalVolatility; + sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; + sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iVolatility ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } //////////////////// REPAIR EASE { @@ -8845,20 +10979,40 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iRepairEaseValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%d", iRepairEaseValue ); - } - else if ( iRepairEaseValue > 0 ) - { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iRepairEaseValue ); + if (iRepairEaseValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iRepairEaseValue ); + } + else if ( iRepairEaseValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iRepairEaseValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); - } + INT16 iComparedRepairEaseValue = Item[ gpComparedItemDescObject->usItem ].bRepairEase; + INT16 iComparedRepairEaseDifference = iComparedRepairEaseValue - iRepairEaseValue; + if ( iComparedRepairEaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedRepairEaseDifference ); + } + else if ( iComparedRepairEaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedRepairEaseDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -8893,6 +11047,8 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) UINT8 ubNumLine; INT16 sLeft, sTop, sWidth, sHeight; + OBJECTTYPE *gpComparedItemDescObject = NULL; + if( UsingEDBSystem() == 0 ) return; @@ -8901,6 +11057,22 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) if (gubDescBoxPage == 1) { + + // anv: if alt is pressed in map inventory, show comparison with selected armor + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_ARMOUR ) + { + if( Armour[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubArmourClass == Armour[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubArmourClass ) + fComparisonMode = TRUE; + } + } + } + ////////////////////////////////////////////////// HEADERS SetFontForeground( FONT_MCOLOR_WHITE ); @@ -8960,7 +11132,27 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iProtectionValue ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iProtectionValue ); + } + else + { + INT8 iComparedProtectionValue = Armour[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubProtection; + INT8 iComparedProtectionDifference = iComparedProtectionValue - iProtectionValue; + if ( iComparedProtectionDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedProtectionDifference ); + } + else if ( iComparedProtectionDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedProtectionDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -9022,14 +11214,51 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iCoverageValue ); - wcscat( pStr, L"%" ); - FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE - wcscat( pStr, ChineseSpecString1 ); - #else + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iCoverageValue ); wcscat( pStr, L"%" ); - #endif + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else + { + INT8 iComparedCoverageValue = Armour[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubCoverage; + INT8 iComparedCoverageDifference = iComparedCoverageValue - iCoverageValue; + if ( iComparedCoverageDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedCoverageDifference ); + wcscat( pStr, L"%" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else if ( iComparedCoverageDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedCoverageDifference ); + wcscat( pStr, L"%" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } + } mprintf( usX, usY, pStr ); // Print modifier @@ -9076,14 +11305,51 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - swprintf( pStr, L"%d", iDegradeValue ); - wcscat( pStr, L"%" ); - FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); - #ifdef CHINESE - wcscat( pStr, ChineseSpecString1 ); - #else + if( !fComparisonMode ) + { + swprintf( pStr, L"%d", iDegradeValue ); wcscat( pStr, L"%" ); - #endif + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else + { + INT8 iComparedDegradeValue = Armour[Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubDegradePercent; + INT8 iComparedDegradeDifference = iComparedDegradeValue - iDegradeValue; + if ( iComparedDegradeDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%+d", iComparedDegradeDifference ); + wcscat( pStr, L"%" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else if ( iComparedDegradeDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%d", iComparedDegradeDifference ); + wcscat( pStr, L"%" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif + } + else + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } + } mprintf( usX, usY, pStr ); // Print modifier @@ -9130,20 +11396,40 @@ void DrawArmorValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iRepairEaseValue < 0) + if( !fComparisonMode ) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%d", iRepairEaseValue ); - } - else if ( iRepairEaseValue > 0 ) - { - SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iRepairEaseValue ); + if (iRepairEaseValue < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iRepairEaseValue ); + } + else if ( iRepairEaseValue > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iRepairEaseValue ); + } + else + { + swprintf( pStr, L"--" ); + } } else { - swprintf( pStr, L"--" ); - } + INT8 iComparedRepairEaseValue = Item[gpComparedItemDescObject->usItem].bRepairEase; + INT8 iComparedRepairEaseDifference = iComparedRepairEaseValue - iRepairEaseValue; + if ( iComparedRepairEaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%+d", iComparedRepairEaseDifference ); + } + else if ( iComparedRepairEaseDifference < 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedRepairEaseDifference ); + } + else + swprintf( pStr, L"=" ); + } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); @@ -9189,9 +11475,42 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) INT16 iModifier[3]; FLOAT iFloatModifier[3]; + INT16 iComparedModifier[3]; + FLOAT iComparedFloatModifier[3]; + FLOAT bRecoilModifierX; FLOAT bRecoilModifierY; + FLOAT bComparedRecoilModifierX; + FLOAT bComparedRecoilModifierY; + + OBJECTTYPE *gpComparedItemDescObject = NULL; + // anv: if alt is pressed in map inventory, show comparison with selected item + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpItemDescObject->usItem ].usItemClass == Item[ gpComparedItemDescObject->usItem ].usItemClass ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_AMMO ) + fComparisonMode = TRUE; + else if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_ARMOUR ) + { + if( Armour[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubArmourClass == Armour[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex ].ubArmourClass ) + fComparisonMode = TRUE; + } + else + fComparisonMode = TRUE; + } + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_EXPLOSV && Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV ) + fComparisonMode = TRUE; + if( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) && Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + ///////////////////// INDEX swprintf( pStr, gzItemDescGenIndexes[0] ); sLeft = gItemDescAdvIndexRegions[0][0].sLeft; @@ -9206,7 +11525,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetAccuracyModifier( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 && UsingNewCTHSystem() == true) + if( fComparisonMode ) + { + iComparedModifier[0] = GetAccuracyModifier( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if ( ( iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) && UsingNewCTHSystem() == true) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9220,6 +11545,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9244,6 +11573,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9259,7 +11593,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATBASE ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATBASE ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATBASE ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATBASE ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATBASE ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATBASE ); + } + if ( ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9273,6 +11615,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9285,6 +11631,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9300,7 +11651,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTBASE ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTBASE ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTBASE ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTBASE ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTBASE ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTBASE ); + } + if ( ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9314,6 +11673,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9338,6 +11701,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9353,7 +11721,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATAIM ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATAIM ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATAIM ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_FLATAIM ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_FLATAIM ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_FLATAIM ); + } + if ( ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9367,6 +11743,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9379,6 +11759,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9394,7 +11779,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTAIM ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTAIM ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTAIM ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTAIM ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTAIM ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTAIM ); + } + if ( ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9408,6 +11801,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9432,6 +11829,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9447,7 +11849,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_AIMLEVELS ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_AIMLEVELS ); - if (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_AIMLEVELS ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_AIMLEVELS ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_AIMLEVELS ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9463,6 +11872,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -9475,6 +11888,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9492,7 +11910,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetAimBonus( gpItemDescSoldier, gpItemDescObject, 100, 1 ); iModifier[1] = 0; iModifier[2] = 0; - if (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) + if( fComparisonMode ) + { + iComparedModifier[0] = GetAimBonus( gpItemDescSoldier, gpComparedItemDescObject, 100, 1 ); + iComparedModifier[1] = 0; + iComparedModifier[2] = 0; + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9508,6 +11933,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9532,6 +11961,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9550,7 +11984,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetToHitBonus( gpItemDescObject, 100, 1, FALSE ); iModifier[1] = 0; iModifier[2] = GetToHitBonus( gpItemDescObject, 100, 1, TRUE ); - if (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) + if( fComparisonMode ) + { + iComparedModifier[0] = GetToHitBonus( gpComparedItemDescObject, 100, 1, FALSE ); + iComparedModifier[1] = 0; + iComparedModifier[2] = GetToHitBonus( gpComparedItemDescObject, 100, 1, TRUE ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9564,9 +12005,12 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) // Flugente: no idea why we would want to skip this in OCTH, commenting this out //if (UsingNewCTHSystem() == false && cnt2 > 0) //break; - SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9591,6 +12035,12 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode && cnt2 != 1 ) + { + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { //swprintf( pStr, L"--" ); @@ -9607,7 +12057,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTCAP ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTCAP ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTCAP ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTCAP ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTCAP ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTCAP ); + } + if ( ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9621,6 +12079,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9645,6 +12107,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9660,7 +12127,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTHANDLING ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTHANDLING ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTHANDLING ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_PERCENTHANDLING ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_PERCENTHANDLING ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_PERCENTHANDLING ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9674,6 +12149,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -9698,6 +12177,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9713,7 +12197,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_DROPCOMPENSATION ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_DROPCOMPENSATION ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_DROPCOMPENSATION ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_DROPCOMPENSATION ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_DROPCOMPENSATION ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_DROPCOMPENSATION ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9727,6 +12219,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9751,6 +12247,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9766,7 +12267,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_TRACKING ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_TRACKING ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_TRACKING ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_TRACKING ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_TRACKING ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_TRACKING ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9780,6 +12289,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9804,6 +12317,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9826,7 +12344,19 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetDamageBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + if (Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_THROWING_KNIFE)) + iComparedModifier[0] = (GetDamageBonus( gpComparedItemDescObject ) * gGameExternalOptions.iGunDamageModifier) / 100; + else if (Item[gpComparedItemDescObject->usItem].usItemClass & (IC_BLADE|IC_PUNCH)) + iComparedModifier[0] = (GetDamageBonus( gpComparedItemDescObject ) * gGameExternalOptions.iMeleeDamageModifier) / 100; + else if (Item[gpComparedItemDescObject->usItem].usItemClass & (IC_EXPLOSV|IC_LAUNCHER)) + iComparedModifier[0] = (GetDamageBonus( gpComparedItemDescObject ) * gGameExternalOptions.iExplosivesDamageModifier) / 100; + else + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9842,6 +12372,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9854,6 +12388,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9869,7 +12408,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetMeleeDamageBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetMeleeDamageBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9885,6 +12430,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9897,6 +12446,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9913,7 +12467,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetRangeBonus( gpItemDescObject ) / CELL_X_SIZE; iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetRangeBonus( gpComparedItemDescObject ) / CELL_X_SIZE; + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9929,6 +12489,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -9941,6 +12505,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -9956,7 +12525,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[0] = GetHighestScopeMagnificationFactor( gpItemDescObject ); iFloatModifier[1] = iFloatModifier[0]; iFloatModifier[2] = iFloatModifier[0]; - if (iFloatModifier[0] > 1.0 && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedFloatModifier[0] = GetHighestScopeMagnificationFactor( gpComparedItemDescObject ); + iComparedFloatModifier[1] = iComparedFloatModifier[0]; + iComparedFloatModifier[2] = iComparedFloatModifier[0]; + } + if ( ( iFloatModifier[0] > 1.0 || ( fComparisonMode && iComparedFloatModifier[0] > 1.0 ) ) && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -9970,7 +12545,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - if (iFloatModifier[cnt2] > 1.0) + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + if (iFloatModifier[cnt2] > 0.0) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%3.1fx", iFloatModifier[cnt2] ); + } + else if (iFloatModifier[cnt2] < 0.0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%3.1fx", iFloatModifier[cnt2] ); + } + else + { + SetFontForeground( 5 ); + swprintf( pStr, L"=", iFloatModifier[cnt2] ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } + else if (iFloatModifier[cnt2] > 1.0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%3.1fx", iFloatModifier[cnt2] ); @@ -10001,7 +12596,16 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = iFloatModifier[0]; iFloatModifier[2] = iFloatModifier[0]; - if ( UsingNewCTHSystem() == true && (iFloatModifier[0] > 1.0 || bNewCode) ) + if( fComparisonMode ) + { + if ( bNewCode ) + iComparedFloatModifier[0] = ((FLOAT)GetBestLaserRange( gpComparedItemDescObject ) / CELL_X_SIZE); + else + iComparedFloatModifier[0] = GetProjectionFactor( gpComparedItemDescObject ); + iComparedFloatModifier[1] = iComparedFloatModifier[0]; + iComparedFloatModifier[2] = iComparedFloatModifier[0]; + } + if ( ( iFloatModifier[0] > 1.0 || ( fComparisonMode && iComparedFloatModifier[0] > 1.0 ) || bNewCode ) && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10039,8 +12643,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentRecoilModifier( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - - if ( iModifier[0] != 0 && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentRecoilModifier( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if ( ( iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10054,6 +12663,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -10078,6 +12691,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10090,12 +12708,21 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } GetFlatRecoilModifier( gpItemDescObject, &bRecoilModifierX, &bRecoilModifierY ); + if( fComparisonMode ) + { + GetFlatRecoilModifier( gpComparedItemDescObject, &bComparedRecoilModifierX, &bComparedRecoilModifierY ); + } ///////////////////// LATERAL RECOIL MODIFIER iFloatModifier[0] = bRecoilModifierX; iFloatModifier[1] = bRecoilModifierX; iFloatModifier[2] = bRecoilModifierX; - - if (iFloatModifier[0] != 0 && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedFloatModifier[0] = bComparedRecoilModifierX; + iComparedFloatModifier[1] = bComparedRecoilModifierX; + iComparedFloatModifier[2] = bComparedRecoilModifierX; + } + if ( ( iFloatModifier[0] != 0 || ( fComparisonMode && iComparedFloatModifier[0] != 0 ) ) && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10109,6 +12736,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -10121,6 +12752,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%3.1f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10136,8 +12772,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[0] = bRecoilModifierY; iFloatModifier[1] = bRecoilModifierY; iFloatModifier[2] = bRecoilModifierY; - - if (iFloatModifier[0] != 0 && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedFloatModifier[0] = bComparedRecoilModifierY; + iComparedFloatModifier[1] = bComparedRecoilModifierY; + iComparedFloatModifier[2] = bComparedRecoilModifierY; + } + if ( ( iFloatModifier[0] != 0 || ( fComparisonMode && iComparedFloatModifier[0] != 0 ) ) && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10151,6 +12792,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -10163,6 +12808,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%3.1f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10179,7 +12829,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[0] = CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_STAND ); iFloatModifier[1] = CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH ); iFloatModifier[2] = CalcCounterForceMax( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE ); - if ((iFloatModifier[0] != 0 || iFloatModifier[1] != 0 || iFloatModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) + if( fComparisonMode ) + { + iComparedFloatModifier[0] = CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND ); + iComparedFloatModifier[1] = CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH ); + iComparedFloatModifier[2] = CalcCounterForceMax( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE ); + } + if ( ((iFloatModifier[0] != 0 || iFloatModifier[1] != 0 || iFloatModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) || + ( fComparisonMode && (iComparedFloatModifier[0] != 0 || iComparedFloatModifier[1] != 0 || iComparedFloatModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10193,6 +12850,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10205,6 +12866,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%3.1f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10220,7 +12886,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEMAX ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEMAX ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEMAX ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEMAX ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ); + } + if ( ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN ) || + ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) && UsingNewCTHSystem() == true && Item[gpComparedItemDescObject->usItem].usItemClass == IC_GUN ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10234,6 +12907,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10258,6 +12935,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10273,7 +12955,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEACCURACY ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEACCURACY ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEACCURACY ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEACCURACY ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEACCURACY ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEACCURACY ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) || ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10287,6 +12976,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10311,6 +13004,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10326,7 +13024,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); iModifier[1] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); iModifier[2] = GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); - if ((iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) && UsingNewCTHSystem() == true ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_STAND, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); + iComparedModifier[1] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); + iComparedModifier[2] = GetObjectModifier( gpItemDescSoldier, gpComparedItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEFREQUENCY ); + } + if ( ( (iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0) || ( fComparisonMode && (iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0) ) ) + && UsingNewCTHSystem() == true ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10340,6 +13045,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10364,6 +13073,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10379,7 +13093,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetAPBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetAPBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10395,6 +13115,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10407,6 +13131,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10422,7 +13151,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentReadyTimeAPReduction( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentReadyTimeAPReduction( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10438,6 +13173,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10462,6 +13201,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10477,7 +13221,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentAPReduction( NULL, gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentAPReduction( NULL, gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10493,6 +13243,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10517,6 +13271,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10531,8 +13290,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) ///////////////////// BURST AP MODIFIER iModifier[0] = GetPercentBurstFireAPReduction( gpItemDescObject ); iModifier[1] = iModifier[0]; - iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + iModifier[2] = iModifier[0]; + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentBurstFireAPReduction( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10548,6 +13313,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10572,6 +13341,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10587,7 +13361,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentAutofireAPReduction( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentAutofireAPReduction( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10603,6 +13383,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10627,6 +13411,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10642,7 +13431,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentReloadTimeAPReduction( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentReloadTimeAPReduction( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10658,6 +13453,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10682,6 +13481,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10697,7 +13501,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetMagSizeBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetMagSizeBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10713,6 +13523,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10725,6 +13539,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10740,7 +13559,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetBurstSizeBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetBurstSizeBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10756,6 +13581,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10768,6 +13597,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10783,7 +13617,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = IsFlashSuppressorAlt( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] ) + if( fComparisonMode ) + { + iComparedModifier[0] = IsFlashSuppressorAlt( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10799,7 +13639,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - if (iModifier[cnt2]) + if ( fComparisonMode && iComparedModifier[0] ) + { + if (iModifier[cnt2]) + { + SetFontForeground( 5 ); + swprintf( pStr, L"=", iModifier[cnt2] ); + } + else + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"Y", iModifier[cnt2] ); + } + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } + else if ( fComparisonMode && !iComparedModifier[0] ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"N", iModifier[cnt2] ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } + else if (iModifier[cnt2]) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"Y", iModifier[cnt2] ); // FIXME: unused param @@ -10820,7 +13680,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetPercentNoiseVolume( gpItemDescObject )-100; iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetPercentNoiseVolume( gpComparedItemDescObject )-100; + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10836,6 +13702,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] < 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10860,6 +13730,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10875,7 +13750,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = CalculateItemSize( gpItemDescObject ) - Item[ gpItemDescObject->usItem ].ItemSize; iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = CalculateItemSize( gpComparedItemDescObject ) - Item[ gpComparedItemDescObject->usItem ].ItemSize; + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10891,6 +13772,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -10903,6 +13788,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10918,8 +13808,16 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetReliability( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (!(Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && - iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetReliability( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if ( (!(Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && + iModifier[0] != 0 ) || + ( fComparisonMode && !(Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_PUNCH|IC_ARMOUR|IC_EXPLOSV)) && + iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10935,6 +13833,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -10947,6 +13849,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) swprintf( pStr, L"%d", iModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -10962,7 +13869,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetCamoBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetCamoBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -10978,6 +13891,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11002,6 +13919,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11017,7 +13939,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetUrbanCamoBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetUrbanCamoBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11033,6 +13961,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11057,6 +13989,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11072,7 +14009,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetDesertCamoBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetDesertCamoBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11088,6 +14031,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11112,6 +14059,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11127,7 +14079,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetSnowCamoBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetSnowCamoBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11143,6 +14101,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11167,6 +14129,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11182,7 +14149,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetStealthBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetStealthBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11198,6 +14171,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11222,6 +14199,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11237,7 +14219,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemHearingRangeBonus( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemHearingRangeBonus( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11253,6 +14241,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11267,9 +14259,9 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } else if (iModifier[cnt2] < 0) { - SetFontForeground( ITEMDESC_FONTNEGATIVE ); - wcscat( pStr, L"%" ); + SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%d", iModifier[cnt2] ); + wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); #ifdef CHINESE wcscat( pStr, ChineseSpecString1 ); @@ -11277,6 +14269,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11292,7 +14289,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemVisionRangeBonus( gpItemDescObject, 0 ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemVisionRangeBonus( gpComparedItemDescObject, 0 ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11308,6 +14311,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11332,6 +14339,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11347,7 +14359,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemVisionRangeBonus( gpItemDescObject, 2 ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemVisionRangeBonus( gpComparedItemDescObject, 2 ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11363,6 +14381,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11387,6 +14409,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11402,7 +14429,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemVisionRangeBonus( gpItemDescObject, 1 ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemVisionRangeBonus( gpComparedItemDescObject, 1 ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11418,6 +14451,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11442,6 +14479,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11457,7 +14499,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemVisionRangeBonus( gpItemDescObject, 3 ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemVisionRangeBonus( gpComparedItemDescObject, 3 ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11473,6 +14521,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11497,6 +14549,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11512,7 +14569,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemVisionRangeBonus( gpItemDescObject, 4 ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemVisionRangeBonus( gpComparedItemDescObject, 4 ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11528,6 +14591,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -11552,6 +14619,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11567,7 +14639,13 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[0] = GetItemPercentTunnelVision( gpItemDescObject ); iModifier[1] = iModifier[0]; iModifier[2] = iModifier[0]; - if (iModifier[0] != 0 ) + if( fComparisonMode ) + { + iComparedModifier[0] = GetItemPercentTunnelVision( gpComparedItemDescObject ); + iComparedModifier[1] = iComparedModifier[0]; + iComparedModifier[2] = iComparedModifier[0]; + } + if (iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -11583,6 +14661,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -11607,6 +14689,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11669,7 +14756,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) // Flugente if ( gGameExternalOptions.fWeaponOverheating ) { - if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here? ///////////////////// SINGLE SHOT TEMPERATURE @@ -11688,12 +14776,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetSingleShotTemperature( gpItemDescObject ) - iFloatModifier[0]; iFloatModifier[2] = GetSingleShotTemperature( gpItemDescObject ); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Weapon[ gpComparedItemDescObject->usItem ].usOverheatingSingleShotTemperature; + if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatTemperatureModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_LAUNCHER ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatTemperatureModifierLauncher; + iComparedFloatModifier[1] = GetSingleShotTemperature( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetSingleShotTemperature( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -11720,6 +14823,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11745,12 +14853,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetItemCooldownFactor(gpItemDescObject) - iFloatModifier[0]; iFloatModifier[2] = GetItemCooldownFactor(gpItemDescObject); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Item[ gpComparedItemDescObject->usItem ].usOverheatingCooldownFactor; + if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatCooldownModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_LAUNCHER ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatCooldownModifierLauncher; + iComparedFloatModifier[1] = GetItemCooldownFactor( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetItemCooldownFactor( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -11777,6 +14900,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11802,12 +14930,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetOverheatJamThreshold(gpItemDescObject) - iFloatModifier[0]; iFloatModifier[2] = GetOverheatJamThreshold(gpItemDescObject); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Weapon[ gpComparedItemDescObject->usItem ].usOverheatingJamThreshold; + if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatJamThresholdModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_LAUNCHER ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatJamThresholdModifierLauncher; + iComparedFloatModifier[1] = GetOverheatJamThreshold( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetOverheatJamThreshold( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -11834,6 +14977,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11859,12 +15007,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetOverheatDamageThreshold(gpItemDescObject) - iFloatModifier[0]; iFloatModifier[2] = GetOverheatDamageThreshold(gpItemDescObject); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Weapon[ gpComparedItemDescObject->usItem ].usOverheatingDamageThreshold; + if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatDamageThresholdModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ]; + else if ( Item[gpComparedItemDescObject->usItem].usItemClass & IC_LAUNCHER ) + iComparedFloatModifier[0] *= gItemSettings.fOverheatDamageThresholdModifierLauncher; + iComparedFloatModifier[1] = GetOverheatDamageThreshold( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetOverheatDamageThreshold( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -11891,6 +15054,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11902,7 +15070,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) cnt++; } - else if ( Item[gpItemDescObject->usItem].barrel == TRUE ) // display for barrel items + else if ( ( Item[gpItemDescObject->usItem].barrel == TRUE ) || // display for barrel items + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].barrel == TRUE ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here? ///////////////////// COOLDOWN FACTOR @@ -11916,12 +15085,23 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetItemCooldownFactor(gpItemDescObject) - iFloatModifier[0]; iFloatModifier[2] = GetItemCooldownFactor(gpItemDescObject); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Item[gpComparedItemDescObject->usItem].usOverheatingCooldownFactor; + iComparedFloatModifier[1] = GetItemCooldownFactor( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetItemCooldownFactor( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -11948,6 +15128,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -11958,7 +15143,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } cnt++; } - else if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) + else if ( ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) || + ( fComparisonMode && ( ( Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here? @@ -11973,12 +15159,23 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetTemperatureModifier( gpItemDescObject ) - iFloatModifier[0]; iFloatModifier[2] = GetTemperatureModifier( gpItemDescObject ); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = -1.0f - Item[gpComparedItemDescObject->usItem].overheatTemperatureModificator; + iComparedFloatModifier[1] = GetTemperatureModifier( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetTemperatureModifier( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -12005,6 +15202,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -12017,7 +15219,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) ///////////////////// TEMPERATURE MODIFIER ///////////////////// COOLDOWN MODIFIER - if ( ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) && cnt >= sFirstLine && cnt < sLastLine) + if ( ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatCooldownModificator != 0.0 ) ) + && cnt >= sFirstLine && cnt < sLastLine) { // Set Y coordinates sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; @@ -12027,12 +15230,23 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetItemCooldownModificator( gpItemDescObject ) - iFloatModifier[0]; iFloatModifier[2] = GetItemCooldownModificator( gpItemDescObject ); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Item[gpComparedItemDescObject->usItem].overheatCooldownModificator; + iComparedFloatModifier[1] = GetItemCooldownModificator( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetItemCooldownModificator( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -12059,6 +15273,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -12071,7 +15290,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) ///////////////////// COOLDOWN MODIFIER ///////////////////// JAM THRESHOLD MODIFIER - if ( ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) && cnt >= sFirstLine && cnt < sLastLine) + if ( ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) ) + && cnt >= sFirstLine && cnt < sLastLine) { // Set Y coordinates sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; @@ -12081,12 +15301,23 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetOverheatJamThresholdModifier( gpItemDescObject ) - iFloatModifier[0]; iFloatModifier[2] = GetOverheatJamThresholdModifier( gpItemDescObject ); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = -1.0f - Item[gpComparedItemDescObject->usItem].overheatJamThresholdModificator; + iComparedFloatModifier[1] = GetOverheatJamThresholdModifier( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetOverheatJamThresholdModifier( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -12113,6 +15344,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -12125,7 +15361,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) ///////////////////// JAM THRESHOLD MODIFIER ///////////////////// DAMAGE THRESHOLD MODIFIER - if ( ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) && cnt >= sFirstLine && cnt < sLastLine) + if ( ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 || ( fComparisonMode && Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) ) + && cnt >= sFirstLine && cnt < sLastLine) { // Set Y coordinates sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; @@ -12135,12 +15372,23 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[1] = GetOverheatDamageThresholdModifier( gpItemDescObject ) - iFloatModifier[0]; iFloatModifier[2] = GetOverheatDamageThresholdModifier( gpItemDescObject ); + if( fComparisonMode ) + { + iComparedFloatModifier[0] = -1.0f - Item[gpComparedItemDescObject->usItem].overheatDamageThresholdModificator; + iComparedFloatModifier[1] = GetOverheatDamageThresholdModifier( gpComparedItemDescObject ) - iComparedFloatModifier[0]; + iComparedFloatModifier[2] = GetOverheatDamageThresholdModifier( gpComparedItemDescObject ); + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { if ( cnt2 == 1 ) @@ -12167,6 +15415,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -12189,8 +15442,19 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iModifier[1] = AmmoTypes[ammotype].poisonPercentage; iModifier[2] = iModifier[0] + iModifier[1]; + if( fComparisonMode ) + { + iComparedModifier[0] = Item[gpComparedItemDescObject->usItem].bPoisonPercentage; + + UINT8 comparedammotype = (*gpComparedItemDescObject)[0]->data.gun.ubGunAmmoType; + + iComparedModifier[1] = AmmoTypes[comparedammotype].poisonPercentage; + iComparedModifier[2] = iComparedModifier[0] + iComparedModifier[1]; + } + // only draw if item is poisoned in any way - if ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) + if ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) || + ( fComparisonMode && ( iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0 ) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here? if (cnt >= sFirstLine && cnt < sLastLine) @@ -12205,6 +15469,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetRGBFontForeground( 0, 255, 0 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2]; + } if (iModifier[cnt2] > 0) { swprintf( pStr, L"%d", iModifier[cnt2] ); @@ -12238,7 +15506,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) if ( gGameExternalOptions.fDirtSystem ) { - if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) + if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) || + ( fComparisonMode && Item[gpComparedItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; //insert Indexes here? ///////////////////// DIRT MODIFICATOR @@ -12252,18 +15521,32 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) iFloatModifier[2] = GetItemDirtIncreaseFactor( gpItemDescObject, TRUE ); iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0]; + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Item[ gpComparedItemDescObject->usItem ].dirtIncreaseFactor * gGameExternalOptions.iDirtGlobalModifier; + iComparedFloatModifier[2] = GetItemDirtIncreaseFactor( gpComparedItemDescObject, TRUE ); + iComparedFloatModifier[1] = iComparedFloatModifier[2] - iComparedFloatModifier[0]; + } + // Print Values for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++) { SetFontForeground( 5 ); sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if( fComparisonMode ) + { + iFloatModifier[cnt2] = iComparedFloatModifier[cnt2] - iFloatModifier[cnt2]; + } if (iFloatModifier[cnt2] > 0) { - if ( cnt2 == 1 ) + if ( cnt2 == 1 || fComparisonMode) SetFontForeground( ITEMDESC_FONTNEGATIVE ); - swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); + if ( !fComparisonMode ) + swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); + else + swprintf( pStr, L"+%4.2f", iFloatModifier[cnt2] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); #ifdef CHINESE wcscat( pStr, ChineseSpecString1 ); @@ -12273,7 +15556,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } else if (iFloatModifier[cnt2] < 0) { - if ( cnt2 == 1 ) + if ( cnt2 == 1 || fComparisonMode) SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] ); @@ -12284,6 +15567,11 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) wcscat( pStr, L"%" ); #endif } + else if( fComparisonMode ) + { + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + } else { swprintf( pStr, L"--" ); @@ -12299,12 +15587,19 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) if ( gGameOptions.fFoodSystem ) { UINT32 fFoodtype = Item[gpItemDescObject->usItem].foodtype; - if ( fFoodtype > 0 ) + UINT32 fComparedFoodtype = 0; + if( fComparisonMode ) + { + fComparedFoodtype = Item[gpComparedItemDescObject->usItem].foodtype; + } + if ( fFoodtype > 0 || ( fComparisonMode && fComparedFoodtype > 0 ) ) { if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; //insert Indexes here? //////////////////////////// POISONED FOOD iFloatModifier[0] = (*gpItemDescObject)[0]->data.bTemperature;//temperature is reused for poisoned food - if ( iFloatModifier[0] != 0.0f && OVERHEATING_MAX_TEMPERATURE > 0.0 ) + if( fComparisonMode ) + iComparedFloatModifier[0] = (*gpComparedItemDescObject)[0]->data.bTemperature; + if ( ( iFloatModifier[0] != 0.0f || ( fComparisonMode && iComparedFloatModifier[0] != 0.0f ) ) && OVERHEATING_MAX_TEMPERATURE > 0.0 ) { if (cnt >= sFirstLine && cnt < sLastLine) { @@ -12321,11 +15616,33 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) else iModifier[1] = 0; iModifier[2] = iModifier[1]; + if( fComparisonMode ) + { + iComparedFloatModifier[0] = min( 1.0f, iComparedFloatModifier[0] / OVERHEATING_MAX_TEMPERATURE ); + iComparedModifier[0] = 0; + //FOOD_BAD_THRESHOLD + if ( iComparedFloatModifier[0] < 0.5f ) + { + iComparedModifier[1] = (INT16)( max( Food[fComparedFoodtype].bFoodPoints, Food[fComparedFoodtype].bDrinkPoints ) * (1.0 - iComparedFloatModifier[0]) * 0.025 );//Poison formula coppied from food.cpp + iComparedModifier[1] = min( iComparedModifier[1], gGameExternalOptions.usFoodMaxPoisoning ); + } + else + iComparedModifier[1] = 0; + iComparedModifier[2] = iComparedModifier[1]; + iModifier[0] = iComparedModifier[0] - iModifier[0]; + iModifier[1] = iComparedModifier[1] - iModifier[1]; + iModifier[2] = iComparedModifier[2] - iModifier[2]; + } for ( UINT8 cnt2 = 0; cnt2 < 3; cnt2++ ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; - sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - if ( iModifier[cnt2] > 0 ) + sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + if ( fComparisonMode && iModifier[cnt2] > 0 ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%d", iModifier[cnt2] ); + } + else if ( iModifier[cnt2] > 0 ) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%d", iModifier[cnt2] ); @@ -12335,10 +15652,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%d", iModifier[cnt2] ); } + else if( fComparisonMode ) + { + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + } else { SetFontForeground( 5 ); - swprintf( pStr, L"--", iModifier[cnt2] ); + swprintf( pStr, L"--" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); @@ -12346,21 +15668,56 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } cnt++; } + else if( fComparisonMode && OVERHEATING_MAX_TEMPERATURE > 0.0 ) + { + if (cnt >= sFirstLine && cnt < sLastLine) + { + sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; + sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; + for ( UINT8 cnt2 = 0; cnt2 < 3; cnt2++ ) + { + sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; + sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); + mprintf( usX, usY, pStr ); + } + } + cnt++; + } //////////////////////////// FOOD POINTS iFloatModifier[0] = ( (FLOAT) Food[fFoodtype].bFoodPoints )/1000; + if( fComparisonMode ) + { + iComparedFloatModifier[0] = ( (FLOAT) Food[fComparedFoodtype].bFoodPoints )/1000; + } sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - if ( iFloatModifier[0] != 0 ) + if ( iFloatModifier[0] != 0 || ( fComparisonMode && iComparedFloatModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { iFloatModifier[2] = ( ( (FLOAT)(*gpItemDescObject)[0]->data.objectStatus )/100 ) * iFloatModifier[0]; iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0]; + if ( fComparisonMode ) + { + iComparedFloatModifier[2] = ( ( (FLOAT)(*gpComparedItemDescObject)[0]->data.objectStatus )/100 ) * iComparedFloatModifier[0]; + iComparedFloatModifier[1] = iComparedFloatModifier[2] - iComparedFloatModifier[0]; + iFloatModifier[0] = iComparedFloatModifier[0] - iFloatModifier[0]; + iFloatModifier[1] = iComparedFloatModifier[1] - iFloatModifier[1]; + iFloatModifier[2] = iComparedFloatModifier[2] - iFloatModifier[2]; + } for ( UINT8 cnt2 = 0; cnt2 < 3; cnt2++ ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - if ( iFloatModifier[cnt2] > 0 ) + if ( fComparisonMode && iFloatModifier[cnt2] > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%4.3f", iFloatModifier[cnt2] ); + } + else if ( iFloatModifier[cnt2] > 0 ) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%4.3f", iFloatModifier[cnt2] ); @@ -12370,10 +15727,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%4.3f", iFloatModifier[cnt2] ); } + else if( fComparisonMode ) + { + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + } else { SetFontForeground( 5 ); - swprintf( pStr, L"--", iFloatModifier[cnt2] ); + swprintf( pStr, L"--" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); @@ -12383,19 +15745,36 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } ////////////////////////// DRINK POINTS iFloatModifier[0] = ( (FLOAT) Food[fFoodtype].bDrinkPoints )/1000; + if( fComparisonMode ) + { + iComparedFloatModifier[0] = ( (FLOAT) Food[fComparedFoodtype].bDrinkPoints )/1000; + } sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - if ( iFloatModifier[0] != 0 ) + if ( iFloatModifier[0] != 0 || ( fComparisonMode && iComparedFloatModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { iFloatModifier[2] = ( ( (FLOAT)(*gpItemDescObject)[0]->data.objectStatus )/100 ) * iFloatModifier[0]; iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0]; + if ( fComparisonMode ) + { + iComparedFloatModifier[2] = ( ( (FLOAT)(*gpComparedItemDescObject)[0]->data.objectStatus )/100 ) * iComparedFloatModifier[0]; + iComparedFloatModifier[1] = iComparedFloatModifier[2] - iComparedFloatModifier[0]; + iFloatModifier[0] = iComparedFloatModifier[0] - iFloatModifier[0]; + iFloatModifier[1] = iComparedFloatModifier[1] - iFloatModifier[1]; + iFloatModifier[2] = iComparedFloatModifier[2] - iFloatModifier[2]; + } for ( UINT8 cnt2 = 0; cnt2 < 3; cnt2++ ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - if ( iFloatModifier[cnt2] > 0 ) + if ( fComparisonMode && iFloatModifier[cnt2] > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%3.2f", iFloatModifier[cnt2] ); + } + else if ( iFloatModifier[cnt2] > 0 ) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%3.2f", iFloatModifier[cnt2] ); @@ -12405,10 +15784,15 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%3.2f", iFloatModifier[cnt2] ); } + else if( fComparisonMode ) + { + SetFontForeground( 5 ); + swprintf( pStr, L"=" ); + } else { SetFontForeground( 5 ); - swprintf( pStr, L"--", iFloatModifier[cnt2] ); + swprintf( pStr, L"--" ); } FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); @@ -12418,13 +15802,27 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) } ////////////////////////// PORTION SIZE iModifier[0] = Food[fFoodtype].ubPortionSize; + if( fComparisonMode ) + { + iComparedModifier[0] = Food[fComparedFoodtype].ubPortionSize; + iModifier[0] = iComparedModifier[0] - iModifier[0]; + } sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - if ( iModifier[0] != 0 ) + if ( iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { - if ( iModifier[0] <= 20 ) + if( fComparisonMode ) + { + if ( iModifier[0] < 0 ) + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + else if ( iModifier[0] > 0 ) + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + else + SetFontForeground( 5 ); + } + else if ( iModifier[0] <= 20 ) SetFontForeground( ITEMDESC_FONTPOSITIVE ); else SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -12432,28 +15830,54 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - swprintf( pStr, L"%d", iModifier[0] ); - wcscat( pStr, L"%" ); + if ( fComparisonMode && iModifier[0] > 0 ) + swprintf( pStr, L"+%d", iModifier[0] ); + else if ( fComparisonMode && iModifier[0] < 0 ) + swprintf( pStr, L"%d", iModifier[0] ); + else if ( fComparisonMode ) + swprintf( pStr, L"=" ); + else + swprintf( pStr, L"%d", iModifier[0] ); + FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); + if( !( fComparisonMode && iModifier[0] == 0 ) ) + { + wcscat( pStr, L"%" ); #ifdef CHINESE - wcscat( pStr, ChineseSpecString1 ); + wcscat( pStr, ChineseSpecString1 ); #else - wcscat( pStr, L"%" ); + wcscat( pStr, L"%" ); #endif + } mprintf( usX, usY, pStr ); } } cnt++; } + ////////////////////////// MORALE MODIFIER iModifier[0] = Food[fFoodtype].bMoraleMod; + if( fComparisonMode ) + { + iComparedModifier[0] = Food[fComparedFoodtype].bMoraleMod; + iModifier[0] = iComparedModifier[0] - iModifier[0]; + } sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - if ( iModifier[0] != 0 ) + if ( iModifier[0] != 0 || ( fComparisonMode && iComparedModifier[0] != 0 ) ) { if (cnt >= sFirstLine && cnt < sLastLine) { - if ( iModifier[0] > 0 ) + if( fComparisonMode ) + { + if ( iModifier[0] < 0 ) + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + else if ( iModifier[0] > 0 ) + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + else + SetFontForeground( 5 ); + } + else if ( iModifier[0] > 0 ) SetFontForeground( ITEMDESC_FONTPOSITIVE ); else SetFontForeground( ITEMDESC_FONTNEGATIVE ); @@ -12461,22 +15885,44 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - swprintf( pStr, L"%d", iModifier[0] ); + if ( fComparisonMode && iModifier[0] > 0 ) + swprintf( pStr, L"+%d", iModifier[0] ); + else if ( fComparisonMode && iModifier[0] < 0 ) + swprintf( pStr, L"%d", iModifier[0] ); + else if ( fComparisonMode ) + swprintf( pStr, L"=" ); + else + swprintf( pStr, L"%d", iModifier[0] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); } } cnt++; } + ////////////////////////// DECAY RATE iFloatModifier[0] = Food[fFoodtype].usDecayRate; + if( fComparisonMode ) + { + iComparedFloatModifier[0] = Food[fComparedFoodtype].usDecayRate; + iFloatModifier[0] = iComparedFloatModifier[0] - iFloatModifier[0]; + } sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - if ( iFloatModifier[0] != 0 ) + if ( iFloatModifier[0] != 0 || ( fComparisonMode && iComparedFloatModifier[0] != 0 ) ) { if ( cnt >= sFirstLine && cnt < sLastLine ) { - if ( iFloatModifier[0] > 1.0f ) + if( fComparisonMode ) + { + if ( iFloatModifier[0] < 0.0f ) + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + else if ( iFloatModifier[0] > 0.0f ) + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + else + SetFontForeground( 5 ); + } + else if ( iFloatModifier[0] > 1.0f ) SetFontForeground( ITEMDESC_FONTNEGATIVE ); else SetFontForeground( ITEMDESC_FONTPOSITIVE ); @@ -12484,7 +15930,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) { sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft; sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft; - swprintf( pStr, L"%4.2f", iFloatModifier[0] ); + if( fComparisonMode && iFloatModifier[0] > 0.0f ) + swprintf( pStr, L"+%4.2f", iFloatModifier[0] ); + else + swprintf( pStr, L"%4.2f", iFloatModifier[0] ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY ); mprintf( usX, usY, pStr ); } @@ -12539,6 +15988,19 @@ void DrawMiscValues( OBJECTTYPE * gpItemDescObject ) if (gubDescBoxPage == 1) { + OBJECTTYPE *gpComparedItemDescObject = NULL; + // anv: if alt is pressed in map inventory, show comparison with selected misc + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass == Item[ gpItemDescObject->usItem ].usItemClass ) + fComparisonMode = TRUE; + } + } + ////////////////////////////////////////////////// HEADERS SetFontForeground( FONT_MCOLOR_WHITE ); @@ -12590,7 +16052,26 @@ void DrawMiscValues( OBJECTTYPE * gpItemDescObject ) SetFontForeground( 5 ); sLeft = gItemDescGenRegions[ubNumLine][1].sLeft; sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft; - if (iRepairEaseValue < 0) + if( fComparisonMode ) + { + INT8 iComparedRepairEaseValue = Item[gpComparedItemDescObject->usItem].bRepairEase; + INT8 iComparedRepairEaseDifference = iComparedRepairEaseValue - iRepairEaseValue; + if (iComparedRepairEaseDifference < 0) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%d", iComparedRepairEaseDifference ); + } + else if ( iComparedRepairEaseDifference > 0 ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%d", iComparedRepairEaseDifference ); + } + else + { + swprintf( pStr, L"=" ); + } + } + else if (iRepairEaseValue < 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%d", iRepairEaseValue ); diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 80ddc9370..d90767e48 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -6924,11 +6924,38 @@ void RenderItemDescriptionBox( ) { if ( Item[ gpItemDescObject->usItem ].usItemClass & IC_GUN || Item[ gpItemDescObject->usItem ].usItemClass & IC_LAUNCHER ) { + OBJECTTYPE *gpComparedItemDescObject; + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + // display bullets for ROF - if ( !Weapon[gpItemDescObject->usItem].NoSemiAuto ) + if ( !Weapon[gpItemDescObject->usItem].NoSemiAuto || + ( fComparisonMode && !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) ) BltVideoObjectFromIndex( guiSAVEBUFFER, guiBullet, 0, gODBItemDescRegions[3][1].sLeft, gODBItemDescRegions[3][1].sTop, VO_BLT_SRCTRANSPARENCY, NULL ); - if ( GetShotsPerBurst(gpItemDescObject) > 0 ) + if ( fComparisonMode && GetShotsPerBurst(gpComparedItemDescObject) > 0 ) + { + for ( cnt = 0; cnt < __min(GetShotsPerBurst(gpComparedItemDescObject),12); cnt++ ) + { + BltVideoObjectFromIndex( guiSAVEBUFFER, guiBullet, 0, gODBItemDescRegions[3][4].sLeft + cnt * (BULLET_WIDTH/2 + 1), gODBItemDescRegions[3][4].sTop, VO_BLT_SRCTRANSPARENCY, NULL ); + } + } + else if ( fComparisonMode && GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0 ) + { + for ( cnt = 0; cnt < 10; cnt++ ) + { + BltVideoObjectFromIndex( guiSAVEBUFFER, guiBullet, 0, gODBItemDescRegions[3][4].sLeft + cnt * (BULLET_WIDTH/2 + 1), gODBItemDescRegions[3][4].sTop, VO_BLT_SRCTRANSPARENCY, NULL ); + } + } + else if ( GetShotsPerBurst(gpItemDescObject) > 0 ) { for ( cnt = 0; cnt < __min(GetShotsPerBurst(gpItemDescObject),12); cnt++ ) { @@ -7363,6 +7390,18 @@ void RenderItemDescriptionBox( ) } else { + OBJECTTYPE *gpComparedItemDescObject; + BOOLEAN fComparisonMode = FALSE; + if( _KeyDown( ALT ) && gfCheckForCursorOverMapSectorInventoryItem ) + { + gpComparedItemDescObject = &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCurrentlyHighLightedItem].object;// = pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object; + if( gpComparedItemDescObject != NULL ) + { + if( Item[ gpComparedItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE|IC_BLADE|IC_PUNCH) ) + fComparisonMode = TRUE; + } + } + if ( Item[ gpItemDescObject->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER|IC_THROWING_KNIFE) ) { // RANGE @@ -7377,7 +7416,25 @@ void RenderItemDescriptionBox( ) { SetFontForeground( 5 ); } - swprintf( pStr, L"%2d", ( GunRange( gpItemDescObject, NULL ) ) / 10 ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%2d", ( GunRange( gpItemDescObject, NULL ) ) / 10 ); + } + else + { + if( GunRange( gpComparedItemDescObject, NULL ) > GunRange( gpItemDescObject, NULL ) ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%2d", ( GunRange( gpComparedItemDescObject, NULL ) - GunRange( gpItemDescObject, NULL ) ) / 10 ); + } + else if( GunRange( gpComparedItemDescObject, NULL ) < GunRange( gpItemDescObject, NULL ) ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%2d", ( GunRange( gpComparedItemDescObject, NULL ) - GunRange( gpItemDescObject, NULL ) ) / 10 ); + } + else + swprintf( pStr, L"="); + } FindFontRightCoordinates( gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sTop, gODBItemDescRegions[2][7].sRight - gODBItemDescRegions[2][7].sLeft, gODBItemDescRegions[2][7].sBottom - gODBItemDescRegions[2][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } @@ -7389,29 +7446,47 @@ void RenderItemDescriptionBox( ) UINT8 ubImpact = GetDamage(gpItemDescObject); - UINT16 exceptionalDamage; - // Melee damage - if ( Item[gpItemDescObject->usItem].usItemClass == IC_BLADE || Item[gpItemDescObject->usItem].usItemClass == IC_PUNCH || Item[gpItemDescObject->usItem].usItemClass == IC_TENTACLES ) - { - exceptionalDamage = (UINT16)(( EXCEPTIONAL_MELEE_DAMAGE * gGameExternalOptions.iMeleeDamageModifier ) / 100); - } - // Gun damage - else - { - exceptionalDamage = (UINT16)(( EXCEPTIONAL_GUN_DAMAGE * gGameExternalOptions.iGunDamageModifier ) / 100); - } + UINT16 exceptionalDamage; + // Melee damage + if ( Item[gpItemDescObject->usItem].usItemClass == IC_BLADE || Item[gpItemDescObject->usItem].usItemClass == IC_PUNCH || Item[gpItemDescObject->usItem].usItemClass == IC_TENTACLES ) + { + exceptionalDamage = (UINT16)(( EXCEPTIONAL_MELEE_DAMAGE * gGameExternalOptions.iMeleeDamageModifier ) / 100); + } + // Gun damage + else + { + exceptionalDamage = (UINT16)(( EXCEPTIONAL_GUN_DAMAGE * gGameExternalOptions.iGunDamageModifier ) / 100); + } - if ( ubImpact >= exceptionalDamage) - { - SetFontForeground( ITEMDESC_FONTHIGHLIGHT ); - } - else - { - SetFontForeground( 5 ); - } + if ( ubImpact >= exceptionalDamage) + { + SetFontForeground( ITEMDESC_FONTHIGHLIGHT ); + } + else + { + SetFontForeground( 5 ); + } //Damage - swprintf( pStr, L"%2d", ubImpact ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%2d", ubImpact ); + } + else + { + if( GetDamage(gpComparedItemDescObject) > ubImpact ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"+%2d", GetDamage(gpComparedItemDescObject) - ubImpact ); + } + else if( GetDamage(gpComparedItemDescObject) < ubImpact ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"%2d", GetDamage(gpComparedItemDescObject) - ubImpact ); + } + else + swprintf( pStr, L"="); + } FindFontRightCoordinates( gODBItemDescRegions[2][3].sLeft, gODBItemDescRegions[2][3].sTop, gODBItemDescRegions[2][3].sRight - gODBItemDescRegions[2][3].sLeft, gODBItemDescRegions[2][3].sBottom - gODBItemDescRegions[2][3].sTop ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } @@ -7448,7 +7523,41 @@ void RenderItemDescriptionBox( ) //AP's if ( !Weapon[gpItemDescObject->usItem].NoSemiAuto ) { - swprintf( pStr, L"%2d", ubAttackAPs ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%2d", ubAttackAPs ); + } + else + { + if ( !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) + { + UINT8 ubComparedAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); + if( ubComparedAttackAPs > ubAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%2d", ubComparedAttackAPs - ubAttackAPs ); + } + else if( ubComparedAttackAPs < ubAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedAttackAPs - ubAttackAPs ); + } + else + swprintf( pStr, L"="); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } + } + FindFontRightCoordinates( gODBItemDescRegions[3][3].sLeft, gODBItemDescRegions[3][3].sTop, gODBItemDescRegions[3][3].sRight - gODBItemDescRegions[3][3].sLeft, gODBItemDescRegions[3][3].sBottom - gODBItemDescRegions[3][3].sTop ,pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + else if ( fComparisonMode && !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) + { + UINT8 ubComparedAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); + swprintf( pStr, L"%2d", ubComparedAttackAPs ); FindFontRightCoordinates( gODBItemDescRegions[3][3].sLeft, gODBItemDescRegions[3][3].sTop, gODBItemDescRegions[3][3].sRight - gODBItemDescRegions[3][3].sLeft, gODBItemDescRegions[3][3].sBottom - gODBItemDescRegions[3][3].sTop ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } @@ -7463,17 +7572,130 @@ void RenderItemDescriptionBox( ) { SetFontForeground( 5 ); } - swprintf( pStr, L"%2d", ubAttackAPs + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpItemDescObject, NULL ) ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%2d", ubAttackAPs + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpItemDescObject, NULL ) ); + } + else + { + UINT8 ubBurstAttackAPs = ubAttackAPs + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpItemDescObject, NULL ); + if (GetShotsPerBurst(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, NULL ); + if( ubComparedBurstAttackAPs > ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else if( ubComparedBurstAttackAPs < ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else + swprintf( pStr, L"="); + } + else if (GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, 3, NULL ); + if( ubComparedBurstAttackAPs > ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else if( ubComparedBurstAttackAPs < ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else + swprintf( pStr, L"="); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } + } FindFontRightCoordinates( gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sTop, gODBItemDescRegions[3][7].sRight - gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sBottom - gODBItemDescRegions[3][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } else if (GetAutofireShotsPerFiveAPs(gpItemDescObject) > 0) { SetFontForeground( 5 ); - swprintf( pStr, L"%2d", ubAttackAPs + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpItemDescObject, 3, NULL ) ); + if( !fComparisonMode ) + { + swprintf( pStr, L"%2d", ubAttackAPs + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpItemDescObject, 3, NULL ) ); + } + else + { + UINT8 ubBurstAttackAPs = ubAttackAPs + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpItemDescObject, 3, NULL ); + if (GetShotsPerBurst(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, NULL ); + if( ubComparedBurstAttackAPs > ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else if( ubComparedBurstAttackAPs < ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else + swprintf( pStr, L"="); + } + else if (GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, 3, NULL ); + if( ubComparedBurstAttackAPs > ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"+%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else if( ubComparedBurstAttackAPs < ubBurstAttackAPs ) + { + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs - ubBurstAttackAPs ); + } + else + swprintf( pStr, L"="); + } + else + { + SetFontForeground( ITEMDESC_FONTNEGATIVE ); + swprintf( pStr, L"-" ); + } + } FindFontRightCoordinates( gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sTop, gODBItemDescRegions[3][7].sRight - gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sBottom - gODBItemDescRegions[3][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } + else if( fComparisonMode ) + { + if (GetShotsPerBurst(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToBurst( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, NULL ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs ); + FindFontRightCoordinates( gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sTop, gODBItemDescRegions[3][7].sRight - gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sBottom - gODBItemDescRegions[3][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + else if (GetAutofireShotsPerFiveAPs(gpComparedItemDescObject) > 0) + { + UINT8 ubComparedBurstAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ) + + CalcAPsToAutofire( APBPConstants[DEFAULT_APS], gpComparedItemDescObject, 3, NULL ); + SetFontForeground( ITEMDESC_FONTPOSITIVE ); + swprintf( pStr, L"%2d", ubComparedBurstAttackAPs ); + FindFontRightCoordinates( gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sTop, gODBItemDescRegions[3][7].sRight - gODBItemDescRegions[3][7].sLeft, gODBItemDescRegions[3][7].sBottom - gODBItemDescRegions[3][7].sTop ,pStr, BLOCKFONT2, &usX, &usY); + mprintf( usX, usY, pStr ); + } + } } else { diff --git a/Tactical/Interface Items.h b/Tactical/Interface Items.h index b085bf37e..c1e5755a9 100644 --- a/Tactical/Interface Items.h +++ b/Tactical/Interface Items.h @@ -91,6 +91,8 @@ void ItemDescCallback( MOUSE_REGION * pRegion, INT32 iReason ); #define EXCEPTIONAL_REPAIR_EASE 2 #define EXCEPTIONAL_ACCURACY 4 #define ITEMDESC_FONTHIGHLIGHT FONT_MCOLOR_WHITE +#define ITEMDESC_FONTPOSITIVE FONT_MCOLOR_LTGREEN +#define ITEMDESC_FONTNEGATIVE FONT_MCOLOR_LTRED //CHRISL: extern'd for EDB project extern INT16 gsInvDescX;