Increment watched location when soldier hears enemy and can possibly see noise location.

Suppression:
- when calculating suppression effectiveness for shotgun, modify damage for pellets.
- set attacker spot as watched location
- alert enemy soldier if he is under fire

Red AI:
- no Main Red AI for civilians
- set watched location to closest position where enemy can appear
- snipers and soldiers with scoped guns should decide watch more often

Improved Red AI watch code:
- crouch if not crouched
- raise weapon if not raised
- turn to watched location
- possibly go prone, if soldier has LOS to watched location

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8789 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-04-20 20:10:30 +00:00
parent 2147de571e
commit 3fe13b9161
3 changed files with 140 additions and 82 deletions
+13
View File
@@ -6542,6 +6542,19 @@ void HearNoise(SOLDIERTYPE *pSoldier, UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bL
// remember that the soldier has been heard and his new location
UpdatePersonal(pSoldier,ubNoiseMaker,HEARD_THIS_TURN,sGridNo, bLevel);
// sevenfm: increment watched location when soldier hears enemy
if ((ubNoiseType == NOISE_GUNFIRE || ubNoiseType == NOISE_MOVEMENT || ubNoiseType == NOISE_SCREAM || ubNoiseType == NOISE_VOICE) &&
!TileIsOutOfBounds(sGridNo) &&
!(pSoldier->flags.uiStatusFlags & SOLDIER_PC) &&
!pSoldier->aiData.bNeutral &&
MercPtrs[ubNoiseMaker] &&
!MercPtrs[ubNoiseMaker]->aiData.bNeutral &&
!pSoldier->IsFlanking() &&
SoldierToVirtualSoldierLineOfSightTest(pSoldier, sGridNo, bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS))
{
IncrementWatchedLoc(pSoldier->ubID, sGridNo, bLevel);
}
// Public info is not set unless EVERYONE on the team fails to see the
// ubnoisemaker, leaving the 'seen' flag FALSE. See ProcessNoise().