-added StealthBonus tag to Items

-stealth works like extra camouflage, but is not terrain dependent and also conceals noise
-fixed armour attachments getting destroyed when armour is destroyed

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@361 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2006-07-20 23:27:23 +00:00
parent 2abefe52a8
commit 37162fc413
7 changed files with 79 additions and 5 deletions
+30
View File
@@ -7177,4 +7177,34 @@ UINT8 AllowedAimingLevels(SOLDIERTYPE * pSoldier)
return aimLevels;
}
//Madd: added
INT16 GetStealthBonus( OBJECTTYPE * pObj )
{
INT8 bLoop;
INT16 bns=0;
bns = (INT16) BonusReduce(Item[pObj->usItem].stealthbonus,pObj->bStatus[0]);
for (bLoop = 0; bLoop < MAX_ATTACHMENTS; bLoop++)
{
bns += (INT16) BonusReduce(Item[pObj->usAttachItem[bLoop]].stealthbonus,pObj->bAttachStatus[bLoop]);
}
return( bns );
}
INT16 GetWornStealth( SOLDIERTYPE * pSoldier )
{
//note: Stealth bonus is capped at 100
//note: Stealth is not a perk! Stealth bonus only applies to equipment, and stacks with camouflage
//note: stealth bonus is not affected by terrain like the camo bonus, otherwise they're very similar
//note: stealth bonus also affects noise made by characters walking
INT8 bLoop;
INT16 ttl=0;
for (bLoop = HELMETPOS; bLoop <= LEGPOS; bLoop++)
{
if ( pSoldier->inv[bLoop].usItem > NONE )
ttl += GetStealthBonus(&pSoldier->inv[bLoop]);
}
return __min( ttl, 100 );
}