Brief: //dnl ch61

- Basic support for reducing AI friendly fire.
Details:
- Friendly fire grids are defined during best shot calculation then AI decide depending of soldier character to fire or take other action. Still in autofire accidentally friendly hits could be higher depending of bullets spreading.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6313 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-08-25 07:36:03 +00:00
parent 4ac9cf5ebe
commit f06df7741f
4 changed files with 107 additions and 2 deletions
+25
View File
@@ -4420,6 +4420,31 @@ INT16 ubMinAPCost;
}
}
if(BestShot.ubFriendlyFireChance)//dnl ch61 180813
{
if(BestShot.ubFriendlyFireChance == 100)
{
if(pSoldier->aiData.bAttitude == AGGRESSIVE)
iChance = 5;
}
else
{
switch(pSoldier->aiData.bAttitude)
{
case DEFENSIVE:iChance = 15;break;
case BRAVESOLO:iChance = 25;break;
case BRAVEAID:iChance = 20;break;
case CUNNINGSOLO:iChance = 35;break;
case CUNNINGAID:iChance = 30;break;
case AGGRESSIVE:iChance = 45;break;
case ATTACKSLAYONLY:iChance = 40;break;
default:iChance = 10;break;
}
}
if(!((INT32)Random(100) < iChance))
BestShot.ubPossible = FALSE;
}
if (BestShot.ubPossible)
{
// if the selected opponent is not a threat (unconscious & !serviced)