New option AI_TACTICAL_RETREAT (false by default) controls tactical enemy retreat from battle.

Moved options AI_YELLOW_FLANKING, AI_EXTRA_SUPPRESSION, AI_NEW_MORALE and AI_BETTER_COVER to [Tactical AI Settings]
AI_NEW_MORALE:
- zombies always have high morale
- always low morale when soldier is blinded
- neutrals always have low morale even if they have guns, so they don't run into the heat of battle
- prevent hopeless morale when not under attack
UpdateAniTiles: also check EXPLOSV_CREATUREGAS (from merc05's fixes)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8721 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2019-12-30 08:45:08 +00:00
parent d02a4ddd7d
commit 470bae3c20
6 changed files with 225 additions and 205 deletions
+12 -10
View File
@@ -1245,15 +1245,15 @@ INT32 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
{
INT32 sGridNo;
INT32 sBestSpot = NOWHERE;
UINT32 uiLoop;
INT32 iThreatRange,iClosestThreatRange = 1500, iSpotClosestThreatRange;
INT32 sThreatLoc, sThreatGridNo[MAXMERCS];
UINT32 uiThreatCnt = 0;
INT32 iSearchRange;
INT32 sGridNo;
INT32 sBestSpot = NOWHERE;
UINT32 uiLoop;
INT32 iThreatRange, iClosestThreatRange = 1500, iSpotClosestThreatRange;
INT32 sThreatLoc, sThreatGridNo[MAXMERCS];
UINT32 uiThreatCnt = 0;
INT32 iSearchRange;
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
INT8 * pbPersOL,*pbPublOL, bEscapeDirection, bBestEscapeDirection = -1;
INT8 *pbPersOL, *pbPublOL, bEscapeDirection, bBestEscapeDirection = -1;
SOLDIERTYPE *pOpponent;
INT32 sOrigin;
INT32 iRoamRange;
@@ -1480,7 +1480,10 @@ INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
iSpotClosestThreatRange = 1500;
if ( pSoldier->bTeam == ENEMY_TEAM && GridNoOnEdgeOfMap( sGridNo, &bEscapeDirection ) && EscapeDirectionIsValid( &bEscapeDirection ) )
if (gGameExternalOptions.fAITacticalRetreat &&
pSoldier->bTeam == ENEMY_TEAM &&
GridNoOnEdgeOfMap(sGridNo, &bEscapeDirection) &&
EscapeDirectionIsValid(&bEscapeDirection))
{
// We can escape! This is better than anything else except a closer spot which we can
// cross over from.
@@ -1521,7 +1524,6 @@ INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
//NumMessage("New best grid = ",bestSpot);
}
}
}
gubNPCAPBudget = 0;