mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Fix: soldier automatically taunts us whenever we steal, making stealth impossible
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8526 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+25
-18
@@ -3508,12 +3508,14 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
// otherwise, if we are the player, we can steal multiple items if the other guy is collapsed, or we are succesful, and
|
// otherwise, if we are the player, we can steal multiple items if the other guy is collapsed, or we are succesful, and
|
||||||
// if using fEnhancedCloseCombatSystem, only allow this if the other guy is not alerted
|
// if using fEnhancedCloseCombatSystem, only allow this if the other guy is not alerted
|
||||||
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) ||
|
if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) ||
|
||||||
pSoldier->bTeam == gbPlayerNum &&
|
( pSoldier->bTeam == gbPlayerNum &&
|
||||||
( fSoldierCollapsed ||
|
( fSoldierCollapsed ||
|
||||||
( iDiceRoll < ( iHitChance * 2 / 3 ) &&
|
( iDiceRoll < ( iHitChance * 2 / 3 ) &&
|
||||||
!gGameExternalOptions.fEnhancedCloseCombatSystem ||
|
( !gGameExternalOptions.fEnhancedCloseCombatSystem ||
|
||||||
pSoldier->aiData.bAlertStatus < STATUS_RED ) ) )
|
pTargetSoldier->aiData.bAlertStatus < STATUS_RED ) ) ) ) )
|
||||||
{
|
{
|
||||||
|
fStealAttempt = TRUE;
|
||||||
|
|
||||||
// first, charge extra Aps, because it's difficlut to pickup from other soldier
|
// first, charge extra Aps, because it's difficlut to pickup from other soldier
|
||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
DeductPoints( pSoldier, (GetBasicAPsToPickupItem( pSoldier ) * 2), 0, AFTERACTION_INTERRUPT );
|
DeductPoints( pSoldier, (GetBasicAPsToPickupItem( pSoldier ) * 2), 0, AFTERACTION_INTERRUPT );
|
||||||
@@ -3778,8 +3780,11 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
StatChange( pSoldier, AGILAMT, 3, FALSE );
|
StatChange( pSoldier, AGILAMT, 3, FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
// anv: enemy taunt on getting robbed
|
if ( !fStealAttempt || pTargetSoldier->aiData.bAlertStatus >= STATUS_RED )
|
||||||
PossiblyStartEnemyTaunt( pTargetSoldier, TAUNT_GOT_ROBBED, pSoldier->ubID );
|
{
|
||||||
|
// anv: enemy taunt on getting robbed
|
||||||
|
PossiblyStartEnemyTaunt( pTargetSoldier, TAUNT_GOT_ROBBED, pSoldier->ubID );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3801,20 +3806,23 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SANDRO - Enhanced Close Combat System - Notice merc after stealing
|
// Flugente: no turning if the other guy doesn't notice us...
|
||||||
// sevenfm: don't turn when lying prone
|
if ( fFailure || !fStealAttempt || pTargetSoldier->aiData.bAlertStatus >= STATUS_RED )
|
||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem && gAnimControl[ pTargetSoldier->usAnimState ].ubEndHeight != ANIM_PRONE)
|
{
|
||||||
pTargetSoldier->EVENT_SetSoldierDesiredDirection( GetDirectionFromGridNo( pSoldier->sGridNo, pTargetSoldier ) );
|
// SANDRO - Enhanced Close Combat System - Notice merc after stealing
|
||||||
|
// sevenfm: don't turn when lying prone
|
||||||
|
if ( gGameExternalOptions.fEnhancedCloseCombatSystem && gAnimControl[pTargetSoldier->usAnimState].ubEndHeight != ANIM_PRONE )
|
||||||
|
pTargetSoldier->EVENT_SetSoldierDesiredDirection( GetDirectionFromGridNo( pSoldier->sGridNo, pTargetSoldier ) );
|
||||||
|
|
||||||
// 0verhaul: Also handled in the animation transition
|
// 0verhaul: Also handled in the animation transition
|
||||||
// #ifdef JA2BETAVERSION
|
// #ifdef JA2BETAVERSION
|
||||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - steal") );
|
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - steal") );
|
||||||
// #endif
|
// #endif
|
||||||
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||||
|
|
||||||
// anv: enemy taunt on steal
|
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_STEAL, pTargetSoldier->ubID );
|
|
||||||
|
|
||||||
|
// anv: enemy taunt on steal
|
||||||
|
PossiblyStartEnemyTaunt( pSoldier, TAUNT_STEAL, pTargetSoldier->ubID );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
@@ -4048,7 +4056,6 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
pSoldier->aiData.bMonsterSmell--;
|
pSoldier->aiData.bMonsterSmell--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user