mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
-reverted most AI changes
-spreadsheet update git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@200 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2517,165 +2517,4 @@ BOOLEAN ArmySeesOpponents( void )
|
||||
}
|
||||
|
||||
|
||||
void AskForNoise( SOLDIERTYPE * pSoldier, INT16 *sNoiseGridno, UINT8 *ubNoiseVolume, INT8 *bNoiseLevel, INT8 bDist )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE *pFriend;
|
||||
|
||||
|
||||
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
{
|
||||
pFriend = MercSlots[ uiLoop ];
|
||||
|
||||
// it's me! Next merc
|
||||
if( pFriend == pSoldier )
|
||||
continue;
|
||||
|
||||
// if this merc is inactive, at base, on assignment, dead, unconscious
|
||||
if (!pFriend || (pFriend->bLife < OKLIFE))
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
if ( pSoldier->bTeam != pFriend->bTeam )
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
if( pFriend->sNoiseGridno != NOWHERE && GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, pFriend->sGridNo ) / 10 <= bDist )
|
||||
{
|
||||
*sNoiseGridno = pFriend->sNoiseGridno;
|
||||
*ubNoiseVolume = pFriend->ubNoiseVolume;
|
||||
*bNoiseLevel = pFriend->bNoiseLevel;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
INT32 RangeToClosestOpponent( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT16 sClosestDisturbance;
|
||||
//BOOLEAN fClimb;
|
||||
sClosestDisturbance = ClosestKnownOpponent(pSoldier, 0, 0);
|
||||
if( sClosestDisturbance != NOWHERE )
|
||||
return GetRangeFromGridNoDiff( pSoldier->sGridNo, sClosestDisturbance );
|
||||
else
|
||||
return 128;
|
||||
}
|
||||
|
||||
|
||||
UINT8 NeedTimeToReadyGun_IfAlreadyReady( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT16 usAnimState = PickSoldierReadyAnimation( pSoldier, FALSE );
|
||||
|
||||
if( usAnimState == INVALID_ANIMATION || GetAPsToReadyWeapon( pSoldier, usAnimState ) == 0 )
|
||||
{
|
||||
if( pSoldier->inv[HANDPOS].usItem != NOTHING && Item[pSoldier->inv[HANDPOS].usItem ].usItemClass == IC_GUN )
|
||||
return Weapon[ Item[pSoldier->inv[HANDPOS].usItem].ubClassIndex ].ubReadyTime;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT32 CountRatingOfTeamMatesDensity( SOLDIERTYPE * pSoldier, INT16 sGridNo, INT32 iDist )
|
||||
{
|
||||
//UINT8 X, Y , ubWhoIsThere;
|
||||
DOUBLE ddCount;
|
||||
|
||||
// INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown;
|
||||
// INT16 iGridNo;
|
||||
DOUBLE ddDistance;
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE *pFriend;
|
||||
DOUBLE ddMaxDistance = iDist;
|
||||
|
||||
ddCount = 0;
|
||||
|
||||
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
{
|
||||
pFriend = MercSlots[ uiLoop ];
|
||||
|
||||
// it's me! Next merc
|
||||
if( pFriend == pSoldier )
|
||||
continue;
|
||||
|
||||
|
||||
// if this merc is inactive, at base, on assignment, dead, unconscious
|
||||
if (!pFriend || (pFriend->bLife < OKLIFE))
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
// if this man is neutral / on the same side
|
||||
if ( pSoldier->bSide != pFriend->bSide )
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
|
||||
ddDistance = (INT32)(GetRangeInCellCoordsFromGridNoDiff( sGridNo, pFriend->sGridNo ) / 10);
|
||||
|
||||
if( ddDistance > ddMaxDistance)
|
||||
ddDistance = ddMaxDistance;
|
||||
|
||||
// if( ddDistance )
|
||||
// ddDistance = iDist + 1 - ddDistance;
|
||||
|
||||
ddCount += max( 0, ddMaxDistance - ddDistance );
|
||||
}
|
||||
|
||||
return( ddCount );
|
||||
}
|
||||
|
||||
UINT32 CountRatingOfOpponentsDensity( SOLDIERTYPE * pSoldier, INT16 sGridNo, INT32 iDist )
|
||||
{
|
||||
//UINT8 X, Y , ubWhoIsThere;
|
||||
DOUBLE ddCount;
|
||||
|
||||
// INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown;
|
||||
// INT16 iGridNo;
|
||||
DOUBLE ddDistance;
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE *pOpponent;
|
||||
DOUBLE ddMaxDistance = iDist;
|
||||
|
||||
ddCount = 0;
|
||||
|
||||
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
{
|
||||
pOpponent = MercSlots[ uiLoop ];
|
||||
|
||||
// it's me! Next merc
|
||||
if( pOpponent == pSoldier )
|
||||
continue;
|
||||
|
||||
|
||||
// if this merc is inactive, at base, on assignment, dead, unconscious
|
||||
if (!pOpponent || (pOpponent->bLife < OKLIFE))
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
// if this man is neutral / on the same side
|
||||
if ( CONSIDERED_NEUTRAL( pSoldier, pOpponent ) || (pSoldier->bSide == pOpponent->bSide))
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
|
||||
ddDistance = (INT32)(GetRangeInCellCoordsFromGridNoDiff( sGridNo, pOpponent->sGridNo ) / 10);
|
||||
|
||||
if( ddDistance > ddMaxDistance)
|
||||
ddDistance = ddMaxDistance;
|
||||
|
||||
// if( ddDistance )
|
||||
// ddDistance = iDist + 1 - ddDistance;
|
||||
|
||||
ddCount += max( 0, ddMaxDistance - ddDistance );
|
||||
}
|
||||
|
||||
return( ddCount );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user