Fix (by Sevenfm): NCTH aperture was offset by 1 to the bottom right

EDB enhancement: rechamber display now includes effects from traits

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7765 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2015-03-02 17:15:29 +00:00
parent 215550e8fc
commit 8ae8c147f9
2 changed files with 51 additions and 5 deletions
+49 -3
View File
@@ -8157,12 +8157,26 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Get base Manual Reload Cost
INT16 iManualReloadAPCost = iFinalManualReloadAPCost;
// trait bonuses
if( gGameOptions.fNewTraitSystem && !(Item[ gpItemDescObject->usItem ].usItemClass & IC_LAUNCHER) )
{
// rifles and sniper rifles
if( Weapon[ gpItemDescObject->usItem ].ubWeaponType == GUN_SN_RIFLE || Weapon[ gpItemDescObject->usItem ].ubWeaponType == GUN_RIFLE )
iFinalManualReloadAPCost = (INT16)( (FLOAT)iFinalManualReloadAPCost * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, SNIPER_NT )) / 100.0f + 0.5 );
// shotguns
else if( Weapon[ gpItemDescObject->usItem ].ubWeaponType == GUN_SHOTGUN )
iFinalManualReloadAPCost = (INT16)( (FLOAT)iFinalManualReloadAPCost * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, RANGER_NT )) /100.0f + 0.5);
}
// Get manual reload cost modifier
INT16 iManualReloadAPCostModifier = iFinalManualReloadAPCost - iManualReloadAPCost;
if( !fComparisonMode )
{
// Print base value
DrawPropertyValueInColour( iManualReloadAPCost, ubNumLine, 1, fComparisonMode, FALSE, FALSE );
// Print modifier
DrawPropertyTextInColour( L"--", ubNumLine, 2 );
DrawPropertyValueInColour( iManualReloadAPCostModifier, ubNumLine, 2, FALSE, TRUE, FALSE );
// Print final value
DrawPropertyValueInColour( iFinalManualReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE, FONT_MCOLOR_WHITE );
}
@@ -8176,12 +8190,28 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
iComparedFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ];
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER )
iComparedFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
// Get base Manual Reload Cost
INT16 iComparedManualReloadAPCost = iComparedFinalManualReloadAPCost;
// trait bonuses
if( gGameOptions.fNewTraitSystem && !(Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_LAUNCHER) )
{
// rifles and sniper rifles
if( Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_SN_RIFLE || Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_RIFLE )
iComparedFinalManualReloadAPCost = (INT16)( (FLOAT)iComparedFinalManualReloadAPCost * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, SNIPER_NT )) / 100.0f + 0.5 );
// shotguns
else if( Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_SHOTGUN )
iComparedFinalManualReloadAPCost = (INT16)( (FLOAT)iComparedFinalManualReloadAPCost * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, RANGER_NT )) /100.0f + 0.5);
}
// Get manual reload cost modifier
INT16 iComparedManualReloadAPCostModifier = iComparedFinalManualReloadAPCost - iComparedManualReloadAPCost;
// Print difference in base value
DrawPropertyValueInColour( iComparedManualReloadAPCost - iManualReloadAPCost, ubNumLine, 1, fComparisonMode, FALSE, FALSE );
// Print modifier
DrawPropertyTextInColour( L"--", ubNumLine, 2 );
DrawPropertyValueInColour( iComparedManualReloadAPCostModifier - iManualReloadAPCostModifier, ubNumLine, 2, FALSE, TRUE, FALSE );
// Print difference in final value
DrawPropertyValueInColour( iComparedFinalManualReloadAPCost - iFinalManualReloadAPCost, ubNumLine, 3, fComparisonMode, FALSE, FALSE );
}
@@ -8203,12 +8233,28 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
iFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType ];
else if ( Item[ gpComparedItemDescObject->usItem ].usItemClass == IC_LAUNCHER )
iFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
// Get base Manual Reload Cost
INT16 iManualReloadAPCost = iFinalManualReloadAPCost;
// trait bonuses
if( gGameOptions.fNewTraitSystem && !(Item[ gpComparedItemDescObject->usItem ].usItemClass & IC_LAUNCHER) )
{
// rifles and sniper rifles
if( Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_SN_RIFLE || Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_RIFLE )
iFinalManualReloadAPCost = (INT16)( (FLOAT)iFinalManualReloadAPCost * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, SNIPER_NT )) / 100.0f + 0.5 );
// shotguns
else if( Weapon[ gpComparedItemDescObject->usItem ].ubWeaponType == GUN_SHOTGUN )
iFinalManualReloadAPCost = (INT16)( (FLOAT)iFinalManualReloadAPCost * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( gpItemDescSoldier, RANGER_NT )) /100.0f + 0.5);
}
// Get manual reload cost modifier
INT16 iManualReloadAPCostModifier = iFinalManualReloadAPCost - iManualReloadAPCost;
// Print base value
DrawPropertyValueInColour( iManualReloadAPCost, ubNumLine, 1, FALSE, FALSE, FALSE,ITEMDESC_FONTNEGATIVE );
// Print modifier
DrawPropertyTextInColour( L"--", ubNumLine, 2 );
DrawPropertyValueInColour( iManualReloadAPCostModifier, ubNumLine, 2, FALSE, TRUE, FALSE );
// Print final value
DrawPropertyValueInColour( iFinalManualReloadAPCost, ubNumLine, 3, FALSE, FALSE, FALSE, ITEMDESC_FONTNEGATIVE );
}
+2 -2
View File
@@ -2654,8 +2654,8 @@ BOOLEAN DrawCTHIndicator()
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
sStartScreenX = (INT16)MousePos.x;
sStartScreenY = (INT16)MousePos.y;
sStartScreenX = (INT16)MousePos.x - 1; // sevenfm: fix (-1) for cursor mismatch
sStartScreenY = (INT16)MousePos.y - 1;
// Define regions for the various indicators. We need to do this now because the Aperture Circles will want to
// avoid being drawn within these regions, otherwise they might make them harder to see.