mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Data and Source v1.13 Mod High Resolution version from 2006-04-15
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@25 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1702,6 +1702,10 @@ BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[ pSoldier->bLevel ] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1722,6 +1726,10 @@ BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1740,6 +1748,10 @@ INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridNo)
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1752,6 +1764,10 @@ BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -2350,6 +2366,7 @@ UINT8 SoldierDifficultyLevel( SOLDIERTYPE * pSoldier )
|
||||
INT8 bDifficultyBase;
|
||||
INT8 bDifficulty;
|
||||
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("SoldierDifficultyLevel"));
|
||||
// difficulty modifier ranges from 0 to 100
|
||||
// and we want to end up with a number between 0 and 4 (4=hardest)
|
||||
// to a base of 1, divide by 34 to get a range from 1 to 3
|
||||
|
||||
+50
-28
@@ -164,8 +164,12 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns
|
||||
#endif
|
||||
|
||||
// calculate minimum action points required to shoot at this opponent
|
||||
ubMinAPcost = MinAPsToAttack(pSoldier,pOpponent->sGridNo,ADDTURNCOST);
|
||||
//NumMessage("MinAPcost to shoot this opponent = ",ubMinAPcost);
|
||||
if ( !Weapon[pSoldier->usAttackingWeapon].NoSemiAuto )
|
||||
ubMinAPcost = MinAPsToAttack(pSoldier,pOpponent->sGridNo,ADDTURNCOST);
|
||||
else
|
||||
ubMinAPcost = CalcAPsToAutofire( CalcActionPoints( pSoldier ), &(pSoldier->inv[HANDPOS]), 3 );
|
||||
|
||||
//NumMessage("MinAPcost to shoot this opponent = ",ubMinAPcost);
|
||||
|
||||
// if we don't have enough APs left to shoot even a snap-shot at this guy
|
||||
if (ubMinAPcost > pSoldier->bActionPoints)
|
||||
@@ -252,31 +256,43 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns
|
||||
}
|
||||
|
||||
// consider the various aiming times
|
||||
for (ubAimTime = AP_MIN_AIM_ATTACK; ubAimTime <= ubMaxPossibleAimTime; ubAimTime++)
|
||||
{
|
||||
//HandleMyMouseCursor(KEYBOARDALSO);
|
||||
if ( !Weapon[pSoldier->usAttackingWeapon].NoSemiAuto )
|
||||
{
|
||||
for (ubAimTime = AP_MIN_AIM_ATTACK; ubAimTime <= ubMaxPossibleAimTime; ubAimTime++)
|
||||
{
|
||||
//HandleMyMouseCursor(KEYBOARDALSO);
|
||||
|
||||
//NumMessage("ubAimTime = ",ubAimTime);
|
||||
//NumMessage("ubAimTime = ",ubAimTime);
|
||||
|
||||
ubChanceToHit = (UINT8) AICalcChanceToHitGun(pSoldier,pOpponent->sGridNo,ubAimTime, AIM_SHOT_TORSO);
|
||||
// ExtMen[pOpponent->ubID].haveStats = TRUE;
|
||||
//NumMessage("chance to Hit = ",ubChanceToHit);
|
||||
ubChanceToHit = (UINT8) AICalcChanceToHitGun(pSoldier,pOpponent->sGridNo,ubAimTime, AIM_SHOT_TORSO);
|
||||
// ExtMen[pOpponent->ubID].haveStats = TRUE;
|
||||
//NumMessage("chance to Hit = ",ubChanceToHit);
|
||||
|
||||
//sprintf((CHAR *)tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
|
||||
//PopMessage(tempstr);
|
||||
//sprintf((CHAR *)tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
|
||||
//PopMessage(tempstr);
|
||||
|
||||
iHitRate = (pSoldier->bActionPoints * ubChanceToHit) / (ubRawAPCost + ubAimTime);
|
||||
//NumMessage("hitRate = ",iHitRate);
|
||||
iHitRate = (pSoldier->bActionPoints * ubChanceToHit) / (ubRawAPCost + ubAimTime);
|
||||
//NumMessage("hitRate = ",iHitRate);
|
||||
|
||||
// if aiming for this amount of time produces a better hit rate
|
||||
if (iHitRate > iBestHitRate)
|
||||
{
|
||||
iBestHitRate = iHitRate;
|
||||
ubBestAimTime = ubAimTime;
|
||||
ubBestChanceToHit = ubChanceToHit;
|
||||
}
|
||||
}
|
||||
// if aiming for this amount of time produces a better hit rate
|
||||
if (iHitRate > iBestHitRate)
|
||||
{
|
||||
iBestHitRate = iHitRate;
|
||||
ubBestAimTime = ubAimTime;
|
||||
ubBestChanceToHit = ubChanceToHit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ubAimTime = AP_MIN_AIM_ATTACK;
|
||||
ubChanceToHit = (UINT8) AICalcChanceToHitGun(pSoldier,pOpponent->sGridNo,ubAimTime, AIM_SHOT_TORSO);
|
||||
iHitRate = (pSoldier->bActionPoints * ubChanceToHit) / (ubRawAPCost + ubAimTime);
|
||||
|
||||
iBestHitRate = iHitRate;
|
||||
ubBestAimTime = ubAimTime;
|
||||
ubBestChanceToHit = ubChanceToHit;
|
||||
}
|
||||
|
||||
// if we can't get any kind of hit rate at all
|
||||
if (iBestHitRate == 0)
|
||||
@@ -290,7 +306,7 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns
|
||||
continue; // next opponent
|
||||
|
||||
// really limit knife throwing so it doesn't look wrong
|
||||
if ( Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_THROWING_KNIFE && (ubChanceToReallyHit < 30 || ( PythSpacesAway( pSoldier->sGridNo, pOpponent->sGridNo ) > CalcMaxTossRange( pSoldier, THROWING_KNIFE, FALSE ) )))// Madd / 2 ) ) )
|
||||
if ( Item[ pSoldier->usAttackingWeapon ].usItemClass == IC_THROWING_KNIFE && (ubChanceToReallyHit < 30 || ( PythSpacesAway( pSoldier->sGridNo, pOpponent->sGridNo ) > CalcMaxTossRange( pSoldier, pSoldier->usAttackingWeapon, FALSE ) )))// Madd / 2 ) ) )
|
||||
continue; // don't bother... next opponent
|
||||
|
||||
// calculate this opponent's threat value (factor in my cover from him)
|
||||
@@ -805,9 +821,12 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
||||
// if considering a gas/smoke grenade, check to see if there is such stuff already there!
|
||||
if ( usGrenade )
|
||||
{
|
||||
// if ( gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_SMOKE ||
|
||||
// gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS) ||
|
||||
// gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_MUSTARDGAS)
|
||||
if ( gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_SMOKE ||
|
||||
gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS) ||
|
||||
gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_MUSTARDGAS)
|
||||
gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS | MAPELEMENT_EXT_BURNABLEGAS) ||
|
||||
gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_MUSTARDGAS || gpWorldLevelData[ sGridNo ].ubExtFlags[ bOpponentLevel[ubLoop] ] & MAPELEMENT_EXT_BURNABLEGAS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1718,6 +1737,12 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
|
||||
}
|
||||
|
||||
}
|
||||
if ( Explosive[ ubExplosiveIndex ].ubType == EXPLOSV_BURNABLEGAS )
|
||||
{
|
||||
// if target gridno is outdoors (where tear gas lasts only 1-2 turns)
|
||||
if (gpWorldLevelData[sGridno].ubTerrainID != FLAT_FLOOR)
|
||||
iBreathDamage /= 2; // reduce effective breath damage by 1/2
|
||||
}
|
||||
else if (iExplosDamage)
|
||||
{
|
||||
// EXPLOSION DAMAGE is spread amongst locations
|
||||
@@ -2337,9 +2362,6 @@ void CheckIfShotPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN s
|
||||
//if ( Weapon [pObj->usItem ].ubWeaponType != GUN_SN_RIFLE )
|
||||
// return;
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CheckIfShotPossible: checking for scope");
|
||||
//check for sniper scope
|
||||
|
||||
// if it's in his holster, swap it into his hand temporarily
|
||||
if (pBestShot->bWeaponIn != HANDPOS)
|
||||
{
|
||||
@@ -2347,7 +2369,7 @@ void CheckIfShotPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN s
|
||||
RearrangePocket(pSoldier, HANDPOS, pBestShot->bWeaponIn, TEMPORARILY);
|
||||
}
|
||||
|
||||
if ( (!suppressionFire && IsScoped(pObj) && GunRange(pObj) > 30 ) || (suppressionFire && IsGunAutofireCapable(pSoldier,pBestShot->bWeaponIn ) && GetMagSize(pObj) > 30 && pObj->ubGunShotsLeft > 20 ))
|
||||
if ( (!suppressionFire && IsScoped(pObj) && !Weapon[pObj->usItem].NoSemiAuto && GunRange(pObj) > 30 ) || (suppressionFire && IsGunAutofireCapable(pSoldier,pBestShot->bWeaponIn ) && GetMagSize(pObj) > 30 && pObj->ubGunShotsLeft > 20 ))
|
||||
{
|
||||
// get the minimum cost to attack with this item
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CheckIfShotPossible: getting min aps");
|
||||
|
||||
+39
-14
@@ -20,7 +20,7 @@
|
||||
#include "pathai.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Boxing.h"
|
||||
#include "Air Raid.h"
|
||||
// #include "Air Raid.h"
|
||||
#endif
|
||||
|
||||
extern BOOLEAN InternalIsValidStance( SOLDIERTYPE *pSoldier, INT8 bDirection, INT8 bNewStance );
|
||||
@@ -934,6 +934,11 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
case ATTACKSLAYONLY: break;
|
||||
}
|
||||
|
||||
|
||||
//hide those suicidal militia on the roofs for better defensive positions
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM )
|
||||
iChance += 20;
|
||||
|
||||
// reduce chance for any injury, less likely to hop up if hurt
|
||||
iChance -= (pSoldier->bLifeMax - pSoldier->bLife);
|
||||
|
||||
@@ -1500,6 +1505,9 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
// reduce chance if breath is down, less likely to wander around when tired
|
||||
iChance -= (100 - pSoldier->bBreath);
|
||||
|
||||
//Madd: make militia less likely to go running headlong into trouble
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM )
|
||||
iChance -= 30;
|
||||
|
||||
if ((INT16) PreRandom(100) < iChance )
|
||||
{
|
||||
@@ -1738,7 +1746,11 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
|
||||
// reduce chance if breath is down, less likely to wander around when tired
|
||||
//Madd: make militia more likely to take cover
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM )
|
||||
iChance += 20;
|
||||
|
||||
// reduce chance if breath is down, less likely to wander around when tired
|
||||
iChance -= (100 - pSoldier->bBreath);
|
||||
|
||||
if ((INT16)PreRandom(100) < iChance)
|
||||
@@ -2209,7 +2221,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
}
|
||||
while( pSoldier->bActionPoints - (BestShot.ubAPCost - BestShot.ubAimTime) > ubBurstAPs &&
|
||||
pSoldier->inv[ pSoldier->ubAttackingHand ].ubGunShotsLeft >= pSoldier->bDoAutofire &&
|
||||
GetBurstPenalty(&pSoldier->inv[ pSoldier->ubAttackingHand ], gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE)*pSoldier->bDoAutofire <= 80 );
|
||||
GetAutoPenalty(&pSoldier->inv[ pSoldier->ubAttackingHand ], gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE)*pSoldier->bDoAutofire <= 80 );
|
||||
|
||||
|
||||
pSoldier->bDoAutofire--;
|
||||
@@ -2236,7 +2248,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
}
|
||||
// suppression not possible, do something else
|
||||
}
|
||||
|
||||
/*
|
||||
// CALL IN AIR STRIKE & RADIO RED ALERT
|
||||
if ( !fCivilian && pSoldier->bTeam != MILITIA_TEAM && gGameOptions.fAirStrikes && airstrikeavailable && (pSoldier->bActionPoints >= AP_RADIO) && !WillAirRaidBeStopped(pSoldier->sSectorX,pSoldier->sSectorY))
|
||||
{
|
||||
@@ -2293,7 +2305,7 @@ if ( !fCivilian && pSoldier->bTeam != MILITIA_TEAM && gGameOptions.fAirStrikes &
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: crouch and rest if running out of breath");
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -2589,6 +2601,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
|
||||
case AGGRESSIVE: bSeekPts += +1; bHelpPts += 0; bHidePts += -1; bWatchPts += 0; break;
|
||||
case ATTACKSLAYONLY:bSeekPts += +1; bHelpPts += 0; bHidePts += -1; bWatchPts += 0; break;
|
||||
}
|
||||
|
||||
//Madd: make militia less likely to go running headlong into trouble
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM )
|
||||
{
|
||||
bSeekPts += -1; bHelpPts += 0; bHidePts += +1; bWatchPts += +1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gfTurnBasedAI)
|
||||
@@ -3290,7 +3308,9 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
|
||||
BOOLEAN fAllowCoverCheck = FALSE;
|
||||
|
||||
// once we hit status black, reset flanking status
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"DecideActionBlack");
|
||||
|
||||
// once we hit status black, reset flanking status
|
||||
//pSoldier->numFlanks = 0;
|
||||
|
||||
|
||||
@@ -4144,7 +4164,7 @@ bCanAttack = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
iChance = (25 / (BestAttack.ubAimTime + 1));
|
||||
iChance = (25 / max((BestAttack.ubAimTime + 1),1));
|
||||
switch (pSoldier->bAttitude)
|
||||
{
|
||||
case DEFENSIVE: iChance += -5; break;
|
||||
@@ -4162,6 +4182,7 @@ bCanAttack = FALSE;
|
||||
// increase chance based on proximity and difficulty of enemy
|
||||
if ( PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) < 15 )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("DecideActionBlack: check chance to burst"));
|
||||
iChance += ( 15 - PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) ) * ( 1 + SoldierDifficultyLevel( pSoldier ) );
|
||||
if ( pSoldier->bAttitude == ATTACKSLAYONLY )
|
||||
{
|
||||
@@ -4190,8 +4211,8 @@ bCanAttack = FALSE;
|
||||
|
||||
if (IsGunAutofireCapable( pSoldier, BestAttack.bWeaponIn /*, FALSE*/ ) &&
|
||||
!(Menptr[BestShot.ubOpponent].bLife < OKLIFE) && // don't burst at downed targets
|
||||
pSoldier->inv[BestAttack.bWeaponIn].ubGunShotsLeft > 1 &&
|
||||
BestAttack.ubAimTime != BURSTING)
|
||||
(( pSoldier->inv[BestAttack.bWeaponIn].ubGunShotsLeft > 1 &&
|
||||
BestAttack.ubAimTime != BURSTING ) || Weapon[pSoldier->inv[BestAttack.bWeaponIn].usItem].NoSemiAuto) )
|
||||
{
|
||||
pSoldier->bDoAutofire = 0;
|
||||
do
|
||||
@@ -4201,7 +4222,7 @@ bCanAttack = FALSE;
|
||||
}
|
||||
while( pSoldier->bActionPoints - (BestAttack.ubAPCost - BestAttack.ubAimTime) > ubBurstAPs &&
|
||||
pSoldier->inv[ pSoldier->ubAttackingHand ].ubGunShotsLeft >= pSoldier->bDoAutofire &&
|
||||
GetBurstPenalty(&pSoldier->inv[ BestAttack.bWeaponIn ], gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE)*pSoldier->bDoAutofire <= 80);
|
||||
GetAutoPenalty(&pSoldier->inv[ BestAttack.bWeaponIn ], gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE)*pSoldier->bDoAutofire <= 80);
|
||||
|
||||
|
||||
|
||||
@@ -4217,7 +4238,7 @@ bCanAttack = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
iChance = (100 / (BestAttack.ubAimTime + 1));
|
||||
iChance = (100 / max((BestAttack.ubAimTime + 1),1));
|
||||
switch (pSoldier->bAttitude)
|
||||
{
|
||||
case DEFENSIVE: iChance += -5; break;
|
||||
@@ -4236,6 +4257,7 @@ bCanAttack = FALSE;
|
||||
// increase chance based on proximity and difficulty of enemy
|
||||
if ( PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) < 15 )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("DecideActionBlack: check chance to autofire"));
|
||||
iChance += ( 15 - PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) ) * ( 1 + SoldierDifficultyLevel( pSoldier ) );
|
||||
if ( pSoldier->bAttitude == ATTACKSLAYONLY )
|
||||
{
|
||||
@@ -4245,7 +4267,7 @@ bCanAttack = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if ((INT32) PreRandom( 100 ) < iChance)
|
||||
if ((INT32) PreRandom( 100 ) < iChance || Weapon[pSoldier->inv[BestAttack.bWeaponIn].usItem].NoSemiAuto)
|
||||
{
|
||||
BestAttack.ubAimTime = AUTOFIRING + pSoldier->bDoAutofire;
|
||||
BestAttack.ubAPCost = BestAttack.ubAPCost - BestAttack.ubAimTime + CalcAPsToAutofire( CalcActionPoints( pSoldier ), &(pSoldier->inv[BestAttack.bWeaponIn]), pSoldier->bDoAutofire );
|
||||
@@ -4371,6 +4393,7 @@ bCanAttack = FALSE;
|
||||
case ATTACKSLAYONLY:iChance += 30; break;
|
||||
}
|
||||
// increase chance based on proximity and difficulty of enemy
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("DecideActionBlack: check chance to gl burst"));
|
||||
iChance += ( 15 - PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) ) * ( 1 + SoldierDifficultyLevel( pSoldier ) );
|
||||
}
|
||||
|
||||
@@ -4619,8 +4642,10 @@ bCanAttack = FALSE;
|
||||
|
||||
// if there hasn't been an initial RED ALERT yet in this sector
|
||||
if ( !(gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition) || NeedToRadioAboutPanicTrigger() )
|
||||
// since I'm at STATUS RED, I obviously know we're being invaded!
|
||||
iChance = gbDiff[DIFF_RADIO_RED_ALERT][ SoldierDifficultyLevel( pSoldier ) ];
|
||||
{ // since I'm at STATUS RED, I obviously know we're being invaded!
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("DecideActionBlack: check chance to radio contact"));
|
||||
iChance = gbDiff[DIFF_RADIO_RED_ALERT][ SoldierDifficultyLevel( pSoldier ) ];
|
||||
}
|
||||
else // subsequent radioing (only to update enemy positions, request help)
|
||||
// base chance depends on how much new info we have to radio to the others
|
||||
iChance = 10 * WhatIKnowThatPublicDont(pSoldier,FALSE); // use 10 * for RED alert
|
||||
|
||||
@@ -266,6 +266,8 @@ INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8
|
||||
INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 iMyAPsLeft,
|
||||
UINT32 uiThreatIndex, INT32 iRange, INT32 morale, INT32 *iTotalScale)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("CalcCoverValue"));
|
||||
|
||||
// all 32-bit integers for max. speed
|
||||
INT32 iMyPosValue, iHisPosValue, iCoverValue;
|
||||
INT32 iReductionFactor, iThisScale;
|
||||
@@ -523,6 +525,8 @@ UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT16 sGridNo )
|
||||
|
||||
INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentBetter)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("FindBestNearbyCover"));
|
||||
|
||||
// all 32-bit integers for max. speed
|
||||
UINT32 uiLoop;
|
||||
INT32 iCurrentCoverValue, iCoverValue, iBestCoverValue;
|
||||
@@ -1648,6 +1652,8 @@ INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
|
||||
INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("SearchForItems"));
|
||||
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
INT16 sGridNo;
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="TacticalAI"
|
||||
SccProjectName=""$/Jagged Alliance 2/Development/Programming/Jagged Alliance 2/Build", AVAAAAAA"
|
||||
SccLocalPath="..\..\..\ja2\build">
|
||||
SccProjectName=""
|
||||
SccAuxPath=""
|
||||
SccLocalPath=""
|
||||
SccProvider="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
@@ -21,8 +23,8 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="\Standard Gaming Platform,\ja2\Build,\ja2\Build\Tactical,\ja2\Build\Utils,\ja2\Build\TileEngine,\ja2\build\strategic,\ja2\build\laptop"
|
||||
PreprocessorDefinitions="RELEASE_WITH_DEBUG_INFO;NDEBUG;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="RELEASE_WITH_DEBUG_INFO;NDEBUG;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -37,7 +39,7 @@
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -75,7 +77,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\laptop,..\Standard Gaming Platform,..\,..\Tactical,..\Utils,..\TileEngine,..\strategic,.\"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="NDEBUG;RELEASE_WITH_DEBUG_INFO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -91,7 +93,8 @@
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"
|
||||
DisableSpecificWarnings="4292;4189"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -128,7 +131,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Standard Gaming Platform,..\TileEngine,..\,..\Tactical,..\Utils,..\Editor,..\strategic,..\Laptop,.\"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
@@ -141,7 +144,7 @@
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"
|
||||
CompileAs="2"
|
||||
DisableSpecificWarnings="4292"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
@@ -179,8 +182,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="\Standard Gaming Platform,\ja2\Build,\ja2\Build\Tactical,\ja2\Build\Utils,\ja2\Build\TileEngine,\ja2\build\strategic,\ja2\build\laptop"
|
||||
PreprocessorDefinitions="_DEBUG;BOUNDS_CHECKER;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;_VTUNE_PROFILING"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="_DEBUG;BOUNDS_CHECKER;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="AI All.h"
|
||||
@@ -192,7 +195,8 @@
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"
|
||||
DisableSpecificWarnings="4292"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -230,7 +234,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\Standard Gaming Platform,..\,..\Tactical,..\Utils,..\TileEngine,..\strategic,..\laptop,.\"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="RELEASE_WITH_DEBUG_INFO;NDEBUG;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -246,7 +250,7 @@
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -283,8 +287,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="\Standard Gaming Platform,\ja2\Build,\ja2\Build\Tactical,\ja2\Build\Utils,\ja2\Build\TileEngine,\ja2\build\strategic,\ja2\build\laptop"
|
||||
PreprocessorDefinitions="_DEBUG;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="_DEBUG;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="AI All.h"
|
||||
@@ -296,7 +300,7 @@
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -333,8 +337,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="\Standard Gaming Platform,\ja2\Build,\ja2\Build\Tactical,\ja2\Build\Utils,\ja2\Build\TileEngine,\ja2\build\strategic,\ja2\build\laptop"
|
||||
PreprocessorDefinitions="_DEBUG;BOUNDS_CHECKER;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="_DEBUG;BOUNDS_CHECKER;JA2DEMO;WIN32;_WINDOWS;JA2;PRECOMPILEDHEADERS;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="AI All.h"
|
||||
@@ -346,7 +350,7 @@
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
@@ -383,8 +387,13 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\Standard Gaming Platform,..\TileEngine,..\,..\Tactical,..\Utils,..\Editor,..\strategic,..\Laptop,.\"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\Utils;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -398,7 +407,7 @@
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
CompileAs="2"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
|
||||
Reference in New Issue
Block a user