mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user