Brief: //dnl ch70

- Some APs fixing for throwing knives and backpack, with doing some correction to my previous changes.
Details:
- Do some correction and missing parts to ch58 and ch69.
- Throwing knives will add you bonus for throwing knives to same target as was suppose from v1.12 but never works.
- Fix AI use gun calculation for throwing knives instead for throw.
- Fix incorrect showing and deducting APs when try to shoot from prone with backpack or throw from prone and crouch positions with turning in general.
- Fix cheating when sLastTarget is set just for raise gun in that direction, this was always done after you fire.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6409 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-09-17 11:33:47 +00:00
parent c3d88744b9
commit 30cc0160cf
5 changed files with 83 additions and 27 deletions
+9 -7
View File
@@ -37,6 +37,7 @@
#include "opplist.h" // added by SANDRO
#include "lighting.h" // added by SANDRO
#include "Food.h" // added by Flugente
#include "AIInternals.h"//dnl ch69 150913
#endif
#include "connect.h"
//rain
@@ -3027,15 +3028,15 @@ INT16 GetAPsToChangeStance( SOLDIERTYPE *pSoldier, INT8 bDesiredHeight )
}
if ( bCurrentHeight == ANIM_CROUCH && bDesiredHeight == ANIM_STAND )
{
sAPCost = GetAPsCrouch(pSoldier, TRUE);
sAPCost = GetAPsCrouch(pSoldier, TRUE*2);//dnl ch70 160913
}
if ( bCurrentHeight == ANIM_PRONE && bDesiredHeight == ANIM_STAND )
{
sAPCost = GetAPsProne(pSoldier, TRUE) + GetAPsCrouch(pSoldier, TRUE);
sAPCost = GetAPsProne(pSoldier, TRUE*2) + GetAPsCrouch(pSoldier, TRUE*2);//dnl ch70 160913
}
if ( bCurrentHeight == ANIM_PRONE && bDesiredHeight == ANIM_CROUCH )
{
sAPCost = GetAPsProne(pSoldier, TRUE);
sAPCost = GetAPsProne(pSoldier, TRUE*2);//dnl ch70 160913
}
return( sAPCost );
@@ -3106,10 +3107,11 @@ INT16 GetAPsToLook( SOLDIERTYPE *pSoldier )
case ANIM_PRONE:
// APBPConstants[AP_PRONE] is the AP cost to go to or from the prone stance. To turn while prone, your merc has to get up to
// crouched, turn, and then go back down. Hence you go up (APBPConstants[AP_PRONE]), turn (APBPConstants[AP_LOOK_PRONE]) and down (APBPConstants[AP_PRONE]).
//dnl ch70 160913 because of backpack cost for going up is 2
if (HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ) && gGameOptions.fNewTraitSystem )
return( max( 1, (INT16)((APBPConstants[AP_LOOK_PRONE] * (100 - gSkillTraitValues.ubMAApsTurnAroundReduction * NUM_SKILL_TRAITS( pSoldier, MARTIAL_ARTS_NT )) / 100) + 0.5)) + GetAPsProne(pSoldier, TRUE) + GetAPsProne(pSoldier, TRUE) );
return( max( 1, (INT16)((APBPConstants[AP_LOOK_PRONE] * (100 - gSkillTraitValues.ubMAApsTurnAroundReduction * NUM_SKILL_TRAITS( pSoldier, MARTIAL_ARTS_NT )) / 100) + 0.5)) + GetAPsProne(pSoldier, TRUE) + GetAPsProne(pSoldier, TRUE*2) );
else
return( APBPConstants[AP_LOOK_PRONE] + GetAPsProne(pSoldier, TRUE) + GetAPsProne(pSoldier, TRUE) );
return( APBPConstants[AP_LOOK_PRONE] + GetAPsProne(pSoldier, TRUE) + GetAPsProne(pSoldier, TRUE*2) );
break;
// no other values should be possible
@@ -3922,7 +3924,7 @@ INT16 GetAPsCrouch( SOLDIERTYPE *pSoldier, BOOLEAN fBackpackCheck )
// if backpack and new inventory
if ( fBackpackCheck && (UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true && !pSoldier->flags.ZipperFlag)
iFinalAPsToCrouch += 1;
iFinalAPsToCrouch += fBackpackCheck;//dnl ch70 160913 was 1
// -x% APs needed to change stance for MA trait
if ( HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ) && ( gGameOptions.fNewTraitSystem ))
@@ -3942,7 +3944,7 @@ INT16 GetAPsProne( SOLDIERTYPE *pSoldier, BOOLEAN fBackpackCheck )
// if backpack and new inventory
if ( fBackpackCheck && (UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true && !pSoldier->flags.ZipperFlag)
iFinalAPsToLieDown += 1;
iFinalAPsToLieDown += fBackpackCheck;//dnl ch70 160913 was 1
// -x% APs needed to change stance for MA trait
if ( HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ) && ( gGameOptions.fNewTraitSystem ))