-tweaked ai turning in green a little bit to make them look for noises in green (mostly for snipers)

-enabled tunnel vision attribute on readied weapons (previously only worked on attachments, and non-weapon items)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@338 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2006-07-09 19:43:24 +00:00
parent f673236935
commit 185f154aa8
3 changed files with 19 additions and 4 deletions
+13 -1
View File
@@ -1212,7 +1212,19 @@ DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DecideActionGreen: Snipers like to raise
}
else
{
pSoldier->usActionData = (UINT16)Random(8);
INT32 iNoiseValue;
BOOLEAN fClimb;
BOOLEAN fReachable;
INT16 sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue, &fClimb, &fReachable);
UINT8 ubNoiseDir;
if (sNoiseGridNo != NOWHERE)
ubNoiseDir = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sNoiseGridNo),CenterY(sNoiseGridNo));
if ( sNoiseGridNo != NOWHERE && pSoldier->bDirection != ubNoiseDir )
pSoldier->usActionData = ubNoiseDir;
else
pSoldier->usActionData = (UINT16)PreRandom(8);
}
} while (pSoldier->usActionData == pSoldier->bDirection);