- new option: ENEMY_JAMS in [Tactical Gameplay Settings] allows enemy gun jams

- take into account unjam AP cost for jammed weapon
- improved AI_BETTER_COVER option

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8409 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2017-06-21 07:40:36 +00:00
parent 3c4da04532
commit 6ce47c4cef
8 changed files with 163 additions and 12 deletions
+10
View File
@@ -2533,6 +2533,16 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
else
bAPCost += APBPConstants[AP_CHANGE_TARGET];
}
// sevenfm: add unjam AP cost
if( Item[usUBItem].usItemClass == IC_GUN &&
!EXPLOSIVE_GUN( usUBItem ) &&
!(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO) &&
(*pObjUsed)[0]->data.gun.bGunAmmoStatus < 0)
{
bAPCost += APBPConstants[AP_UNJAM];
}
#if 0//dnl ch63 240813 this seems very wrong, in most case (pSoldier->bActionPoints > bFullAps) and this will return less points then is actually required and could cancel some AI actions, like throwing grenades
// the minimum AP cost of ANY shot can NEVER be more than merc's maximum APs!
if ( bAPCost > bFullAPs )