mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
-removed lighted spots from valid locations to move to for flanking, finding cover and running away
-moved the running out of lighted areas code to after the main Red AI - this will prevent enemies from running into and back out of lighted areas; however, it might also mean that they end up running straight through the light sometimes -enabled AI to fire at opponents seen by other AIs on Expert & Insane git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@262 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+18
-13
@@ -2036,18 +2036,6 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// WHEN IN THE LIGHT, GET OUT OF THERE!
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
if ( ubCanMove && InLightAtNight( pSoldier->sGridNo, pSoldier->bLevel ) && pSoldier->bOrders != STATIONARY )
|
||||
{
|
||||
pSoldier->usActionData = FindNearbyDarkerSpot( pSoldier );
|
||||
if ( pSoldier->usActionData != NOWHERE )
|
||||
{
|
||||
// move as if leaving water or gas
|
||||
return( AI_ACTION_LEAVE_WATER_GAS );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fCivilian && !( pSoldier->ubBodyType == COW || pSoldier->ubBodyType == CRIPPLECIV ) )
|
||||
{
|
||||
@@ -2351,6 +2339,19 @@ if ( !fCivilian && pSoldier->bTeam != MILITIA_TEAM && gGameOptions.fAirStrikes &
|
||||
}
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// WHEN IN THE LIGHT, GET OUT OF THERE!
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
if ( ubCanMove && InLightAtNight( pSoldier->sGridNo, pSoldier->bLevel ) && pSoldier->bOrders != STATIONARY )
|
||||
{
|
||||
pSoldier->usActionData = FindNearbyDarkerSpot( pSoldier );
|
||||
if ( pSoldier->usActionData != NOWHERE )
|
||||
{
|
||||
// move as if leaving water or gas
|
||||
return( AI_ACTION_LEAVE_WATER_GAS );
|
||||
}
|
||||
}
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: crouch and rest if running out of breath");
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// CROUCH & REST IF RUNNING OUT OF BREATH
|
||||
@@ -3747,7 +3748,11 @@ bCanAttack = FALSE;
|
||||
if (pSoldier->bActionPoints >= ubMinAPCost)
|
||||
{
|
||||
// look around for a worthy target (which sets BestShot.ubPossible)
|
||||
CalcBestShot(pSoldier,&BestShot,FALSE);
|
||||
BOOLEAN shootUnseen = FALSE;
|
||||
if (gGameOptions.ubDifficultyLevel > DIF_LEVEL_MEDIUM )
|
||||
shootUnseen = TRUE;
|
||||
|
||||
CalcBestShot(pSoldier,&BestShot,shootUnseen);
|
||||
|
||||
if (pSoldier->bTeam == gbPlayerNum && pSoldier->bRTPCombat == RTP_COMBAT_CONSERVE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user