mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
NEW_SUPPRESSION_CODE: calc base suppression tolerance for AI from health/shock instead of AI morale.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9175 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -8753,11 +8753,12 @@ INT8 CalcSuppressionTolerance( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT8 bToleranceMorale;
|
||||
INT8 bToleranceSkill;
|
||||
UINT8 ubMaxShock = gGameExternalOptions.ubMaxSuppressionShock;
|
||||
|
||||
if (pSoldier->flags.uiStatusFlags & SOLDIER_PC)
|
||||
bToleranceMorale = pSoldier->aiData.bMorale;
|
||||
else
|
||||
bToleranceMorale = 20 + pSoldier->aiData.bAIMorale * 20 - pSoldier->aiData.bShock / 4;
|
||||
bToleranceMorale = (20 + 80 * pSoldier->stats.bLife / max(OKLIFE, pSoldier->stats.bLifeMax) - 40 * min(ubMaxShock, pSoldier->aiData.bShock) / max(1, ubMaxShock));
|
||||
|
||||
// limit base tolerance to 75% when having max morale and experience level
|
||||
bToleranceSkill = (bToleranceMorale + 20 * pSoldier->stats.bExpLevel) / 4;
|
||||
|
||||
Reference in New Issue
Block a user