mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Enemy soldiers will try to avoid being hit by artillery strike.
FindBestNearbyCover: - penalty to locations in red smoke danger zone - avoid moving into red smoke danger zone if not in red smoke danger already FindNearestUngassedLand: - improved code - try not to move closer to known enemies. - calculate path with correct movement mode FindNearbyDarkerSpot: - improved code - calculate path with correct movement mode FindFlankingSpot: - avoid locations near bombs - avoid moving into red smoke danger zone git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8753 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1084,7 +1084,7 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DecideActionGreen: get out of water and gas"));
|
||||
|
||||
if (bInWater || bInGas || FindBombNearby(pSoldier, pSoldier->sGridNo, DAY_VISION_RANGE/8))
|
||||
if (bInWater || bInGas || FindBombNearby(pSoldier, pSoldier->sGridNo, BOMB_DETECTION_RANGE) || RedSmokeDanger(pSoldier->sGridNo, pSoldier->pathing.bLevel))
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
@@ -1607,7 +1607,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
// WHEN IN GAS, GO TO NEAREST REACHABLE SPOT OF UNGASSED LAND
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if ( InGas(pSoldier, pSoldier->sGridNo) || DeepWater( pSoldier->sGridNo, pSoldier->pathing.bLevel ) || FindBombNearby(pSoldier, pSoldier->sGridNo, DAY_VISION_RANGE/8) )
|
||||
if (InGas(pSoldier, pSoldier->sGridNo) || DeepWater(pSoldier->sGridNo, pSoldier->pathing.bLevel) || FindBombNearby(pSoldier, pSoldier->sGridNo, BOMB_DETECTION_RANGE))
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
@@ -2582,7 +2582,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
// WHEN IN GAS, GO TO NEAREST REACHABLE SPOT OF UNGASSED LAND
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (ubCanMove && (bInGas || FindBombNearby(pSoldier, pSoldier->sGridNo, DAY_VISION_RANGE/8)))
|
||||
if (ubCanMove && (bInGas || bInDeepWater || FindBombNearby(pSoldier, pSoldier->sGridNo, BOMB_DETECTION_RANGE) || RedSmokeDanger(pSoldier->sGridNo, pSoldier->pathing.bLevel)))
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
@@ -4719,7 +4719,7 @@ INT16 ubMinAPCost;
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// if soldier in water/gas has enough APs left to move at least 1 square
|
||||
if ( ( bInDeepWater || bInGas || FindBombNearby(pSoldier, pSoldier->sGridNo, DAY_VISION_RANGE/8) ) && ubCanMove)
|
||||
if (ubCanMove && (bInGas || bInDeepWater || FindBombNearby(pSoldier, pSoldier->sGridNo, BOMB_DETECTION_RANGE) || RedSmokeDanger(pSoldier->sGridNo, pSoldier->pathing.bLevel)))
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user