Damage lock with bullets:

- lockBustingPower works as percentage bonus to damage based on bullet impact
- only damage lock if opening possible
- allow damaging lock if ubSmashDifficulty <= lockBustingPower + bullet impact

AttemptToBlowUpLock: make noise when using shaped charge.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9384 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2022-05-11 15:23:23 +00:00
parent dc8fffb471
commit 2874a0cb92
2 changed files with 10 additions and 6 deletions
+6 -6
View File
@@ -3635,7 +3635,8 @@ INT32 HandleBulletStructureInteraction( BULLET * pBullet, STRUCTURE * pStructure
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Door info: damage = %d, pick difficulty = %d, smash difficulty = %d, lockbuster power = %d",pDoor->bLockDamage,LockTable[ pDoor->ubLockID ].ubPickDifficulty,LockTable[ pDoor->ubLockID ].ubSmashDifficulty,lockBustingPower) );
if ( pDoor && (( LockTable[ pDoor->ubLockID ].ubPickDifficulty < 50 && LockTable[ pDoor->ubLockID ].ubSmashDifficulty < 70 ) || lockBustingPower*2 >= LockTable[ pDoor->ubLockID ].ubSmashDifficulty ) )
if (pDoor && (LockTable[pDoor->ubLockID].ubPickDifficulty < 50 && LockTable[pDoor->ubLockID].ubSmashDifficulty < 70 ||
LockTable[pDoor->ubLockID].ubSmashDifficulty <= lockBustingPower + pBullet->iImpact))
{
// Yup.....
@@ -3649,10 +3650,8 @@ INT32 HandleBulletStructureInteraction( BULLET * pBullet, STRUCTURE * pStructure
if ( PreRandom( ubRandomChanceHitLock ) == 0 || lockBustingPower > 0 )
{
// Adjust damage-- CC adjust this based on gun type, etc.....
//sLockDamage = (INT16)( 35 + Random( 35 ) );
sLockDamage = (INT16) (pBullet->iImpact - pBullet->iImpactReduction );
sLockDamage += (INT16) PreRandom( sLockDamage );
sLockDamage += lockBustingPower;
INT16 sBaseDamage = (INT16)(pBullet->iImpact - pBullet->iImpactReduction);
sLockDamage = sBaseDamage + (INT16)Random(sBaseDamage) + sBaseDamage * lockBustingPower / 100;
sLockDamage = min(sLockDamage,127);
@@ -3665,7 +3664,8 @@ INT32 HandleBulletStructureInteraction( BULLET * pBullet, STRUCTURE * pStructure
pDoor->bLockDamage+= sLockDamage;
// Check if it has been shot!
if ( pDoor->bLockDamage > LockTable[ pDoor->ubLockID ].ubSmashDifficulty || sLockDamage > LockTable[ pDoor->ubLockID ].ubSmashDifficulty )
if (LockTable[pDoor->ubLockID].ubSmashDifficulty != OPENING_NOT_POSSIBLE &&
max(pDoor->bLockDamage, sLockDamage) > LockTable[pDoor->ubLockID].ubSmashDifficulty)
{
// Display message!
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[ LOCK_HAS_BEEN_DESTROYED ] );