mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+26
-26
@@ -29,7 +29,7 @@ extern BOOLEAN gfTurnBasedAI;
|
||||
|
||||
//Kris: November 10, 1997
|
||||
//Please don't change this value from 10. It will invalidate all of the maps and soldiers.
|
||||
#define MAXPATROLGRIDS 10
|
||||
//#define MAXPATROLGRIDS 10//dnl ch33 200909 already defined in Soldier Control.h
|
||||
|
||||
#define NOWATER 0
|
||||
#define WATEROK 1
|
||||
@@ -107,7 +107,7 @@ enum
|
||||
typedef struct
|
||||
{
|
||||
SOLDIERTYPE * pOpponent;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
INT32 iValue;
|
||||
INT32 iAPs;
|
||||
INT32 iCertainty;
|
||||
@@ -127,7 +127,7 @@ typedef struct
|
||||
INT16 ubChanceToReallyHit; // chance to hit * chance to get through cover
|
||||
//END STRUCTURE CHANGE BY GOTTHARD 7/14/07
|
||||
INT32 iAttackValue; // relative worthiness of this type of attack
|
||||
INT16 sTarget; // target gridno of this attack
|
||||
INT32 sTarget; // target gridno of this attack
|
||||
INT8 bTargetLevel; // target level of this attack
|
||||
INT16 ubAPCost; // how many APs the attack will use up
|
||||
INT8 bWeaponIn; // the inv slot of the weapon in question
|
||||
@@ -160,14 +160,14 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow);
|
||||
void CalcTentacleAttack(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab );
|
||||
|
||||
INT16 CalcSpreadBurst( SOLDIERTYPE * pSoldier, INT16 sFirstTarget, INT8 bTargetLevel );
|
||||
INT32 CalcManThreatValue(SOLDIERTYPE *pSoldier, INT16 sMyGrid, UINT8 ubReduceForCover, SOLDIERTYPE * pMe );
|
||||
INT32 CalcManThreatValue(SOLDIERTYPE *pSoldier, INT32 sMyGrid, UINT8 ubReduceForCover, SOLDIERTYPE * pMe );
|
||||
INT8 CanNPCAttack(SOLDIERTYPE *pSoldier);
|
||||
void CheckIfTossPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow);
|
||||
BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel );
|
||||
BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel );
|
||||
INT8 ClosestPanicTrigger( SOLDIERTYPE * pSoldier );
|
||||
INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK, BOOLEAN * pfChangeLevel );
|
||||
INT16 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbingNecessary);
|
||||
INT16 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLevel);
|
||||
INT32 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK, BOOLEAN * pfChangeLevel );
|
||||
INT32 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbingNecessary);
|
||||
INT32 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel);
|
||||
void CreatureCall( SOLDIERTYPE * pCaller );
|
||||
INT8 CreatureDecideAction( SOLDIERTYPE * pCreature );
|
||||
void CreatureDecideAlertStatus( SOLDIERTYPE *pCreature );
|
||||
@@ -178,31 +178,31 @@ UINT16 DetermineMovementMode( SOLDIERTYPE * pSoldier, INT8 bAction );
|
||||
|
||||
INT32 EstimateShotDamage(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 ubChanceToHit);
|
||||
INT32 EstimateStabDamage(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 ubChanceToHit, BOOLEAN fBladeAttack);
|
||||
INT32 EstimateThrowDamage(SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *pOpponent, INT16 sGridno);
|
||||
INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel, BOOLEAN fAddCostAfterClimbingUp, BOOLEAN * pfClimbingNecessary, INT16 * psClimbGridNo );
|
||||
INT32 EstimateThrowDamage(SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *pOpponent, INT32 sGridNo);
|
||||
INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel, BOOLEAN fAddCostAfterClimbingUp, BOOLEAN * pfClimbingNecessary, INT32 * psClimbGridNo );
|
||||
|
||||
BOOLEAN FindBetterSpotForItem( SOLDIERTYPE * pSoldier, INT8 bSlot );
|
||||
INT16 FindClosestClimbPointAvailableToAI( SOLDIERTYPE * pSoldier, INT16 sStartGridNo, INT16 sDesiredGridNo, BOOLEAN fClimbUp );
|
||||
INT16 FindRouteBackOntoMap( SOLDIERTYPE * pSoldier, INT16 sDestGridNo );
|
||||
INT16 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing );
|
||||
INT16 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel, BOOLEAN * pfClimbingNecessary );
|
||||
INT32 FindClosestClimbPointAvailableToAI( SOLDIERTYPE * pSoldier, INT32 sStartGridNo, INT32 sDesiredGridNo, BOOLEAN fClimbUp );
|
||||
INT32 FindRouteBackOntoMap( SOLDIERTYPE * pSoldier, INT32 sDestGridNo );
|
||||
INT32 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing );
|
||||
INT32 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel, BOOLEAN * pfClimbingNecessary );
|
||||
UINT8 GetTraversalQuoteActionID( INT8 bDirection );
|
||||
INT16 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, INT8 bAction);
|
||||
INT32 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, INT8 bAction);
|
||||
|
||||
INT8 HeadForTheStairCase( SOLDIERTYPE * pSoldier );
|
||||
|
||||
BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT16 sGridNo );
|
||||
BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo );
|
||||
BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo );
|
||||
BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT32 sGridNo );
|
||||
BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo );
|
||||
BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo );
|
||||
|
||||
void InitAttackType(ATTACKTYPE *pAttack);
|
||||
|
||||
INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, INT16 bReserveAPs, INT8 bAction, INT8 fFlags );
|
||||
INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, INT16 bReserveAPs, INT8 bAction, INT8 fFlags );
|
||||
|
||||
int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode, UINT8 ubWaterOK, UINT8 fFlags);
|
||||
int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridno, UINT8 ubPathMode, UINT8 ubWaterOK, UINT8 fFlags);
|
||||
void LoadWeaponIfNeeded(SOLDIERTYPE *pSoldier);
|
||||
INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN * pfClimbingNecessary, BOOLEAN * pfReachable );
|
||||
INT16 NPCConsiderInitiatingConv( SOLDIERTYPE * pNPC, UINT8 * pubDesiredMerc );
|
||||
INT32 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN * pfClimbingNecessary, BOOLEAN * pfReachable );
|
||||
INT32 NPCConsiderInitiatingConv( SOLDIERTYPE * pNPC, UINT8 * pubDesiredMerc );
|
||||
void NPCDoesAct(SOLDIERTYPE *pSoldier);
|
||||
void NPCDoesNothing(SOLDIERTYPE *pSoldier);
|
||||
INT8 OKToAttack(SOLDIERTYPE *ptr, int target);
|
||||
@@ -218,18 +218,18 @@ UINT16 RunAway( SOLDIERTYPE * pSoldier );
|
||||
INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem );
|
||||
UINT8 ShootingStanceChange( SOLDIERTYPE * pSoldier, ATTACKTYPE * pAttack, INT8 bDesiredDirection );
|
||||
UINT8 StanceChange( SOLDIERTYPE * pSoldier, INT16 ubAttackAPCost );
|
||||
INT16 TrackScent( SOLDIERTYPE * pSoldier );
|
||||
INT32 TrackScent( SOLDIERTYPE * pSoldier );
|
||||
void RefreshAI(SOLDIERTYPE *pSoldier);
|
||||
BOOLEAN InLightAtNight( INT16 sGridNo, INT8 bLevel );
|
||||
BOOLEAN InLightAtNight( INT32 sGridNo, INT8 bLevel );
|
||||
INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier );
|
||||
|
||||
BOOLEAN ArmySeesOpponents( void );
|
||||
|
||||
void CheckIfShotPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN suppressionFire);
|
||||
|
||||
INT16 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubSearchRadius );
|
||||
INT32 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubSearchRadius );
|
||||
|
||||
INT8 FindDirectionForClimbing( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel);
|
||||
INT8 FindDirectionForClimbing( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel);
|
||||
|
||||
// HEADROCK HAM B2.7: Functions to assist group AI
|
||||
// WANNE: Headrock informed me that I should disable these 3 functions in code, because they need a lot of CPU during AI calculation.
|
||||
|
||||
+31
-31
@@ -558,8 +558,8 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
|
||||
if (pSoldier->aiData.bAction >= FIRST_MOVEMENT_ACTION && pSoldier->aiData.bAction <= LAST_MOVEMENT_ACTION && !pSoldier->flags.fDelayedMovement)
|
||||
{
|
||||
if (pSoldier->pathing.usPathIndex == pSoldier->pathing.usPathDataSize)
|
||||
{
|
||||
if (pSoldier->sAbsoluteFinalDestination != NOWHERE)
|
||||
{
|
||||
if (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
|
||||
{
|
||||
if ( !ACTING_ON_SCHEDULE( pSoldier ) && SpacesAway( pSoldier->sGridNo, pSoldier->sAbsoluteFinalDestination ) < 4 )
|
||||
{
|
||||
@@ -897,7 +897,7 @@ void StartNPCAI(SOLDIERTYPE *pSoldier)
|
||||
|
||||
|
||||
|
||||
BOOLEAN DestNotSpokenFor(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
BOOLEAN DestNotSpokenFor(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
{
|
||||
INT32 cnt;
|
||||
SOLDIERTYPE *pOurTeam;
|
||||
@@ -909,7 +909,7 @@ BOOLEAN DestNotSpokenFor(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
{
|
||||
if ( pOurTeam->bActive )
|
||||
{
|
||||
if (pOurTeam->sGridNo == sGridno || pOurTeam->aiData.usActionData == sGridno)
|
||||
if (pOurTeam->sGridNo == sGridNo || pOurTeam->aiData.usActionData == sGridNo)
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
@@ -918,25 +918,25 @@ BOOLEAN DestNotSpokenFor(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
}
|
||||
|
||||
|
||||
INT16 FindAdjacentSpotBeside(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
INT32 FindAdjacentSpotBeside(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
{
|
||||
INT32 cnt;
|
||||
INT16 mods[4] = {-1,-MAPWIDTH,1,MAPWIDTH};
|
||||
INT16 sTempGridno,sCheapestCost=500,sMovementCost,sCheapestDest=NOWHERE;
|
||||
|
||||
INT16 mods[4] = {-1,-WORLD_COLS,1,WORLD_COLS};
|
||||
INT32 sTempGridNo = NOWHERE, sCheapestDest = MAX_MAP_POS;
|
||||
INT16 sCheapestCost=500, sMovementCost;
|
||||
|
||||
for (cnt=0; cnt < 4; cnt++)
|
||||
{
|
||||
sTempGridno = sGridno + mods[cnt];
|
||||
if (!OutOfBounds(sGridno,sTempGridno))
|
||||
sTempGridNo = sGridNo + mods[cnt];
|
||||
if (!OutOfBounds(sGridNo,sTempGridNo))
|
||||
{
|
||||
if (NewOKDestination(pSoldier,sTempGridno,PEOPLETOO, pSoldier->pathing.bLevel ) && DestNotSpokenFor(pSoldier,sTempGridno))
|
||||
if (NewOKDestination(pSoldier,sTempGridNo,PEOPLETOO, pSoldier->pathing.bLevel ) && DestNotSpokenFor(pSoldier,sTempGridNo))
|
||||
{
|
||||
sMovementCost = PlotPath(pSoldier,sTempGridno,FALSE,FALSE,FALSE,WALKING,FALSE,FALSE,0);
|
||||
sMovementCost = PlotPath(pSoldier,sTempGridNo,FALSE,FALSE,FALSE,WALKING,FALSE,FALSE,0);
|
||||
if (sMovementCost < sCheapestCost)
|
||||
{
|
||||
sCheapestCost = sMovementCost;
|
||||
sCheapestDest = sTempGridno;
|
||||
sCheapestDest = sTempGridNo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1486,8 +1486,8 @@ pSoldier->aiData.bActionTimeout = 0;
|
||||
|
||||
INT16 ActionInProgress(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// if NPC has a desired destination, but isn't currently going there
|
||||
if ((pSoldier->pathing.sFinalDestination != NOWHERE) && (pSoldier->pathing.sDestination != pSoldier->pathing.sFinalDestination))
|
||||
// if NPC has a desired destination, but isn't currently going there
|
||||
if ((!TileIsOutOfBounds(pSoldier->pathing.sFinalDestination)) && (pSoldier->pathing.sDestination != pSoldier->pathing.sFinalDestination))
|
||||
{
|
||||
// return success (TRUE) if we successfully resume the movement
|
||||
return(TryToResumeMovement(pSoldier,pSoldier->pathing.sFinalDestination));
|
||||
@@ -1870,8 +1870,8 @@ void TurnBasedHandleNPCAI(SOLDIERTYPE *pSoldier)
|
||||
// the item pool index was stored in the special data field
|
||||
pSoldier->aiData.uiPendingActionData1 = pSoldier->iNextActionSpecialData;
|
||||
}
|
||||
}
|
||||
else if ( pSoldier->sAbsoluteFinalDestination != NOWHERE )
|
||||
}
|
||||
else if (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
|
||||
{
|
||||
if ( ACTING_ON_SCHEDULE( pSoldier ) )
|
||||
{
|
||||
@@ -1948,8 +1948,8 @@ void TurnBasedHandleNPCAI(SOLDIERTYPE *pSoldier)
|
||||
|
||||
// perform the chosen action
|
||||
pSoldier->aiData.bActionInProgress = ExecuteAction(pSoldier); // if started, mark us as busy
|
||||
|
||||
if ( !pSoldier->aiData.bActionInProgress && pSoldier->sAbsoluteFinalDestination != NOWHERE )
|
||||
|
||||
if ( !pSoldier->aiData.bActionInProgress && !TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
|
||||
{
|
||||
// turn based... abort this guy's turn
|
||||
EndAIGuysTurn( pSoldier );
|
||||
@@ -2201,12 +2201,12 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
if ( gfTurnBasedAI && pSoldier->aiData.bAlertStatus < STATUS_BLACK )
|
||||
{
|
||||
if ( pSoldier->sLastTwoLocations[0] == NOWHERE )
|
||||
{
|
||||
if (TileIsOutOfBounds(pSoldier->sLastTwoLocations[0]))
|
||||
{
|
||||
pSoldier->sLastTwoLocations[0] = pSoldier->sGridNo;
|
||||
}
|
||||
else if ( pSoldier->sLastTwoLocations[1] == NOWHERE )
|
||||
}
|
||||
else if (TileIsOutOfBounds(pSoldier->sLastTwoLocations[1]))
|
||||
{
|
||||
pSoldier->sLastTwoLocations[1] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -2246,8 +2246,8 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
||||
|
||||
// optimization - Ian (if up-to-date path is known, do not check again)
|
||||
if (!pSoldier->pathing.bPathStored)
|
||||
{
|
||||
if ( (pSoldier->sAbsoluteFinalDestination != NOWHERE || gTacticalStatus.fAutoBandageMode) && !(gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
if ( (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination) || gTacticalStatus.fAutoBandageMode) && !(gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
// NPC system move, allow path through
|
||||
if (LegalNPCDestination(pSoldier,pSoldier->aiData.usActionData,ENSURE_PATH,WATEROK, PATH_THROUGH_PEOPLE ))
|
||||
@@ -2268,8 +2268,8 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
||||
// if we STILL don't have a path
|
||||
if ( !pSoldier->pathing.bPathStored )
|
||||
{
|
||||
// Check if we were told to move by NPC stuff
|
||||
if ( pSoldier->sAbsoluteFinalDestination != NOWHERE && !(gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
// Check if we were told to move by NPC stuff
|
||||
if ( !TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination) && !(gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_ERROR, L"AI %s failed to get path for dialogue-related move!", pSoldier->name );
|
||||
|
||||
@@ -2586,9 +2586,9 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
STRUCTURE * pStructure;
|
||||
UINT8 ubDirection;
|
||||
INT16 sDoorGridNo;
|
||||
INT32 sDoorGridNo;
|
||||
|
||||
ubDirection = GetDirectionFromGridNo( (INT16)pSoldier->aiData.usActionData, pSoldier );
|
||||
ubDirection = GetDirectionFromGridNo( pSoldier->aiData.usActionData, pSoldier );
|
||||
if (ubDirection == EAST || ubDirection == SOUTH)
|
||||
{
|
||||
sDoorGridNo = pSoldier->sGridNo;
|
||||
@@ -2697,8 +2697,8 @@ void CheckForChangingOrders(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
case STATUS_GREEN:
|
||||
if ( !CREATURE_OR_BLOODCAT( pSoldier ) )
|
||||
{
|
||||
if ( pSoldier->bTeam == CIV_TEAM && pSoldier->ubProfile != NO_PROFILE && pSoldier->aiData.bNeutral && gMercProfiles[ pSoldier->ubProfile ].sPreCombatGridNo != NOWHERE && pSoldier->ubCivilianGroup != QUEENS_CIV_GROUP )
|
||||
{
|
||||
if ( pSoldier->bTeam == CIV_TEAM && pSoldier->ubProfile != NO_PROFILE && pSoldier->aiData.bNeutral && !TileIsOutOfBounds(gMercProfiles[ pSoldier->ubProfile ].sPreCombatGridNo) && pSoldier->ubCivilianGroup != QUEENS_CIV_GROUP )
|
||||
{
|
||||
// must make them uncower first, then return to start location
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_END_COWER_AND_MOVE;
|
||||
|
||||
+85
-103
@@ -124,7 +124,7 @@ INT8 OKToAttack(SOLDIERTYPE * pSoldier, int target)
|
||||
|
||||
BOOLEAN ConsiderProne( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT16 sOpponentGridNo;
|
||||
INT32 sOpponentGridNo;
|
||||
INT8 bOpponentLevel;
|
||||
INT32 iRange;
|
||||
|
||||
@@ -366,7 +366,7 @@ UINT16 DetermineMovementMode( SOLDIERTYPE * pSoldier, INT8 bAction )
|
||||
}
|
||||
}
|
||||
|
||||
void NewDest(SOLDIERTYPE *pSoldier, UINT16 usGridNo)
|
||||
void NewDest(SOLDIERTYPE *pSoldier, INT32 usGridNo)
|
||||
{
|
||||
// ATE: Setting sDestination? Tis does not make sense...
|
||||
//pSoldier->pathing.sDestination = usGridNo;
|
||||
@@ -411,8 +411,8 @@ void NewDest(SOLDIERTYPE *pSoldier, UINT16 usGridNo)
|
||||
default:
|
||||
/* if ( PreRandom( 5 - SoldierDifficultyLevel( pSoldier ) ) == 0 )
|
||||
{
|
||||
INT16 sClosestNoise = (INT16) MostImportantNoiseHeard( pSoldier, NULL, NULL, NULL );
|
||||
if ( sClosestNoise != NOWHERE && PythSpacesAway( pSoldier->sGridNo, sClosestNoise ) < MaxDistanceVisible() + 10 )
|
||||
INT32 sClosestNoise = (INT16) MostImportantNoiseHeard( pSoldier, NULL, NULL, NULL );
|
||||
if ( !TileIsOutOfBounds(sClosestNoise) && PythSpacesAway( pSoldier->sGridNo, sClosestNoise ) < MaxDistanceVisible() + 10 )
|
||||
{
|
||||
pSoldier->usUIMovementMode = SWATTING;
|
||||
fSet = TRUE;
|
||||
@@ -591,12 +591,12 @@ INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier)
|
||||
UINT8 ubDirsLeft;
|
||||
BOOLEAN fDirChecked[8];
|
||||
BOOLEAN fRangeRestricted = FALSE, fFound = FALSE;
|
||||
UINT16 usDest, usOrigin;
|
||||
INT32 usDest, usOrigin;
|
||||
SOLDIERTYPE * pFriend;
|
||||
|
||||
|
||||
// obtain maximum roaming distance from soldier's origin
|
||||
usMaxDist = RoamingRange(pSoldier, (INT16 *)&usOrigin);
|
||||
usMaxDist = RoamingRange(pSoldier,&usOrigin);
|
||||
|
||||
// if our movement range is restricted
|
||||
|
||||
@@ -726,10 +726,10 @@ INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
|
||||
INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
INT32 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT16 sRandDest = NOWHERE;
|
||||
UINT16 usOrigin, usMaxDist;
|
||||
INT32 sRandDest = NOWHERE;
|
||||
INT32 usOrigin, usMaxDist;
|
||||
UINT8 ubTriesLeft;
|
||||
BOOLEAN fLimited = FALSE, fFound = FALSE;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXRange, sYRange, sXOffset, sYOffset;
|
||||
@@ -752,7 +752,7 @@ INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
ubTriesLeft = 1;
|
||||
}
|
||||
|
||||
usMaxDist = RoamingRange(pSoldier, (INT16 *)&usOrigin);
|
||||
usMaxDist = RoamingRange(pSoldier,&usOrigin);
|
||||
|
||||
if ( pSoldier->aiData.bOrders <= CLOSEPATROL && (pSoldier->bTeam == CIV_TEAM || pSoldier->ubProfile != NO_PROFILE ) )
|
||||
{
|
||||
@@ -828,11 +828,12 @@ INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
if (fLimited)
|
||||
{
|
||||
sXOffset = ((INT16)Random(sXRange)) - sMaxLeft;
|
||||
sYOffset = ((INT16)Random(sYRange)) - sMaxUp;
|
||||
|
||||
sRandDest = usOrigin + sXOffset + (MAXCOL * sYOffset);
|
||||
|
||||
do//dnl ch53 111009 This loop should increase search performance, but probably need some counter to prevent eventual endless loop
|
||||
{
|
||||
sXOffset = ((INT16)Random(sXRange)) - sMaxLeft;
|
||||
sYOffset = ((INT16)Random(sYRange)) - sMaxUp;
|
||||
sRandDest = usOrigin + sXOffset + (MAXCOL * sYOffset);
|
||||
}while(!GridNoOnVisibleWorldTile(sRandDest));
|
||||
#ifdef BETAVERSION
|
||||
if ((sRandDest < 0) || (sRandDest >= GRIDSIZE))
|
||||
{
|
||||
@@ -843,7 +844,10 @@ INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
else
|
||||
{
|
||||
sRandDest = (INT16) PreRandom(GRIDSIZE);
|
||||
do//dnl ch53 111009 This loop should increase search performance, but probably need some counter to prevent eventual endless loop
|
||||
{
|
||||
sRandDest = PreRandom(GRIDSIZE);
|
||||
}while(!GridNoOnVisibleWorldTile(sRandDest));
|
||||
}
|
||||
|
||||
if ( ubRoom && InARoom( sRandDest, &ubTempRoom ) && ubTempRoom != ubRoom )
|
||||
@@ -868,33 +872,33 @@ INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier)
|
||||
return(sRandDest); // defaults to NOWHERE
|
||||
}
|
||||
|
||||
INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK, BOOLEAN * pfChangeLevel )
|
||||
INT32 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK, BOOLEAN * pfChangeLevel )
|
||||
{
|
||||
INT16 *psLastLoc, *pusNoiseGridNo;
|
||||
INT32 *psLastLoc, *pusNoiseGridNo;
|
||||
INT8 *pbLastLevel;
|
||||
INT16 sGridNo=-1;
|
||||
INT32 sGridNo=-1;
|
||||
INT8 bLevel, bClosestLevel = -1;
|
||||
BOOLEAN fClimbingNecessary, fClosestClimbingNecessary = FALSE;
|
||||
INT32 iPathCost;
|
||||
INT16 sClosestDisturbance = NOWHERE;
|
||||
INT32 sClosestDisturbance = NOWHERE;
|
||||
UINT32 uiLoop;
|
||||
UINT16 closestConscious = NOWHERE,closestUnconscious = NOWHERE;
|
||||
UINT32 closestConscious = NOWHERE,closestUnconscious = NOWHERE;
|
||||
INT32 iShortestPath = 1000;
|
||||
INT32 iShortestPathConscious = 1000,iShortestPathUnconscious = 1000;
|
||||
UINT8 *pubNoiseVolume;
|
||||
INT8 *pbNoiseLevel;
|
||||
INT8 *pbPersOL,*pbPublOL;
|
||||
INT16 sClimbGridNo;
|
||||
INT32 sClimbGridNo;
|
||||
SOLDIERTYPE * pOpp;
|
||||
|
||||
// CJC: can't trace a path to every known disturbance!
|
||||
// for starters, try the closest one as the crow flies
|
||||
INT16 sClosestEnemy = NOWHERE, sDistToClosestEnemy = 1000, sDistToEnemy;
|
||||
INT32 sClosestEnemy = NOWHERE, sDistToClosestEnemy = 1000, sDistToEnemy;
|
||||
|
||||
*pfChangeLevel = FALSE;
|
||||
|
||||
pubNoiseVolume = &gubPublicNoiseVolume[pSoldier->bTeam];
|
||||
pusNoiseGridNo = &gsPublicNoiseGridno[pSoldier->bTeam];
|
||||
pusNoiseGridNo = &gsPublicNoiseGridNo[pSoldier->bTeam];
|
||||
pbNoiseLevel = &gbPublicNoiseLevel[pSoldier->bTeam];
|
||||
|
||||
// hang pointers at start of this guy's personal and public opponent opplists
|
||||
@@ -959,8 +963,8 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
{
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
if (sGridNo == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
// huh?
|
||||
continue;
|
||||
@@ -975,8 +979,8 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sClosestEnemy != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestEnemy))
|
||||
{
|
||||
iPathCost = EstimatePathCostToLocation( pSoldier, sClosestEnemy, bClosestLevel, FALSE, &fClimbingNecessary, &sClimbGridNo );
|
||||
// if we can get there
|
||||
@@ -995,8 +999,8 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
}
|
||||
}
|
||||
|
||||
// if any "misc. noise" was also heard recently
|
||||
if (pSoldier->aiData.sNoiseGridno != NOWHERE && pSoldier->aiData.sNoiseGridno != sClosestDisturbance)
|
||||
// if any "misc. noise" was also heard recently
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.sNoiseGridno) && pSoldier->aiData.sNoiseGridno != sClosestDisturbance)
|
||||
{
|
||||
// test this gridno, too
|
||||
sGridNo = pSoldier->aiData.sNoiseGridno;
|
||||
@@ -1030,8 +1034,8 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
}
|
||||
|
||||
|
||||
// if any PUBLIC "misc. noise" was also heard recently
|
||||
if (*pusNoiseGridNo != NOWHERE && *pusNoiseGridNo != sClosestDisturbance )
|
||||
// if any PUBLIC "misc. noise" was also heard recently
|
||||
if (!TileIsOutOfBounds(*pusNoiseGridNo) && *pusNoiseGridNo != sClosestDisturbance )
|
||||
{
|
||||
// test this gridno, too
|
||||
sGridNo = *pusNoiseGridNo;
|
||||
@@ -1066,8 +1070,8 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (sClosestDisturbance != NOWHERE)
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
AINumMessage("CLOSEST DISTURBANCE is at gridno ",sClosestDisturbance);
|
||||
}
|
||||
@@ -1078,9 +1082,9 @@ INT16 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
}
|
||||
|
||||
|
||||
INT16 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLevel)
|
||||
INT32 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel)
|
||||
{
|
||||
INT16 *psLastLoc,sGridNo, sClosestOpponent = NOWHERE;
|
||||
INT32 *psLastLoc,sGridNo, sClosestOpponent = NOWHERE;
|
||||
UINT32 uiLoop;
|
||||
INT32 iRange, iClosestRange = 1500;
|
||||
INT8 *pbPersOL,*pbPublOL;
|
||||
@@ -1171,8 +1175,8 @@ INT16 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLev
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
AINumMessage("CLOSEST OPPONENT is at gridno ",sClosestOpponent);
|
||||
}
|
||||
@@ -1189,9 +1193,9 @@ INT16 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLev
|
||||
return( sClosestOpponent );
|
||||
}
|
||||
|
||||
INT16 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLevel)
|
||||
INT32 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel)
|
||||
{
|
||||
INT16 sGridNo, sClosestOpponent = NOWHERE;
|
||||
INT32 sGridNo, sClosestOpponent = NOWHERE;
|
||||
UINT32 uiLoop;
|
||||
INT32 iRange, iClosestRange = 1500;
|
||||
INT8 *pbPersOL;
|
||||
@@ -1261,8 +1265,8 @@ INT16 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLeve
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
AINumMessage("CLOSEST OPPONENT is at gridno ",sClosestOpponent);
|
||||
}
|
||||
@@ -1280,7 +1284,7 @@ INT16 ClosestSeenOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLeve
|
||||
}
|
||||
|
||||
|
||||
INT16 ClosestPC( SOLDIERTYPE *pSoldier, INT16 * psDistance )
|
||||
INT32 ClosestPC( SOLDIERTYPE *pSoldier, INT32 * psDistance )
|
||||
{
|
||||
// used by NPCs... find the closest PC
|
||||
|
||||
@@ -1288,9 +1292,9 @@ INT16 ClosestPC( SOLDIERTYPE *pSoldier, INT16 * psDistance )
|
||||
|
||||
UINT8 ubLoop;
|
||||
SOLDIERTYPE *pTargetSoldier;
|
||||
INT16 sMinDist = (INT16)WORLD_MAX;
|
||||
INT16 sDist;
|
||||
INT16 sGridNo = NOWHERE;
|
||||
INT32 sMinDist = WORLD_MAX;
|
||||
INT32 sDist;
|
||||
INT32 sGridNo = NOWHERE;
|
||||
|
||||
// Loop through all mercs on player team
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
@@ -1339,10 +1343,10 @@ INT16 ClosestPC( SOLDIERTYPE *pSoldier, INT16 * psDistance )
|
||||
return( sGridNo );
|
||||
}
|
||||
|
||||
INT16 FindClosestClimbPointAvailableToAI( SOLDIERTYPE * pSoldier, INT16 sStartGridNo, INT16 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
INT32 FindClosestClimbPointAvailableToAI( SOLDIERTYPE * pSoldier, INT32 sStartGridNo, INT32 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT16 sRoamingOrigin;
|
||||
INT32 sGridNo;
|
||||
INT32 sRoamingOrigin;
|
||||
INT16 sRoamingRange;
|
||||
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_PC )
|
||||
@@ -1371,7 +1375,7 @@ INT16 FindClosestClimbPointAvailableToAI( SOLDIERTYPE * pSoldier, INT16 sStartGr
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel )
|
||||
BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel )
|
||||
{
|
||||
if (pSoldier->pathing.bLevel == bDestLevel)
|
||||
{
|
||||
@@ -1390,7 +1394,7 @@ BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDest
|
||||
}
|
||||
}
|
||||
|
||||
INT16 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel, BOOLEAN * pfClimbingNecessary )
|
||||
INT32 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel, BOOLEAN * pfClimbingNecessary )
|
||||
{
|
||||
if (pSoldier->pathing.bLevel == bDestLevel)
|
||||
{
|
||||
@@ -1425,10 +1429,10 @@ INT16 GetInterveningClimbingLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo,
|
||||
}
|
||||
}
|
||||
|
||||
INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT8 bDestLevel, BOOLEAN fAddCostAfterClimbingUp, BOOLEAN * pfClimbingNecessary, INT16 * psClimbGridNo )
|
||||
INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT8 bDestLevel, BOOLEAN fAddCostAfterClimbingUp, BOOLEAN * pfClimbingNecessary, INT32 * psClimbGridNo )
|
||||
{
|
||||
INT16 sPathCost;
|
||||
INT16 sClimbGridNo;
|
||||
INT32 sClimbGridNo;
|
||||
|
||||
if (pSoldier->pathing.bLevel == bDestLevel)
|
||||
{
|
||||
@@ -1443,8 +1447,8 @@ INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT
|
||||
{
|
||||
// different buildings!
|
||||
// yes, pass in same gridno twice... want closest climb-down spot for building we are on!
|
||||
sClimbGridNo = FindClosestClimbPointAvailableToAI( pSoldier, sDestGridNo, pSoldier->sGridNo, FALSE );
|
||||
if (sClimbGridNo == NOWHERE)
|
||||
sClimbGridNo = FindClosestClimbPointAvailableToAI( pSoldier, sDestGridNo, pSoldier->sGridNo, FALSE );
|
||||
if (TileIsOutOfBounds(sClimbGridNo))
|
||||
{
|
||||
sPathCost = 0;
|
||||
}
|
||||
@@ -1486,8 +1490,8 @@ INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT16 sDestGridNo, INT
|
||||
// got to go DOWN off building
|
||||
sClimbGridNo = FindClosestClimbPointAvailableToAI( pSoldier, sDestGridNo, pSoldier->sGridNo, FALSE );
|
||||
}
|
||||
|
||||
if (sClimbGridNo == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(sClimbGridNo))
|
||||
{
|
||||
sPathCost = 0;
|
||||
}
|
||||
@@ -1549,10 +1553,10 @@ BOOLEAN GuySawEnemyThisTurnOrBefore( SOLDIERTYPE * pSoldier )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
INT16 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbingNecessary)
|
||||
INT32 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbingNecessary)
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
INT16 sPathCost, sClosestFriend = NOWHERE, sShortestPath = 1000, sClimbGridNo;
|
||||
INT32 sPathCost, sClosestFriend = NOWHERE, sShortestPath = 1000, sClimbGridNo;
|
||||
BOOLEAN fClimbingNecessary, fClosestClimbingNecessary = FALSE;
|
||||
SOLDIERTYPE *pFriend;
|
||||
|
||||
@@ -1626,8 +1630,8 @@ INT16 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbin
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (sClosestFriend != NOWHERE)
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (!TileIsOutOfBounds(sClosestFriend))
|
||||
{
|
||||
AINumMessage("CLOSEST FRIEND is at gridno ",sClosestFriend);
|
||||
}
|
||||
@@ -1701,7 +1705,7 @@ INT16 DistanceToClosestFriend( SOLDIERTYPE * pSoldier )
|
||||
return( sMinDist );
|
||||
}
|
||||
|
||||
BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
if (WaterTooDeepForAttacks( sGridNo ))
|
||||
{
|
||||
@@ -1715,13 +1719,8 @@ BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
}
|
||||
|
||||
// tear/mustard gas
|
||||
//if ( (gpWorldLevelData[sGridNo].ubExtFlags[ pSoldier->pathing.bLevel ] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
// (pSoldier->inv[HEAD1POS].usItem != GASMASK && pSoldier->inv[HEAD2POS].usItem != GASMASK) )
|
||||
if ( (gpWorldLevelData[sGridNo].ubExtFlags[ pSoldier->pathing.bLevel ] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
FindGasMask(pSoldier) == NO_SLOT )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if((gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS|MAPELEMENT_EXT_MUSTARDGAS)) && !DoesSoldierWearGasMask(pSoldier))//dnl ch40 200909
|
||||
return(TRUE);
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[ pSoldier->pathing.bLevel ] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -1730,22 +1729,11 @@ BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// smoke
|
||||
if (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_SMOKE)
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
// tear/mustard gas
|
||||
//if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
// (pSoldier->inv[HEAD1POS].usItem != GASMASK && pSoldier->inv[HEAD2POS].usItem != GASMASK) )
|
||||
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
FindGasMask(pSoldier) == NO_SLOT )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
// smoke/tear/mustard gas
|
||||
if((gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_SMOKE|MAPELEMENT_EXT_TEARGAS|MAPELEMENT_EXT_MUSTARDGAS)) && !DoesSoldierWearGasMask(pSoldier))//dnl ch40 230909
|
||||
return(TRUE);
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -1755,7 +1743,7 @@ BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridNo)
|
||||
INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
{
|
||||
if (WaterTooDeepForAttacks( sGridNo ))
|
||||
{
|
||||
@@ -1763,11 +1751,8 @@ INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridNo)
|
||||
}
|
||||
|
||||
// tear/mustard gas
|
||||
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
FindGasMask(pSoldier) == NO_SLOT )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if((gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS|MAPELEMENT_EXT_MUSTARDGAS)) && !DoesSoldierWearGasMask(pSoldier))//dnl ch40 200909
|
||||
return(TRUE);
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -1776,14 +1761,11 @@ INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridNo)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// tear/mustard gas
|
||||
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
FindGasMask(pSoldier) == NO_SLOT )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
if((gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS|MAPELEMENT_EXT_MUSTARDGAS)) && !DoesSoldierWearGasMask(pSoldier))//dnl ch40 200909
|
||||
return(TRUE);
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -1823,7 +1805,7 @@ BOOLEAN WearGasMaskIfAvailable( SOLDIERTYPE * pSoldier )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN InLightAtNight( INT16 sGridNo, INT8 bLevel )
|
||||
BOOLEAN InLightAtNight( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
UINT8 ubBackgroundLightLevel;
|
||||
|
||||
@@ -2113,7 +2095,7 @@ INT8 CalcMorale(SOLDIERTYPE *pSoldier)
|
||||
return(bMoraleCategory);
|
||||
}
|
||||
|
||||
INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT16 sMyGrid, UINT8 ubReduceForCover, SOLDIERTYPE * pMe )
|
||||
INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT32 sMyGrid, UINT8 ubReduceForCover, SOLDIERTYPE * pMe )
|
||||
{
|
||||
INT32 iThreatValue = 0;
|
||||
BOOLEAN fForCreature = CREATURE_OR_BLOODCAT( pMe );
|
||||
@@ -2182,8 +2164,8 @@ INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT16 sMyGrid, UINT8 ubReduceForC
|
||||
iThreatValue -= pEnemy->aiData.bShock;
|
||||
}
|
||||
|
||||
// if I have a specifically defined spot where I'm at (sometime I don't!)
|
||||
if (sMyGrid != NOWHERE)
|
||||
// if I have a specifically defined spot where I'm at (sometime I don't!)
|
||||
if (!TileIsOutOfBounds(sMyGrid))
|
||||
{
|
||||
// ADD 10% if man's already been shooting at me
|
||||
if (pEnemy->sLastTarget == sMyGrid)
|
||||
@@ -2203,8 +2185,8 @@ INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT16 sMyGrid, UINT8 ubReduceForC
|
||||
// if this man is conscious
|
||||
if (pEnemy->stats.bLife >= OKLIFE)
|
||||
{
|
||||
// and we were told to reduce threat for my cover
|
||||
if (ubReduceForCover && (sMyGrid != NOWHERE))
|
||||
// and we were told to reduce threat for my cover
|
||||
if (ubReduceForCover && (!TileIsOutOfBounds(sMyGrid)))
|
||||
{
|
||||
// Reduce iThreatValue to same % as the chance HE has shoot through at ME
|
||||
//iThreatValue = (iThreatValue * ChanceToGetThrough( pEnemy, myGrid, FAKE, ACTUAL, TESTWALLS, 9999, M9PISTOL, NOT_FOR_LOS)) / 100;
|
||||
@@ -2251,7 +2233,7 @@ INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT16 sMyGrid, UINT8 ubReduceForC
|
||||
return(iThreatValue);
|
||||
}
|
||||
|
||||
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT16 * pusFromGridNo)
|
||||
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 * pusFromGridNo)
|
||||
{
|
||||
if ( CREATURE_OR_BLOODCAT( pSoldier ) )
|
||||
{
|
||||
|
||||
@@ -389,9 +389,9 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns
|
||||
}
|
||||
|
||||
// JA2Gold: added
|
||||
BOOLEAN CloseEnoughForGrenadeToss( INT16 sGridNo, INT16 sGridNo2 )
|
||||
BOOLEAN CloseEnoughForGrenadeToss( INT32 sGridNo, INT32 sGridNo2 )
|
||||
{
|
||||
INT16 sTempGridNo;
|
||||
INT32 sTempGridNo;
|
||||
UINT8 ubDirection;
|
||||
INT16 sXPos, sYPos, sXPos2, sYPos2;
|
||||
UINT8 ubMovementCost;
|
||||
@@ -459,7 +459,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
||||
UINT8 ubLoop, ubLoop2;
|
||||
INT32 iAttackValue;
|
||||
INT32 iHitRate, iThreatValue, iTotalThreatValue,iOppThreatValue[MAXMERCS];
|
||||
INT16 sGridNo, sEndGridNo, sFriendTile[MAXMERCS], sOpponentTile[MAXMERCS];
|
||||
INT32 sGridNo, sEndGridNo, sFriendTile[MAXMERCS], sOpponentTile[MAXMERCS];
|
||||
INT8 bFriendLevel[MAXMERCS], bOpponentLevel[MAXMERCS];
|
||||
INT32 iEstDamage;
|
||||
UINT8 ubFriendCnt = 0,ubOpponentCnt = 0, ubOpponentID[MAXMERCS];
|
||||
@@ -1544,7 +1544,7 @@ void CalcTentacleAttack(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab )
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 NumMercsCloseTo( INT16 sGridNo, UINT8 ubMaxDist )
|
||||
UINT8 NumMercsCloseTo( INT32 sGridNo, UINT8 ubMaxDist )
|
||||
{
|
||||
INT8 bNumber = 0;
|
||||
UINT32 uiLoop;
|
||||
@@ -1705,14 +1705,14 @@ INT32 EstimateShotDamage(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 ub
|
||||
return( iDamage );
|
||||
}
|
||||
|
||||
INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *pOpponent, INT16 sGridno )
|
||||
INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *pOpponent, INT32 sGridNo )
|
||||
{
|
||||
UINT16 ubExplosiveIndex;
|
||||
INT32 iExplosDamage, iBreathDamage, iArmourAmount, iDamage = 0;
|
||||
INT8 bSlot;
|
||||
|
||||
|
||||
if( pSoldier == NULL || pOpponent == NULL || ubItemPos > pSoldier->inv.size() || sGridno > NUMBEROFTILES )
|
||||
if( pSoldier == NULL || pOpponent == NULL || ubItemPos > pSoldier->inv.size() || sGridNo > NUMBEROFTILES )
|
||||
return 0;
|
||||
|
||||
if( pSoldier->inv[ubItemPos].exists() == false )
|
||||
@@ -1762,7 +1762,7 @@ INT32 EstimateThrowDamage( SOLDIERTYPE *pSoldier, UINT8 ubItemPos, SOLDIERTYPE *
|
||||
if ( Explosive[ ubExplosiveIndex ].ubType == EXPLOSV_TEARGAS || Explosive[ ubExplosiveIndex ].ubType == EXPLOSV_MUSTGAS )
|
||||
{
|
||||
// if target gridno is outdoors (where tear gas lasts only 1-2 turns)
|
||||
if (gpWorldLevelData[sGridno].ubTerrainID != FLAT_FLOOR)
|
||||
if (gpWorldLevelData[sGridNo].ubTerrainID != FLAT_FLOOR)
|
||||
iBreathDamage /= 2; // reduce effective breath damage by 1/2
|
||||
|
||||
bSlot = FindObj( pOpponent, GASMASK );
|
||||
@@ -1777,7 +1777,7 @@ 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)
|
||||
if (gpWorldLevelData[sGridNo].ubTerrainID != FLAT_FLOOR)
|
||||
iBreathDamage /= 2; // reduce effective breath damage by 1/2
|
||||
}
|
||||
else if (iExplosDamage)
|
||||
|
||||
@@ -216,8 +216,8 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
|
||||
if ( /*bInWater || */ bInGas)
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -285,8 +285,8 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
|
||||
if ( /*bInWater ||*/ ((INT16) PreRandom(100) < iChance))
|
||||
{
|
||||
pSoldier->aiData.usActionData = RandDestWithinRange(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -443,7 +443,7 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
// monster AI - heard something
|
||||
UINT8 ubNoiseDir;
|
||||
INT16 sNoiseGridNo;
|
||||
INT32 sNoiseGridNo;
|
||||
INT32 iNoiseValue;
|
||||
INT32 iChance, iSneaky;
|
||||
BOOLEAN fClimb;
|
||||
@@ -458,8 +458,8 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
|
||||
// determine the most important noise heard, and its relative value
|
||||
sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue,&fClimb, &fReachable);
|
||||
//NumMessage("iNoiseValue = ",iNoiseValue);
|
||||
|
||||
if (sNoiseGridNo == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(sNoiseGridNo))
|
||||
{
|
||||
// then we have no business being under YELLOW status any more!
|
||||
#ifdef RECORDNET
|
||||
@@ -564,8 +564,8 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
|
||||
if ((INT16) PreRandom(100) < iChance)
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sNoiseGridNo, AI_ACTION_SEEK_NOISE);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -603,14 +603,14 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
|
||||
INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
{
|
||||
// monster AI - hostile mammals somewhere around!
|
||||
INT16 iChance, sClosestOpponent /*,sClosestOpponent,sClosestFriend*/;
|
||||
INT16 sClosestDisturbance;
|
||||
INT16 sDistVisible;
|
||||
INT32 iChance, sClosestOpponent /*,sClosestOpponent,sClosestFriend*/;
|
||||
INT32 sClosestDisturbance;
|
||||
INT32 sDistVisible;
|
||||
UINT8 ubCanMove,ubOpponentDir;
|
||||
//INT8 bInWater;
|
||||
INT8 bInGas;
|
||||
INT8 bSeekPts = 0, bHelpPts = 0, bHidePts = 0;
|
||||
INT16 sAdjustedGridNo;
|
||||
INT32 sAdjustedGridNo;
|
||||
BOOLEAN fChangeLevel;
|
||||
|
||||
// if we have absolutely no action points, we can't do a thing under RED!
|
||||
@@ -643,8 +643,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
if (bInGas && ubCanMove)
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -742,8 +742,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
// probably a baby bug... run away! run away!
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return(AI_ACTION_RUN_AWAY);
|
||||
}
|
||||
@@ -765,8 +765,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier, pSoldier->aiData.sCallerGridNo, -1, AI_ACTION_SEEK_FRIEND, FLAG_STOPSHORT);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -781,8 +781,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
|
||||
// get the location of the closest reachable opponent
|
||||
sClosestDisturbance = ClosestReachableDisturbance(pSoldier,ubUnconsciousOK, &fChangeLevel);
|
||||
// if there is an opponent reachable
|
||||
if (sClosestDisturbance != NOWHERE)
|
||||
// if there is an opponent reachable
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// SEEK CLOSEST DISTURBANCE: GO DIRECTLY TOWARDS CLOSEST KNOWN OPPONENT
|
||||
@@ -791,8 +791,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
// try to move towards him
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sClosestDisturbance,AI_ACTION_SEEK_OPPONENT);
|
||||
|
||||
// if it's possible
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
// if it's possible
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
// do it!
|
||||
@@ -815,7 +815,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
// need smell/visibility check?
|
||||
if (PythSpacesAway( pSoldier->sGridNo, pSoldier->aiData.usActionData) < MAX_EAT_DIST )
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
sGridNo = FindAdjacentGridEx( pSoldier, pSoldier->aiData.usActionData, &ubOpponentDir, &sAdjustedGridNo, FALSE, FALSE );
|
||||
|
||||
@@ -844,8 +844,8 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
// determine the location of the known closest opponent
|
||||
// (don't care if he's conscious, don't care if he's reachable at all)
|
||||
sClosestOpponent = ClosestKnownOpponent(pSoldier, NULL, NULL);
|
||||
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
// determine direction from this soldier to the closest opponent
|
||||
ubOpponentDir = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sClosestOpponent),CenterY(sClosestOpponent));
|
||||
@@ -907,8 +907,9 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
// monster AI - hostile mammals in sense range
|
||||
INT16 sClosestOpponent,sBestCover = NOWHERE;
|
||||
INT16 sClosestDisturbance,ubMinAPCost;
|
||||
INT32 sClosestOpponent,sBestCover = NOWHERE;
|
||||
INT32 sClosestDisturbance;
|
||||
INT16 ubMinAPCost;
|
||||
UINT8 ubCanMove/*,bInWater*/,bInGas;
|
||||
INT8 bDirection;
|
||||
UINT8 ubBestAttackAction;
|
||||
@@ -1013,8 +1014,8 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -1038,7 +1039,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -1161,8 +1162,8 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
// get the location of the closest CONSCIOUS reachable opponent
|
||||
sClosestDisturbance = ClosestReachableDisturbance(pSoldier,FALSE,&fChangeLevel);
|
||||
|
||||
// if we found one
|
||||
if (sClosestDisturbance != NOWHERE)
|
||||
// if we found one
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
// don't bother checking GRENADES/KNIVES, he can't have conscious targets
|
||||
#ifdef RECORDNET
|
||||
@@ -1379,15 +1380,15 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
// determine the location of the known closest opponent
|
||||
// (don't care if he's conscious, don't care if he's reachable at all)
|
||||
sClosestOpponent = ClosestKnownOpponent(pSoldier, NULL, NULL);
|
||||
// if we have a closest reachable opponent
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
// if we have a closest reachable opponent
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
if ( ubCanMove && PythSpacesAway( pSoldier->sGridNo, sClosestOpponent ) > 2 )
|
||||
{
|
||||
if ( bSpitIn != NO_SLOT )
|
||||
{
|
||||
pSoldier->aiData.usActionData = AdvanceToFiringRange( pSoldier, sClosestOpponent );
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
pSoldier->aiData.usActionData = AdvanceToFiringRange( pSoldier, sClosestOpponent );
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sClosestOpponent,AI_ACTION_SEEK_OPPONENT);
|
||||
}
|
||||
@@ -1401,8 +1402,8 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
pSoldier->aiData.usActionData = NOWHERE;
|
||||
}
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE) // charge!
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData)) // charge!
|
||||
{
|
||||
return( AI_ACTION_SEEK_OPPONENT );
|
||||
}
|
||||
@@ -1435,8 +1436,8 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
//pSoldier->aiData.usActionData = RunAway( pSoldier );
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return(AI_ACTION_RUN_AWAY);
|
||||
}
|
||||
@@ -1585,8 +1586,8 @@ void CreatureDecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
// if we are NOT aware of any uninvestigated noises right now
|
||||
// and we are not currently in the middle of an action
|
||||
// (could still be on his way heading to investigate a noise!)
|
||||
if ((MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) == NOWHERE) && !pSoldier->aiData.bActionInProgress)
|
||||
// (could still be on his way heading to investigate a noise!)
|
||||
if (( TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy))) && !pSoldier->aiData.bActionInProgress)
|
||||
{
|
||||
// then drop back to GREEN status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
@@ -1602,8 +1603,8 @@ void CreatureDecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we ARE aware of any uninvestigated noises right now
|
||||
if (MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) != NOWHERE)
|
||||
// if we ARE aware of any uninvestigated noises right now
|
||||
if ( !TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy)))
|
||||
{
|
||||
// then move up to YELLOW status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_YELLOW;
|
||||
@@ -1656,9 +1657,9 @@ void CreatureDecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
// force a NEW decision so that he can get some rest
|
||||
SetNewSituation( pSoldier );
|
||||
|
||||
// current action will be canceled. if noise is no longer important
|
||||
// current action will be canceled. if noise is no longer important
|
||||
if ((pSoldier->aiData.bAlertStatus == STATUS_YELLOW) &&
|
||||
(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) == NOWHERE))
|
||||
(TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy))))
|
||||
{
|
||||
// then drop back to GREEN status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
@@ -1690,14 +1691,14 @@ INT8 CrowDecideActionRed( SOLDIERTYPE * pSoldier )
|
||||
|
||||
INT8 CrowDecideActionGreen( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT16 sCorpseGridNo;
|
||||
INT32 sCorpseGridNo;
|
||||
UINT8 ubDirection;
|
||||
INT16 sFacingDir;
|
||||
|
||||
// Look for a corse!
|
||||
sCorpseGridNo = FindNearestRottingCorpse( pSoldier );
|
||||
|
||||
if ( sCorpseGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sCorpseGridNo))
|
||||
{
|
||||
// Are we close, if so , peck!
|
||||
if ( SpacesAway( pSoldier->sGridNo, sCorpseGridNo ) < 2 )
|
||||
@@ -1723,8 +1724,8 @@ INT8 CrowDecideActionGreen( SOLDIERTYPE * pSoldier )
|
||||
else
|
||||
{
|
||||
// Walk to nearest one!
|
||||
pSoldier->aiData.usActionData = FindGridNoFromSweetSpot( pSoldier, sCorpseGridNo, 4, &ubDirection );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
pSoldier->aiData.usActionData = FindGridNoFromSweetSpot( pSoldier, sCorpseGridNo, 4, &ubDirection );
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return( AI_ACTION_GET_CLOSER );
|
||||
}
|
||||
|
||||
+190
-161
@@ -72,7 +72,7 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
SCHEDULENODE * pSchedule;
|
||||
INT32 iScheduleIndex;
|
||||
UINT8 ubScheduleAction;
|
||||
UINT16 usGridNo1, usGridNo2;
|
||||
INT32 usGridNo1, usGridNo2;
|
||||
INT16 sX, sY;
|
||||
INT8 bDirection;
|
||||
STRUCTURE * pStructure;
|
||||
@@ -140,8 +140,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
case 1:
|
||||
// start the door open: find the door...
|
||||
usGridNo1 = FindDoorAtGridNoOrAdjacent( usGridNo1 );
|
||||
|
||||
if ( usGridNo1 == NOWHERE )
|
||||
|
||||
if (TileIsOutOfBounds(usGridNo1))
|
||||
{
|
||||
// do nothing right now!
|
||||
return( AI_ACTION_NONE );
|
||||
@@ -205,13 +205,13 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
pSoldier->bAIScheduleProgress++;
|
||||
// fall through
|
||||
|
||||
case 2:
|
||||
if (pSoldier->sGridNo == usGridNo2 || pSoldier->sGridNo == NOWHERE)
|
||||
case 2:
|
||||
if (pSoldier->sGridNo == usGridNo2 || TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
// NOWHERE indicates we were supposed to go off map and have done so
|
||||
DoneScheduleAction( pSoldier );
|
||||
|
||||
if ( pSoldier->sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
pSoldier->aiData.sPatrolGrid[0] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -256,8 +256,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
case 1:
|
||||
// start the door open: find the door...
|
||||
usGridNo1 = FindDoorAtGridNoOrAdjacent( usGridNo1 );
|
||||
|
||||
if ( usGridNo1 == NOWHERE )
|
||||
|
||||
if (TileIsOutOfBounds(usGridNo1))
|
||||
{
|
||||
// do nothing right now!
|
||||
return( AI_ACTION_NONE );
|
||||
@@ -350,12 +350,12 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
pSoldier->bAIScheduleProgress++;
|
||||
// fall through
|
||||
|
||||
case 2:
|
||||
if (pSoldier->sGridNo == usGridNo2 || pSoldier->sGridNo == NOWHERE)
|
||||
case 2:
|
||||
if (pSoldier->sGridNo == usGridNo2 || TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
// NOWHERE indicates we were supposed to go off map and have done so
|
||||
DoneScheduleAction( pSoldier );
|
||||
if ( pSoldier->sGridNo != NOWHERE )
|
||||
DoneScheduleAction( pSoldier );
|
||||
if (!TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
pSoldier->aiData.sPatrolGrid[0] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -380,8 +380,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
if ( pSoldier->sGridNo == usGridNo1 )
|
||||
{
|
||||
// done!
|
||||
DoneScheduleAction( pSoldier );
|
||||
if ( pSoldier->sGridNo != NOWHERE )
|
||||
DoneScheduleAction( pSoldier );
|
||||
if (!TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
pSoldier->aiData.sPatrolGrid[0] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -401,8 +401,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
case 0: // start the action
|
||||
|
||||
pSoldier->aiData.usActionData = FindNearestEdgePoint( pSoldier->sGridNo );
|
||||
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Civilian could not find path to map edge!" );
|
||||
@@ -428,7 +428,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
case 1: // near edge
|
||||
|
||||
pSoldier->aiData.usActionData = FindNearbyPointOnEdgeOfMap( pSoldier, &bDirection );
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
// what the heck??
|
||||
// ABORT!
|
||||
@@ -475,7 +476,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
if (pSoldier->sGridNo == usGridNo1)
|
||||
{
|
||||
DoneScheduleAction( pSoldier );
|
||||
if ( pSoldier->sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
pSoldier->aiData.sPatrolGrid[0] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -513,7 +515,8 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
// Sleep
|
||||
pSoldier->aiData.fAIFlags |= AI_ASLEEP;
|
||||
DoneScheduleAction( pSoldier );
|
||||
if ( pSoldier->sGridNo != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->sGridNo))
|
||||
{
|
||||
pSoldier->aiData.sPatrolGrid[0] = pSoldier->sGridNo;
|
||||
}
|
||||
@@ -534,7 +537,7 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
|
||||
INT8 DecideActionBoxerEnteringRing(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
UINT8 ubRoom;
|
||||
INT16 sDesiredMercLoc;
|
||||
INT32 sDesiredMercLoc;
|
||||
UINT8 ubDesiredMercDir;
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -546,7 +549,8 @@ INT8 DecideActionBoxerEnteringRing(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// look towards nearest player
|
||||
sDesiredMercLoc = ClosestPC( pSoldier, NULL );
|
||||
if ( sDesiredMercLoc != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sDesiredMercLoc))
|
||||
{
|
||||
// see if we are facing this person
|
||||
ubDesiredMercDir = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sDesiredMercLoc),CenterY(sDesiredMercLoc));
|
||||
@@ -580,10 +584,10 @@ INT8 DecideActionBoxerEnteringRing(SOLDIERTYPE *pSoldier)
|
||||
|
||||
INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT16 sDesiredMercLoc;
|
||||
INT32 sDesiredMercLoc;
|
||||
UINT8 ubDesiredMercDir;
|
||||
UINT8 ubDesiredMerc;
|
||||
INT16 sDesiredMercDist;
|
||||
INT32 sDesiredMercDist;
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
#endif
|
||||
@@ -596,7 +600,8 @@ INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
|
||||
if (pSoldier->ubQuoteRecord && pSoldier->ubQuoteActionID == QUOTE_ACTION_ID_TURNTOWARDSPLAYER )
|
||||
{
|
||||
sDesiredMercLoc = ClosestPC( pSoldier, &sDesiredMercDist );
|
||||
if (sDesiredMercLoc != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sDesiredMercLoc))
|
||||
{
|
||||
if ( sDesiredMercDist <= NPC_TALK_RADIUS * 2)
|
||||
{
|
||||
@@ -636,7 +641,8 @@ INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
|
||||
// CHECK TO SEE IF WE WANT TO GO UP TO PERSON AND SAY SOMETHING
|
||||
///////////////
|
||||
pSoldier->aiData.usActionData = NPCConsiderInitiatingConv( pSoldier, &ubDesiredMerc );
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return( AI_ACTION_APPROACH_MERC );
|
||||
}
|
||||
@@ -651,7 +657,8 @@ INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
|
||||
case OLGA:
|
||||
case TYRONE:
|
||||
sDesiredMercLoc = ClosestPC( pSoldier, &sDesiredMercDist );
|
||||
if (sDesiredMercLoc != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sDesiredMercLoc))
|
||||
{
|
||||
if ( sDesiredMercDist <= NPC_TALK_RADIUS * 2 )
|
||||
{
|
||||
@@ -663,7 +670,8 @@ INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards( pSoldier, sDesiredMercLoc, AI_ACTION_APPROACH_MERC );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return( AI_ACTION_APPROACH_MERC );
|
||||
}
|
||||
@@ -738,7 +746,9 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
// character then didn't trigger the end of boxing record
|
||||
// (and we know from the if statement above that we're
|
||||
// still in a boxing state of some sort...)
|
||||
// HEADROCK HAM 3.6: The NULL here causes issues of non-payment!
|
||||
//TriggerEndOfBoxingRecord( NULL );
|
||||
|
||||
// HEADROCK HAM 3.6: This should trigger Darren's script
|
||||
TriggerEndOfBoxingRecord( pSoldier );
|
||||
}
|
||||
}
|
||||
@@ -893,8 +903,8 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
if (bInWater || bInGas)
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -997,8 +1007,8 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
pSoldier->aiData.usActionData = FindClosestClimbPoint(pSoldier, fUp );
|
||||
// Added the check here because sniper militia who are locked inside of a building without keys
|
||||
// will still have a >100% chance to want to climb, which means an infinite loop. In fact, any
|
||||
// time a move is desired, there probably also will be a need to check for a path.
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE &&
|
||||
// time a move is desired, there probably also will be a need to check for a path.
|
||||
if ( !TileIsOutOfBounds(pSoldier->aiData.usActionData) &&
|
||||
LegalNPCDestination(pSoldier,pSoldier->aiData.usActionData,ENSURE_PATH,WATEROK, 0 ))
|
||||
{
|
||||
return( AI_ACTION_MOVE_TO_CLIMB );
|
||||
@@ -1068,13 +1078,13 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
if (bInWater || ((INT16) PreRandom(100) < iChance))
|
||||
{
|
||||
pSoldier->aiData.usActionData = RandDestWithinRange(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards( pSoldier, pSoldier->aiData.usActionData, AI_ACTION_RANDOM_PATROL );
|
||||
}
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - RANDOM PATROL to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -1242,15 +1252,15 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
INT32 iNoiseValue;
|
||||
BOOLEAN fClimb;
|
||||
BOOLEAN fReachable;
|
||||
INT16 sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue, &fClimb, &fReachable);
|
||||
INT32 sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue, &fClimb, &fReachable);
|
||||
UINT8 ubNoiseDir;
|
||||
|
||||
if (sNoiseGridNo == NOWHERE ||
|
||||
|
||||
if (TileIsOutOfBounds(sNoiseGridNo) ||
|
||||
(ubNoiseDir = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sNoiseGridNo),CenterY(sNoiseGridNo))
|
||||
) == pSoldier->ubDirection )
|
||||
|
||||
{
|
||||
pSoldier->aiData.usActionData = (UINT16)PreRandom(8);
|
||||
pSoldier->aiData.usActionData = PreRandom(8);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1298,10 +1308,10 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT32 iDummy;
|
||||
UINT8 ubNoiseDir;
|
||||
INT16 sNoiseGridNo;
|
||||
INT32 sNoiseGridNo;
|
||||
INT32 iNoiseValue;
|
||||
INT32 iChance, iSneaky;
|
||||
INT16 sClosestFriend;
|
||||
INT32 sClosestFriend;
|
||||
BOOLEAN fCivilian = (PTR_CIVILIAN && (pSoldier->ubCivilianGroup == NON_CIV_GROUP || pSoldier->aiData.bNeutral || (pSoldier->ubBodyType >= FATCIV && pSoldier->ubBodyType <= CRIPPLECIV) ) );
|
||||
BOOLEAN fClimb;
|
||||
BOOLEAN fReachable;
|
||||
@@ -1339,8 +1349,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
// determine the most important noise heard, and its relative value
|
||||
sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue, &fClimb, &fReachable);
|
||||
//NumMessage("iNoiseValue = ",iNoiseValue);
|
||||
|
||||
if (sNoiseGridNo == NOWHERE)
|
||||
|
||||
if (TileIsOutOfBounds(sNoiseGridNo))
|
||||
{
|
||||
// then we have no business being under YELLOW status any more!
|
||||
#ifdef RECORDNET
|
||||
@@ -1480,8 +1490,9 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
//continue flanking
|
||||
INT16 tempGridNo;
|
||||
if ( sNoiseGridNo == NOWHERE )
|
||||
INT32 tempGridNo;
|
||||
|
||||
if (TileIsOutOfBounds(sNoiseGridNo))
|
||||
tempGridNo = pSoldier->lastFlankSpot;
|
||||
else
|
||||
tempGridNo = sNoiseGridNo;
|
||||
@@ -1502,8 +1513,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_LEFT);
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE ) //&& (currDir - origDir) < 2 )
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_LEFT);
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData) ) //&& (currDir - origDir) < 2 )
|
||||
return AI_ACTION_FLANK_LEFT ;
|
||||
else
|
||||
pSoldier->numFlanks = MAX_FLANKS_YELLOW;
|
||||
@@ -1520,8 +1531,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_RIGHT);
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )//&& (origDir - currDir) < 2 )
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_RIGHT);
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))//&& (origDir - currDir) < 2 )
|
||||
return AI_ACTION_FLANK_RIGHT ;
|
||||
else
|
||||
pSoldier->numFlanks = MAX_FLANKS_YELLOW;
|
||||
@@ -1617,8 +1628,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sNoiseGridNo,AI_ACTION_SEEK_NOISE);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - INVESTIGATING NOISE at grid %d, moving to %d",
|
||||
@@ -1650,8 +1661,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
else
|
||||
{
|
||||
// pSoldier->aiData.usActionData = FindClosestClimbPoint(pSoldier, pSoldier->sGridNo , sNoiseGridNo , fUp );
|
||||
pSoldier->aiData.usActionData = sNoiseGridNo;
|
||||
//if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
pSoldier->aiData.usActionData = sNoiseGridNo;
|
||||
//if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return( AI_ACTION_MOVE_TO_CLIMB );
|
||||
}
|
||||
@@ -1684,8 +1695,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
return AI_ACTION_SEEK_NOISE ;
|
||||
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, sNoiseGridNo, action );
|
||||
|
||||
if ( pSoldier->aiData.usActionData == NOWHERE || pSoldier->numFlanks >= MAX_FLANKS_YELLOW )
|
||||
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData) || pSoldier->numFlanks >= MAX_FLANKS_YELLOW )
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sNoiseGridNo,AI_ACTION_SEEK_NOISE);
|
||||
//pSoldier->numFlanks = 0;
|
||||
@@ -1723,8 +1734,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
|
||||
sClosestFriend = ClosestReachableFriendInTrouble(pSoldier, &fClimb);
|
||||
|
||||
// if there is a friend alive & reachable who last radioed in
|
||||
if (sClosestFriend != NOWHERE)
|
||||
// if there is a friend alive & reachable who last radioed in
|
||||
if (!TileIsOutOfBounds(sClosestFriend))
|
||||
{
|
||||
// there a chance enemy soldier choose to go "help" his friend
|
||||
iChance = 50 - SpacesAway(pSoldier->sGridNo,sClosestFriend);
|
||||
@@ -1762,8 +1773,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
if ((INT16)PreRandom(100) < iChance)
|
||||
{
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sClosestFriend,AI_ACTION_SEEK_FRIEND);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
|
||||
@@ -1794,8 +1805,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
else
|
||||
{
|
||||
//pSoldier->aiData.usActionData = FindClosestClimbPoint(pSoldier, pSoldier->sGridNo , sClosestFriend , fUp );
|
||||
pSoldier->aiData.usActionData = sClosestFriend;
|
||||
//if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
pSoldier->aiData.usActionData = sClosestFriend;
|
||||
//if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
return( AI_ACTION_MOVE_TO_CLIMB );
|
||||
}
|
||||
@@ -1862,8 +1873,8 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
pSoldier->aiData.bAIMorale = CalcMorale( pSoldier );
|
||||
pSoldier->aiData.usActionData = FindBestNearbyCover(pSoldier,pSoldier->aiData.bAIMorale,&iDummy);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - TAKING COVER at grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -1933,8 +1944,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
{
|
||||
INT8 bActionReturned;
|
||||
INT32 iDummy;
|
||||
INT16 iChance,sClosestOpponent,sClosestFriend;
|
||||
INT16 sClosestDisturbance, sDistVisible, sCheckGridNo;
|
||||
INT32 iChance,sClosestOpponent,sClosestFriend;
|
||||
INT32 sClosestDisturbance, sDistVisible, sCheckGridNo;
|
||||
UINT8 ubCanMove,ubOpponentDir;
|
||||
INT8 bInWater, bInDeepWater, bInGas;
|
||||
INT8 bSeekPts = 0, bHelpPts = 0, bHidePts = 0, bWatchPts = 0;
|
||||
@@ -2021,6 +2032,9 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
}
|
||||
}
|
||||
|
||||
if(WearGasMaskIfAvailable(pSoldier))//dnl ch40 200909
|
||||
bInGas = InGasOrSmoke(pSoldier, pSoldier->sGridNo);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// WHEN IN GAS, GO TO NEAREST REACHABLE SPOT OF UNGASSED LAND
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -2028,8 +2042,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
if (bInGas && ubCanMove)
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -2060,8 +2074,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
else
|
||||
{
|
||||
// set up next action to run away
|
||||
pSoldier->aiData.usNextActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
if ( pSoldier->aiData.usNextActionData != NOWHERE )
|
||||
pSoldier->aiData.usNextActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usNextActionData))
|
||||
{
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_RUN_AWAY;
|
||||
pSoldier->aiData.usActionData = ANIM_STAND;
|
||||
@@ -2127,8 +2141,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
else
|
||||
{
|
||||
// set up next action to run away
|
||||
pSoldier->aiData.usNextActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
if ( pSoldier->aiData.usNextActionData != NOWHERE )
|
||||
pSoldier->aiData.usNextActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usNextActionData))
|
||||
{
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_RUN_AWAY;
|
||||
pSoldier->aiData.usActionData = ANIM_STAND;
|
||||
@@ -2177,8 +2191,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// IF POSSIBLE, FIRE LONG RANGE WEAPONS AT TARGETS REPORTED BY RADIO
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
if(!is_networked)//hayden
|
||||
{
|
||||
//if(!is_networked)//hayden
|
||||
//{
|
||||
// can't do this in realtime, because the player could be shooting a gun or whatever at the same time!
|
||||
if (gfTurnBasedAI && !fCivilian && !bInWater && !bInGas && !(pSoldier->flags.uiStatusFlags & SOLDIER_BOXER) && (CanNPCAttack(pSoldier) == TRUE))
|
||||
{
|
||||
@@ -2223,7 +2237,7 @@ if(!is_networked)//hayden
|
||||
sCheckGridNo = NewGridNo( pSoldier->sGridNo, DirectionInc( gOppositeDirection[ ubOpponentDir ] ) );
|
||||
if ( OKFallDirection( pSoldier, sCheckGridNo, pSoldier->pathing.bLevel, gOppositeDirection[ ubOpponentDir ], pSoldier->usAnimState ) )
|
||||
{
|
||||
pSoldier->aiData.usActionData = (UINT16) sCheckGridNo;
|
||||
pSoldier->aiData.usActionData = sCheckGridNo;
|
||||
|
||||
return( AI_ACTION_GET_CLOSER );
|
||||
}
|
||||
@@ -2259,7 +2273,7 @@ if(!is_networked)//hayden
|
||||
}
|
||||
}
|
||||
|
||||
}//hayden
|
||||
//}//hayden
|
||||
|
||||
|
||||
|
||||
@@ -2450,7 +2464,7 @@ if(!is_networked)//hayden
|
||||
if ( ubCanMove && InLightAtNight( pSoldier->sGridNo, pSoldier->pathing.bLevel ) && pSoldier->aiData.bOrders != STATIONARY )
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearbyDarkerSpot( pSoldier );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
// move as if leaving water or gas
|
||||
return( AI_ACTION_LEAVE_WATER_GAS );
|
||||
@@ -2507,8 +2521,8 @@ if(!is_networked)//hayden
|
||||
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -2615,8 +2629,9 @@ if(!is_networked)//hayden
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: check to continue flanking");
|
||||
// continue flanking
|
||||
INT16 tempGridNo;
|
||||
if ( sClosestDisturbance == NOWHERE )
|
||||
INT32 tempGridNo;
|
||||
|
||||
if (TileIsOutOfBounds(sClosestDisturbance))
|
||||
tempGridNo = pSoldier->lastFlankSpot;
|
||||
else
|
||||
tempGridNo = sClosestDisturbance;
|
||||
@@ -2639,7 +2654,8 @@ if(!is_networked)//hayden
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_LEFT);
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE ) //&& (currDir - origDir) < 2 )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData) ) //&& (currDir - origDir) < 2 )
|
||||
return AI_ACTION_FLANK_LEFT ;
|
||||
else
|
||||
pSoldier->numFlanks = MAX_FLANKS_RED;
|
||||
@@ -2657,7 +2673,8 @@ if(!is_networked)//hayden
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, tempGridNo , AI_ACTION_FLANK_RIGHT);
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )//&& (origDir - currDir) < 2 )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData) )//&& (origDir - currDir) < 2 )
|
||||
return AI_ACTION_FLANK_RIGHT ;
|
||||
else
|
||||
pSoldier->numFlanks = MAX_FLANKS_RED;
|
||||
@@ -2676,7 +2693,8 @@ if(!is_networked)//hayden
|
||||
{
|
||||
// reserve APs for a possible crouch plus a shot
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier, tempGridNo, (INT8) (MinAPsToAttack( pSoldier, tempGridNo, ADDTURNCOST) + APBPConstants[AP_CROUCH]), AI_ACTION_SEEK_OPPONENT, FLAG_CAUTIOUS );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
pSoldier->aiData.fAIFlags |= AI_CAUTIOUS;
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_END_TURN;
|
||||
@@ -2788,8 +2806,8 @@ if(!is_networked)//hayden
|
||||
guiRedSeekTimeTotal += (uiEndTime - uiStartTime);
|
||||
guiRedSeekCounter++;
|
||||
#endif
|
||||
// if there is an opponent reachable
|
||||
if (sClosestDisturbance != NOWHERE && gAnimControl[ pSoldier->usAnimState ].ubHeight != ANIM_PRONE )
|
||||
// if there is an opponent reachable
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance) && gAnimControl[ pSoldier->usAnimState ].ubHeight != ANIM_PRONE )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: seek opponent");
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -2798,8 +2816,8 @@ if(!is_networked)//hayden
|
||||
|
||||
// try to move towards him
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier,sClosestDisturbance,APBPConstants[AP_CROUCH],AI_ACTION_SEEK_OPPONENT,0);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
// Check for a trap
|
||||
if ( !ArmySeesOpponents() )
|
||||
@@ -2812,8 +2830,8 @@ if(!is_networked)//hayden
|
||||
}
|
||||
}
|
||||
|
||||
// if it's possible
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
// if it's possible
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
// do it!
|
||||
@@ -2852,8 +2870,8 @@ if(!is_networked)//hayden
|
||||
// necessary. The returned grid # in sClosestDisturbance is that climb point. So if climb is
|
||||
// set, then use sClosestDisturbance as is.
|
||||
//INT16 usClimbPoint = FindClosestClimbPoint(pSoldier, pSoldier->sGridNo , sClosestDisturbance , fUp );
|
||||
INT16 usClimbPoint = sClosestDisturbance;
|
||||
if ( usClimbPoint != NOWHERE )
|
||||
INT32 usClimbPoint = sClosestDisturbance;
|
||||
if (!TileIsOutOfBounds(usClimbPoint))
|
||||
{
|
||||
pSoldier->aiData.usActionData = usClimbPoint;
|
||||
return( AI_ACTION_MOVE_TO_CLIMB );
|
||||
@@ -2896,8 +2914,8 @@ if(!is_networked)//hayden
|
||||
return AI_ACTION_SEEK_OPPONENT ;
|
||||
|
||||
pSoldier->aiData.usActionData = FindFlankingSpot (pSoldier, sClosestDisturbance, action );
|
||||
|
||||
if ( pSoldier->aiData.usActionData == NOWHERE || pSoldier->numFlanks >= MAX_FLANKS_RED )
|
||||
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData) || pSoldier->numFlanks >= MAX_FLANKS_RED )
|
||||
{
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier,sClosestDisturbance,APBPConstants[AP_CROUCH], AI_ACTION_SEEK_OPPONENT,0);
|
||||
//pSoldier->numFlanks = 0;
|
||||
@@ -2905,7 +2923,8 @@ if(!is_networked)//hayden
|
||||
{
|
||||
// reserve APs for a possible crouch plus a shot
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier, sClosestDisturbance, (INT8) (MinAPsToAttack( pSoldier, sClosestDisturbance, ADDTURNCOST) + APBPConstants[AP_CROUCH]), AI_ACTION_SEEK_OPPONENT, FLAG_CAUTIOUS );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
pSoldier->aiData.fAIFlags |= AI_CAUTIOUS;
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_END_TURN;
|
||||
@@ -2942,7 +2961,8 @@ if(!is_networked)//hayden
|
||||
{
|
||||
// reserve APs for a possible crouch plus a shot
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier, sClosestDisturbance, (INT8) (MinAPsToAttack( pSoldier, sClosestDisturbance, ADDTURNCOST) + APBPConstants[AP_CROUCH]), AI_ACTION_SEEK_OPPONENT, FLAG_CAUTIOUS );
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
pSoldier->aiData.fAIFlags |= AI_CAUTIOUS;
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_END_TURN;
|
||||
@@ -3032,15 +3052,15 @@ if(!is_networked)//hayden
|
||||
guiRedHelpTimeTotal += (uiEndTime - uiStartTime);
|
||||
guiRedHelpCounter++;
|
||||
#endif
|
||||
|
||||
if (sClosestFriend != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestFriend))
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// GO DIRECTLY TOWARDS CLOSEST FRIEND UNDER FIRE OR WHO LAST RADIOED
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
pSoldier->aiData.usActionData = InternalGoAsFarAsPossibleTowards(pSoldier,sClosestFriend,APBPConstants[AP_CROUCH], AI_ACTION_SEEK_OPPONENT,0);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
|
||||
@@ -3071,8 +3091,8 @@ if(!is_networked)//hayden
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.usActionData = sClosestFriend;
|
||||
//INT16 sClimbPoint = FindClosestClimbPoint(pSoldier, pSoldier->sGridNo , sClosestFriend , fUp );
|
||||
//if ( sClimbPoint != NOWHERE )
|
||||
//INT32 sClimbPoint = FindClosestClimbPoint(pSoldier, pSoldier->sGridNo , sClosestFriend , fUp );
|
||||
//if (!TileIsOutOfBounds(sClimbPoint))
|
||||
{
|
||||
//pSoldier->aiData.usActionData = sClimbPoint;
|
||||
return( AI_ACTION_MOVE_TO_CLIMB );
|
||||
@@ -3102,8 +3122,8 @@ if(!is_networked)//hayden
|
||||
if ((bHidePts > -90) && (bHidePts >= bSeekPts) && (bHidePts >= bHelpPts) && (bHidePts >= bWatchPts ))
|
||||
{
|
||||
sClosestOpponent = ClosestKnownOpponent( pSoldier, NULL, NULL );
|
||||
// if an opponent is known (not necessarily reachable or conscious)
|
||||
if (!SkipCoverCheck && sClosestOpponent != NOWHERE )
|
||||
// if an opponent is known (not necessarily reachable or conscious)
|
||||
if (!SkipCoverCheck && !TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TAKE BEST NEARBY COVER FROM ALL KNOWN OPPONENTS
|
||||
@@ -3120,11 +3140,11 @@ if(!is_networked)//hayden
|
||||
guiRedHideCounter++;
|
||||
#endif
|
||||
|
||||
// let's be a bit cautious about going right up to a location without enough APs to shoot
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
// let's be a bit cautious about going right up to a location without enough APs to shoot
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
sClosestDisturbance = ClosestReachableDisturbance(pSoldier, ubUnconsciousOK, &fClimb);
|
||||
if ( sClosestDisturbance != NOWHERE && ( SpacesAway( pSoldier->aiData.usActionData, sClosestDisturbance ) < 5 || SpacesAway( pSoldier->aiData.usActionData, sClosestDisturbance ) + 5 < SpacesAway( pSoldier->sGridNo, sClosestDisturbance ) ) )
|
||||
sClosestDisturbance = ClosestReachableDisturbance(pSoldier, ubUnconsciousOK, &fClimb);
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance) && ( SpacesAway( pSoldier->aiData.usActionData, sClosestDisturbance ) < 5 || SpacesAway( pSoldier->aiData.usActionData, sClosestDisturbance ) + 5 < SpacesAway( pSoldier->sGridNo, sClosestDisturbance ) ) )
|
||||
{
|
||||
// either moving significantly closer or into very close range
|
||||
// ensure will we have enough APs for a possible crouch plus a shot
|
||||
@@ -3181,8 +3201,8 @@ if(!is_networked)//hayden
|
||||
{
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -3243,8 +3263,8 @@ if(!is_networked)//hayden
|
||||
// determine the location of the known closest opponent
|
||||
// (don't care if he's conscious, don't care if he's reachable at all)
|
||||
sClosestOpponent = ClosestKnownOpponent(pSoldier, NULL, NULL);
|
||||
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
// determine direction from this soldier to the closest opponent
|
||||
ubOpponentDir = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sClosestOpponent),CenterY(sClosestOpponent));
|
||||
@@ -3305,7 +3325,8 @@ if(!is_networked)//hayden
|
||||
if (!gfTurnBasedAI || GetAPsToLook( pSoldier ) <= pSoldier->bActionPoints)
|
||||
{
|
||||
sClosestDisturbance = MostImportantNoiseHeard( pSoldier, NULL, NULL, NULL );
|
||||
if ( sClosestDisturbance != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
ubOpponentDir = atan8( CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), CenterX( sClosestDisturbance ), CenterY( sClosestDisturbance ) );
|
||||
if ( pSoldier->ubDirection == ubOpponentDir )
|
||||
@@ -3397,8 +3418,8 @@ if(!is_networked)//hayden
|
||||
// SWITCH TO GREEN: soldier does ordinary regular patrol, seeks friends
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// if not in combat or under fire, and we COULD have moved, just chose not to
|
||||
if ( (pSoldier->aiData.bAlertStatus != STATUS_BLACK) && !pSoldier->aiData.bUnderFire && ubCanMove && (!gfTurnBasedAI || pSoldier->bActionPoints >= pSoldier->bInitialActionPoints) && ( ClosestReachableDisturbance(pSoldier, TRUE, &fClimb) == NOWHERE) )
|
||||
// if not in combat or under fire, and we COULD have moved, just chose not to
|
||||
if ( (pSoldier->aiData.bAlertStatus != STATUS_BLACK) && !pSoldier->aiData.bUnderFire && ubCanMove && (!gfTurnBasedAI || pSoldier->bActionPoints >= pSoldier->bInitialActionPoints) && ( TileIsOutOfBounds(ClosestReachableDisturbance(pSoldier, TRUE, &fClimb))) )
|
||||
{
|
||||
// addition: if soldier is bleeding then reduce bleeding and do nothing
|
||||
if ( pSoldier->bBleeding > MIN_BLEEDING_THRESHOLD )
|
||||
@@ -3430,8 +3451,8 @@ if(!is_networked)//hayden
|
||||
{
|
||||
sClosestOpponent = ClosestKnownOpponent(pSoldier, NULL, NULL);
|
||||
|
||||
//if ( (sClosestOpponent != NOWHERE && PythSpacesAway( pSoldier->sGridNo, sClosestOpponent ) < (MaxNormalDistanceVisible() * 3) / 2 ) || PreRandom( 4 ) == 0 )
|
||||
if ( (sClosestOpponent != NOWHERE && PythSpacesAway( pSoldier->sGridNo, sClosestOpponent ) < (pSoldier->GetMaxDistanceVisible(sClosestOpponent) * 3) / 2 ) || PreRandom( 4 ) == 0 )
|
||||
//if ( ( !TileIsOutOfBounds(sClosestOpponent) && PythSpacesAway( pSoldier->sGridNo, sClosestOpponent ) < (MaxNormalDistanceVisible() * 3) / 2 ) || PreRandom( 4 ) == 0 )
|
||||
if ( (!TileIsOutOfBounds(sClosestOpponent) && PythSpacesAway( pSoldier->sGridNo, sClosestOpponent ) < (pSoldier->GetMaxDistanceVisible(sClosestOpponent) * 3) / 2 ) || PreRandom( 4 ) == 0 )
|
||||
{
|
||||
if (!gfTurnBasedAI || GetAPsToChangeStance( pSoldier, ANIM_CROUCH ) <= pSoldier->bActionPoints)
|
||||
{
|
||||
@@ -3454,7 +3475,8 @@ if(!is_networked)//hayden
|
||||
if ( !fCivilian && pSoldier->aiData.bUnderFire && pSoldier->bActionPoints >= (pSoldier->bInitialActionPoints - GetAPsToLook( pSoldier ) ) && IsValidStance( pSoldier, ANIM_PRONE ) )
|
||||
{
|
||||
sClosestDisturbance = MostImportantNoiseHeard( pSoldier, NULL, NULL, NULL );
|
||||
if ( sClosestDisturbance != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
ubOpponentDir = atan8( CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), CenterX( sClosestDisturbance ), CenterY( sClosestDisturbance ) );
|
||||
if ( pSoldier->ubDirection != ubOpponentDir )
|
||||
@@ -3512,8 +3534,9 @@ if(!is_networked)//hayden
|
||||
INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT32 iCoverPercentBetter, iOffense, iDefense, iChance;
|
||||
INT16 sClosestOpponent,sBestCover = NOWHERE;
|
||||
INT16 sClosestDisturbance,ubMinAPCost;
|
||||
INT32 sClosestOpponent,sBestCover = NOWHERE;
|
||||
INT32 sClosestDisturbance;
|
||||
INT16 ubMinAPCost;
|
||||
UINT8 ubCanMove;
|
||||
INT8 bInWater,bInDeepWater,bInGas;
|
||||
INT8 bDirection;
|
||||
@@ -3533,7 +3556,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
BOOLEAN fClimb;
|
||||
INT16 ubBurstAPs;
|
||||
UINT8 ubOpponentDir;
|
||||
INT16 sCheckGridNo;
|
||||
INT32 sCheckGridNo;
|
||||
|
||||
BOOLEAN fAllowCoverCheck = FALSE;
|
||||
|
||||
@@ -3640,6 +3663,9 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
if(WearGasMaskIfAvailable(pSoldier))//dnl ch40 200909
|
||||
bInGas = InGasOrSmoke(pSoldier, pSoldier->sGridNo);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// IF GASSED, OR REALLY TIRED (ON THE VERGE OF COLLAPSING), TRY TO RUN AWAY
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -3652,8 +3678,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - GASSED or LOW ON BREATH (%d), RUNNING AWAY to grid %d",pSoldier->name,pSoldier->bBreath,pSoldier->aiData.usActionData);
|
||||
@@ -3686,8 +3712,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
if ( ( bInDeepWater || bInGas ) && ubCanMove)
|
||||
{
|
||||
pSoldier->aiData.usActionData = FindNearestUngassedLand(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -3701,8 +3727,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - NO LAND NEAR, RUNNING AWAY to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -3780,7 +3806,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// set up next action to run away
|
||||
pSoldier->aiData.usNextActionData = FindSpotMaxDistFromOpponents( pSoldier );
|
||||
if ( pSoldier->aiData.usNextActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usNextActionData))
|
||||
{
|
||||
pSoldier->aiData.bNextAction = AI_ACTION_RUN_AWAY;
|
||||
pSoldier->aiData.usActionData = ANIM_STAND;
|
||||
@@ -3937,8 +3964,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// get the location of the closest CONSCIOUS reachable opponent
|
||||
sClosestDisturbance = ClosestReachableDisturbance(pSoldier,FALSE, &fClimb);
|
||||
|
||||
// if we found one
|
||||
if (sClosestDisturbance != NOWHERE)
|
||||
// if we found one
|
||||
if (!TileIsOutOfBounds(sClosestDisturbance))
|
||||
{
|
||||
// don't bother checking GRENADES/KNIVES, he can't have conscious targets
|
||||
#ifdef RECORDNET
|
||||
@@ -3978,8 +4005,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// this looks for throwables, and sets BestThrow.ubPossible if it can be done
|
||||
//if ( !gfHiddenInterrupt )
|
||||
// {
|
||||
if(!is_networked) //disable for mp ai
|
||||
{
|
||||
//if(!is_networked) //disable for mp ai
|
||||
//{
|
||||
CheckIfTossPossible(pSoldier,&BestThrow);
|
||||
|
||||
if (BestThrow.ubPossible)
|
||||
@@ -3990,7 +4017,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
ubOpponentDir = (UINT8)GetDirectionFromGridNo( BestThrow.sTarget, pSoldier );
|
||||
|
||||
// Get new gridno!
|
||||
sCheckGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc( ubOpponentDir ) );
|
||||
sCheckGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)DirectionInc( ubOpponentDir ) );
|
||||
|
||||
if ( !OKFallDirection( pSoldier, sCheckGridNo, pSoldier->pathing.bLevel, ubOpponentDir, pSoldier->usAnimState ) )
|
||||
{
|
||||
@@ -3998,7 +4025,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
BestThrow.ubPossible = FALSE;
|
||||
|
||||
// try behind us, see if there's room to move back
|
||||
sCheckGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, (UINT16)DirectionInc( gOppositeDirection[ ubOpponentDir ] ) );
|
||||
sCheckGridNo = NewGridNo( pSoldier->sGridNo, (UINT16)DirectionInc( gOppositeDirection[ ubOpponentDir ] ) );
|
||||
if ( OKFallDirection( pSoldier, sCheckGridNo, pSoldier->pathing.bLevel, gOppositeDirection[ ubOpponentDir ], pSoldier->usAnimState ) )
|
||||
{
|
||||
pSoldier->aiData.usActionData = sCheckGridNo;
|
||||
@@ -4016,7 +4043,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
@@ -4220,13 +4247,13 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// make militia a bit more cautious
|
||||
// 3 (UINT16) CONVERSIONS HERE TO AVOID ERRORS. GOTTHARD 7/15/08
|
||||
if ( ( (pSoldier->bTeam == MILITIA_TEAM) && (PreRandom( 20 ) > (UINT16)BestAttack.ubChanceToReallyHit) )
|
||||
|| ( (pSoldier->bTeam != MILITIA_TEAM) && (PreRandom( 40 ) > (UINT16)BestAttack.ubChanceToReallyHit) ) )
|
||||
if ( ( (pSoldier->bTeam == MILITIA_TEAM) && ((INT16)(PreRandom( 20 )) > BestAttack.ubChanceToReallyHit) )
|
||||
|| ( (pSoldier->bTeam != MILITIA_TEAM) && ((INT16)(PreRandom( 40 )) > BestAttack.ubChanceToReallyHit) ) )
|
||||
{
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"AI %d allowing cover check, chance to hit is only %d, at range %d", BestAttack.ubChanceToReallyHit, PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) );
|
||||
// maybe taking cover would be better!
|
||||
fAllowCoverCheck = TRUE;
|
||||
if ( PreRandom( 10 ) > (UINT16)BestAttack.ubChanceToReallyHit )
|
||||
if ( (INT16)(PreRandom( 10 )) > BestAttack.ubChanceToReallyHit )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"DecideActionBlack: can't hit so screw the attack");
|
||||
// screw the attack!
|
||||
@@ -4266,8 +4293,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// IF NECESSARY, DECIDE BETWEEN ATTACKING AND DEFENDING (TAKING COVER)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// if both are possible
|
||||
if ((ubBestAttackAction != AI_ACTION_NONE) && (sBestCover != NOWHERE))
|
||||
// if both are possible
|
||||
if ((ubBestAttackAction != AI_ACTION_NONE) && ( !TileIsOutOfBounds(sBestCover)))
|
||||
{
|
||||
// gotta compare their merits and select the more desirable option
|
||||
iOffense = BestAttack.ubChanceToReallyHit;
|
||||
@@ -4734,7 +4761,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
if ( ubCanMove )
|
||||
{
|
||||
sClosestOpponent = ClosestSeenOpponent(pSoldier, NULL, NULL);
|
||||
if ( sClosestOpponent != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
// temporarily make boxer have orders of CLOSEPATROL rather than STATIONARY
|
||||
// And make him patrol the ring, not his usual place
|
||||
@@ -4745,7 +4773,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards( pSoldier, sClosestOpponent, AI_ACTION_GET_CLOSER );
|
||||
pSoldier->aiData.sPatrolGrid[0] = tgrd;
|
||||
pSoldier->aiData.bOrders = STATIONARY;
|
||||
if ( pSoldier->aiData.usActionData != NOWHERE )
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
// truncate path to 1 step
|
||||
pSoldier->aiData.usActionData = pSoldier->sGridNo + DirectionInc( (UINT8) pSoldier->pathing.usPathingData[0] );
|
||||
@@ -4762,8 +4791,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// IF A LOCATION WITH BETTER COVER IS AVAILABLE & REACHABLE, GO FOR IT!
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (sBestCover != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sBestCover))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR tempstr="";
|
||||
@@ -4790,8 +4819,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// look for best place to RUN AWAY to (farthest from the closest threat)
|
||||
//pSoldier->aiData.usActionData = RunAway( pSoldier );
|
||||
pSoldier->aiData.usActionData = FindSpotMaxDistFromOpponents(pSoldier);
|
||||
|
||||
if (pSoldier->aiData.usActionData != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - RUNNING AWAY to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -4859,8 +4888,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// (don't care if he's conscious, don't care if he's reachable at all)
|
||||
|
||||
sClosestOpponent = ClosestSeenOpponent(pSoldier, NULL, NULL);
|
||||
// if we have a closest seen opponent
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
// if we have a closest seen opponent
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
bDirection = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sClosestOpponent),CenterY(sClosestOpponent));
|
||||
|
||||
@@ -4917,8 +4946,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
|
||||
|
||||
sClosestOpponent = ClosestSeenOpponent(pSoldier, NULL, NULL);
|
||||
// if we have a closest reachable opponent
|
||||
if (sClosestOpponent != NOWHERE)
|
||||
// if we have a closest reachable opponent
|
||||
if (!TileIsOutOfBounds(sClosestOpponent))
|
||||
{
|
||||
bDirection = atan8(CenterX(pSoldier->sGridNo),CenterY(pSoldier->sGridNo),CenterX(sClosestOpponent),CenterY(sClosestOpponent));
|
||||
|
||||
@@ -5183,8 +5212,8 @@ INT8 DecideActionEscort(SOLDIERTYPE *pSoldier)
|
||||
STR16 tempstr;
|
||||
#endif
|
||||
|
||||
// if he has a place to go, and isn't already there... go!
|
||||
if (pSoldier->aiData.usActionData != NOWHERE && (pSoldier->sGridNo != pSoldier->aiData.usActionData))
|
||||
// if he has a place to go, and isn't already there... go!
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.usActionData) && (pSoldier->sGridNo != pSoldier->aiData.usActionData))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
sprintf(tempstr,"%s - ESCORTED NPC GOING to grid %d",pSoldier->name,pSoldier->aiData.usActionData);
|
||||
@@ -5254,8 +5283,8 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
// if we are NOT aware of any uninvestigated noises right now
|
||||
// and we are not currently in the middle of an action
|
||||
// (could still be on his way heading to investigate a noise!)
|
||||
if ((MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) == NOWHERE) && !pSoldier->aiData.bActionInProgress)
|
||||
// (could still be on his way heading to investigate a noise!)
|
||||
if (( TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy))) && !pSoldier->aiData.bActionInProgress)
|
||||
{
|
||||
// then drop back to GREEN status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
@@ -5272,8 +5301,8 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we ARE aware of any uninvestigated noises right now
|
||||
if (MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) != NOWHERE)
|
||||
// if we ARE aware of any uninvestigated noises right now
|
||||
if (!TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy)))
|
||||
{
|
||||
// then move up to YELLOW status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_YELLOW;
|
||||
@@ -5307,8 +5336,8 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// if he just dropped back from alert status, and it's a GUARD
|
||||
if ((oldStatus >= STATUS_RED) && (pSoldier->manCategory == MAN_GUARD))
|
||||
{
|
||||
if (pSoldier->whereIWas == NOWHERE) // not assigned to any trees
|
||||
{
|
||||
if (TileIsOutOfBounds(pSoldier->whereIWas)) // not assigned to any trees
|
||||
// FUTURE ENHANCEMENT: Look for unguarded trees with tappers
|
||||
pSoldier->orders = ONCALL;
|
||||
else // assigned to trees
|
||||
@@ -5371,9 +5400,9 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier )
|
||||
// force a NEW decision so that he can get some rest
|
||||
SetNewSituation( pSoldier );
|
||||
|
||||
// current action will be canceled. if noise is no longer important
|
||||
// current action will be canceled. if noise is no longer important
|
||||
if ((pSoldier->aiData.bAlertStatus == STATUS_YELLOW) &&
|
||||
(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy) == NOWHERE))
|
||||
( TileIsOutOfBounds(MostImportantNoiseHeard(pSoldier,&iDummy,&fClimbDummy,&fReachableDummy))))
|
||||
{
|
||||
// then drop back to GREEN status
|
||||
pSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
|
||||
+133
-129
@@ -33,8 +33,9 @@
|
||||
|
||||
#include "PathAIDebug.h"
|
||||
|
||||
INT16 * gsCoverValue = NULL;
|
||||
#ifdef _DEBUG
|
||||
INT16 gsCoverValue[WORLD_MAX];
|
||||
|
||||
INT16 gsBestCover;
|
||||
#ifndef PATHAI_VISIBLE_DEBUG
|
||||
// NB Change this to true to get visible cover debug -- CJC
|
||||
@@ -105,7 +106,7 @@ INT32 CalcPercentBetter(INT32 iOldValue, INT32 iNewValue, INT32 iOldScale, INT32
|
||||
return(iPercentBetter);
|
||||
}
|
||||
|
||||
void AICenterXY( INT16 sGridNo, FLOAT * pdX, FLOAT * pdY )
|
||||
void AICenterXY( INT32 sGridNo, FLOAT * pdX, FLOAT * pdY )
|
||||
{
|
||||
INT16 sXPos, sYPos;
|
||||
|
||||
@@ -116,7 +117,7 @@ void AICenterXY( INT16 sGridNo, FLOAT * pdX, FLOAT * pdY )
|
||||
*pdY = (FLOAT) (sYPos * CELL_Y_SIZE + CELL_Y_SIZE / 2);
|
||||
}
|
||||
|
||||
INT8 CalcWorstCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
INT8 CalcWorstCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT32 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
{
|
||||
// When considering a gridno for cover, we want to take into account cover if we
|
||||
// lie down, so we return the LOWEST chance to get through for that location.
|
||||
@@ -155,7 +156,7 @@ INT8 CalcWorstCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT16 sOpp
|
||||
return( bWorstCTGT );
|
||||
}
|
||||
|
||||
INT8 CalcAverageCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
INT8 CalcAverageCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT32 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
{
|
||||
// When considering a gridno for cover, we want to take into account cover if we
|
||||
// lie down, so we return the LOWEST chance to get through for that location.
|
||||
@@ -189,13 +190,13 @@ INT8 CalcAverageCTGTForPosition( SOLDIERTYPE * pSoldier, UINT8 ubOppID, INT16 sO
|
||||
}
|
||||
|
||||
|
||||
INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT32 sOppGridNo, INT8 bLevel, INT32 iMyAPsLeft )
|
||||
{
|
||||
// NOTE: CTGT stands for "ChanceToGetThrough..."
|
||||
|
||||
// using only ints for maximum execution speed here
|
||||
// CJC: Well, so much for THAT idea!
|
||||
INT16 sCentralGridNo, sAdjSpot, sNorthGridNo, sSouthGridNo, sCheckSpot, sOKTest;
|
||||
INT32 sCentralGridNo, sAdjSpot, sNorthGridNo, sSouthGridNo, sCheckSpot, sOKTest;
|
||||
|
||||
INT8 bThisCTGT, bBestCTGT = 0;
|
||||
|
||||
@@ -270,7 +271,7 @@ INT8 CalcBestCTGT( SOLDIERTYPE *pSoldier, UINT8 ubOppID, INT16 sOppGridNo, INT8
|
||||
}
|
||||
|
||||
|
||||
INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 iMyAPsLeft,
|
||||
INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT32 sMyGridNo, INT32 iMyThreat, INT32 iMyAPsLeft,
|
||||
UINT32 uiThreatIndex, INT32 iRange, INT32 morale, INT32 *iTotalScale)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("CalcCoverValue"));
|
||||
@@ -278,7 +279,7 @@ INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 i
|
||||
// all 32-bit integers for max. speed
|
||||
INT32 iMyPosValue, iHisPosValue, iCoverValue;
|
||||
INT32 iReductionFactor, iThisScale;
|
||||
INT16 sHisGridNo, sMyRealGridNo = NOWHERE, sHisRealGridNo = NOWHERE;
|
||||
INT32 sHisGridNo, sMyRealGridNo = NOWHERE, sHisRealGridNo = NOWHERE;
|
||||
INT16 sTempX, sTempY;
|
||||
FLOAT dMyX, dMyY, dHisX, dHisY;
|
||||
INT8 bHisBestCTGT, bHisActualCTGT, bHisCTGT, bMyCTGT;
|
||||
@@ -339,8 +340,8 @@ INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 i
|
||||
if (bHisActualCTGT < 100)
|
||||
{
|
||||
// if we didn't remember his real gridno earlier up above, we got to now,
|
||||
// because calculating worst case is about to play with it in a big way!
|
||||
if (sHisRealGridNo == NOWHERE)
|
||||
// because calculating worst case is about to play with it in a big way!
|
||||
if (TileIsOutOfBounds(sHisRealGridNo))
|
||||
{
|
||||
sHisRealGridNo = pHim->sGridNo; // remember where he REALLY is
|
||||
dHisX = pHim->dXPos;
|
||||
@@ -390,15 +391,15 @@ INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 i
|
||||
}
|
||||
}
|
||||
|
||||
// UNDO ANY TEMPORARY "DAMAGE" DONE ABOVE
|
||||
if (sMyRealGridNo != NOWHERE)
|
||||
// UNDO ANY TEMPORARY "DAMAGE" DONE ABOVE
|
||||
if (!TileIsOutOfBounds(sMyRealGridNo))
|
||||
{
|
||||
pMe->sGridNo = sMyRealGridNo; // put me back where I belong!
|
||||
pMe->dXPos = dMyX; // also change the 'x'
|
||||
pMe->dYPos = dMyY; // and the 'y'
|
||||
}
|
||||
|
||||
if (sHisRealGridNo != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sHisRealGridNo))
|
||||
{
|
||||
pHim->sGridNo = sHisRealGridNo; // put HIM back where HE belongs!
|
||||
pHim->dXPos = dHisX; // also change the 'x'
|
||||
@@ -507,10 +508,10 @@ INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 i
|
||||
}
|
||||
|
||||
|
||||
UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT16 sGridNo )
|
||||
UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
{
|
||||
UINT8 ubLoop, ubCount, ubWhoIsThere;
|
||||
INT16 sTempGridNo;
|
||||
UINT8 ubLoop, ubCount, ubWhoIsThere;
|
||||
INT32 sTempGridNo;
|
||||
|
||||
ubCount = 0;
|
||||
|
||||
@@ -530,7 +531,7 @@ UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT16 sGridNo )
|
||||
return( ubCount );
|
||||
}
|
||||
|
||||
INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentBetter)
|
||||
INT32 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentBetter)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("FindBestNearbyCover"));
|
||||
|
||||
@@ -539,18 +540,18 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
INT32 iCurrentCoverValue, iCoverValue, iBestCoverValue;
|
||||
INT32 iCurrentScale = -1, iCoverScale = -1, iBestCoverScale = -1;
|
||||
INT32 iDistFromOrigin, iDistCoverFromOrigin, iThreatCertainty;
|
||||
INT16 sGridNo, sBestCover = NOWHERE;
|
||||
INT32 sGridNo, sBestCover = NOWHERE;
|
||||
INT32 iPathCost;
|
||||
INT32 iThreatRange, iClosestThreatRange = 1500;
|
||||
// INT16 sClosestThreatGridno = NOWHERE;
|
||||
INT32 iMyThreatValue;
|
||||
INT16 sThreatLoc;
|
||||
INT32 sThreatLoc;
|
||||
INT32 iMaxThreatRange;
|
||||
UINT32 uiThreatCnt = 0;
|
||||
INT32 iMaxMoveTilesLeft, iSearchRange, iRoamRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
INT16 sOrigin; // has to be a short, need a pointer
|
||||
INT16 * pusLastLoc;
|
||||
INT32 sOrigin; // has to be a short, need a pointer
|
||||
INT32 * pusLastLoc;
|
||||
INT8 * pbPersOL;
|
||||
INT8 * pbPublOL;
|
||||
SOLDIERTYPE *pOpponent;
|
||||
@@ -795,22 +796,22 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
#endif
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
iRoamRange = RoamingRange(pSoldier,&sOrigin);
|
||||
|
||||
// if status isn't black (life & death combat), and roaming range is limited
|
||||
// if status isn't black (life & death combat), and roaming range is limited
|
||||
if ((pSoldier->aiData.bAlertStatus != STATUS_BLACK) && (iRoamRange < MAX_ROAMING_RANGE) &&
|
||||
(sOrigin != NOWHERE))
|
||||
(!TileIsOutOfBounds(sOrigin)))
|
||||
{
|
||||
// must try to stay within or return to the point of origin
|
||||
iDistFromOrigin = SpacesAway(sOrigin,pSoldier->sGridNo);
|
||||
@@ -869,7 +870,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_TAKE_COVER ), COPYREACHABLE_AND_APS, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_TAKE_COVER ), COPYREACHABLE_AND_APS, 0 );//dnl ch50 071009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -1072,8 +1073,8 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
}
|
||||
#endif
|
||||
|
||||
// if a better cover location was found
|
||||
if (sBestCover != NOWHERE)
|
||||
// if a better cover location was found
|
||||
if (!TileIsOutOfBounds(sBestCover))
|
||||
{
|
||||
#if defined( _DEBUG ) && !defined( PATHAI_VISIBLE_DEBUG )
|
||||
gsBestCover = sBestCover;
|
||||
@@ -1096,25 +1097,25 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
SnuggleDebug(pSoldier,"Found Cover");
|
||||
#endif
|
||||
|
||||
return((INT16)sBestCover); // return the gridno of that cover
|
||||
return(sBestCover); // return the gridno of that cover
|
||||
}
|
||||
}
|
||||
return(NOWHERE); // return that no suitable cover was found
|
||||
}
|
||||
|
||||
INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT16 sBestSpot = NOWHERE;
|
||||
INT32 sGridNo;
|
||||
INT32 sBestSpot = NOWHERE;
|
||||
UINT32 uiLoop;
|
||||
INT32 iThreatRange,iClosestThreatRange = 1500, iSpotClosestThreatRange;
|
||||
INT16 sThreatLoc, sThreatGridNo[MAXMERCS];
|
||||
INT32 sThreatLoc, sThreatGridNo[MAXMERCS];
|
||||
UINT32 uiThreatCnt = 0;
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
INT8 * pbPersOL,*pbPublOL, bEscapeDirection, bBestEscapeDirection = -1;
|
||||
SOLDIERTYPE *pOpponent;
|
||||
INT16 sOrigin;
|
||||
INT32 sOrigin;
|
||||
INT32 iRoamRange;
|
||||
|
||||
// BUILD A LIST OF THREATENING GRID #s FROM PERSONAL & PUBLIC opplistS
|
||||
@@ -1250,15 +1251,15 @@ INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
//NumMessage("gubNPCAPBudget = ",gubNPCAPBudget);
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
@@ -1282,7 +1283,7 @@ INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_RUN_AWAY ), COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_RUN_AWAY ), COPYREACHABLE, 0 );//dnl ch50 121009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -1390,9 +1391,9 @@ INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
return( sBestSpot );
|
||||
}
|
||||
|
||||
INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
INT32 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT16 sGridNo,sClosestLand = NOWHERE,sPathCost,sShortestPath = 1000;
|
||||
INT32 sGridNo,sClosestLand = NOWHERE,sPathCost,sShortestPath = 1000;
|
||||
INT16 sMaxLeft,sMaxRight,sMaxUp,sMaxDown,sXOffset,sYOffset;
|
||||
INT32 iSearchRange;
|
||||
|
||||
@@ -1405,15 +1406,15 @@ INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
//NumMessage("Trying iSearchRange = ", iSearchRange);
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
@@ -1437,7 +1438,7 @@ INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_LEAVE_WATER_GAS ), COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_LEAVE_WATER_GAS ), COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -1470,7 +1471,7 @@ INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
// CJC: here, unfortunately, we must calculate a path so we have an AP cost
|
||||
|
||||
// obviously, we're looking for LAND, so water is out!
|
||||
sPathCost = (INT16) LegalNPCDestination(pSoldier,sGridNo,ENSURE_PATH_COST,NOWATER,0);
|
||||
sPathCost = LegalNPCDestination(pSoldier,sGridNo,ENSURE_PATH_COST,NOWATER,0);
|
||||
|
||||
if (!sPathCost)
|
||||
{
|
||||
@@ -1490,8 +1491,8 @@ INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
// if we found a piece of land in this search area
|
||||
if (sClosestLand != NOWHERE) // quit now, no need to look any farther
|
||||
// if we found a piece of land in this search area
|
||||
if (!TileIsOutOfBounds(sClosestLand)) // quit now, no need to look any farther
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1501,13 +1502,13 @@ INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
||||
|
||||
INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT16 sGridNo, sClosestSpot = NOWHERE, sPathCost;
|
||||
INT32 sGridNo, sClosestSpot = NOWHERE, sPathCost;
|
||||
INT32 iSpotValue, iBestSpotValue = 1000;
|
||||
INT16 sMaxLeft,sMaxRight,sMaxUp,sMaxDown,sXOffset,sYOffset;
|
||||
INT32 iSearchRange;
|
||||
INT8 bLightLevel, bCurrLightLevel, bLightDiff;
|
||||
INT32 iRoamRange;
|
||||
INT16 sOrigin;
|
||||
INT32 sOrigin;
|
||||
|
||||
bCurrLightLevel = LightTrueLevel( pSoldier->sGridNo, pSoldier->pathing.bLevel );
|
||||
|
||||
@@ -1518,15 +1519,15 @@ INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
for (iSearchRange = 5; iSearchRange <= 15; iSearchRange += 5)
|
||||
{
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min(iSearchRange,(pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min(iSearchRange,MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min(iSearchRange,(pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min(iSearchRange,MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
@@ -1550,7 +1551,7 @@ INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_LEAVE_WATER_GAS ), COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_LEAVE_WATER_GAS ), COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -1600,7 +1601,7 @@ INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// CJC: here, unfortunately, we must calculate a path so we have an AP cost
|
||||
|
||||
sPathCost = (INT16) LegalNPCDestination(pSoldier,sGridNo,ENSURE_PATH_COST,NOWATER,0);
|
||||
sPathCost = LegalNPCDestination(pSoldier,sGridNo,ENSURE_PATH_COST,NOWATER,0);
|
||||
|
||||
if (!sPathCost)
|
||||
{
|
||||
@@ -1622,8 +1623,8 @@ INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
// if we found a piece of land in this search area
|
||||
if (sClosestSpot != NOWHERE) // quit now, no need to look any farther
|
||||
// if we found a piece of land in this search area
|
||||
if (!TileIsOutOfBounds(sClosestSpot)) // quit now, no need to look any farther
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1640,8 +1641,8 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
INT16 sGridNo;
|
||||
INT16 sBestSpot = NOWHERE;
|
||||
INT32 sGridNo;
|
||||
INT32 sBestSpot = NOWHERE;
|
||||
INT32 iTempValue, iValue, iBestValue = 0;
|
||||
ITEM_POOL * pItemPool;
|
||||
OBJECTTYPE * pObj;
|
||||
@@ -1695,15 +1696,15 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
iSearchRange /= 2;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
@@ -1731,7 +1732,7 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_PICKUP_ITEM ), COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_PICKUP_ITEM ), COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
// SET UP DOUBLE-LOOP TO STEP THROUGH POTENTIAL GRID #s
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
@@ -1914,7 +1915,10 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
// WANNE: Fix a vanilla bug: When an enemy soldier is looking for items and finds a non-helmet/vest/leggings piece of armour it was incorrectly considered for pickup.
|
||||
// Fixed by Tron (Stracciatella): Revision: 5719
|
||||
// break;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1941,8 +1945,8 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sBestSpot != NOWHERE)
|
||||
|
||||
if (!TileIsOutOfBounds(sBestSpot))
|
||||
{
|
||||
DebugAI( String( "%d decides to pick up %S", pSoldier->ubID, ItemNames[ gWorldItems[ iBestItemIndex ].object.usItem ] ) );
|
||||
if (Item[gWorldItems[ iBestItemIndex ].object.usItem].usItemClass == IC_GUN)
|
||||
@@ -1982,26 +1986,26 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
|
||||
return( AI_ACTION_NONE );
|
||||
}
|
||||
|
||||
INT16 FindClosestDoor( SOLDIERTYPE * pSoldier )
|
||||
INT32 FindClosestDoor( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT16 sClosestDoor = NOWHERE;
|
||||
INT32 sClosestDoor = NOWHERE;
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
INT32 iDist, iClosestDist = 10;
|
||||
|
||||
iSearchRange = 5;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
// SET UP DOUBLE-LOOP TO STEP THROUGH POTENTIAL GRID #s
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
@@ -2025,12 +2029,12 @@ INT16 FindClosestDoor( SOLDIERTYPE * pSoldier )
|
||||
return( sClosestDoor );
|
||||
}
|
||||
|
||||
INT16 FindNearestEdgepointOnSpecifiedEdge( INT16 sGridNo, INT8 bEdgeCode )
|
||||
INT32 FindNearestEdgepointOnSpecifiedEdge( INT32 sGridNo, INT8 bEdgeCode )
|
||||
{
|
||||
INT32 iLoop;
|
||||
INT16 *psEdgepointArray;
|
||||
INT32 *psEdgepointArray;
|
||||
INT32 iEdgepointArraySize;
|
||||
INT16 sClosestSpot = NOWHERE, sClosestDist = 0x7FFF, sTempDist;
|
||||
INT32 sClosestSpot = NOWHERE, sClosestDist = 0x7FFF, sTempDist;
|
||||
|
||||
switch( bEdgeCode )
|
||||
{
|
||||
@@ -2071,16 +2075,16 @@ INT16 FindNearestEdgepointOnSpecifiedEdge( INT16 sGridNo, INT8 bEdgeCode )
|
||||
return( sClosestSpot );
|
||||
}
|
||||
|
||||
INT16 FindNearestEdgePoint( INT16 sGridNo )
|
||||
INT32 FindNearestEdgePoint( INT32 sGridNo )
|
||||
{
|
||||
INT16 sGridX, sGridY;
|
||||
INT16 sScreenX, sScreenY, sMaxScreenX, sMaxScreenY;
|
||||
INT16 sDist[5], sMinDist;
|
||||
INT32 iLoop;
|
||||
INT8 bMinIndex;
|
||||
INT16 * psEdgepointArray;
|
||||
INT32 * psEdgepointArray;
|
||||
INT32 iEdgepointArraySize;
|
||||
INT16 sClosestSpot = NOWHERE, sClosestDist = 0x7FFF, sTempDist;
|
||||
INT32 sClosestSpot = NOWHERE, sClosestDist = 0x7FFF, sTempDist;
|
||||
|
||||
ConvertGridNoToXY( sGridNo, &sGridX, &sGridY );
|
||||
GetWorldXYAbsoluteScreenXY( sGridX, sGridY, &sScreenX, &sScreenY );
|
||||
@@ -2146,12 +2150,12 @@ INT16 FindNearestEdgePoint( INT16 sGridNo )
|
||||
|
||||
#define EDGE_OF_MAP_SEARCH 5
|
||||
|
||||
INT16 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection )
|
||||
INT32 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection )
|
||||
{
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
|
||||
INT16 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT32 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT8 bDirection, bClosestDirection;
|
||||
INT32 iPathCost, iClosestPathCost = 1000;
|
||||
|
||||
@@ -2166,15 +2170,15 @@ INT16 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection )
|
||||
iSearchRange = EDGE_OF_MAP_SEARCH;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
|
||||
// reset the "reachable" flags in the region we're looking at
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
@@ -2191,7 +2195,7 @@ INT16 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection )
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, WALKING, COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, WALKING, COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -2233,7 +2237,7 @@ INT16 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection )
|
||||
return( sClosestSpot );
|
||||
}
|
||||
|
||||
INT16 FindRouteBackOntoMap( SOLDIERTYPE * pSoldier, INT16 sDestGridNo )
|
||||
INT32 FindRouteBackOntoMap( SOLDIERTYPE * pSoldier, INT32 sDestGridNo )
|
||||
{
|
||||
// the first thing to do is restore the soldier's gridno from the X and Y
|
||||
// values
|
||||
@@ -2251,12 +2255,12 @@ INT16 FindRouteBackOntoMap( SOLDIERTYPE * pSoldier, INT16 sDestGridNo )
|
||||
|
||||
}
|
||||
|
||||
INT16 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
|
||||
INT32 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
|
||||
{
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
|
||||
INT16 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT32 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT32 iDistance, iClosestDistance = 9999;
|
||||
UINT8 ubRoom;
|
||||
|
||||
@@ -2264,9 +2268,9 @@ INT16 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
|
||||
iSearchRange = 7;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
if ( (pSoldier->bTeam == gbPlayerNum) && (fInRing == FALSE) )
|
||||
@@ -2276,9 +2280,9 @@ INT16 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
|
||||
}
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
{
|
||||
@@ -2305,12 +2309,12 @@ INT16 FindClosestBoxingRingSpot( SOLDIERTYPE * pSoldier, BOOLEAN fInRing )
|
||||
return( sClosestSpot );
|
||||
}
|
||||
|
||||
INT16 FindNearestOpenableNonDoor( INT16 sStartGridNo )
|
||||
INT32 FindNearestOpenableNonDoor( INT32 sStartGridNo )
|
||||
{
|
||||
INT32 iSearchRange;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
|
||||
INT16 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT32 sGridNo, sClosestSpot = NOWHERE;
|
||||
INT32 iDistance, iClosestDistance = 9999;
|
||||
STRUCTURE * pStructure;
|
||||
|
||||
@@ -2318,15 +2322,15 @@ INT16 FindNearestOpenableNonDoor( INT16 sStartGridNo )
|
||||
iSearchRange = 7;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (sStartGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (sStartGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((sStartGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((sStartGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (sStartGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (sStartGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((sStartGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((sStartGridNo / MAXROW) + 1));
|
||||
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
{
|
||||
@@ -2367,10 +2371,10 @@ INT16 FindNearestOpenableNonDoor( INT16 sStartGridNo )
|
||||
|
||||
|
||||
|
||||
INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
INT32 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT32 sPos, INT8 bAction )
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT16 sBestSpot = NOWHERE;
|
||||
INT32 sGridNo;
|
||||
INT32 sBestSpot = NOWHERE;
|
||||
INT32 iSearchRange = 4;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
|
||||
@@ -2425,15 +2429,15 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
// stay away from the edges
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
//NumMessage("sMaxDown = ",sMaxDown);
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
@@ -2457,7 +2461,7 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, bAction ), COPYREACHABLE, 0 );
|
||||
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, bAction ), COPYREACHABLE, 0 );//dnl ch50 071009
|
||||
|
||||
// Turn off the "reachable" flag for his current location
|
||||
// so we don't consider it
|
||||
@@ -2500,7 +2504,7 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
// calculate the next potential gridno
|
||||
sGridNo = pSoldier->sGridNo + sXOffset + (MAXCOL * sYOffset);
|
||||
sTempDir = GetDirectionFromGridNo ( sGridNo, pSoldier );
|
||||
sTempDist = (INT16) GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo , sGridNo );
|
||||
sTempDist = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo , sGridNo );
|
||||
|
||||
//NumMessage("Testing gridno #",gridno);
|
||||
if ( !(sGridNo >=0 && sGridNo < WORLD_MAX) )
|
||||
@@ -2566,9 +2570,9 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
|
||||
|
||||
|
||||
INT16 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp )
|
||||
INT32 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp )
|
||||
{
|
||||
INT16 sBestSpot = NOWHERE;
|
||||
INT32 sBestSpot = NOWHERE;
|
||||
|
||||
//DebugMsg( TOPIC_JA2AI , DBG_LEVEL_3 , "FindClosestClimbPoint");
|
||||
|
||||
@@ -2581,7 +2585,7 @@ INT16 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp )
|
||||
if (fClimbUp)
|
||||
{
|
||||
// For the climb up case, search the nearby limits for a climb up point and take the closest.
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
static const INT32 iSearchRange = 20;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
UINT8 ubTestDir;
|
||||
@@ -2631,7 +2635,7 @@ INT16 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp )
|
||||
// Search for the destination climb point on the roof
|
||||
for (ubTestDir=0; ubTestDir < 8; ubTestDir += 2)
|
||||
{
|
||||
INT16 sTestGridNo = NewGridNo( sGridNo, DirectionInc( ubTestDir));
|
||||
INT32 sTestGridNo = NewGridNo( sGridNo, DirectionInc( ubTestDir));
|
||||
// And see if it or the ground location is occupied
|
||||
if (gpWorldLevelData[ sTestGridNo ].ubExtFlags[1] & MAPELEMENT_EXT_CLIMBPOINT &&
|
||||
(WhoIsThere2( sTestGridNo, 1 ) == NOBODY) &&
|
||||
@@ -2668,7 +2672,7 @@ BOOLEAN CanClimbFromHere (SOLDIERTYPE * pSoldier, BOOLEAN fUp )
|
||||
return FindDirectionForClimbing( pSoldier, pSoldier->sGridNo, pSoldier->pathing.bLevel) != DIRECTION_IRRELEVANT;
|
||||
#else
|
||||
BUILDING * pBuilding;
|
||||
INT16 i;
|
||||
INT32 i;
|
||||
INT32 iSearchRange = 1;
|
||||
INT16 sMaxLeft, sMaxRight, sMaxUp, sMaxDown, sXOffset, sYOffset;
|
||||
|
||||
@@ -2676,14 +2680,14 @@ BOOLEAN CanClimbFromHere (SOLDIERTYPE * pSoldier, BOOLEAN fUp )
|
||||
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = (INT16) min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxRight = (INT16) min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = (INT16) min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxDown = (INT16) min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
|
||||
INT16 sGridNo=NOWHERE;
|
||||
INT32 sGridNo=NOWHERE;
|
||||
|
||||
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
|
||||
{
|
||||
@@ -2783,7 +2787,7 @@ extern BUILDING gBuildings[ MAX_BUILDINGS ];
|
||||
extern UINT8 gubNumberOfBuildings;
|
||||
|
||||
|
||||
INT16 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubSearchRadius )
|
||||
INT32 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubSearchRadius )
|
||||
{
|
||||
INT32 iPercentBetter;
|
||||
// INT16 sTrueGridNo;
|
||||
@@ -2798,18 +2802,18 @@ INT16 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubS
|
||||
|
||||
pSoldier->stats.bWisdom = bRealWisdom;
|
||||
// pSoldier->sGridNo = sTrueGridNo;
|
||||
|
||||
if( sResultGridNo != NOWHERE )
|
||||
|
||||
if(!TileIsOutOfBounds(sResultGridNo))
|
||||
return sResultGridNo;
|
||||
else
|
||||
return sGridNo;
|
||||
|
||||
}
|
||||
|
||||
INT8 FindDirectionForClimbing( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bLevel )
|
||||
INT8 FindDirectionForClimbing( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
UINT8 ubClimbDir;
|
||||
INT16 sClimbSpot;
|
||||
INT32 sClimbSpot;
|
||||
|
||||
if (bLevel == 0)
|
||||
{
|
||||
|
||||
+22
-23
@@ -12,7 +12,7 @@
|
||||
#include "Soldier macros.h"
|
||||
#endif
|
||||
|
||||
void CallAvailableEnemiesTo( INT16 sGridNo )
|
||||
void CallAvailableEnemiesTo( INT32 sGridNo )
|
||||
{
|
||||
INT32 iLoop;
|
||||
INT32 iLoop2;
|
||||
@@ -28,7 +28,7 @@ void CallAvailableEnemiesTo( INT16 sGridNo )
|
||||
if (!(gTacticalStatus.Team[iLoop].bHuman) && (iLoop != CIV_TEAM))
|
||||
{
|
||||
// make this team (publicly) aware of the "noise"
|
||||
gsPublicNoiseGridno[iLoop] = sGridNo;
|
||||
gsPublicNoiseGridNo[iLoop] = sGridNo;
|
||||
gubPublicNoiseVolume[iLoop] = MAX_MISC_NOISE_DURATION;
|
||||
|
||||
// new situation for everyone;
|
||||
@@ -49,7 +49,7 @@ void CallAvailableEnemiesTo( INT16 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
void CallAvailableTeamEnemiesTo( INT16 sGridno, INT8 bTeam )
|
||||
void CallAvailableTeamEnemiesTo( INT32 sGridNo, INT8 bTeam )
|
||||
{
|
||||
INT32 iLoop2;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
@@ -62,7 +62,7 @@ void CallAvailableTeamEnemiesTo( INT16 sGridno, INT8 bTeam )
|
||||
if (!(gTacticalStatus.Team[bTeam].bHuman) && (bTeam != CIV_TEAM))
|
||||
{
|
||||
// make this team (publicly) aware of the "noise"
|
||||
gsPublicNoiseGridno[bTeam] = sGridno;
|
||||
gsPublicNoiseGridNo[bTeam] = sGridNo;
|
||||
gubPublicNoiseVolume[bTeam] = MAX_MISC_NOISE_DURATION;
|
||||
|
||||
// new situation for everyone;
|
||||
@@ -80,7 +80,7 @@ void CallAvailableTeamEnemiesTo( INT16 sGridno, INT8 bTeam )
|
||||
}
|
||||
}
|
||||
|
||||
void CallAvailableKingpinMenTo( INT16 sGridNo )
|
||||
void CallAvailableKingpinMenTo( INT32 sGridNo )
|
||||
{
|
||||
// like call all enemies, but only affects civgroup KINGPIN guys with
|
||||
// NO PROFILE
|
||||
@@ -93,7 +93,7 @@ void CallAvailableKingpinMenTo( INT16 sGridNo )
|
||||
if (gTacticalStatus.Team[CIV_TEAM].bTeamActive)
|
||||
{
|
||||
// make this team (publicly) aware of the "noise"
|
||||
gsPublicNoiseGridno[CIV_TEAM] = sGridNo;
|
||||
gsPublicNoiseGridNo[CIV_TEAM] = sGridNo;
|
||||
gubPublicNoiseVolume[CIV_TEAM] = MAX_MISC_NOISE_DURATION;
|
||||
|
||||
// new situation for everyone...
|
||||
@@ -109,7 +109,7 @@ void CallAvailableKingpinMenTo( INT16 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
void CallEldinTo( INT16 sGridNo )
|
||||
void CallEldinTo( INT32 sGridNo )
|
||||
{
|
||||
// like call all enemies, but only affects Eldin
|
||||
SOLDIERTYPE * pSoldier;
|
||||
@@ -150,24 +150,24 @@ void CallEldinTo( INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN * pfClimbingNecessary, BOOLEAN * pfReachable )
|
||||
INT32 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN * pfClimbingNecessary, BOOLEAN * pfReachable )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
INT8 * pbPersOL, * pbPublOL;
|
||||
INT16 *psLastLoc,*psNoiseGridNo;
|
||||
INT32 *psLastLoc,*psNoiseGridNo;
|
||||
INT8 * pbNoiseLevel;
|
||||
INT8 *pbLastLevel;
|
||||
UINT8 *pubNoiseVolume;
|
||||
INT32 iDistAway;
|
||||
INT32 iNoiseValue, iBestValue = -10000;
|
||||
INT16 sBestGridNo = NOWHERE;
|
||||
INT32 sBestGridNo = NOWHERE;
|
||||
INT8 bBestLevel = 0;
|
||||
INT16 sClimbingGridNo;
|
||||
INT32 sClimbingGridNo;
|
||||
BOOLEAN fClimbingNecessary = FALSE;
|
||||
SOLDIERTYPE * pTemp;
|
||||
|
||||
pubNoiseVolume = &gubPublicNoiseVolume[pSoldier->bTeam];
|
||||
psNoiseGridNo = &gsPublicNoiseGridno[pSoldier->bTeam];
|
||||
psNoiseGridNo = &gsPublicNoiseGridNo[pSoldier->bTeam];
|
||||
pbNoiseLevel = &gbPublicNoiseLevel[pSoldier->bTeam];
|
||||
|
||||
psLastLoc = gsLastKnownOppLoc[pSoldier->ubID];
|
||||
@@ -226,8 +226,8 @@ INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
|
||||
|
||||
}
|
||||
|
||||
// if any "misc. noise" was also heard recently
|
||||
if (pSoldier->aiData.sNoiseGridno != NOWHERE)
|
||||
// if any "misc. noise" was also heard recently
|
||||
if (!TileIsOutOfBounds(pSoldier->aiData.sNoiseGridno))
|
||||
{
|
||||
if ( pSoldier->bNoiseLevel != pSoldier->pathing.bLevel || PythSpacesAway( pSoldier->sGridNo, pSoldier->aiData.sNoiseGridno ) >= 6 || SoldierTo3DLocationLineOfSightTest( pSoldier, pSoldier->aiData.sNoiseGridno, pSoldier->bNoiseLevel, 0, FALSE, NO_DISTANCE_LIMIT ) == 0 )
|
||||
{
|
||||
@@ -253,9 +253,8 @@ INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
|
||||
|
||||
// if any recent PUBLIC "misc. noise" is also known
|
||||
if ( (pSoldier->bTeam != CIV_TEAM) || ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP ) )
|
||||
{
|
||||
|
||||
if (*psNoiseGridNo != NOWHERE)
|
||||
{
|
||||
if (!TileIsOutOfBounds(*psNoiseGridNo))
|
||||
{
|
||||
// if we are NOT there (at the noise gridno)
|
||||
if ( *pbNoiseLevel != pSoldier->pathing.bLevel || PythSpacesAway( pSoldier->sGridNo, *psNoiseGridNo ) >= 6 || SoldierTo3DLocationLineOfSightTest( pSoldier, *psNoiseGridNo, *pbNoiseLevel, 0, FALSE, NO_DISTANCE_LIMIT ) == 0 )
|
||||
@@ -274,8 +273,8 @@ INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sBestGridNo != NOWHERE && pfReachable )
|
||||
|
||||
if (!TileIsOutOfBounds(sBestGridNo) && pfReachable )
|
||||
{
|
||||
*pfReachable = TRUE;
|
||||
|
||||
@@ -300,8 +299,8 @@ INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
|
||||
// of where we have to climb to instead
|
||||
sClimbingGridNo = GetInterveningClimbingLocation( pSoldier, sBestGridNo, bBestLevel, &fClimbingNecessary );
|
||||
if ( fClimbingNecessary )
|
||||
{
|
||||
if ( sClimbingGridNo == NOWHERE )
|
||||
{
|
||||
if (TileIsOutOfBounds(sClimbingGridNo))
|
||||
{
|
||||
// can't investigate!
|
||||
*pfReachable = FALSE;
|
||||
@@ -329,8 +328,8 @@ INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN
|
||||
*pfClimbingNecessary = fClimbingNecessary;
|
||||
}
|
||||
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (sBestGridNo != NOWHERE)
|
||||
#ifdef DEBUGDECISIONS
|
||||
if (!TileIsOutOfBounds(sBestGridNo))
|
||||
AINumMessage("MOST IMPORTANT NOISE HEARD FROM GRID #",sBestGridNo);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ BOOLEAN CanCharacterBeAutoBandagedByTeammate( SOLDIERTYPE *pSoldier );
|
||||
//c an this grunt help anyone else out?
|
||||
BOOLEAN CanCharacterAutoBandageTeammate( SOLDIERTYPE *pSoldier );
|
||||
|
||||
BOOLEAN FindAutobandageClimbPoint( INT16 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
BOOLEAN FindAutobandageClimbPoint( INT32 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
{
|
||||
// checks for existance of location to climb up to building, not occupied by a medic
|
||||
BUILDING * pBuilding;
|
||||
@@ -230,16 +230,16 @@ BOOLEAN CanCharacterBeAutoBandagedByTeammate( SOLDIERTYPE *pSoldier )
|
||||
INT8 FindBestPatient( SOLDIERTYPE * pSoldier, BOOLEAN * pfDoClimb )
|
||||
{
|
||||
UINT8 cnt, cnt2;
|
||||
INT16 bBestPriority = 0, sBestAdjGridNo = NOWHERE;
|
||||
INT16 sPatientGridNo = NOWHERE, sBestPatientGridNo = NOWHERE;
|
||||
INT32 bBestPriority = 0, sBestAdjGridNo = NOWHERE;
|
||||
INT32 sPatientGridNo = NOWHERE, sBestPatientGridNo = NOWHERE;
|
||||
INT16 sShortestPath = 1000, sPathCost, sOtherMedicPathCost;
|
||||
SOLDIERTYPE * pPatient;
|
||||
SOLDIERTYPE * pBestPatient = NULL;
|
||||
SOLDIERTYPE * pOtherMedic;
|
||||
INT8 bPatientPriority;
|
||||
UINT8 ubDirection;
|
||||
INT16 sAdjustedGridNo, sAdjacentGridNo, sOtherAdjacentGridNo;
|
||||
INT16 sClimbGridNo, sBestClimbGridNo = NOWHERE, sShortestClimbPath = 1000;
|
||||
INT32 sAdjustedGridNo, sAdjacentGridNo, sOtherAdjacentGridNo;
|
||||
INT32 sClimbGridNo, sBestClimbGridNo = NOWHERE, sShortestClimbPath = 1000;
|
||||
BOOLEAN fClimbingNecessary;
|
||||
|
||||
gubGlobalPathFlags = PATH_THROUGH_PEOPLE;
|
||||
@@ -394,8 +394,8 @@ INT8 FindBestPatient( SOLDIERTYPE * pSoldier, BOOLEAN * pfDoClimb )
|
||||
pSoldier->aiData.usActionData = sBestAdjGridNo;
|
||||
return( AI_ACTION_GET_CLOSER );
|
||||
}
|
||||
}
|
||||
else if (sBestClimbGridNo != NOWHERE )
|
||||
}
|
||||
else if (!TileIsOutOfBounds(sBestClimbGridNo))
|
||||
{
|
||||
*pfDoClimb = TRUE;
|
||||
pSoldier->aiData.usActionData = sBestClimbGridNo;
|
||||
|
||||
+67
-70
@@ -34,32 +34,29 @@ extern INT16 DirYIncrementer[8];
|
||||
// GoAsFarAsPossibleTowards - C.O. stuff related to current animation esp first aid
|
||||
// SetCivilianDestination - C.O. stuff for if we don't control the civ
|
||||
|
||||
int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode, UINT8 ubWaterOK, UINT8 fFlags)
|
||||
int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubPathMode, UINT8 ubWaterOK, UINT8 fFlags)
|
||||
{
|
||||
BOOLEAN fSkipTilesWithMercs;
|
||||
|
||||
if ((sGridno < 0) || (sGridno >= GRIDSIZE))
|
||||
if ((sGridNo < 0) || (sGridNo >= GRIDSIZE))
|
||||
{
|
||||
#ifdef RECORDNET
|
||||
fprintf(NetDebugFile,"LegalNPC->pathing.sDestination: ERROR - rcvd invalid gridno %d",gridno);
|
||||
fprintf(NetDebugFile,"LegalNPC->pathing.sDestination: ERROR - rcvd invalid gridno %d",GridNo);
|
||||
#endif
|
||||
|
||||
#ifdef BETAVERSION
|
||||
NumMessage("LegalNPC->pathing.sDestination: ERROR - rcvd invalid gridno ",gridno);
|
||||
NumMessage("LegalNPC->pathing.sDestination: ERROR - rcvd invalid gridno ",GridNo);
|
||||
#endif
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// return false if gridno on different level from merc
|
||||
if ( GridNoOnVisibleWorldTile( pSoldier->sGridNo ) && gpWorldLevelData[ pSoldier->sGridNo ].sHeight != gpWorldLevelData[ sGridno ].sHeight )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//dnl ch53 121009 Return false if gridno on different level from merc or inside unvisible area
|
||||
if ((GridNoOnVisibleWorldTile(pSoldier->sGridNo) && gpWorldLevelData[pSoldier->sGridNo].sHeight != gpWorldLevelData[sGridNo].sHeight) || !GridNoOnVisibleWorldTile(sGridNo))
|
||||
return(FALSE);
|
||||
|
||||
// skip mercs if turnbased and adjacent AND not doing an IGNORE_PATH check (which is used almost exclusively by GoAsFarAsPossibleTowards)
|
||||
fSkipTilesWithMercs = (gfTurnBasedAI && ubPathMode != IGNORE_PATH && SpacesAway( pSoldier->sGridNo, sGridno ) == 1 );
|
||||
fSkipTilesWithMercs = (gfTurnBasedAI && ubPathMode != IGNORE_PATH && SpacesAway( pSoldier->sGridNo, sGridNo ) == 1 );
|
||||
|
||||
// if this gridno is an OK destination
|
||||
// AND the gridno is NOT in a tear-gassed tile when we have no gas mask
|
||||
@@ -68,10 +65,10 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode,
|
||||
// AND the gridno hasn't been black-listed for us
|
||||
|
||||
// Nov 28 98: skip people in destination tile if in turnbased
|
||||
if ( ( NewOKDestination(pSoldier, sGridno, fSkipTilesWithMercs, pSoldier->pathing.bLevel ) ) &&
|
||||
( !InGas( pSoldier, sGridno ) ) &&
|
||||
( sGridno != pSoldier->sGridNo ) &&
|
||||
( sGridno != pSoldier->pathing.sBlackList ) )
|
||||
if ( ( NewOKDestination(pSoldier, sGridNo, fSkipTilesWithMercs, pSoldier->pathing.bLevel ) ) &&
|
||||
( !InGas( pSoldier, sGridNo ) ) &&
|
||||
( sGridNo != pSoldier->sGridNo ) &&
|
||||
( sGridNo != pSoldier->pathing.sBlackList ) )
|
||||
/*
|
||||
if ( ( NewOKDestination(pSoldier, sGridno, FALSE, pSoldier->pathing.bLevel ) ) &&
|
||||
( !(gpWorldLevelData[ sGridno ].ubExtFlags[0] & (MAPELEMENT_EXT_SMOKE | MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) || ( pSoldier->inv[ HEAD1POS ].usItem == GASMASK || pSoldier->inv[ HEAD2POS ].usItem == GASMASK ) ) &&
|
||||
@@ -86,16 +83,16 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode,
|
||||
{
|
||||
|
||||
// if water's a problem, and gridno is in a water tile (bridges are OK)
|
||||
if (!ubWaterOK && Water(sGridno))
|
||||
if (!ubWaterOK && Water(sGridNo))
|
||||
return(FALSE);
|
||||
|
||||
//Madd: added to prevent people from running into gas and fire
|
||||
if ( (gpWorldLevelData[sGridno].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
|
||||
FindGasMask(pSoldier) == NO_SLOT )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
if ( gpWorldLevelData[sGridno].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -108,7 +105,7 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode,
|
||||
// for example), don't bother
|
||||
case IGNORE_PATH : return(TRUE);
|
||||
|
||||
case ENSURE_PATH : if ( FindBestPath( pSoldier, sGridno, pSoldier->pathing.bLevel, WALKING, COPYROUTE, fFlags ) )
|
||||
case ENSURE_PATH : if ( FindBestPath( pSoldier, sGridNo, pSoldier->pathing.bLevel, WALKING, COPYROUTE, fFlags ) )
|
||||
{
|
||||
return(TRUE); // legal destination
|
||||
}
|
||||
@@ -118,7 +115,7 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode,
|
||||
return(FALSE);
|
||||
}
|
||||
// *** NOTE: movement mode hardcoded to WALKING !!!!!
|
||||
case ENSURE_PATH_COST: return(PlotPath(pSoldier,sGridno,FALSE,FALSE,FALSE,WALKING,FALSE,FALSE,0));
|
||||
case ENSURE_PATH_COST: return(PlotPath(pSoldier,sGridNo,FALSE,FALSE,FALSE,WALKING,FALSE,FALSE,0));
|
||||
|
||||
default :
|
||||
#ifdef BETAVERSION
|
||||
@@ -134,7 +131,7 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubPathMode,
|
||||
|
||||
|
||||
|
||||
int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
{
|
||||
UINT8 ubGottaCancel = FALSE;
|
||||
UINT8 ubSuccess = FALSE;
|
||||
@@ -142,7 +139,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
|
||||
// have to make sure the old destination is still legal (somebody may
|
||||
// have occupied the destination gridno in the meantime!)
|
||||
if (LegalNPCDestination(pSoldier,sGridno,ENSURE_PATH,WATEROK,0))
|
||||
if (LegalNPCDestination(pSoldier,sGridNo,ENSURE_PATH,WATEROK,0))
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR tempstr;
|
||||
@@ -153,12 +150,12 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
pSoldier->pathing.bPathStored = TRUE; // optimization - Ian
|
||||
|
||||
// make him go to it (needed to continue movement across multiple turns)
|
||||
NewDest(pSoldier,sGridno);
|
||||
NewDest(pSoldier,sGridNo);
|
||||
|
||||
ubSuccess = TRUE;
|
||||
|
||||
// make sure that it worked (check that pSoldier->pathing.sDestination == pSoldier->sGridNo)
|
||||
if (pSoldier->pathing.sDestination == sGridno)
|
||||
if (pSoldier->pathing.sDestination == sGridNo)
|
||||
{
|
||||
ubSuccess = TRUE;
|
||||
}
|
||||
@@ -207,26 +204,26 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
{
|
||||
// this is an escorted NPC, don't want to just completely stop
|
||||
// moving, try to find a nearby "next best" destination if possible
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sGridno,pSoldier->aiData.bAction);
|
||||
pSoldier->aiData.usActionData = GoAsFarAsPossibleTowards(pSoldier,sGridNo,pSoldier->aiData.bAction);
|
||||
|
||||
// if it's not possible to get any closer
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
// if it's not possible to get any closer
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
ubGottaCancel = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// change his desired destination to this new one
|
||||
sGridno = pSoldier->aiData.usActionData;
|
||||
sGridNo = pSoldier->aiData.usActionData;
|
||||
|
||||
// GoAsFar... sets pathStored TRUE only if he could go all the way
|
||||
|
||||
// make him go to it (needed to continue movement across multiple turns)
|
||||
NewDest(pSoldier,sGridno);
|
||||
NewDest(pSoldier,sGridNo);
|
||||
|
||||
|
||||
// make sure that it worked (check that pSoldier->pathing.sDestination == pSoldier->sGridNo)
|
||||
if (pSoldier->pathing.sDestination == sGridno)
|
||||
if (pSoldier->pathing.sDestination == sGridNo)
|
||||
ubSuccess = TRUE;
|
||||
else
|
||||
ubGottaCancel = TRUE;
|
||||
@@ -248,7 +245,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
|
||||
|
||||
|
||||
|
||||
INT16 NextPatrolPoint(SOLDIERTYPE *pSoldier)
|
||||
INT32 NextPatrolPoint(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
// patrol slot 0 is UNUSED, so max patrolCnt is actually only 9
|
||||
if ((pSoldier->aiData.bPatrolCnt < 1) || (pSoldier->aiData.bPatrolCnt >= MAXPATROLGRIDS))
|
||||
@@ -276,7 +273,7 @@ INT16 NextPatrolPoint(SOLDIERTYPE *pSoldier)
|
||||
|
||||
INT8 PointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT16 sPatrolPoint;
|
||||
INT32 sPatrolPoint;
|
||||
INT8 bOldOrders;
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
@@ -291,8 +288,8 @@ INT8 PointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
do
|
||||
{
|
||||
sPatrolPoint = NextPatrolPoint(pSoldier);
|
||||
}
|
||||
while ((sPatrolPoint != NOWHERE) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel) < 1));
|
||||
}
|
||||
while (( !TileIsOutOfBounds(sPatrolPoint)) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel) < 1));
|
||||
|
||||
// if we're back where we started, then ALL other patrol points are junk!
|
||||
if (pSoldier->sGridNo == sPatrolPoint)
|
||||
@@ -305,8 +302,8 @@ INT8 PointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
// if we don't have a legal patrol point
|
||||
if (sPatrolPoint == NOWHERE)
|
||||
// if we don't have a legal patrol point
|
||||
if (TileIsOutOfBounds(sPatrolPoint))
|
||||
{
|
||||
#ifdef BETAVERSION
|
||||
NumMessage("PointPatrolAI: ERROR - no legal patrol point for %d",pSoldier->ubID);
|
||||
@@ -336,8 +333,8 @@ INT8 PointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
|
||||
pSoldier->aiData.bOrders = bOldOrders;
|
||||
|
||||
// if it's not possible to get any closer, that's OK, but fail this call
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
// if it's not possible to get any closer, that's OK, but fail this call
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -356,7 +353,7 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
#endif
|
||||
INT16 sPatrolPoint;
|
||||
INT32 sPatrolPoint;
|
||||
INT8 bOldOrders, bPatrolIndex;
|
||||
INT8 bCnt;
|
||||
|
||||
@@ -375,8 +372,8 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
bPatrolIndex = (INT8) PreRandom( pSoldier->aiData.bPatrolCnt ) + 1;
|
||||
sPatrolPoint = pSoldier->aiData.sPatrolGrid[ bPatrolIndex];
|
||||
bCnt++;
|
||||
}
|
||||
while ( (sPatrolPoint == pSoldier->sGridNo) || ( (sPatrolPoint != NOWHERE) && (bCnt < pSoldier->aiData.bPatrolCnt) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel ) < 1)) );
|
||||
}
|
||||
while ( (sPatrolPoint == pSoldier->sGridNo) || ( (!TileIsOutOfBounds(sPatrolPoint)) && (bCnt < pSoldier->aiData.bPatrolCnt) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel ) < 1)) );
|
||||
|
||||
if (bCnt == pSoldier->aiData.bPatrolCnt)
|
||||
{
|
||||
@@ -385,8 +382,8 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
do
|
||||
{
|
||||
sPatrolPoint = NextPatrolPoint(pSoldier);
|
||||
}
|
||||
while ((sPatrolPoint != NOWHERE) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel) < 1));
|
||||
}
|
||||
while ((!TileIsOutOfBounds(sPatrolPoint)) && (NewOKDestination(pSoldier,sPatrolPoint,IGNOREPEOPLE, pSoldier->pathing.bLevel) < 1));
|
||||
}
|
||||
|
||||
// do nothing this time around
|
||||
@@ -396,8 +393,8 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
// if we don't have a legal patrol point
|
||||
if (sPatrolPoint == NOWHERE)
|
||||
// if we don't have a legal patrol point
|
||||
if (TileIsOutOfBounds(sPatrolPoint))
|
||||
{
|
||||
#ifdef BETAVERSION
|
||||
NumMessage("PointPatrolAI: ERROR - no legal patrol point for %d",pSoldier->ubID);
|
||||
@@ -426,8 +423,8 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
|
||||
pSoldier->aiData.bOrders = bOldOrders;
|
||||
|
||||
// if it's not possible to get any closer, that's OK, but fail this call
|
||||
if (pSoldier->aiData.usActionData == NOWHERE)
|
||||
// if it's not possible to get any closer, that's OK, but fail this call
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -443,14 +440,14 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
|
||||
|
||||
|
||||
|
||||
INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, INT16 bReserveAPs, INT8 bAction, INT8 fFlags )
|
||||
INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, INT16 bReserveAPs, INT8 bAction, INT8 fFlags )
|
||||
{
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
#endif
|
||||
INT16 sLoop,sAPCost;
|
||||
INT16 sTempDest,sGoToGrid;
|
||||
INT16 sOrigin;
|
||||
INT32 sLoop,sAPCost;
|
||||
INT32 sTempDest,sGoToGrid;
|
||||
INT32 sOrigin;
|
||||
UINT16 usMaxDist;
|
||||
UINT8 ubDirection,ubDirsLeft,ubDirChecked[8],fFound = FALSE;
|
||||
INT8 bAPsLeft, fPathFlags;
|
||||
@@ -483,8 +480,8 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
|
||||
{
|
||||
if ( InARoom( pSoldier->aiData.sPatrolGrid[0], &ubRoomRequired ) )
|
||||
{
|
||||
// make sure this doesn't interfere with pathing for scripts
|
||||
if ( pSoldier->sAbsoluteFinalDestination != NOWHERE )
|
||||
// make sure this doesn't interfere with pathing for scripts
|
||||
if (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
|
||||
{
|
||||
ubRoomRequired = 0;
|
||||
}
|
||||
@@ -787,14 +784,14 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
|
||||
}
|
||||
}
|
||||
|
||||
INT16 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, INT8 bAction)
|
||||
INT32 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, INT8 bAction)
|
||||
{
|
||||
return( InternalGoAsFarAsPossibleTowards( pSoldier, sDesGrid, -1, bAction, 0 ) );
|
||||
}
|
||||
|
||||
void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
INT16 sNewGridNo,bAPCost;
|
||||
INT32 usNewGridNo,bAPCost;
|
||||
|
||||
|
||||
// turn off the flag now that we're going to do something about it...
|
||||
@@ -807,7 +804,7 @@ void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pSoldier->aiData.usActionData >= NOWHERE)
|
||||
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
|
||||
{
|
||||
CancelAIAction(pSoldier,DONTFORCE);
|
||||
return;
|
||||
@@ -844,15 +841,15 @@ void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
|
||||
#endif
|
||||
}
|
||||
|
||||
sNewGridNo = NewGridNo( (INT16)pSoldier->sGridNo, DirectionInc( (UINT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ] ) );
|
||||
usNewGridNo = NewGridNo( pSoldier->sGridNo, DirectionInc( (UINT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ] ) );
|
||||
|
||||
// Find out how much it takes to move here!
|
||||
bAPCost = EstimateActionPointCost( pSoldier, sNewGridNo, (INT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ], pSoldier->usUIMovementMode, (INT8) pSoldier->pathing.usPathIndex, (INT8) pSoldier->pathing.usPathDataSize );
|
||||
bAPCost = EstimateActionPointCost( pSoldier, usNewGridNo, (INT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ], pSoldier->usUIMovementMode, (INT8) pSoldier->pathing.usPathIndex, (INT8) pSoldier->pathing.usPathDataSize );
|
||||
|
||||
if (pSoldier->bActionPoints >= bAPCost )
|
||||
if (pSoldier->bActionPoints >= bAPCost)
|
||||
{
|
||||
// seems to have enough points...
|
||||
NewDest(pSoldier,sNewGridNo);
|
||||
NewDest(pSoldier,usNewGridNo);
|
||||
// maybe we didn't actually start the action last turn...
|
||||
pSoldier->aiData.bActionInProgress = TRUE;
|
||||
#ifdef TESTAI
|
||||
@@ -913,7 +910,7 @@ void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
|
||||
void SetCivilianDestination(UINT8 ubWho, INT16 sGridno)
|
||||
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo)
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -926,10 +923,10 @@ void SetCivilianDestination(UINT8 ubWho, INT16 sGridno)
|
||||
{
|
||||
*/
|
||||
// if the destination is different from what he has now
|
||||
if (pSoldier->aiData.usActionData != sGridno)
|
||||
if (pSoldier->aiData.usActionData != sGridNo)
|
||||
{
|
||||
// store his new destination
|
||||
pSoldier->aiData.usActionData = sGridno;
|
||||
pSoldier->aiData.usActionData = sGridNo;
|
||||
|
||||
// and cancel any movement in progress that he was still engaged in
|
||||
pSoldier->aiData.bAction = AI_ACTION_NONE;
|
||||
@@ -964,7 +961,7 @@ void SetCivilianDestination(UINT8 ubWho, INT16 sGridno)
|
||||
|
||||
#define RADIUS 3
|
||||
|
||||
INT16 TrackScent( SOLDIERTYPE * pSoldier )
|
||||
INT32 TrackScent( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
// This function returns the best gridno to go to based on the scent being followed,
|
||||
// and the soldier (creature/animal)'s current direction (which is used to resolve
|
||||
@@ -1037,8 +1034,8 @@ INT16 TrackScent( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
}
|
||||
else if (ubStrength == ubBestStrength)
|
||||
{
|
||||
if (iBestGridNo == NOWHERE)
|
||||
{
|
||||
if (TileIsOutOfBounds(iBestGridNo))
|
||||
{
|
||||
// first place we've found with the same strength
|
||||
iBestGridNo = iGridNo;
|
||||
@@ -1074,11 +1071,11 @@ INT16 TrackScent( SOLDIERTYPE * pSoldier )
|
||||
else
|
||||
{
|
||||
// who else can track?
|
||||
}
|
||||
if (iBestGridNo != NOWHERE )
|
||||
}
|
||||
if (!TileIsOutOfBounds(iBestGridNo))
|
||||
{
|
||||
pSoldier->aiData.usActionData = (INT16) iBestGridNo;
|
||||
return( (INT16) iBestGridNo );
|
||||
pSoldier->aiData.usActionData = iBestGridNo;
|
||||
return( iBestGridNo );
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
+131
-54
@@ -53,6 +53,9 @@
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
// WANNE - BMP: DONE!
|
||||
//SB: new .npc format
|
||||
#define NPCEX_SIGNATURE 0x00070000
|
||||
|
||||
#define NUM_CIVQUOTE_SECTORS 20
|
||||
#define MINERS_CIV_QUOTE_INDEX 16
|
||||
@@ -82,13 +85,13 @@ INT16 gsCivQuoteSector[NUM_CIVQUOTE_SECTORS][2] =
|
||||
0, 0,
|
||||
};
|
||||
|
||||
#define NO_FACT (MAX_FACTS - 1)
|
||||
#define NO_QUEST 255
|
||||
#define NO_FACT (MAX_FACTS - 1)
|
||||
#define NO_QUEST 255
|
||||
#define QUEST_NOT_STARTED_NUM 100
|
||||
#define QUEST_DONE_NUM 200
|
||||
#define NO_QUOTE 255
|
||||
#define IRRELEVANT 255
|
||||
#define NO_MOVE 65535
|
||||
#define QUEST_DONE_NUM 200
|
||||
#define NO_QUOTE 255
|
||||
#define IRRELEVANT 255
|
||||
#define NO_MOVE NOWHERE//dnl ch46 031009
|
||||
|
||||
NPCQuoteInfo * gpNPCQuoteInfoArray[NUM_PROFILES] = { NULL };
|
||||
NPCQuoteInfo * gpBackupNPCQuoteInfoArray[NUM_PROFILES] = { NULL };
|
||||
@@ -125,6 +128,7 @@ extern void PayOffSkyriderDebtIfAny( );
|
||||
// NPC QUOTE LOW LEVEL ROUTINES
|
||||
//
|
||||
|
||||
// WANNE - BMP: DONE!
|
||||
NPCQuoteInfo * LoadQuoteFile( UINT8 ubNPC )
|
||||
{
|
||||
CHAR8 zFileName[255];
|
||||
@@ -132,6 +136,7 @@ NPCQuoteInfo * LoadQuoteFile( UINT8 ubNPC )
|
||||
NPCQuoteInfo * pFileData;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFileSize;
|
||||
DWORD uiSignature = 0; // SB // WANNE - BMP: DONE!
|
||||
|
||||
if ( ubNPC == PETER || ubNPC == ALBERTO || ubNPC == CARLO )
|
||||
{
|
||||
@@ -169,31 +174,107 @@ NPCQuoteInfo * LoadQuoteFile( UINT8 ubNPC )
|
||||
hFile = FileOpen( zFileName, FILE_ACCESS_READ, FALSE );
|
||||
CHECKN( hFile );
|
||||
|
||||
uiFileSize = sizeof( NPCQuoteInfo ) * NUM_NPC_QUOTE_RECORDS;
|
||||
pFileData = (NPCQuoteInfo *)MemAlloc( uiFileSize );
|
||||
if (pFileData)
|
||||
// WANNE - BMP: DONE!
|
||||
//<SB> new script format
|
||||
if (!FileRead( hFile, &uiSignature, sizeof(uiSignature), &uiBytesRead ) || uiBytesRead != sizeof(uiSignature) )
|
||||
return NULL;
|
||||
|
||||
if(uiSignature == NPCEX_SIGNATURE)//new fmt
|
||||
{
|
||||
if (!FileRead( hFile, pFileData, uiFileSize, &uiBytesRead ) || uiBytesRead != uiFileSize )
|
||||
uiFileSize = sizeof( NPCQuoteInfo ) * NUM_NPC_QUOTE_RECORDS;
|
||||
pFileData = (NPCQuoteInfo *)MemAlloc( uiFileSize );
|
||||
if (pFileData)
|
||||
{
|
||||
MemFree( pFileData );
|
||||
pFileData = NULL;
|
||||
if (!FileRead( hFile, pFileData, uiFileSize, &uiBytesRead ) || uiBytesRead != uiFileSize )
|
||||
{
|
||||
MemFree( pFileData );
|
||||
pFileData = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
FileClose( hFile );
|
||||
}
|
||||
else //old fmt - make conversion
|
||||
{
|
||||
int iRecord;
|
||||
_old_NPCQuoteInfo * pFileData_old_;
|
||||
uiFileSize = sizeof( _old_NPCQuoteInfo ) * NUM_NPC_QUOTE_RECORDS;
|
||||
pFileData_old_ = ( _old_NPCQuoteInfo * )MemAlloc( uiFileSize );
|
||||
FileSeek(hFile, 0, FILE_SEEK_FROM_START);
|
||||
if (pFileData_old_)
|
||||
{
|
||||
if (!FileRead( hFile, pFileData_old_, uiFileSize, &uiBytesRead ) || uiBytesRead != uiFileSize )
|
||||
{
|
||||
MemFree( pFileData_old_ );
|
||||
pFileData_old_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
FileClose( hFile );
|
||||
//check for Russian script & make a runtime conversion of it to International
|
||||
if( *(DWORD*)pFileData_old_ == 0x00350039 )
|
||||
{
|
||||
//just offset records 4 bytes backward
|
||||
_old_NPCQuoteInfo * pEnglishScript = ( _old_NPCQuoteInfo * )MemAlloc( uiFileSize );
|
||||
memcpy( pEnglishScript, ((char*)pFileData_old_)+4, uiFileSize-4 );
|
||||
MemFree( pFileData_old_ );
|
||||
pFileData_old_ = pEnglishScript;
|
||||
}
|
||||
|
||||
// Now it's time for conversion
|
||||
uiFileSize = sizeof(NPCQuoteInfo) * NUM_NPC_QUOTE_RECORDS;
|
||||
pFileData = (NPCQuoteInfo*)MemAlloc(uiFileSize);
|
||||
for(iRecord=0; iRecord<NUM_NPC_QUOTE_RECORDS; iRecord++)
|
||||
pFileData[iRecord] = pFileData_old_[iRecord];//dnl ch46 021009
|
||||
MemFree(pFileData_old_);
|
||||
}
|
||||
|
||||
FileClose( hFile );
|
||||
//<SB> check for Russian script & make a runtime conversion of it to International :D
|
||||
// just offset ptr 4 bytes backward
|
||||
if( *(DWORD*)pFileData == 0x00350039 )
|
||||
{
|
||||
NPCQuoteInfo * pEnglishScript = (NPCQuoteInfo *) MemAlloc( uiFileSize );
|
||||
memcpy( pEnglishScript, ((char*)pFileData)+4, uiFileSize-4 );
|
||||
MemFree( pFileData );
|
||||
return( pEnglishScript );
|
||||
}
|
||||
//</SB>
|
||||
//
|
||||
//</SB> new script format
|
||||
return( pFileData );
|
||||
}
|
||||
|
||||
//dnl ch46 021009
|
||||
NPCQuoteInfo& NPCQuoteInfo::operator=(const _old_NPCQuoteInfo& src)
|
||||
{
|
||||
if((void*)this != (void*)&src)
|
||||
{
|
||||
fFlags = src.fFlags;
|
||||
if(src.sRequiredGridno < 0)
|
||||
{
|
||||
sRequiredItem = NOTHING;
|
||||
sRequiredGridNo = -src.sRequiredGridno;
|
||||
}
|
||||
else
|
||||
{
|
||||
sRequiredItem = src.sRequiredItem;
|
||||
sRequiredGridNo = NOWHERE;
|
||||
}
|
||||
usFactMustBeTrue = src.usFactMustBeTrue;
|
||||
usFactMustBeFalse = src.usFactMustBeFalse;
|
||||
ubQuest = src.ubQuest;
|
||||
ubFirstDay = src.ubFirstDay;
|
||||
ubLastDay = src.ubLastDay;
|
||||
ubApproachRequired = src.ubApproachRequired;
|
||||
ubOpinionRequired = src.ubOpinionRequired;
|
||||
ubUnused = 0;
|
||||
ubQuoteNum = src.ubQuoteNum;
|
||||
ubNumQuotes = src.ubNumQuotes;
|
||||
ubStartQuest = src.ubStartQuest;
|
||||
ubEndQuest = src.ubEndQuest;
|
||||
ubTriggerNPC = src.ubTriggerNPC;
|
||||
ubTriggerNPCRec = src.ubTriggerNPCRec;
|
||||
usSetFactTrue = src.usSetFactTrue;
|
||||
usGiftItem = src.usGiftItem;
|
||||
sActionData = src.sActionData;
|
||||
if(src.usGoToGridno >= OLD_WORLD_MAX)
|
||||
usGoToGridNo = NOWHERE;
|
||||
else
|
||||
usGoToGridNo = src.usGoToGridno;
|
||||
}
|
||||
return(*this);
|
||||
}
|
||||
|
||||
void RevertToOriginalQuoteFile( UINT8 ubNPC )
|
||||
{
|
||||
if ( gpBackupNPCQuoteInfoArray[ ubNPC ] && gpNPCQuoteInfoArray[ubNPC] )
|
||||
@@ -718,13 +799,11 @@ UINT8 NPCConsiderTalking( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT8 ubRec
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if ( pNPCQuoteInfo->sRequiredGridno < 0 )
|
||||
}
|
||||
else if(!TileIsOutOfBounds(pNPCQuoteInfo->sRequiredGridNo))//dnl ch46 031009
|
||||
{
|
||||
if ( pSoldier->sGridNo != -(pNPCQuoteInfo->sRequiredGridno) )
|
||||
{
|
||||
if(pSoldier->sGridNo != pNPCQuoteInfo->sRequiredGridNo)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( NPCConsiderQuote( ubNPC, ubMerc, bApproach, ubLoop, ubTalkDesire, pNPCQuoteInfoArray ) )
|
||||
@@ -1462,7 +1541,7 @@ UINT8 NPCConsiderQuote( UINT8 ubNPC, UINT8 ubMerc, UINT8 ubApproach, UINT8 ubQuo
|
||||
}
|
||||
|
||||
|
||||
void ReplaceLocationInNPCData( NPCQuoteInfo * pNPCQuoteInfoArray, INT16 sOldGridNo, INT16 sNewGridNo )
|
||||
void ReplaceLocationInNPCData( NPCQuoteInfo * pNPCQuoteInfoArray, INT32 sOldGridNo, INT32 sNewGridNo )
|
||||
{
|
||||
UINT8 ubFirstQuoteRecord, ubLastQuoteRecord, ubLoop;
|
||||
NPCQuoteInfo * pNPCQuoteInfo;
|
||||
@@ -1472,18 +1551,16 @@ void ReplaceLocationInNPCData( NPCQuoteInfo * pNPCQuoteInfoArray, INT16 sOldGrid
|
||||
for (ubLoop = ubFirstQuoteRecord; ubLoop <= ubLastQuoteRecord; ubLoop++)
|
||||
{
|
||||
pNPCQuoteInfo = &(pNPCQuoteInfoArray[ ubLoop ]);
|
||||
if (sOldGridNo == -pNPCQuoteInfo->sRequiredGridno)
|
||||
if(sOldGridNo == pNPCQuoteInfo->sRequiredGridNo)//dnl ch46 031009
|
||||
pNPCQuoteInfo->sRequiredGridNo = sNewGridNo;
|
||||
if (sOldGridNo == pNPCQuoteInfo->usGoToGridNo)
|
||||
{
|
||||
pNPCQuoteInfo->sRequiredGridno = -sNewGridNo;
|
||||
}
|
||||
if (sOldGridNo == pNPCQuoteInfo->usGoToGridno)
|
||||
{
|
||||
pNPCQuoteInfo->usGoToGridno = sNewGridNo;
|
||||
pNPCQuoteInfo->usGoToGridNo = sNewGridNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT16 sOldGridNo, INT16 sNewGridNo )
|
||||
void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT32 sOldGridNo, INT32 sNewGridNo )
|
||||
{
|
||||
NPCQuoteInfo * pNPCQuoteInfoArray;
|
||||
|
||||
@@ -2066,7 +2143,7 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
}
|
||||
NPCDoAction( ubNPC, (UINT16) -(pQuotePtr->sActionData), ubRecordNum );
|
||||
}
|
||||
else if ( pQuotePtr->usGoToGridno == NO_MOVE && pQuotePtr->sActionData > 0 )
|
||||
else if ( pQuotePtr->usGoToGridNo == NO_MOVE && pQuotePtr->sActionData > 0 )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( ubNPC, FALSE );
|
||||
ZEROTIMECOUNTER( pSoldier->timeCounters.AICounter );
|
||||
@@ -2079,7 +2156,7 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
}
|
||||
|
||||
// Movement?
|
||||
if ( pQuotePtr->usGoToGridno != NO_MOVE )
|
||||
if ( pQuotePtr->usGoToGridNo != NO_MOVE )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( ubNPC, FALSE );
|
||||
|
||||
@@ -2089,7 +2166,7 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
// make sure he has keys
|
||||
pSoldier->flags.bHasKeys = TRUE;
|
||||
}
|
||||
if (pSoldier && pSoldier->sGridNo == pQuotePtr->usGoToGridno )
|
||||
if (pSoldier && pSoldier->sGridNo == pQuotePtr->usGoToGridNo )
|
||||
{
|
||||
// search for quotes to trigger immediately!
|
||||
pSoldier->ubQuoteRecord = ubRecordNum + 1; // add 1 so that the value is guaranteed nonzero
|
||||
@@ -2108,14 +2185,14 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
|
||||
if (pQuotePtr->sActionData == NPC_ACTION_TELEPORT_NPC)
|
||||
{
|
||||
BumpAnyExistingMerc( pQuotePtr->usGoToGridno );
|
||||
TeleportSoldier( pSoldier, pQuotePtr->usGoToGridno, FALSE );
|
||||
BumpAnyExistingMerc( pQuotePtr->usGoToGridNo );
|
||||
TeleportSoldier( pSoldier, pQuotePtr->usGoToGridNo, FALSE );
|
||||
// search for quotes to trigger immediately!
|
||||
NPCReachedDestination( pSoldier, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
NPCGotoGridNo( ubNPC, pQuotePtr->usGoToGridno, ubRecordNum );
|
||||
NPCGotoGridNo( ubNPC, pQuotePtr->usGoToGridNo, ubRecordNum );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2178,9 +2255,9 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
}
|
||||
}
|
||||
|
||||
INT16 NPCConsiderInitiatingConv( SOLDIERTYPE * pNPC, UINT8 * pubDesiredMerc )
|
||||
INT32 NPCConsiderInitiatingConv( SOLDIERTYPE * pNPC, UINT8 * pubDesiredMerc )
|
||||
{
|
||||
INT16 sMyGridNo, sDist, sDesiredMercDist = 100;
|
||||
INT32 sMyGridNo, sDist, sDesiredMercDist = 100;
|
||||
UINT8 ubNPC, ubMerc, ubDesiredMerc = NOBODY;
|
||||
UINT8 ubTalkDesire, ubHighestTalkDesire = 0;
|
||||
SOLDIERTYPE * pMerc;
|
||||
@@ -2352,7 +2429,7 @@ void NPCReachedDestination( SOLDIERTYPE * pNPC, BOOLEAN fAlreadyThere )
|
||||
// (indicated by a negative gridno in the has-item field)
|
||||
// or an action to perform once we reached this gridno
|
||||
|
||||
if ( pNPC->sGridNo == pQuotePtr->usGoToGridno )
|
||||
if ( pNPC->sGridNo == pQuotePtr->usGoToGridNo )
|
||||
{
|
||||
// check for an after-move action
|
||||
if ( pQuotePtr->sActionData > 0)
|
||||
@@ -2364,7 +2441,7 @@ void NPCReachedDestination( SOLDIERTYPE * pNPC, BOOLEAN fAlreadyThere )
|
||||
for ( ubLoop = 0; ubLoop < NUM_NPC_QUOTE_RECORDS; ubLoop++ )
|
||||
{
|
||||
pQuotePtr = &(pNPCQuoteInfoArray[ubLoop]);
|
||||
if ( pNPC->sGridNo == -(pQuotePtr->sRequiredGridno ) )
|
||||
if ( pNPC->sGridNo == pQuotePtr->sRequiredGridNo )//dnl ch46 031009
|
||||
{
|
||||
if ( NPCConsiderQuote( ubNPC, 0, TRIGGER_NPC, ubLoop, 0, pNPCQuoteInfoArray ) )
|
||||
{
|
||||
@@ -2468,7 +2545,7 @@ void PCsNearNPC( UINT8 ubNPC )
|
||||
for ( ubLoop = 0; ubLoop < NUM_NPC_QUOTE_RECORDS; ubLoop++ )
|
||||
{
|
||||
pQuotePtr = &(pNPCQuoteInfoArray[ubLoop]);
|
||||
if ( pSoldier->sGridNo == -(pQuotePtr->sRequiredGridno ) )
|
||||
if ( pSoldier->sGridNo == pQuotePtr->sRequiredGridNo )//dnl ch46 031009
|
||||
{
|
||||
if ( NPCConsiderQuote( ubNPC, 0, TRIGGER_NPC, ubLoop, 0, pNPCQuoteInfoArray ) )
|
||||
{
|
||||
@@ -3337,7 +3414,7 @@ void UpdateDarrelScriptToGoTo( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
// change destination in Darrel record 10 to go to a gridno adjacent to the
|
||||
// soldier's gridno, and destination in record 11
|
||||
INT16 sAdjustedGridNo;
|
||||
INT32 sAdjustedGridNo;
|
||||
UINT8 ubDummyDirection;
|
||||
SOLDIERTYPE * pDarrel;
|
||||
|
||||
@@ -3348,12 +3425,12 @@ void UpdateDarrelScriptToGoTo( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
|
||||
// find a spot to an alternate location nearby
|
||||
sAdjustedGridNo = FindGridNoFromSweetSpotExcludingSweetSpot( pDarrel, pSoldier->sGridNo, 5, &ubDummyDirection );
|
||||
if (sAdjustedGridNo == NOWHERE)
|
||||
sAdjustedGridNo = FindGridNoFromSweetSpotExcludingSweetSpot( pDarrel, pSoldier->sGridNo, 5, &ubDummyDirection );
|
||||
if (TileIsOutOfBounds(sAdjustedGridNo))
|
||||
{
|
||||
// yikes! try again with a bigger radius!
|
||||
sAdjustedGridNo = FindGridNoFromSweetSpotExcludingSweetSpot( pDarrel, pSoldier->sGridNo, 10, &ubDummyDirection );
|
||||
if (sAdjustedGridNo == NOWHERE)
|
||||
sAdjustedGridNo = FindGridNoFromSweetSpotExcludingSweetSpot( pDarrel, pSoldier->sGridNo, 10, &ubDummyDirection );
|
||||
if (TileIsOutOfBounds(sAdjustedGridNo))
|
||||
{
|
||||
// ok, now we're completely foobar
|
||||
return;
|
||||
@@ -3361,8 +3438,8 @@ void UpdateDarrelScriptToGoTo( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
|
||||
EnsureQuoteFileLoaded( DARREL );
|
||||
gpNPCQuoteInfoArray[ DARREL ][ 10 ].usGoToGridno = sAdjustedGridNo;
|
||||
gpNPCQuoteInfoArray[ DARREL ][ 11 ].sRequiredGridno = -(sAdjustedGridNo);
|
||||
gpNPCQuoteInfoArray[ DARREL ][ 10 ].usGoToGridNo = sAdjustedGridNo;
|
||||
gpNPCQuoteInfoArray[ DARREL ][ 11 ].sRequiredGridNo = sAdjustedGridNo;//dnl ch46 031009
|
||||
gpNPCQuoteInfoArray[ DARREL ][ 11 ].ubTriggerNPC = pSoldier->ubProfile;
|
||||
}
|
||||
|
||||
|
||||
+42
-2
@@ -33,6 +33,8 @@
|
||||
#define ACCEPT_ANY_ITEM 1000
|
||||
#define ANY_RIFLE 1001
|
||||
|
||||
|
||||
//WANNE - BMP: DONE!
|
||||
typedef struct
|
||||
{
|
||||
//SB: unify structure for all versions
|
||||
@@ -76,7 +78,45 @@ typedef struct
|
||||
UINT8 ubUnused[4];
|
||||
//#endif
|
||||
|
||||
} NPCQuoteInfo; // 32 bytes
|
||||
} _old_NPCQuoteInfo; // 32 bytes
|
||||
|
||||
//dnl ch46 021009
|
||||
class NPCQuoteInfo
|
||||
{
|
||||
public:
|
||||
//UINT8 ubIdentifier[4];
|
||||
|
||||
UINT16 fFlags;
|
||||
|
||||
// conditions
|
||||
INT16 sRequiredItem; // item NPC must have to say quote
|
||||
INT32 sRequiredGridNo; // location for NPC req'd to say quote
|
||||
|
||||
UINT16 usFactMustBeTrue; // ...before saying quote
|
||||
UINT16 usFactMustBeFalse; // ...before saying quote
|
||||
UINT8 ubQuest; // quest must be current to say quote
|
||||
UINT8 ubFirstDay; // first day quote can be said
|
||||
UINT8 ubLastDay; // last day quote can be said
|
||||
UINT8 ubApproachRequired; // must use this approach to generate quote
|
||||
UINT8 ubOpinionRequired; // opinion needed for this quote
|
||||
UINT8 ubUnused;
|
||||
|
||||
// quote to say (if any)
|
||||
UINT8 ubQuoteNum; // this is the quote to say
|
||||
UINT8 ubNumQuotes; // total # of quotes to say
|
||||
|
||||
// actions
|
||||
UINT8 ubStartQuest;
|
||||
UINT8 ubEndQuest;
|
||||
UINT8 ubTriggerNPC;
|
||||
UINT8 ubTriggerNPCRec;
|
||||
UINT16 usSetFactTrue;
|
||||
UINT16 usGiftItem; // item NPC gives to merc after saying quote
|
||||
INT16 sActionData; // special action value
|
||||
INT32 usGoToGridNo;
|
||||
public:
|
||||
NPCQuoteInfo& operator=(const _old_NPCQuoteInfo& src);
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -169,7 +209,7 @@ BOOLEAN LoadNPCInfoFromSavedGameFile( HWFILE hFile, UINT32 uiSaveGameVersion );
|
||||
|
||||
extern void TriggerFriendWithHostileQuote( UINT8 ubNPC );
|
||||
|
||||
extern void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT16 sOldGridNo, INT16 sNewGridNo );
|
||||
extern void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT32 sOldGridNo, INT32 sNewGridNo );
|
||||
|
||||
extern UINT8 ActionIDForMovementRecord( UINT8 ubNPC, UINT8 ubRecord );
|
||||
|
||||
|
||||
+11
-11
@@ -22,7 +22,7 @@ void MakeClosestEnemyChosenOne()
|
||||
UINT8 ubClosestEnemy = NOBODY;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT8 bPanicTrigger;
|
||||
INT16 sPanicTriggerGridNo;
|
||||
INT32 sPanicTriggerGridNo;
|
||||
|
||||
if ( ! (gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE) )
|
||||
{
|
||||
@@ -101,8 +101,8 @@ void MakeClosestEnemyChosenOne()
|
||||
continue; // next soldier
|
||||
}
|
||||
|
||||
sPanicTriggerGridNo = gTacticalStatus.sPanicTriggerGridNo[ bPanicTrigger ];
|
||||
if (sPanicTriggerGridNo == NOWHERE)
|
||||
sPanicTriggerGridNo = gTacticalStatus.sPanicTriggerGridNo[ bPanicTrigger ];
|
||||
if (TileIsOutOfBounds(sPanicTriggerGridNo))
|
||||
{
|
||||
// this should never happen!
|
||||
continue;
|
||||
@@ -186,7 +186,7 @@ void PossiblyMakeThisEnemyChosenOne( SOLDIERTYPE * pSoldier )
|
||||
INT32 iAPCost, iPathCost;
|
||||
//INT8 bOldKeys;
|
||||
INT8 bPanicTrigger;
|
||||
INT16 sPanicTriggerGridNo;
|
||||
INT32 sPanicTriggerGridNo;
|
||||
UINT32 uiPercentEnemiesKilled;
|
||||
|
||||
if ( ! (gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE) )
|
||||
@@ -252,7 +252,7 @@ INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove)
|
||||
INT8 bSlot;
|
||||
INT32 iPathCost;
|
||||
INT8 bPanicTrigger;
|
||||
INT16 sPanicTriggerGridNo;
|
||||
INT32 sPanicTriggerGridNo;
|
||||
#ifdef DEBUGDECISIONS
|
||||
STR16 tempstr;
|
||||
#endif
|
||||
@@ -431,8 +431,8 @@ INT8 ClosestPanicTrigger( SOLDIERTYPE * pSoldier )
|
||||
uiPercentEnemiesKilled = (UINT32)( 100 * (UINT32)(gTacticalStatus.ubArmyGuysKilled) / (UINT32)( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) );
|
||||
|
||||
for ( bLoop = 0; bLoop < NUM_PANIC_TRIGGERS; bLoop++ )
|
||||
{
|
||||
if ( gTacticalStatus.sPanicTriggerGridNo[ bLoop ] != NOWHERE )
|
||||
{
|
||||
if (!TileIsOutOfBounds(gTacticalStatus.sPanicTriggerGridNo[ bLoop ]))
|
||||
{
|
||||
|
||||
if ( gTacticalStatus.ubPanicTolerance[ bLoop ] > uiPercentEnemiesKilled )
|
||||
@@ -450,8 +450,8 @@ INT8 ClosestPanicTrigger( SOLDIERTYPE * pSoldier )
|
||||
break;
|
||||
}
|
||||
|
||||
// screen out the second/later panic trigger if the first one hasn't been triggered
|
||||
if ( bLoop > 0 && gTacticalStatus.sPanicTriggerGridNo[ bLoop - 1 ] != NOWHERE )
|
||||
// screen out the second/later panic trigger if the first one hasn't been triggered
|
||||
if ( bLoop > 0 && !TileIsOutOfBounds(gTacticalStatus.sPanicTriggerGridNo[ bLoop - 1 ]) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -500,8 +500,8 @@ BOOLEAN NeedToRadioAboutPanicTrigger( void )
|
||||
|
||||
for ( bLoop = 0; bLoop < NUM_PANIC_TRIGGERS; bLoop++ )
|
||||
{
|
||||
// if the bomb exists and its tolerance has been exceeded
|
||||
if ( (gTacticalStatus.sPanicTriggerGridNo[ bLoop ] != NOWHERE) && ( uiPercentEnemiesKilled >= gTacticalStatus.ubPanicTolerance[ bLoop ] ) )
|
||||
// if the bomb exists and its tolerance has been exceeded
|
||||
if ( (!TileIsOutOfBounds(gTacticalStatus.sPanicTriggerGridNo[ bLoop ])) && ( uiPercentEnemiesKilled >= gTacticalStatus.ubPanicTolerance[ bLoop ] ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ void RTHandleAI( SOLDIERTYPE * pSoldier )
|
||||
// the item pool index was stored in the special data field
|
||||
pSoldier->aiData.uiPendingActionData1 = pSoldier->iNextActionSpecialData;
|
||||
}
|
||||
}
|
||||
else if ( pSoldier->sAbsoluteFinalDestination != NOWHERE )
|
||||
}
|
||||
else if (!TileIsOutOfBounds(pSoldier->sAbsoluteFinalDestination))
|
||||
{
|
||||
if ( ACTING_ON_SCHEDULE( pSoldier ) )
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,326 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="TacticalAI" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=TacticalAI - Win32 Demo Bounds Checker
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TacticalAI.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TacticalAI.mak" CFG="TacticalAI - Win32 Demo Bounds Checker"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TacticalAI - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Debug Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Release Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Demo Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Demo Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Jagged Alliance 2/Development/Programming/Jagged Alliance 2/Build", AVAAAAAA"
|
||||
# PROP Scc_LocalPath "..\..\..\ja2\build"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "TacticalAI - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Tactical"
|
||||
# PROP BASE Intermediate_Dir "Tactical"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release with Debug"
|
||||
# PROP Intermediate_Dir "Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "..\laptop" /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\TileEngine" /I "..\strategic" /I ".\\" /D "NDEBUG" /D "RELEASE_WITH_DEBUG_INFO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /Fr /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Tactica1"
|
||||
# PROP BASE Intermediate_Dir "Tactica1"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Bounds Checker"
|
||||
# PROP Intermediate_Dir "Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /FR /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Debug Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Tactica0"
|
||||
# PROP BASE Intermediate_Dir "Tactica0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug Demo"
|
||||
# PROP Intermediate_Dir "Debug Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Release Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Tactica2"
|
||||
# PROP BASE Intermediate_Dir "Tactica2"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release Demo"
|
||||
# PROP Intermediate_Dir "Release Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /D "RELEASE_WITH_DEBUG_INFO" /Fr /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /Fr /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Demo Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Tactica3"
|
||||
# PROP BASE Intermediate_Dir "Tactica3"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Demo Release with Debug"
|
||||
# PROP Intermediate_Dir "Demo Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /D "RELEASE_WITH_DEBUG_INFO" /Fr /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\TileEngine" /I "..\strategic" /I "..\laptop" /I ".\\" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "XML_STATIC" /D "CINTERFACE" /Fr /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Demo Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Tactica4"
|
||||
# PROP BASE Intermediate_Dir "Tactica4"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Demo Bounds Checker"
|
||||
# PROP Intermediate_Dir "Demo Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "BOUNDS_CHECKER" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"AI All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "TacticalAI - Win32 Release"
|
||||
# Name "TacticalAI - Win32 Debug"
|
||||
# Name "TacticalAI - Win32 Release with Debug Info"
|
||||
# Name "TacticalAI - Win32 Bounds Checker"
|
||||
# Name "TacticalAI - Win32 Debug Demo"
|
||||
# Name "TacticalAI - Win32 Release Demo"
|
||||
# Name "TacticalAI - Win32 Demo Release with Debug Info"
|
||||
# Name "TacticalAI - Win32 Demo Bounds Checker"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AIList.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AIMain.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AIUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Attacks.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CreatureDecideAction.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DecideAction.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FindLocations.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Knowledge.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Medical.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Movement.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NPC.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PanicButtons.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\QuestDebug.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Realtime.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\AI All.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ai.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AIInternals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AIList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NPC.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\QuestDebug.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Realtime.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,907 +0,0 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on TacticalAI.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=TacticalAI - Win32 Demo Bounds Checker
|
||||
!MESSAGE No configuration specified. Defaulting to TacticalAI - Win32 Demo Bounds Checker.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "TacticalAI - Win32 Release" && "$(CFG)" != "TacticalAI - Win32 Debug" && "$(CFG)" != "TacticalAI - Win32 Release with Debug Info" && "$(CFG)" != "TacticalAI - Win32 Bounds Checker" && "$(CFG)" != "TacticalAI - Win32 Debug Demo" && "$(CFG)" != "TacticalAI - Win32 Release Demo" && "$(CFG)" != "TacticalAI - Win32 Demo Release with Debug Info" && "$(CFG)" != "TacticalAI - Win32 Demo Bounds Checker"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TacticalAI.mak" CFG="TacticalAI - Win32 Demo Bounds Checker"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TacticalAI - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Debug Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Release Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Demo Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TacticalAI - Win32 Demo Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "TacticalAI - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /GX /Z7 /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Release with Debug Info"
|
||||
|
||||
OUTDIR=.\Release with Debug
|
||||
INTDIR=.\Release with Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release with Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W4 /GX /Zi /O2 /I "..\laptop" /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\TileEngine" /I "..\strategic" /I ".\\" /D "NDEBUG" /D "RELEASE_WITH_DEBUG_INFO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Bounds Checker"
|
||||
|
||||
OUTDIR=.\Bounds Checker
|
||||
INTDIR=.\Bounds Checker
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Bounds Checker
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Debug Demo"
|
||||
|
||||
OUTDIR=.\Debug Demo
|
||||
INTDIR=.\Debug Demo
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug Demo
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Release Demo"
|
||||
|
||||
OUTDIR=.\Release Demo
|
||||
INTDIR=.\Release Demo
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release Demo
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Demo Release with Debug Info"
|
||||
|
||||
OUTDIR=.\Demo Release with Debug
|
||||
INTDIR=.\Demo Release with Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Demo Release with Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MT /W4 /GX /Zi /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\TileEngine" /I "..\strategic" /I "..\laptop" /I ".\\" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "XML_STATIC" /D "CINTERFACE" /Fr"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "TacticalAI - Win32 Demo Bounds Checker"
|
||||
|
||||
OUTDIR=.\Demo Bounds Checker
|
||||
INTDIR=.\Demo Bounds Checker
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Demo Bounds Checker
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\TacticalAI.lib" "$(OUTDIR)\TacticalAI.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\AIList.obj"
|
||||
-@erase "$(INTDIR)\AIList.sbr"
|
||||
-@erase "$(INTDIR)\AIMain.obj"
|
||||
-@erase "$(INTDIR)\AIMain.sbr"
|
||||
-@erase "$(INTDIR)\AIUtils.obj"
|
||||
-@erase "$(INTDIR)\AIUtils.sbr"
|
||||
-@erase "$(INTDIR)\Attacks.obj"
|
||||
-@erase "$(INTDIR)\Attacks.sbr"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.obj"
|
||||
-@erase "$(INTDIR)\CreatureDecideAction.sbr"
|
||||
-@erase "$(INTDIR)\DecideAction.obj"
|
||||
-@erase "$(INTDIR)\DecideAction.sbr"
|
||||
-@erase "$(INTDIR)\FindLocations.obj"
|
||||
-@erase "$(INTDIR)\FindLocations.sbr"
|
||||
-@erase "$(INTDIR)\Knowledge.obj"
|
||||
-@erase "$(INTDIR)\Knowledge.sbr"
|
||||
-@erase "$(INTDIR)\Medical.obj"
|
||||
-@erase "$(INTDIR)\Medical.sbr"
|
||||
-@erase "$(INTDIR)\Movement.obj"
|
||||
-@erase "$(INTDIR)\Movement.sbr"
|
||||
-@erase "$(INTDIR)\NPC.obj"
|
||||
-@erase "$(INTDIR)\NPC.sbr"
|
||||
-@erase "$(INTDIR)\PanicButtons.obj"
|
||||
-@erase "$(INTDIR)\PanicButtons.sbr"
|
||||
-@erase "$(INTDIR)\QuestDebug.obj"
|
||||
-@erase "$(INTDIR)\QuestDebug.sbr"
|
||||
-@erase "$(INTDIR)\Realtime.obj"
|
||||
-@erase "$(INTDIR)\Realtime.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\TacticalAI.bsc"
|
||||
-@erase "$(OUTDIR)\TacticalAI.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP_PROJ=/nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\Tactical" /I "\ja2\Build\Utils" /I "\ja2\Build\TileEngine" /I "\ja2\build\strategic" /I "\ja2\build\laptop" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\TacticalAI.pch" /YX"AI All.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\TacticalAI.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\AIList.sbr" \
|
||||
"$(INTDIR)\AIMain.sbr" \
|
||||
"$(INTDIR)\AIUtils.sbr" \
|
||||
"$(INTDIR)\Attacks.sbr" \
|
||||
"$(INTDIR)\CreatureDecideAction.sbr" \
|
||||
"$(INTDIR)\DecideAction.sbr" \
|
||||
"$(INTDIR)\FindLocations.sbr" \
|
||||
"$(INTDIR)\Knowledge.sbr" \
|
||||
"$(INTDIR)\Medical.sbr" \
|
||||
"$(INTDIR)\Movement.sbr" \
|
||||
"$(INTDIR)\NPC.sbr" \
|
||||
"$(INTDIR)\PanicButtons.sbr" \
|
||||
"$(INTDIR)\QuestDebug.sbr" \
|
||||
"$(INTDIR)\Realtime.sbr"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\TacticalAI.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\AIList.obj" \
|
||||
"$(INTDIR)\AIMain.obj" \
|
||||
"$(INTDIR)\AIUtils.obj" \
|
||||
"$(INTDIR)\Attacks.obj" \
|
||||
"$(INTDIR)\CreatureDecideAction.obj" \
|
||||
"$(INTDIR)\DecideAction.obj" \
|
||||
"$(INTDIR)\FindLocations.obj" \
|
||||
"$(INTDIR)\Knowledge.obj" \
|
||||
"$(INTDIR)\Medical.obj" \
|
||||
"$(INTDIR)\Movement.obj" \
|
||||
"$(INTDIR)\NPC.obj" \
|
||||
"$(INTDIR)\PanicButtons.obj" \
|
||||
"$(INTDIR)\QuestDebug.obj" \
|
||||
"$(INTDIR)\Realtime.obj"
|
||||
|
||||
"$(OUTDIR)\TacticalAI.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("TacticalAI.dep")
|
||||
!INCLUDE "TacticalAI.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "TacticalAI.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "TacticalAI - Win32 Release" || "$(CFG)" == "TacticalAI - Win32 Debug" || "$(CFG)" == "TacticalAI - Win32 Release with Debug Info" || "$(CFG)" == "TacticalAI - Win32 Bounds Checker" || "$(CFG)" == "TacticalAI - Win32 Debug Demo" || "$(CFG)" == "TacticalAI - Win32 Release Demo" || "$(CFG)" == "TacticalAI - Win32 Demo Release with Debug Info" || "$(CFG)" == "TacticalAI - Win32 Demo Bounds Checker"
|
||||
SOURCE=.\AIList.cpp
|
||||
|
||||
"$(INTDIR)\AIList.obj" "$(INTDIR)\AIList.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\AIMain.cpp
|
||||
|
||||
"$(INTDIR)\AIMain.obj" "$(INTDIR)\AIMain.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\AIUtils.cpp
|
||||
|
||||
"$(INTDIR)\AIUtils.obj" "$(INTDIR)\AIUtils.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\Attacks.cpp
|
||||
|
||||
"$(INTDIR)\Attacks.obj" "$(INTDIR)\Attacks.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\CreatureDecideAction.cpp
|
||||
|
||||
"$(INTDIR)\CreatureDecideAction.obj" "$(INTDIR)\CreatureDecideAction.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\DecideAction.cpp
|
||||
|
||||
"$(INTDIR)\DecideAction.obj" "$(INTDIR)\DecideAction.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\FindLocations.cpp
|
||||
|
||||
"$(INTDIR)\FindLocations.obj" "$(INTDIR)\FindLocations.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\Knowledge.cpp
|
||||
|
||||
"$(INTDIR)\Knowledge.obj" "$(INTDIR)\Knowledge.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\Medical.cpp
|
||||
|
||||
"$(INTDIR)\Medical.obj" "$(INTDIR)\Medical.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\Movement.cpp
|
||||
|
||||
"$(INTDIR)\Movement.obj" "$(INTDIR)\Movement.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\NPC.cpp
|
||||
|
||||
"$(INTDIR)\NPC.obj" "$(INTDIR)\NPC.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\PanicButtons.cpp
|
||||
|
||||
"$(INTDIR)\PanicButtons.obj" "$(INTDIR)\PanicButtons.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\QuestDebug.cpp
|
||||
|
||||
"$(INTDIR)\QuestDebug.obj" "$(INTDIR)\QuestDebug.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\Realtime.cpp
|
||||
|
||||
"$(INTDIR)\Realtime.obj" "$(INTDIR)\Realtime.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="TacticalAI_2005Express"
|
||||
ProjectGUID="{27A49DAF-3F5A-4FF2-B943-9559F0B63032}"
|
||||
RootNamespace="TacticalAI_2005Express"
|
||||
@@ -267,6 +267,68 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
@@ -268,6 +268,70 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="..\lib\VS2008\$(ConfigurationName)"
|
||||
IntermediateDirectory="..\build\VS2008\$(ProjectName)_$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_VS2008.vsprops"
|
||||
CharacterSet="0"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
+26
-25
@@ -11,7 +11,8 @@ extern INT16 gubAIPathCosts[19][19];
|
||||
#define AI_PATHCOST_RADIUS 9
|
||||
|
||||
extern BOOLEAN gfDisplayCoverValues;
|
||||
extern INT16 gsCoverValue[WORLD_MAX];
|
||||
//extern INT16 gsCoverValue[WORLD_MAX];
|
||||
extern INT16 * gsCoverValue;
|
||||
|
||||
// AI actions
|
||||
|
||||
@@ -145,17 +146,17 @@ INT16 ActionInProgress(SOLDIERTYPE *pSoldier);
|
||||
|
||||
INT8 CalcMorale(SOLDIERTYPE *pSoldier);
|
||||
INT32 CalcPercentBetter(INT32 iOldValue, INT32 iNewValue, INT32 iOldScale, INT32 iNewScale);
|
||||
void CallAvailableEnemiesTo(INT16 sGridno);
|
||||
void CallAvailableKingpinMenTo( INT16 sGridNo );
|
||||
void CallAvailableTeamEnemiesTo( INT16 sGridno, INT8 bTeam );
|
||||
void CallEldinTo( INT16 sGridNo );
|
||||
void CallAvailableEnemiesTo(INT32 sGridNo);
|
||||
void CallAvailableKingpinMenTo( INT32 sGridNo );
|
||||
void CallAvailableTeamEnemiesTo( INT32 sGridNo, INT8 bTeam );
|
||||
void CallEldinTo( INT32 sGridNo );
|
||||
void CancelAIAction(SOLDIERTYPE *pSoldier, UINT8 ubForce);
|
||||
void CheckForChangingOrders(SOLDIERTYPE *pSoldier );
|
||||
|
||||
INT8 ClosestPanicTrigger( SOLDIERTYPE * pSoldier );
|
||||
|
||||
INT16 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT16 * psGridNo, INT8 * pbLevel);
|
||||
INT16 ClosestPC( SOLDIERTYPE *pSoldier, INT16 * psDistance );
|
||||
INT32 ClosestKnownOpponent(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel);
|
||||
INT32 ClosestPC( SOLDIERTYPE *pSoldier, INT32 * psDistance );
|
||||
BOOLEAN CanAutoBandage( BOOLEAN fDoFullCheck );
|
||||
|
||||
void DebugAI( STR szOutput );
|
||||
@@ -173,11 +174,11 @@ void EndAIGuysTurn( SOLDIERTYPE *pSoldier );
|
||||
|
||||
INT8 ExecuteAction(SOLDIERTYPE *pSoldier);
|
||||
|
||||
INT16 FindAdjacentSpotBeside(SOLDIERTYPE *pSoldier, INT16 sGridno);
|
||||
INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *pPercentBetter);
|
||||
INT16 FindClosestDoor( SOLDIERTYPE * pSoldier );
|
||||
INT16 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection );
|
||||
INT16 FindNearestEdgePoint( INT16 sGridNo );
|
||||
INT32 FindAdjacentSpotBeside(SOLDIERTYPE *pSoldier, INT32 sGridNo);
|
||||
INT32 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *pPercentBetter);
|
||||
INT32 FindClosestDoor( SOLDIERTYPE * pSoldier );
|
||||
INT32 FindNearbyPointOnEdgeOfMap( SOLDIERTYPE * pSoldier, INT8 * pbDirection );
|
||||
INT32 FindNearestEdgePoint( INT32 sGridNo );
|
||||
|
||||
//Kris: Added these as I need specific searches on certain sides.
|
||||
enum
|
||||
@@ -187,12 +188,12 @@ enum
|
||||
SOUTH_EDGEPOINT_SEARCH,
|
||||
WEST_EDGEPOINT_SEARCH,
|
||||
};
|
||||
INT16 FindNearestEdgepointOnSpecifiedEdge( INT16 sGridNo, INT8 bEdgeCode );
|
||||
INT32 FindNearestEdgepointOnSpecifiedEdge( INT32 sGridNo, INT8 bEdgeCode );
|
||||
|
||||
INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier);
|
||||
INT32 FindNearestUngassedLand(SOLDIERTYPE *pSoldier);
|
||||
BOOLEAN FindRoofClimbingPoints( SOLDIERTYPE * pSoldier, INT16 sDesiredSpot );
|
||||
INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier);
|
||||
INT16 FindSweetCoverSpot(SOLDIERTYPE *pSoldier);
|
||||
INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier);
|
||||
INT32 FindSweetCoverSpot(SOLDIERTYPE *pSoldier);
|
||||
|
||||
void FreeUpNPCFromAttacking(UINT8 ubID);
|
||||
void FreeUpNPCFromPendingAction( SOLDIERTYPE * pSoldier );
|
||||
@@ -208,40 +209,40 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier );
|
||||
void HandleInitialRedAlert( INT8 bTeam, UINT8 ubCommunicate);
|
||||
|
||||
void InitPanicSystem();
|
||||
INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridno);
|
||||
INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT32 sGridno);
|
||||
BOOLEAN IsActionAffordable(SOLDIERTYPE *pSoldier);
|
||||
BOOLEAN InitAI( void );
|
||||
|
||||
void MakeClosestEnemyChosenOne();
|
||||
void ManChecksOnFriends(SOLDIERTYPE *pSoldier);
|
||||
|
||||
void NewDest(SOLDIERTYPE *pSoldier, UINT16 sGridno);
|
||||
INT16 NextPatrolPoint(SOLDIERTYPE *pSoldier);
|
||||
void NewDest(SOLDIERTYPE *pSoldier, INT32 sGridNo);
|
||||
INT32 NextPatrolPoint(SOLDIERTYPE *pSoldier);
|
||||
|
||||
INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove);
|
||||
void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier);
|
||||
|
||||
INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier);
|
||||
INT32 RandDestWithinRange(SOLDIERTYPE *pSoldier);
|
||||
INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier);
|
||||
|
||||
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT16 * pFromGridno);
|
||||
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 *pFromGridNo);
|
||||
|
||||
void SetCivilianDestination(UINT8 ubWho, INT16 sGridno);
|
||||
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo);
|
||||
void SetNewSituation( SOLDIERTYPE * pSoldier );
|
||||
|
||||
UINT8 SoldierDifficultyLevel( SOLDIERTYPE * pSoldier );
|
||||
void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier);
|
||||
void StartNPCAI(SOLDIERTYPE *pSoldier);
|
||||
void TempHurt(SOLDIERTYPE *pVictim, SOLDIERTYPE *pAttacker);
|
||||
int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno);
|
||||
int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT32 sGridNo);
|
||||
|
||||
BOOLEAN ValidCreatureTurn( SOLDIERTYPE * pCreature, INT8 bNewDirection );
|
||||
|
||||
BOOLEAN WearGasMaskIfAvailable( SOLDIERTYPE * pSoldier );
|
||||
INT16 WhatIKnowThatPublicDont(SOLDIERTYPE *pSoldier, UINT8 ubInSightOnly);
|
||||
|
||||
INT16 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp );
|
||||
INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction );
|
||||
INT32 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp );
|
||||
INT32 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT32 sPos, INT8 bAction );
|
||||
BOOLEAN CanClimbFromHere (SOLDIERTYPE * pSoldier, BOOLEAN fUp );
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user