Bugfix: UDB display/color coding of handling, armor piercing and their respective comparison feature was wrong. Also enabled display of maximum counter force modifier for other items than guns.

Bugfix: Calculation of maximum counter force modifier was wrong. Stance based bonus was applied to gun and each of its attachments.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7275 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-06-16 16:47:35 +00:00
parent 0e15435069
commit 33b3707381
2 changed files with 22 additions and 17 deletions
+11 -11
View File
@@ -3259,7 +3259,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|| GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_CROUCH, ITEMMODIFIER_COUNTERFORCEMAX ) != 0
|| GetObjectModifier( gpItemDescSoldier, gpItemDescObject, ANIM_PRONE, ITEMMODIFIER_COUNTERFORCEMAX ) != 0 )
{
if( UsingNewCTHSystem() == true && Item[gpItemDescObject->usItem].usItemClass == IC_GUN )
if( UsingNewCTHSystem() == true ) //&& Item[gpItemDescObject->usItem].usItemClass == IC_GUN )
{
if (cnt >= sFirstLine && cnt < sLastLine)
{
@@ -5344,7 +5344,7 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|| 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 )
if( UsingNewCTHSystem() == true ) //&& Item[gpItemDescObject->usItem].usItemClass == IC_GUN )
{
if (cnt >= sFirstLine && cnt < sLastLine)
{
@@ -6865,7 +6865,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Print base value
DrawPropertyValueInColour( iHandlingValue, ubNumLine, 1, fComparisonMode, FALSE, TRUE );
// Print modifier
DrawPropertyValueInColour( iHandlingModifier, ubNumLine, 2, fComparisonMode, TRUE, TRUE );
DrawPropertyValueInColour( iHandlingModifier, ubNumLine, 2, fComparisonMode, TRUE, FALSE );
// Print final value
DrawPropertyValueInColour( iFinalHandlingValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE, FONT_MCOLOR_WHITE );
}
@@ -6883,11 +6883,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Get Final Gun Handling value
UINT16 iComparedFinalHandlingValue = iComparedHandlingValue + iComparedHandlingModifier;
// Print difference in base value
DrawPropertyValueInColour( iComparedHandlingValue - iHandlingValue, ubNumLine, 1, fComparisonMode, FALSE, TRUE );
DrawPropertyValueInColour( iComparedHandlingValue - iHandlingValue, ubNumLine, 1, fComparisonMode, FALSE, FALSE );
// Print difference in modifier
DrawPropertyValueInColour( iComparedHandlingModifier - iHandlingModifier, ubNumLine, 2, fComparisonMode, TRUE, TRUE );
DrawPropertyValueInColour( iComparedHandlingModifier - iHandlingModifier, ubNumLine, 2, fComparisonMode, TRUE, FALSE );
// Print difference in final value
DrawPropertyValueInColour( iComparedFinalHandlingValue - iFinalHandlingValue, ubNumLine, 3, fComparisonMode, FALSE, TRUE );
DrawPropertyValueInColour( iComparedFinalHandlingValue - iFinalHandlingValue, ubNumLine, 3, fComparisonMode, FALSE, FALSE );
}
}
else if( fComparisonMode && UsingNewCTHSystem() == TRUE &&
@@ -8726,7 +8726,7 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
if( !fComparisonMode )
{
// Print base value
DrawPropertyValueInColourFloat( fArmourImpactReduction, ubNumLine, 1, fComparisonMode, FALSE, TRUE, 0, 1.0f, 2 );
DrawPropertyValueInColourFloat( fArmourImpactReduction, ubNumLine, 1, fComparisonMode, FALSE, FALSE, 0, 1.0f, 2 );
// Print modifier
DrawPropertyTextInColour( L"--", ubNumLine, 2 );
// Print final value
@@ -8774,11 +8774,11 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
// Get base Tumbling
FLOAT fComparedFinalAfterArmourImpactReduction = fComparedAfterArmourImpactReduction;
// Print difference in base value
DrawPropertyValueInColourFloat( fComparedAfterArmourImpactReduction - fAfterArmourImpactReduction, ubNumLine, 1, fComparisonMode, FALSE, FALSE, 0, 0.0f, 2 );
DrawPropertyValueInColourFloat( fComparedAfterArmourImpactReduction - fAfterArmourImpactReduction, ubNumLine, 1, fComparisonMode, FALSE, TRUE, 0, 0.0f, 2 );
// Print difference in modifier
DrawPropertyTextInColour( L"=", ubNumLine, 2 );
// Print difference in final value
DrawPropertyValueInColourFloat( fComparedFinalAfterArmourImpactReduction - fFinalAfterArmourImpactReduction, ubNumLine, 3, fComparisonMode, FALSE, FALSE, 0, 0.0f, 2 );
DrawPropertyValueInColourFloat( fComparedFinalAfterArmourImpactReduction - fFinalAfterArmourImpactReduction, ubNumLine, 3, fComparisonMode, FALSE, TRUE, 0, 0.0f, 2 );
}
}
@@ -11248,8 +11248,8 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
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 ( ((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)
{
+11 -6
View File
@@ -10241,12 +10241,6 @@ INT32 GetItemModifier(OBJECTTYPE* pObj, UINT8 ubRef, UINT8 usType)
break;
case ITEMMODIFIER_COUNTERFORCEMAX:
iModifier += BonusReduceMore( Item[pObj->usItem].maxcounterforcemodifier[ubRef], (*pObj)[0]->data.objectStatus );
if(ubRef == 1)
iModifier += (INT32)gGameCTHConstants.RECOIL_MAX_COUNTER_CROUCH;
else if (ubRef == 2)
iModifier += (INT32)gGameCTHConstants.RECOIL_MAX_COUNTER_PRONE;
break;
case ITEMMODIFIER_COUNTERFORCEACCURACY:
iModifier += BonusReduceMore( Item[pObj->usItem].counterforceaccuracymodifier[ubRef], (*pObj)[0]->data.objectStatus );
@@ -10281,6 +10275,17 @@ INT32 GetObjectModifier( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, UINT8 ubStance
// simply add the object modifier
iModifier += GetItemModifier( pObj, ubRef, usType);
// silversurfer: add stance based max counter force modifier here and not in function GetItemModifier() because
// that function is called for everything including attachments multiple times giving an insane bonus to max counter force modifier.
// An attachment that provides such bonus is not affected by this change. This stance based modifier only applies to guns.
if( usType == ITEMMODIFIER_COUNTERFORCEMAX && Item[pObj->usItem].usItemClass & IC_GUN )
{
if(ubRef == 1)
iModifier += (INT32)gGameCTHConstants.RECOIL_MAX_COUNTER_CROUCH;
else if (ubRef == 2)
iModifier += (INT32)gGameCTHConstants.RECOIL_MAX_COUNTER_PRONE;
}
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter)
{
if( iter->exists() )