Brief: //dnl ch58

- Fix several problems which lead into bad or no AI decisions, add optional decision of short autofire.

Details:
- Avoid use of last two locations per turn 
- Fix problems with improper APs calculations for burst and autofire which lead into AI to forcably cancel and end turn for those actions.
- Add option for decide to use short autofire instead of one long to enchance chance to hit.
- After taking cover change facing toward closest enemy to avoid going in status red and rather take proper black decisions.
- Fix bad public noise processing after AI investigate closest disturbance and find nothing, also erase all same noise points in team members if one of them already investigated.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6310 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-08-23 16:27:36 +00:00
parent e49412eae9
commit 1adc9c542c
4 changed files with 51 additions and 12 deletions
+13 -1
View File
@@ -1035,6 +1035,15 @@ INT32 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
// if we are there (at the noise gridno)
if (sGridNo == pSoldier->sGridNo)
{
for(uiLoop=0; uiLoop<guiNumMercSlots; uiLoop++)//dnl ch58 160813
{
pOpp = MercSlots[uiLoop];
if(pSoldier->bSide == pOpp->bSide && pSoldier->ubID != pOpp->ubID&& pSoldier->aiData.sNoiseGridno == pOpp->aiData.sNoiseGridno)
{
pOpp->aiData.sNoiseGridno = NOWHERE;// Erase for all from the same team as it not useful anymore, this will avoid others to check already tested location
pOpp->aiData.ubNoiseVolume = 0;
}
}
pSoldier->aiData.sNoiseGridno = NOWHERE; // wipe it out, not useful anymore
pSoldier->aiData.ubNoiseVolume = 0;
}
@@ -1092,7 +1101,10 @@ INT32 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
else
{
// degrade our public noise a bit
*pusNoiseGridNo -= 2;
//dnl ch58 160813
//*pusNoiseGridNo -= 2;
if(*pubNoiseVolume > 1)
(*pubNoiseVolume)--;
}
}