Use TACTICAL_RANGE instead of DAY_VISION_RANGE for AI calculations.

Implemented Black cover advance code for AI: try to get closer to enemy using cover if soldier has low CTH or enemy too far for shooting or soldier has high morale or no cover at spot.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8931 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-02-11 19:11:54 +00:00
parent 02cba3e1e5
commit 18dcced82a
5 changed files with 195 additions and 39 deletions
+3 -3
View File
@@ -3929,13 +3929,13 @@ void CheckTossFriendSmoke(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
bFriendLevel = pFriend->pathing.bLevel;
sClosestOpponent = ClosestKnownOpponent(pFriend, NULL, NULL);
if (PythSpacesAway(sSpot, sFriendSpot) <= (INT16)DAY_VISION_RANGE &&
PythSpacesAway(sSpot, sFriendSpot) > (INT16)DAY_VISION_RANGE / 4 &&
if (PythSpacesAway(sSpot, sFriendSpot) <= (INT16)TACTICAL_RANGE &&
PythSpacesAway(sSpot, sFriendSpot) > (INT16)TACTICAL_RANGE / 4 &&
!InSmoke(sFriendSpot, bFriendLevel) &&
(!NightLight() || InLightAtNight(sFriendSpot, bFriendLevel)) &&
!Water(sFriendSpot, bFriendLevel) &&
!TileIsOutOfBounds(sClosestOpponent) &&
PythSpacesAway(sFriendSpot, sClosestOpponent) > (INT16)DAY_VISION_RANGE / 4 &&
PythSpacesAway(sFriendSpot, sClosestOpponent) > (INT16)TACTICAL_RANGE / 4 &&
!ProneSightCoverAtSpot(pFriend, sFriendSpot, TRUE) &&
//!SightCoverAtSpot(pFriend, sFriendSpot, FALSE) &&
//!AnyCoverAtSpot(pFriend, sFriendSpot) &&