- capped physical resistance at 95%

- mercs with the 'airdrop' background property do no get the interrupt penalty upon landing only if they have a positive bonus
- Fix: supression resistence wasn't applied as a percentage
- adjusted background min/max values

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6665 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-11-29 18:24:08 +00:00
parent 3d12b39d87
commit 1d49877137
4 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -8008,7 +8008,7 @@ INT8 CalcSuppressionTolerance( SOLDIERTYPE * pSoldier )
}
// Flugente: add personal bonus to suppresion tolerance
bTolerance += pSoldier->GetSuppressionResistanceBonus();
bTolerance = (bTolerance * (100 + pSoldier->GetSuppressionResistanceBonus() ) / 100);
bTolerance = __max(bTolerance, gGameExternalOptions.ubSuppressionToleranceMin);
bTolerance = __min(bTolerance, gGameExternalOptions.ubSuppressionToleranceMax);
+1 -1
View File
@@ -1492,7 +1492,7 @@ void AddSoldierToSectorGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDir
fUpdateFinalPosition = FALSE;
}
// Flugente: if we are airdropping, center screen on the action adn remove soldier initially. He will be dropped into the sector by the helicopter
// Flugente: if we are airdropping, center screen on the action and remove soldier initially. He will be dropped into the sector by the helicopter
if ( pSoldier->bSoldierFlagMask & SOLDIER_AIRDROP )
{
pSoldier->bSoldierFlagMask &= ~SOLDIER_AIRDROP;
+4 -4
View File
@@ -14296,9 +14296,9 @@ INT32 SOLDIERTYPE::GetDamageResistance(BOOLEAN fAutoResolve, BOOLEAN fCalcBreath
resistance += this->GetBackgroundValue(BG_RESI_PHYSICAL);
// resistance is between -100% and 100%
resistance = max( 0, resistance);
resistance = min(100, resistance);
// resistance is between -100% and 95%
resistance = max(-100, resistance);
resistance = min( 95, resistance);
return( resistance );
}
@@ -16983,7 +16983,7 @@ INT16 SOLDIERTYPE::GetInterruptModifier( UINT8 usDistance )
bonus -= 3;
// if we are airdropping and do not have the 'airdrop' background, we receive a substantial malus to our interrupt level. Roping down takes a lot of attention
if ( this->bSoldierFlagMask & SOLDIER_AIRDROP_TURN && (this->GetBackgroundValue(BG_AIRDROP) == 0) )
if ( this->bSoldierFlagMask & SOLDIER_AIRDROP_TURN && (this->GetBackgroundValue(BG_AIRDROP) <= 0) )
bonus -= 8;
return bonus;
+15 -15
View File
@@ -368,7 +368,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "resistance_physical") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_RESI_PHYSICAL] = min(XML_BACKGROUND_RESI_MAX, max(-XML_BACKGROUND_RESI_MAX, (INT8) atol(pData->szCharData) ));
pData->curBackground.value[BG_RESI_PHYSICAL] = min(10, max(-10, (INT8) atol(pData->szCharData) ));
}
else if(strcmp(name, "resistance_alcohol") == 0)
{
@@ -388,12 +388,12 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "betterprices_guns") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_PRICES_GUNS] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_PRICES_GUNS] = min(10, max(-10, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "betterprices") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_PRICES] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_PRICES] = min(10, max(-10, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "capitulation") == 0)
{
@@ -403,7 +403,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "speed_run") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_SPEED_RUNNING] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_SPEED_RUNNING] = min(30, max(-30, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "speed_bandaging") == 0)
{
@@ -418,7 +418,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "carrystrength") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_CARRYSTRENGTH] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_CARRYSTRENGTH] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "food") == 0)
{
@@ -433,7 +433,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "sleep") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_SLEEP] = min(2, max(-2, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_SLEEP] = min(1, max(-1, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "meleedamage") == 0)
{
@@ -448,12 +448,12 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "camo") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_CAMO] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_CAMO] = min(10, max(-20, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "stealth") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_STEALTH] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_STEALTH] = min(10, max(-20, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "increased_maxcth") == 0)
{
@@ -463,32 +463,32 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "hearing_night") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_HEARING_NIGHT] = min(10, max(-10, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_HEARING_NIGHT] = min(2, max(-5, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "hearing_day") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_HEARING_DAY] = min(10, max(-10, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_HEARING_DAY] = min(2, max(-5, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "approach_friendly") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_APPROACH_FRIENDLY] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_APPROACH_FRIENDLY] = min(20, max(-50, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "approach_direct") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_APPROACH_DIRECT] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_APPROACH_DIRECT] = min(20, max(-50, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "approach_threaten") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_APPROACH_THREATEN] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_APPROACH_THREATEN] = min(20, max(-50, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "approach_recruit") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_APPROACH_RECRUIT] = min(50, max(-50, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_APPROACH_RECRUIT] = min(20, max(-50, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "breachingcharge") == 0)
{
@@ -498,7 +498,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "cth_vs_creatures") == 0)
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_PERC_CTH_CREATURE] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
pData->curBackground.value[BG_PERC_CTH_CREATURE] = min(10, max(-10, (INT16) atol(pData->szCharData) ));
}
else if(strcmp(name, "insurance") == 0)
{