HandleItemPointerClick(): use correct target level.

CalcPreRecoilOffset(), CalcRecoilOffset(): fix counterforce calculation for weapon resting feature.
SOLDIERTYPE::GetAPBonus(): use THROUGH_STRATEGIC_MOVE instead of soldier's facing direction to determine sector type.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8719 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2019-12-22 05:57:52 +00:00
parent 0b2e16ac93
commit 3efe899526
3 changed files with 5 additions and 12 deletions
+2 -4
View File
@@ -9542,7 +9542,6 @@ BOOLEAN HandleItemPointerClick( INT32 usMapPos )
}
}
// CHANGE DIRECTION AT LEAST
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, gpItemPointerSoldier );
gpItemPointerSoldier->EVENT_SetSoldierDesiredDirection( ubDirection );
@@ -9554,8 +9553,8 @@ BOOLEAN HandleItemPointerClick( INT32 usMapPos )
DebugAttackBusy( "Incrementing ABC: Throw item\n" );
// Given our gridno, throw grenate!
CalculateLaunchItemParamsForThrow( gpItemPointerSoldier, sGridNo, gpItemPointerSoldier->pathing.bLevel, (INT16)( ( gsInterfaceLevel * 256 ) + sEndZ ), gpItemPointer, 100, ubThrowActionCode, uiThrowActionData, gpItemPointer->usItem );
// Given our gridno, throw grenade!
CalculateLaunchItemParamsForThrow(gpItemPointerSoldier, sGridNo, gsInterfaceLevel, (INT16)(gsInterfaceLevel * 256 + sEndZ), gpItemPointer, 100, ubThrowActionCode, uiThrowActionData, gpItemPointer->usItem);
// OK, goto throw animation
HandleSoldierThrowItem( gpItemPointerSoldier, usMapPos );
@@ -9565,7 +9564,6 @@ BOOLEAN HandleItemPointerClick( INT32 usMapPos )
gfDontChargeAPsToPickup = FALSE;
EndItemPointer( );
return( TRUE );
}
+2 -7
View File
@@ -9800,9 +9800,6 @@ void CalcPreRecoilOffset( SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, FLOAT *dMu
// Calculate the Distance Ratio for later use.
FLOAT dDistanceRatio = (FLOAT)uiRange / (FLOAT)gGameCTHConstants.NORMAL_RECOIL_DISTANCE;
// Calculate the various counter-force related values for our shooter.
FLOAT dCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
@@ -9811,7 +9808,7 @@ void CalcPreRecoilOffset( SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, FLOAT *dMu
FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
FLOAT dCounterForceMax = (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb) / 100;
UINT32 uiCounterForceAccuracy = CalcCounterForceAccuracy(pShooter, pWeapon, uiRange, FALSE, true);
@@ -10079,8 +10076,6 @@ void CalcRecoilOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetX, FLOAT *dMuz
// maximum counter-force that can be applied. By default, it is based primarily on the strength of the shooter,
// although agility is also helpful.
FLOAT dCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
@@ -10089,7 +10084,7 @@ void CalcRecoilOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetX, FLOAT *dMuz
FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
FLOAT dCounterForceMax = (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb) / 100;
// iCounterForceMax is now the absolute limit.
+1 -1
View File
@@ -17361,7 +17361,7 @@ INT16 SOLDIERTYPE::GetAPBonus( )
bonus += this->GetBackgroundValue( BG_ASSAULT );
UINT8 ubSector = (UINT8)SECTOR( this->sSectorX, this->sSectorY );
UINT8 ubTraverseType = SectorInfo[ubSector].ubTraversability[ubDirection];
UINT8 ubTraverseType = SectorInfo[ubSector].ubTraversability[THROUGH_STRATEGIC_MOVE];
switch ( ubTraverseType )
{