mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
-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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user