Added camouflage bonus to the survival trait (by rftr).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9193 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-10-24 09:02:48 +00:00
parent a8bace71fc
commit 36d67602fd
12 changed files with 28 additions and 7 deletions
+12 -2
View File
@@ -630,12 +630,17 @@ INT8 GetSightAdjustmentCamouflageOnTerrain( SOLDIERTYPE* pSoldier, const UINT8&
return 0;
}
INT8 scaler = -(ANIM_STAND+1 - ubStance); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
INT16 scaler = -(ANIM_STAND+1 - ubStance); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
UINT8 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness;
effectiveness += (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CAMO));
if (ProfileHasSkillTrait(pSoldier->ubProfile, SURVIVAL_NT))
{
effectiveness += gSkillTraitValues.ubSVCamoEffectivenessBonus;
}
scaler = effectiveness * scaler / 6;
switch(ubTerrainType) {
@@ -668,12 +673,17 @@ INT8 GetDetailedSightAdjustmentCamouflageOnTerrain( SOLDIERTYPE* pSoldier, const
INT8 bStanceModifier = zGivenTileProperties.bCamoStanceModifer;
INT8 scaler = -(ANIM_STAND+1 - max(ANIM_PRONE, ubStance - bStanceModifier)); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
INT16 scaler = -(ANIM_STAND+1 - max(ANIM_PRONE, ubStance - bStanceModifier)); // stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
UINT8 effectiveness = gGameExternalOptions.ubCamouflageEffectiveness;
effectiveness += (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CAMO));
if (ProfileHasSkillTrait(pSoldier->ubProfile, SURVIVAL_NT))
{
effectiveness += gSkillTraitValues.ubSVCamoEffectivenessBonus;
}
scaler = effectiveness * scaler / 6;
if(gGameExternalOptions.fAlternateMultiTerrainCamoCalculation)
{