mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -745,6 +745,7 @@ BOOLEAN AttemptToBlowUpLock(SOLDIERTYPE * pSoldier, DOOR * pDoor)
|
||||
// sevenfm: remember damage as item will be removed
|
||||
UINT16 usDamage = Explosive[Item[pSoldier->inv[bSlot].usItem].ubClassIndex].ubDamage;
|
||||
UINT16 usItem = pSoldier->inv[bSlot].usItem;
|
||||
UINT8 ubVolume = Explosive[Item[pSoldier->inv[bSlot].usItem].ubClassIndex].ubVolume;
|
||||
|
||||
// Remove the explosive.....
|
||||
pSoldier->inv[bSlot].RemoveObjectsFromStack(1);
|
||||
@@ -814,6 +815,9 @@ BOOLEAN AttemptToBlowUpLock(SOLDIERTYPE * pSoldier, DOOR * pDoor)
|
||||
// Flugente: additional dialogue
|
||||
AdditionalTacticalCharacterDialogue_CallsLua(pSoldier, ADE_LOCKBOMB, 0);
|
||||
}
|
||||
|
||||
// sevenfm: also make noise
|
||||
MakeNoise(pSoldier->ubID, pSoldier->sGridNo, pSoldier->pathing.bLevel, pSoldier->bOverTerrainType, ubVolume, NOISE_EXPLOSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+6
-6
@@ -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 ] );
|
||||
|
||||
Reference in New Issue
Block a user