mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Brief: //dnl ch64
- Fixing Tank bursting shells problem, and some other tank related bugs. Details: - There are several problem with Tank handling, main was forcing to use gun although already decide to use machinegun which lead to bursting shells. - Another one was related to machinegun usage as current autofire handling is not supported by TANK BURST animation which had limit to 6 rounds, so decision to fire anything different then 6 lead to complete wrong APs deduction. - Fix some invalid animation decision as current tank cannot raise gun or move or check for cover. - Fix problem with wrong return (INT8) although after introduction of 100AP system APs variables are INT16 which create bad APs calculation for tank. - Fix general problem with burst and autofire when soldier decide to when swap weapons. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6340 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-1
@@ -3157,7 +3157,7 @@ void SwapObjs(SOLDIERTYPE* pSoldier, int leftSlot, int rightSlot, BOOLEAN fPerma
|
||||
{
|
||||
SwapObjs(&pSoldier->inv[ leftSlot ], &pSoldier->inv[ rightSlot ]);
|
||||
|
||||
if (fPermanent)
|
||||
if(fPermanent && !TANK(pSoldier))//dnl ch64 290813 for current tank don't go further as it lead to invalid animation
|
||||
{
|
||||
//old usItem for the left slot is now stored in the right slot, and vice versa
|
||||
HandleTacticalEffectsOfEquipmentChange(pSoldier, leftSlot, pSoldier->inv[ rightSlot ].usItem, pSoldier->inv[ leftSlot ].usItem);
|
||||
|
||||
+7
-7
@@ -1960,7 +1960,7 @@ void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT32 sGridNo
|
||||
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, pSoldier );
|
||||
|
||||
// Is it the same as he's facing?
|
||||
if ( ubDirection != pSoldier->ubDirection )
|
||||
if ( ubDirection != pSoldier->ubDirection && !(ubDirection == pSoldier->pathing.bDesiredDirection && pSoldier->aiData.bLastAction == AI_ACTION_CHANGE_FACING) )//dnl ch64 310813 sometimes turning is in progress and APs already deducted
|
||||
{
|
||||
fAddingTurningCost = TRUE;
|
||||
}
|
||||
@@ -2285,7 +2285,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
}
|
||||
}
|
||||
|
||||
if ( AM_A_ROBOT( pSoldier ) )
|
||||
if ( AM_A_ROBOT( pSoldier ) || TANK( pSoldier ) )//dnl ch64 300813 robots and tanks cannot do this
|
||||
{
|
||||
fAddingRaiseGunCost = FALSE;
|
||||
}
|
||||
@@ -2416,13 +2416,13 @@ INT16 MinPtsToMove(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// look around all 8 directions and return lowest terrain cost
|
||||
UINT8 cnt;
|
||||
INT16 sLowest=127;
|
||||
INT16 sLowest=32767;//dnl ch64 290813 100AP made return of INT8 or 127 obsolete as other variables are INT16
|
||||
INT16 sCost;
|
||||
INT32 sGridNo;
|
||||
|
||||
if ( TANK( pSoldier ) )
|
||||
{
|
||||
return( (INT8)sLowest);
|
||||
return(sLowest);//dnl ch64 290813 100AP made INT8 return obsolete
|
||||
}
|
||||
|
||||
// WANNE - BMP: FIX: Valid directions are only from 0-7!!
|
||||
@@ -2438,7 +2438,7 @@ INT16 MinPtsToMove(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
}
|
||||
return( (INT8)sLowest);
|
||||
return(sLowest);//dnl ch64 290813 100AP made INT8 return obsolete
|
||||
}
|
||||
|
||||
INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection )
|
||||
@@ -3763,7 +3763,7 @@ INT16 GetAPsToJumpOver( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// HEADROCK HAM 3.6: Calculate the actual AP cost to add this many Extra Aiming levels, taking into account
|
||||
// APBP Constants and extra game features.
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime )
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime, UINT8 ubAddRaiseGunCost )//dnl ch64 310813
|
||||
{
|
||||
INT16 sAPCost = 0;
|
||||
UINT16 usItemNum = pSoldier->inv[HANDPOS].usItem;
|
||||
@@ -3771,7 +3771,7 @@ INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAim
|
||||
Assert(pSoldier != NULL);
|
||||
Assert(&pSoldier->inv[HANDPOS] != NULL);
|
||||
|
||||
if (!( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_FIREREADY | ANIM_FIRE )))
|
||||
if (ubAddRaiseGunCost && !TANK(pSoldier) && !( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_FIREREADY | ANIM_FIRE )))//dnl ch64 310813
|
||||
{
|
||||
// Weapon not ready, check aiming from hip, else add raise gun cost
|
||||
//if (!pSoldier->IsValidShotFromHip(bAimTime,sTargetGridNo))
|
||||
|
||||
+1
-1
@@ -368,7 +368,7 @@ UINT16 GetAPsToReloadRobot( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pRobot );
|
||||
INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo, BOOLEAN usAllAPs = TRUE );
|
||||
INT16 GetAPsToAutoReload( SOLDIERTYPE * pSoldier );
|
||||
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime );
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime, UINT8 ubAddRaiseGunCost=TRUE );//dnl ch64 310813
|
||||
INT8 CalcAimingLevelsAvailableWithAP( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAPsLeft );
|
||||
|
||||
// SANDRO - added these:
|
||||
|
||||
@@ -389,6 +389,13 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
pSoldier->usAniCode = 3;
|
||||
else if(pSoldier->usAnimState == FIRE_BURST_LOW_STAND || pSoldier->usAnimState == LOW_BURST_ALTERNATIVE_STAND && pSoldier->usAniCode == 37) //we are firing down to something very close, last shot
|
||||
pSoldier->usAniCode = 14;
|
||||
else if(pSoldier->usAnimState == TANK_BURST)//dnl ch64 280813 fix 6 round burst limitation
|
||||
{
|
||||
if(pSoldier->bDoBurst < pSoldier->bDoAutofire)//!!! this will be fine as long you not decide to equip tank with other weapons add limitted ammo, weapon jam, etc.
|
||||
pSoldier->usAniCode = 4;
|
||||
else
|
||||
pSoldier->usAniCode = 34;
|
||||
}
|
||||
}
|
||||
|
||||
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( &pSoldier->inv[ pSoldier->ubAttackingHand ] );
|
||||
|
||||
@@ -3656,7 +3656,7 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
||||
{
|
||||
// ATE: Also check for the transition anims to not reset this
|
||||
// this should have used a flag but we're out of them....
|
||||
if ( usNewState != READY_ALTERNATIVE_STAND && usNewState != READY_RIFLE_STAND && usNewState != READY_RIFLE_PRONE && usNewState != READY_RIFLE_CROUCH && usNewState != ROBOT_SHOOT )
|
||||
if ( usNewState != READY_ALTERNATIVE_STAND && usNewState != READY_RIFLE_STAND && usNewState != READY_RIFLE_PRONE && usNewState != READY_RIFLE_CROUCH && usNewState != ROBOT_SHOOT && usNewState != TANK_SHOOT && usNewState != TANK_BURST )//dnl ch64 300813
|
||||
{
|
||||
this->sLastTarget = NOWHERE;
|
||||
}
|
||||
@@ -18154,8 +18154,8 @@ BOOLEAN SOLDIERTYPE::IsValidShotFromHip( INT16 bAimTime, INT32 iTrgGridNo )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
// robots cannot do this
|
||||
if ( AM_A_ROBOT( this ) )
|
||||
// robots and tanks cannot do this
|
||||
if ( AM_A_ROBOT( this ) || TANK( this ) )//dnl ch64 300813
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -18206,8 +18206,8 @@ BOOLEAN SOLDIERTYPE::IsValidPistolFastShot( INT16 bAimTime, INT32 iTrgGridNo )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
// robots cannot do this
|
||||
if ( AM_A_ROBOT( this ) )
|
||||
// robots and tanks cannot do this
|
||||
if ( AM_A_ROBOT( this ) || TANK( this ) )//dnl ch64 300813
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user