Original Source for 1.13 Mod High Resolution version from 12/06/05

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@21 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2006-04-19 11:32:51 +00:00
commit e54aeb96aa
790 changed files with 741287 additions and 0 deletions
+98
View File
@@ -0,0 +1,98 @@
#ifndef __AI_ALL_H
#define __AI_ALL_H
#pragma message("GENERATED PCH FOR TACTICAL AI PROJECT.")
#include "AIList.h"
#include "Overhead.h"
#include "debug.h"
#include "AIInternals.h"
#include "wcheck.h"
#include "sgp.h"
#include "ai.h"
#include "Isometric Utils.h"
#include "math.h"
#include "Event Pump.h"
#include "Overhead Types.h"
#include "sys globals.h"
#include "opplist.h"
#include "animation control.h"
#include "font control.h"
#include "interface.h"
#include "screenids.h"
#include "worldman.h"
#include "pathai.h"
#include "points.h"
#include "weapons.h"
#include "items.h"
#include "Handle Items.h"
#include "animation data.h"
#include "los.h"
#include "message.h"
#include "TeamTurns.h"
#include "NPC.h"
#include "Dialogue Control.h"
#include "Soldier Profile.h"
#include "strategicmap.h"
#include "Tactical Save.h"
#include "Soldier Create.h"
#include "Explosion Control.h"
#include "Interactive Tiles.h"
#include "interface dialogue.h"
#include "Vehicles.h"
#include "renderworld.h"
#include "assignments.h"
#include "Soldier Functions.h"
#include "GameSettings.h"
#include "Buildings.h"
#include "Physics.h"
#include "Bullets.h"
#include "Spread Burst.h"
#include "SkillCheck.h"
#include "types.h"
#include "soldier control.h"
#include "Rotting Corpses.h"
#include "soldier add.h"
#include "Scheduling.h"
#include "Structure Wrap.h"
#include "Keys.h"
#include "Render Fun.h"
#include "Boxing.h"
#include <stdlib.h>
#include "World Items.h"
#include "Map Edgepoints.h"
#include "Text.h"
#include "video.h"
#include "Smell.h"
#include "mapscreen.h"
#include "strategic.h"
#include "Strategic Pathing.h"
#include "Quests.h"
#include "Game Clock.h"
#include "FileMan.h"
#include "Random.h"
#include "QuestDebug.h"
#include "soldier macros.h"
#include "Strategic Town Loyalty.h"
#include "Timer Control.h"
#include "Soldier Tile.h"
#include "meanwhile.h"
#include "Campaign Types.h"
#ifdef JA2TESTVERSION
#include "Quest Debug System.h"
#include "QuestText.h"
#endif
#include "stdarg.h"
#include <stdio.h>
#include "Soldier Profile Type.h"
#include "finances.h"
#include "Civ Quotes.h"
#include "Arms Dealer Init.h"
#include "Interface Panels.h"
#include "Soldier Ani.h"
#include "Queen Command.h"
#include "Lighting.h"
#include "environment.h"
#endif
+224
View File
@@ -0,0 +1,224 @@
#include "types.h"
#include "Isometric Utils.h"
#include "Animation Control.h"
#include "Overhead.h"
#include "random.h"
#include "Points.h"
extern BOOLEAN gfTurnBasedAI;
// THIS IS AN ITEM # - AND FOR NOW JUST COMPLETELY FAKE...
#define MAX_TOSS_SEARCH_DIST 1 // must throw within this of opponent
#define NPC_TOSS_SAFETY_MARGIN 4 // all friends must be this far away
#define ACTING_ON_SCHEDULE( p ) ( (p)->fAIFlags & AI_CHECK_SCHEDULE )
// the AI should try to have this many APs before climbing a roof, if possible
#define AI_AP_CLIMBROOF 15
#define TEMPORARILY 0
#define FOREVER 1
#define IGNORE_PATH 0
#define ENSURE_PATH 1
#define ENSURE_PATH_COST 2
//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 NOWATER 0
#define WATEROK 1
#define DONTADDTURNCOST 0
#define ADDTURNCOST 1
enum
{
URGENCY_LOW = 0,
URGENCY_MED,
URGENCY_HIGH,
NUM_URGENCY_STATES
};
#define NOWATER 0
#define WATEROK 1
#define IGNORE_PATH 0
#define ENSURE_PATH 1
#define ENSURE_PATH_COST 2
#define DONTFORCE 0
#define FORCE 1
#define MAX_ROAMING_RANGE WORLD_COLS
#define PTR_CIV_OR_MILITIA ( PTR_CIVILIAN || (pSoldier->bTeam == MILITIA_TEAM) )
#define REALTIME_AI_DELAY (10000 + Random( 1000 ))
#define REALTIME_CIV_AI_DELAY ( 1000 * (gTacticalStatus.Team[ MILITIA_TEAM ].bMenInSector + gTacticalStatus.Team[ CIV_TEAM ].bMenInSector) + 5000 + 2000 * Random( 3 ) )
#define REALTIME_CREATURE_AI_DELAY ( 10000 + 1000 * Random( 3 ) )
//#define PLAYINGMODE 0
//#define CAMPAIGNLENGTH 1
//#define LASTUSABLESLOT 2
//#define RANDOMMERCS 3
//#define AVAILABLEMERCS 4
//#define HIRINGKNOWLEDGE 5
//#define EQUIPMENTLEVEL 6
//#define ENEMYTEAMSIZE 7
#define ENEMYDIFFICULTY 8 // this is being used in this module
//#define FOG_OF_WAR 9
//#define TURNLENGTH 10
//#define INCREASEDAP 11
//#define BLOODSTAINS 12
//#define STARTINGBALANCE 13
#define MAXGAMEOPTIONS 14
#define NOSHOOT_WAITABIT -1
#define NOSHOOT_WATER -2
#define NOSHOOT_MYSELF -3
#define NOSHOOT_HURT -4
#define NOSHOOT_NOAMMO -5
#define NOSHOOT_NOLOAD -6
#define NOSHOOT_NOWEAPON -7
#define PERCENT_TO_IGNORE_THREAT 50 // any less, use threat value
#define ACTION_TIMEOUT_CYCLES 50 // # failed cycles through AI
#define MAX_THREAT_RANGE 400 // 30 tiles worth
#define MIN_PERCENT_BETTER 5 // 5% improvement in cover is good
#define TOSSES_PER_10TURNS 18 // max # of grenades tossable in 10 turns
#define SHELLS_PER_10TURNS 13 // max # of shells firable in 10 turns
#define SEE_THRU_COVER_THRESHOLD 5 // min chance to get through
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
typedef struct
{
SOLDIERTYPE * pOpponent;
INT16 sGridNo;
INT32 iValue;
INT32 iAPs;
INT32 iCertainty;
INT32 iOrigRange;
} THREATTYPE;
// define for bAimTime for bursting
#define BURSTING 5
#define AUTOFIRING 6
typedef struct
{
UINT8 ubPossible; // is this attack form possible? T/F
UINT8 ubOpponent; // which soldier is the victim?
UINT8 ubAimTime; // how many extra APs to spend on aiming
UINT8 ubChanceToReallyHit; // chance to hit * chance to get through cover
INT32 iAttackValue; // relative worthiness of this type of attack
INT16 sTarget; // target gridno of this attack
INT8 bTargetLevel; // target level of this attack
UINT8 ubAPCost; // how many APs the attack will use up
INT8 bWeaponIn; // the inv slot of the weapon in question
} ATTACKTYPE;
extern THREATTYPE Threat[MAXMERCS];
extern int ThreatPercent[10];
extern UINT8 SkipCoverCheck;
extern INT8 GameOption[MAXGAMEOPTIONS];
typedef enum
{
SEARCH_GENERAL_ITEMS,
SEARCH_AMMO,
SEARCH_WEAPONS
} ItemSearchReasons;
// go as far as possible flags
#define FLAG_CAUTIOUS 0x01
#define FLAG_STOPSHORT 0x02
#define STOPSHORTDIST 5
INT16 AdvanceToFiringRange( SOLDIERTYPE * pSoldier, INT16 sClosestOpponent );
BOOLEAN AimingGun(SOLDIERTYPE *pSoldier);
void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUnseen);
void CalcBestStab(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab, BOOLEAN fBladeAttack);
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 );
INT8 CanNPCAttack(SOLDIERTYPE *pSoldier);
void CheckIfTossPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow);
BOOLEAN ClimbingNecessary( SOLDIERTYPE * pSoldier, INT16 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);
void CreatureCall( SOLDIERTYPE * pCaller );
INT8 CreatureDecideAction( SOLDIERTYPE * pCreature );
void CreatureDecideAlertStatus( SOLDIERTYPE *pCreature );
INT8 CrowDecideAction( SOLDIERTYPE * pSoldier );
void DecideAlertStatus( SOLDIERTYPE *pSoldier );
INT8 DecideAutoBandage( SOLDIERTYPE * pSoldier );
UINT16 DetermineMovementMode( SOLDIERTYPE * pSoldier, INT8 bAction );
INT32 EstimateShotDamage(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubChanceToHit);
INT32 EstimateStabDamage(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 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 );
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 );
UINT8 GetTraversalQuoteActionID( INT8 bDirection );
INT16 GoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 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 );
void InitAttackType(ATTACKTYPE *pAttack);
INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, INT8 bReserveAPs, INT8 bAction, INT8 fFlags );
int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT16 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 );
void NPCDoesAct(SOLDIERTYPE *pSoldier);
void NPCDoesNothing(SOLDIERTYPE *pSoldier);
INT8 OKToAttack(SOLDIERTYPE *ptr, int target);
BOOLEAN NeedToRadioAboutPanicTrigger( void );
INT8 PointPatrolAI(SOLDIERTYPE *pSoldier);
void PossiblyMakeThisEnemyChosenOne( SOLDIERTYPE * pSoldier );
INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier);
INT32 RangeChangeDesire( SOLDIERTYPE * pSoldier );
UINT16 RealtimeDelay( SOLDIERTYPE * pSoldier );
void RearrangePocket(SOLDIERTYPE *pSoldier, INT8 bPocket1, INT8 bPocket2, UINT8 bPermanent);
void RTHandleAI( SOLDIERTYPE * pSoldier );
UINT16 RunAway( SOLDIERTYPE * pSoldier );
INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem );
UINT8 ShootingStanceChange( SOLDIERTYPE * pSoldier, ATTACKTYPE * pAttack, INT8 bDesiredDirection );
UINT8 StanceChange( SOLDIERTYPE * pSoldier, UINT8 ubAttackAPCost );
INT16 TrackScent( SOLDIERTYPE * pSoldier );
void RefreshAI(SOLDIERTYPE *pSoldier);
BOOLEAN InLightAtNight( INT16 sGridNo, INT8 bLevel );
INT16 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier );
BOOLEAN ArmySeesOpponents( void );
void CheckIfShotPossible(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN suppressionFire);
+940
View File
@@ -0,0 +1,940 @@
/*
*
* This file contains code for the AI linked list which
* (in TURNBASED COMBAT) keeps track of which AI guy should
* be handled next.
*
* The basic plan is to insert everyone into this list by their
* alert status at the beginning of the turn, in descending order
* (BLACK, then RED, then YELLOW, then GREEN)
*
*/
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "AIList.h"
#include "Overhead.h"
#include "debug.h"
#include "AIInternals.h"
#endif
#define AI_LIST_SIZE TOTAL_SOLDIERS
AILIST gAIList[ AI_LIST_SIZE ];
AILIST * gpFirstAIListEntry = NULL;
BOOLEAN SatisfiesAIListConditions( SOLDIERTYPE * pSoldier, UINT8 * pubDoneCount, BOOLEAN fDoRandomChecks );
void ClearAIList( void )
{
UINT8 ubLoop;
for ( ubLoop = 0; ubLoop < AI_LIST_SIZE; ubLoop++ )
{
gAIList[ ubLoop ].ubID = NOBODY;
gAIList[ ubLoop ].bPriority = 0;
gAIList[ ubLoop ].pNext = NULL;
}
gpFirstAIListEntry = NULL; // ??
}
void DeleteAIListEntry( AILIST * pEntry )
{
pEntry->ubID = NOBODY;
pEntry->bPriority = 0;
pEntry->pNext = NULL;
}
UINT8 FindEmptyAIListEntry( void )
{
UINT8 ubLoop;
for ( ubLoop = 0; ubLoop < AI_LIST_SIZE; ubLoop++ )
{
if ( gAIList[ ubLoop ].ubID == NOBODY )
{
return( ubLoop );
}
}
AssertMsg( 0, "Fatal error: Could not find empty AI list entry." );
return( AI_LIST_SIZE );
}
AILIST * CreateNewAIListEntry( UINT8 ubNewEntry, UINT8 ubID, INT8 bPriority )
{
gAIList[ ubNewEntry ].ubID = ubID;
gAIList[ ubNewEntry ].bPriority = bPriority;
gAIList[ ubNewEntry ].pNext = NULL;
return( &(gAIList[ ubNewEntry ]) );
}
UINT8 RemoveFirstAIListEntry( void )
{
AILIST * pOldFirstEntry;
UINT8 ubID;
while ( gpFirstAIListEntry != NULL)
{
// record pointer to start of list, and advance head ptr
pOldFirstEntry = gpFirstAIListEntry;
gpFirstAIListEntry = gpFirstAIListEntry->pNext;
// record ID, and delete old now unused entry
ubID = pOldFirstEntry->ubID;
DeleteAIListEntry( pOldFirstEntry );
// make sure conditions still met
if ( SatisfiesAIListConditions( MercPtrs[ ubID ], NULL, FALSE ) )
{
return( ubID );
}
}
return( NOBODY );
}
void RemoveAIListEntryForID( UINT8 ubID )
{
AILIST * pEntry;
AILIST * pPrevEntry;
pEntry = gpFirstAIListEntry;
pPrevEntry = NULL;
while( pEntry != NULL )
{
if ( pEntry->ubID == ubID )
{
if ( pEntry == gpFirstAIListEntry )
{
RemoveFirstAIListEntry();
}
else
{
pPrevEntry->pNext = pEntry->pNext;
DeleteAIListEntry( pEntry );
}
return;
}
pPrevEntry = pEntry;
pEntry = pEntry->pNext;
}
// none found, that's okay
}
BOOLEAN InsertIntoAIList( UINT8 ubID, INT8 bPriority )
{
UINT8 ubNewEntry;
AILIST * pEntry, * pNewEntry, * pPrevEntry = NULL;
ubNewEntry = FindEmptyAIListEntry();
pNewEntry = CreateNewAIListEntry( ubNewEntry, ubID, bPriority );
// look through the list now to see where to insert the entry
if (gpFirstAIListEntry == NULL)
{
// empty list!
gpFirstAIListEntry = pNewEntry;
// new entry's next ptr is null already
return( TRUE );
}
else
{
pEntry = gpFirstAIListEntry;
do
{
if ( bPriority > pEntry->bPriority )
{
// insert before this entry
pNewEntry->pNext = pEntry;
if (pEntry == gpFirstAIListEntry)
{
// inserting at head of list
gpFirstAIListEntry = pNewEntry;
}
else
{
Assert(pPrevEntry != NULL);
pPrevEntry->pNext = pNewEntry;
}
return( TRUE );
}
else if (pEntry->pNext == NULL)
{
// end of list!
pEntry->pNext = pNewEntry;
return( TRUE );
}
pPrevEntry = pEntry;
pEntry = pEntry->pNext;
AssertMsg( pEntry != gpFirstAIListEntry, "Fatal error: Loop in AI list!" );
}
while( pEntry != NULL );
}
// I don't know how the heck we would get here...
return( FALSE );
}
BOOLEAN SatisfiesAIListConditions( SOLDIERTYPE * pSoldier, UINT8 * pubDoneCount, BOOLEAN fDoRandomChecks )
{
if ( (gTacticalStatus.bBoxingState == BOXING) && !(pSoldier->uiStatusFlags & SOLDIER_BOXER) )
{
return( FALSE );
}
if ( ! ( pSoldier->bActive && pSoldier->bInSector ) )
{
// the check for
return( FALSE );
}
if ( ! ( pSoldier->bLife >= OKLIFE && pSoldier->bBreath >= OKBREATH ) )
{
return( FALSE );
}
if ( pSoldier->bMoved )
{
if ( pSoldier->bActionPoints <= 1 && pubDoneCount )
{
(*pubDoneCount)++;
}
return( FALSE );
}
// do we need to re-evaluate alert status here?
DecideAlertStatus( pSoldier );
// if we are dealing with the civ team and this person
// hasn't heard any gunfire, handle only 1 time in 10
if (PTR_CIVILIAN)
{
if ( pSoldier->ubBodyType == CROW || pSoldier->ubBodyType == COW )
{
// don't handle cows and crows in TB!
return( FALSE );
}
// if someone in a civ group is neutral but the civ group is non-neutral, should be handled all the time
if ( pSoldier->bNeutral && (pSoldier->ubCivilianGroup == NON_CIV_GROUP || gTacticalStatus.fCivGroupHostile[pSoldier->ubCivilianGroup] == CIV_GROUP_NEUTRAL ) )
{
if ( pSoldier->bAlertStatus < STATUS_RED )
{
// unalerted, barely handle
if ( fDoRandomChecks && PreRandom( 10 ) && !(pSoldier->ubQuoteRecord) )
{
return( FALSE );
}
}
else
{
// heard gunshots
if ( pSoldier->uiStatusFlags & SOLDIER_COWERING )
{
if ( pSoldier->bVisible )
{
// if have profile, don't handle, don't want them running around
if ( pSoldier->ubProfile != NO_PROFILE )
{
return( FALSE );
}
// else don't handle much
if ( fDoRandomChecks && PreRandom( 3 ) )
{
return( FALSE );
}
}
else
{
// never handle
return( FALSE );
}
}
else if ( pSoldier->ubBodyType == COW || pSoldier->ubBodyType == CRIPPLECIV )
{
// don't handle much
if ( fDoRandomChecks && PreRandom( 3 ) )
{
return( FALSE );
}
}
}
}
// non-neutral civs should be handled all the time, right?
// reset last action if cowering
if ( pSoldier->uiStatusFlags & SOLDIER_COWERING )
{
pSoldier->bLastAction = AI_ACTION_NONE;
}
}
return( TRUE );
}
BOOLEAN MoveToFrontOfAIList( UINT8 ubID )
{
// we'll have to fake this guy's alert status (in the list) to be the same as the current
// front of the list
INT8 bPriority;
UINT8 ubNewEntry;
AILIST * pNewEntry;
if ( !SatisfiesAIListConditions( MercPtrs[ ubID ], NULL, FALSE ) )
{
// can't do dat!
return( FALSE );
}
RemoveAIListEntryForID( ubID );
if (gpFirstAIListEntry == NULL)
{
return( InsertIntoAIList( ubID, MAX_AI_PRIORITY ) );
}
else
{
bPriority = gpFirstAIListEntry->bPriority;
ubNewEntry = FindEmptyAIListEntry();
pNewEntry = CreateNewAIListEntry( ubNewEntry, ubID, bPriority );
// insert at front
pNewEntry->pNext = gpFirstAIListEntry;
gpFirstAIListEntry = pNewEntry;
return( TRUE );
}
}
BOOLEAN BuildAIListForTeam( INT8 bTeam )
{
// loop through all non-player-team guys and add to list
UINT32 uiLoop;
BOOLEAN fInsertRet;
SOLDIERTYPE * pSoldier;
BOOLEAN fRet = FALSE;
UINT8 ubCount = 0;
UINT8 ubDoneCount = 0;
INT8 bPriority;
// this team is being given control so reset their muzzle flashes
TurnOffTeamsMuzzleFlashes( bTeam );
// clear the AI list
ClearAIList();
// create a new list
for( uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++ )
{
// non-null merc slot ensures active
pSoldier = MercSlots[ uiLoop ];
if ( pSoldier && pSoldier->bTeam == bTeam )
{
if ( !SatisfiesAIListConditions( pSoldier, &ubDoneCount, TRUE ) )
{
continue;
}
bPriority = pSoldier->bAlertStatus;
if ( pSoldier->bVisible == TRUE )
{
bPriority += 3;
}
fInsertRet = InsertIntoAIList( pSoldier->ubID, bPriority );
if (fInsertRet == FALSE)
{
// wtf???
break;
}
else
{
fRet = TRUE;
ubCount++;
}
}
}
if (fRet && ubCount > 0)
{
InitEnemyUIBar( ubCount, ubDoneCount );
}
return( fRet );
}
UINT8 gubEncryptionArray1[ BASE_NUMBER_OF_ROTATION_ARRAYS * 3 ][ NEW_ROTATION_ARRAY_SIZE ] =
{
{
11,129,18,136,163,80,128,
53,174,146,188,240,208,162,
127,192,251,6,52,128,119,
123,234,131,60,66,171,237,
89,192,17,37,139,20,185,
48,218,176,116,87,91,156,
166,224,215,100,237,71,157
},
{
99,93,179,25,113,109,38,
135,144,248,17,108,178,84,
210,254,54,240,209,92,35,
121,166,153,203,239,27,134,
231,193,97,73,188,59,87,
146,111,103,48,161,25,196,
84,201,179,208,220,189,113
},
{
217,122,77,162,22,25,203,
190,115,43,235,154,27,227,
44,125,34,58,157,17,83,
26,63,221,159,135,149,85,
26,32,201,22,253,189,250,
113,185,171,252,214,115,41,
65,49,3,174,27,220,206
},
{
180,29,63,146,101,192,164,
128,7,28,111,172,125,203,
63,77,184,220,27,184,98,
224,64,156,178,229,167,105,
169,147,215,103,168,25,40,
114,156,45,253,198,179,207,
35,235,225,20,205,34,14
},
{
144,113,83,76,208,239,2,
236,97,66,38,195,185,52,
121,123,196,66,34,78,50,
66,57,247,79,216,38,63,
155,107,62,234,218,142,175,
125,209,159,31,135,99,143,
250,243,90,127,249,32,121
},
{
76,189,22,40,143,9,197,
91,66,142,145,3,138,202,
4,170,214,219,20,140,212,
214,183,197,98,142,57,235,
16,71,13,186,77,72,147,
14,206,204,152,226,86,66,
219,148,100,89,148,22,243
},
{
206,52,86,217,117,60,134,
215,114,154,137,4,37,66,
48,147,170,113,137,175,130,
112,246,87,69,40,64,249,
227,97,91,216,102,11,40,
195,173,91,205,85,32,40,
248,63,194,73,172,181,184
},
{
95,234,168,147,217,213,204,
132,140,158,22,201,182,222,
191,104,206,165,108,154,226,
236,135,245,247,166,112,180,
49,43,146,43,23,40,249,
206,228,226,135,211,33,241,
74,214,104,47,44,132,187
},
{
26,121,193,40,90,98,61,
42,168,13,248,146,203,80,
166,90,223,172,107,45,168,
161,239,10,34,239,59,209,
4,231,81,23,120,85,12,
12,182,35,39,229,187,83,
243,142,218,94,179,241,90
},
{
142,9,212,220,121,125,115,
191,40,144,216,56,6,76,
46,90,51,206,241,201,77,
202,90,67,73,116,203,199,
115,197,174,133,56,174,132,
91,185,8,143,5,221,216,
232,211,225,219,86,5,16
},
{
195,200,131,175,42,189,78,
186,174,122,45,142,55,106,
248,10,204,112,38,82,5,
154,209,193,124,244,5,29,
79,237,97,175,16,8,250,
93,44,79,143,63,64,84,
205,244,74,6,242,42,58
},
{
82,107,124,208,214,175,77,
77,123,32,162,220,87,3,
156,62,171,114,178,161,88,
102,51,47,152,147,54,41,
105,91,137,53,107,125,183,
174,142,207,195,133,127,164,
165,161,2,37,44,65,60
},
{
79,86,68,37,213,189,232,
15,143,41,230,136,191,222,
103,133,217,205,204,23,10,
45,197,140,55,160,166,99,
169,119,117,198,35,51,178,
15,139,203,66,8,252,236,
125,90,88,169,222,244,35
},
{
206,62,201,224,92,24,183,
166,85,215,246,29,100,157,
224,164,126,118,116,219,18,
120,92,60,230,206,224,4,
51,19,146,37,19,255,11,
123,233,236,157,232,207,13,
66,177,158,229,169,180,180
},
{
254,188,196,16,50,108,215,
198,166,37,72,138,227,191,
212,60,245,70,171,57,30,
97,27,98,4,211,66,152,
225,198,91,154,166,86,234,
10,124,31,130,130,182,56,
85,134,152,104,78,51,237
},
{
236,233,113,237,175,131,167,
99,63,81,142,139,103,199,
62,171,185,154,14,203,229,
21,89,153,52,2,198,224,
253,212,40,155,123,88,134,
5,188,144,130,185,34,11,
131,71,64,82,241,56,101
},
{
201,241,254,183,146,209,209,
56,204,180,211,122,211,146,
154,117,190,49,116,68,216,
29,125,35,65,69,224,144,
123,84,91,223,20,83,90,
22,36,186,200,111,220,126,
240,96,223,53,112,101,142
},
{
243,182,138,24,233,13,236,
111,101,139,30,233,72,14,
184,190,152,139,8,27,43,
209,11,1,28,32,184,180,
23,136,221,224,23,172,92,
54,164,174,55,183,64,226,
55,110,252,49,136,184,237
},
{
168,31,242,128,40,66,176,
76,175,24,54,137,56,123,
117,172,160,14,64,79,145,
189,229,248,232,177,1,228,
140,236,147,75,46,114,76,
98,236,88,11,153,87,150,
113,38,187,224,182,142,66
},
{
122,108,52,202,69,109,124,
11,236,192,188,209,141,143,
107,2,161,242,191,43,149,
213,80,56,214,152,203,56,
184,181,95,171,8,24,230,
90,155,103,126,27,205,246,
138,151,25,142,214,114,214
},
{
213,206,212,75,128,138,215,
3,9,165,183,182,42,136,
95,160,201,65,37,150,152,
120,86,194,18,154,95,72,
32,216,51,191,18,14,196,
210,34,39,38,205,70,33,
49,149,117,58,69,184,47
},
{
103,250,19,106,176,94,193,
170,129,145,215,119,136,99,
150,230,68,189,140,121,205,
122,113,250,249,128,25,160,
111,175,78,31,194,145,244,
241,50,63,74,129,28,126,
145,114,195,134,27,192,129
},
{
105,226,237,237,149,175,252,
47,105,12,92,232,88,227,
150,6,135,43,231,207,108,
96,125,141,94,67,149,47,
140,149,47,26,91,70,142,
191,156,210,71,9,152,66,
2,50,96,134,186,44,99
},
{
170,175,37,193,148,175,69,
82,195,14,57,200,212,237,
173,12,48,17,66,33,172,
253,26,162,149,146,154,80,
201,219,119,146,111,85,150,
130,251,78,244,97,242,176,
24,248,51,221,36,223,33
},
{
213,62,25,152,108,57,4,
234,182,62,27,201,109,115,
108,127,138,80,90,52,185,
155,125,184,249,199,67,143,
9,170,32,163,226,66,228,
119,8,136,33,43,190,251,
25,44,15,242,48,231,170
},
{
69,91,100,123,125,126,3,
16,15,53,81,162,184,255,
71,231,166,75,180,107,111,
70,76,164,128,12,27,134,
15,3,189,185,48,3,58,
65,38,37,200,190,124,195,
106,2,12,153,166,58,138
},
{
123,65,90,159,168,71,9,
59,29,75,192,44,243,30,
96,151,51,235,228,107,25,
10,122,99,77,82,172,172,
238,98,218,213,14,151,193,
17,99,33,53,103,222,249,
211,243,248,47,243,195,56
},
{
56,101,106,235,205,98,227,
149,9,73,232,235,35,111,
57,2,186,181,5,123,226,
25,5,73,234,254,89,240,
29,109,202,196,100,234,133,
21,35,57,225,202,22,171,
86,96,154,71,43,190,51
},
{
113,4,220,161,78,222,190,
105,166,150,161,29,113,135,
244,63,197,107,244,34,109,
12,130,139,204,212,9,130,
89,234,19,21,88,222,93,
119,22,135,8,75,90,48,
186,108,73,157,75,30,108
},
{
17,212,231,18,216,185,255,
206,139,136,155,69,129,54,
249,247,173,184,136,88,86,
87,234,205,238,209,80,233,
120,180,224,128,177,228,157,
229,131,214,148,251,230,103,
174,80,190,201,4,2,208
},
{
146,254,166,111,69,45,224,
229,101,23,235,77,130,235,
201,210,60,113,78,20,166,
239,198,159,25,140,106,57,
210,220,85,242,120,14,58,
186,211,127,152,111,219,20,
147,21,114,47,54,65,221
},
{
155,85,87,94,68,199,179,
247,16,43,80,193,182,242,
2,222,241,243,234,109,211,
36,48,131,165,204,150,166,
31,224,17,175,90,178,226,
156,73,193,106,70,25,207,
45,110,76,9,57,33,236
},
{
92,120,224,167,215,16,147,
48,40,91,171,186,7,158,
131,243,194,20,101,62,158,
82,46,144,65,190,23,223,
233,24,132,74,164,166,105,
255,50,68,41,33,225,183,
114,136,18,144,18,185,137
},
{
17,38,234,111,64,195,105,
13,188,100,59,18,103,53,
94,165,126,168,103,216,69,
76,238,220,198,89,149,145,
208,249,2,180,199,181,161,
111,85,255,154,106,166,101,
176,38,55,72,130,223,209
},
{
167,241,154,215,233,21,164,
109,34,121,61,150,197,43,
152,236,80,57,1,247,197,
38,56,196,145,26,241,225,
184,26,125,57,215,61,108,
5,217,25,106,86,248,82,
244,93,228,157,51,255,155
},
{
17,171,212,222,22,253,38,
199,218,104,6,108,146,77,
24,18,109,109,32,217,136,
11,245,112,196,192,233,176,
199,40,69,165,19,35,228,
253,123,233,162,79,218,165,
141,47,92,202,150,152,45
},
{
225,196,143,248,9,135,132,
255,208,73,103,33,197,201,
226,174,65,101,190,110,210,
217,216,142,238,169,181,244,
21,167,20,177,57,211,138,
7,141,14,153,186,125,207,
52,40,255,101,49,219,7
},
{
221,161,17,57,52,123,239,
174,209,155,220,246,5,150,
183,9,120,65,88,110,87,
121,50,70,26,37,101,116,
179,214,27,159,28,19,139,
66,223,181,127,121,199,102,
162,222,47,153,130,15,38
},
{
17,153,36,244,88,45,209,
13,52,102,102,28,128,115,
92,56,99,16,189,213,111,
73,11,146,130,213,230,111,
254,221,49,151,65,127,210,
67,208,249,241,212,65,196,
197,202,67,119,183,143,207
},
{
215,34,213,248,221,72,132,
67,21,208,217,15,31,125,
206,1,200,69,102,231,110,
158,231,21,29,36,182,156,
61,82,201,119,35,142,102,
8,89,59,54,229,1,5,
70,123,34,41,23,101,57
},
{
237,73,8,231,245,255,96,
23,192,156,114,102,247,212,
103,60,202,216,189,92,25,
135,142,70,147,87,94,74,
147,3,108,158,231,159,5,
78,65,36,186,99,128,2,
18,25,152,230,144,115,68
},
{
67,160,17,62,161,74,151,
54,117,56,133,66,108,253,
205,246,229,26,15,240,160,
164,184,238,53,49,8,79,
128,206,34,19,134,160,42,
46,244,13,175,78,210,242,
70,225,118,232,164,133,95
},
{
234,31,155,10,134,212,66,
76,236,106,93,102,226,169,
245,73,20,225,147,59,178,
82,227,106,224,136,73,140,
225,8,166,24,129,254,2,
60,177,128,86,36,201,254,
46,168,120,115,83,251,187
},
{
250,68,115,1,74,167,252,
185,210,119,96,136,228,20,
226,83,178,12,92,93,137,
176,99,183,16,82,157,33,
240,58,214,190,190,59,230,
162,107,243,19,160,47,144,
237,98,48,50,92,59,202
},
{
200,215,171,200,126,118,10,
108,131,226,88,154,98,215,
172,254,156,39,46,143,200,
255,29,50,226,118,222,231,
11,231,124,91,113,98,162,
28,148,147,126,109,164,97,
127,240,42,199,123,23,180
},
{
12,31,155,207,220,35,247,
228,132,83,16,83,176,193,
3,101,248,53,107,111,184,
58,242,191,69,225,126,151,
54,140,231,245,181,216,122,
88,139,10,38,53,235,254,
183,99,170,32,231,44,224
},
{
58,165,53,170,203,99,6,
7,176,212,91,123,166,220,
253,142,168,30,92,181,147,
230,151,199,9,241,63,145,
18,185,118,166,114,193,176,
248,40,177,209,100,8,139,
202,181,248,231,144,70,195
},
{
130,125,204,233,239,251,121,
125,221,146,233,122,172,27,
30,135,191,89,246,172,84,
164,101,232,68,230,205,26,
131,152,212,69,170,4,10,
157,124,120,171,85,158,175,
253,165,128,27,100,7,165
},
{
73,196,31,75,40,86,63,
169,84,115,12,176,43,123,
51,162,223,112,169,80,73,
82,110,99,145,226,70,121,
158,222,108,131,72,70,172,
32,48,207,219,106,99,30,
51,249,130,195,120,123,171
},
{
200,109,185,213,166,141,95,
219,114,120,103,244,57,23,
111,193,41,233,225,180,176,
121,66,10,13,97,114,5,
125,233,83,167,164,179,138,
170,44,99,209,215,82,191,
160,149,104,78,138,201,227
},
{
213,42,215,30,187,239,231,
72,204,179,60,193,67,75,
188,94,173,32,126,173,132,
254,121,236,7,2,33,168,
68,249,31,180,211,23,228,
135,44,63,68,159,20,222,
221,240,43,142,123,23,244
},
{
94,48,61,112,51,92,118,
161,242,95,128,16,237,38,
159,179,81,76,164,62,254,
14,169,65,160,197,179,44,
81,30,183,138,178,196,54,
141,197,193,234,76,97,64,
186,179,158,235,115,169,11
},
{
168,114,74,10,218,199,193,
41,245,250,186,205,131,243,
215,15,105,59,42,17,150,
13,40,194,220,108,22,72,
37,197,83,249,187,57,148,
64,234,33,109,51,156,254,
53,72,55,68,174,240,117
},
{
55,124,124,107,105,194,22,
114,242,8,53,46,244,181,
96,111,133,70,140,37,165,
131,1,12,65,220,11,103,
233,72,92,101,91,163,116,
125,83,15,224,107,242,66,
178,12,37,63,4,213,48
},
{
115,221,24,12,172,92,193,
137,224,105,238,239,70,221,
224,35,164,110,174,229,104,
50,86,88,100,25,108,68,
195,55,41,87,21,47,249,
212,245,152,96,232,85,190,
77,39,177,136,180,82,111
},
{
231,138,6,145,159,235,88,
248,198,164,9,130,209,202,
96,14,128,170,71,217,142,
180,183,53,110,173,41,252,
249,214,242,217,100,66,95,
181,71,11,111,109,35,175,
240,32,51,69,251,41,220
},
{
177,114,53,161,177,151,101,
226,222,87,255,85,102,86,
161,114,178,99,106,206,188,
98,29,157,53,65,169,67,
74,31,24,83,60,48,80,
186,116,113,179,144,90,220,
252,71,167,25,110,167,94
},
};
+18
View File
@@ -0,0 +1,18 @@
#include "Types.h"
typedef struct AILIST
{
UINT8 ubID;
INT8 bPriority;
UINT8 ubUnused;
struct AILIST * pNext;
} AILIST;
#define MAX_AI_PRIORITY 100
extern void ClearAIList( void );
extern AILIST * CreateNewAIListEntry( UINT8 ubNewEntry, UINT8 ubID, INT8 bAlertStatus );
extern BOOLEAN InsertIntoAIList( UINT8 ubID, INT8 bAlertStatus );
extern UINT8 RemoveFirstAIListEntry( void );
extern BOOLEAN BuildAIListForTeam( INT8 bTeam );
extern BOOLEAN MoveToFrontOfAIList( UINT8 ubID );
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+403
View File
@@ -0,0 +1,403 @@
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "ai.h"
#include "AIInternals.h"
#include "opplist.h"
#endif
void CallAvailableEnemiesTo( INT16 sGridNo )
{
INT32 iLoop;
INT32 iLoop2;
SOLDIERTYPE * pSoldier;
// All enemy teams become aware of a very important "noise" coming from here!
for (iLoop = 0; iLoop < LAST_TEAM; iLoop++)
{
// if this team is active
if (gTacticalStatus.Team[iLoop].bTeamActive)
{
// if this team is computer-controlled, and isn't the CIVILIAN "team"
if (!(gTacticalStatus.Team[iLoop].bHuman) && (iLoop != CIV_TEAM))
{
// make this team (publicly) aware of the "noise"
gsPublicNoiseGridno[iLoop] = sGridNo;
gubPublicNoiseVolume[iLoop] = MAX_MISC_NOISE_DURATION;
// new situation for everyone;
iLoop2 = gTacticalStatus.Team[ iLoop ].bFirstID;
for ( pSoldier = MercPtrs[iLoop2]; iLoop2 <= gTacticalStatus.Team[ iLoop ].bLastID; iLoop2++, pSoldier++ )
{
if (pSoldier->bActive && pSoldier->bInSector && pSoldier->bLife >= OKLIFE)
{
SetNewSituation( pSoldier );
WearGasMaskIfAvailable( pSoldier );
}
}
}
}
}
}
void CallAvailableTeamEnemiesTo( INT16 sGridno, INT8 bTeam )
{
INT32 iLoop2;
SOLDIERTYPE * pSoldier;
// All enemy teams become aware of a very important "noise" coming from here!
// if this team is active
if (gTacticalStatus.Team[bTeam].bTeamActive)
{
// if this team is computer-controlled, and isn't the CIVILIAN "team"
if (!(gTacticalStatus.Team[bTeam].bHuman) && (bTeam != CIV_TEAM))
{
// make this team (publicly) aware of the "noise"
gsPublicNoiseGridno[bTeam] = sGridno;
gubPublicNoiseVolume[bTeam] = MAX_MISC_NOISE_DURATION;
// new situation for everyone;
iLoop2 = gTacticalStatus.Team[ bTeam ].bFirstID;
for ( pSoldier = MercPtrs[iLoop2]; iLoop2 <= gTacticalStatus.Team[ bTeam ].bLastID; iLoop2++, pSoldier++ )
{
if (pSoldier->bActive && pSoldier->bInSector && pSoldier->bLife >= OKLIFE)
{
SetNewSituation( pSoldier );
WearGasMaskIfAvailable( pSoldier );
}
}
}
}
}
void CallAvailableKingpinMenTo( INT16 sGridNo )
{
// like call all enemies, but only affects civgroup KINGPIN guys with
// NO PROFILE
INT32 iLoop2;
SOLDIERTYPE * pSoldier;
// All enemy teams become aware of a very important "noise" coming from here!
// if this team is active
if (gTacticalStatus.Team[CIV_TEAM].bTeamActive)
{
// make this team (publicly) aware of the "noise"
gsPublicNoiseGridno[CIV_TEAM] = sGridNo;
gubPublicNoiseVolume[CIV_TEAM] = MAX_MISC_NOISE_DURATION;
// new situation for everyone...
iLoop2 = gTacticalStatus.Team[ CIV_TEAM ].bFirstID;
for ( pSoldier = MercPtrs[iLoop2]; iLoop2 <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; iLoop2++, pSoldier++ )
{
if (pSoldier->bActive && pSoldier->bInSector && pSoldier->bLife >= OKLIFE && pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP && pSoldier->ubProfile == NO_PROFILE)
{
SetNewSituation( pSoldier );
}
}
}
}
void CallEldinTo( INT16 sGridNo )
{
// like call all enemies, but only affects Eldin
SOLDIERTYPE * pSoldier;
// Eldin becomes aware of a very important "noise" coming from here!
// So long as he hasn't already heard a noise a sec ago...
if (gTacticalStatus.Team[CIV_TEAM].bTeamActive)
{
// new situation for Eldin
pSoldier = FindSoldierByProfileID( ELDIN, FALSE );
if ( pSoldier && pSoldier->bActive && pSoldier->bInSector && pSoldier->bLife >= OKLIFE && (pSoldier->bAlertStatus == STATUS_GREEN || pSoldier->ubNoiseVolume < (MAX_MISC_NOISE_DURATION / 2) ) )
{
if ( SoldierToLocationLineOfSightTest( pSoldier, sGridNo, (UINT8) MaxDistanceVisible(), TRUE ) )
{
// sees the player now!
TriggerNPCWithIHateYouQuote( ELDIN );
SetNewSituation( pSoldier );
}
else
{
pSoldier->sNoiseGridno = sGridNo;
pSoldier->ubNoiseVolume = MAX_MISC_NOISE_DURATION;
pSoldier->bAlertStatus = STATUS_RED;
if ( (pSoldier->bAction != AI_ACTION_GET_CLOSER) || CheckFact( FACT_MUSEUM_ALARM_WENT_OFF, 0 ) == FALSE )
{
CancelAIAction( pSoldier, TRUE );
pSoldier->bNextAction = AI_ACTION_GET_CLOSER;
pSoldier->usNextActionData = sGridNo;
RESETTIMECOUNTER( pSoldier->AICounter, 100 );
}
// otherwise let AI handle this normally
// SetNewSituation( pSoldier );
// reduce any delay to minimal
}
SetFactTrue( FACT_MUSEUM_ALARM_WENT_OFF );
}
}
}
INT16 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN * pfClimbingNecessary, BOOLEAN * pfReachable )
{
UINT32 uiLoop;
INT8 * pbPersOL, * pbPublOL;
INT16 *psLastLoc,*psNoiseGridNo;
INT8 * pbNoiseLevel;
INT8 *pbLastLevel;
UINT8 *pubNoiseVolume;
INT32 iDistAway;
INT32 iNoiseValue, iBestValue = -10000;
INT16 sBestGridNo = NOWHERE;
INT8 bBestLevel = 0;
INT16 sClimbingGridNo;
BOOLEAN fClimbingNecessary = FALSE;
SOLDIERTYPE * pTemp;
pubNoiseVolume = &gubPublicNoiseVolume[pSoldier->bTeam];
psNoiseGridNo = &gsPublicNoiseGridno[pSoldier->bTeam];
pbNoiseLevel = &gbPublicNoiseLevel[pSoldier->bTeam];
psLastLoc = gsLastKnownOppLoc[pSoldier->ubID];
// hang pointers at start of this guy's personal and public opponent opplists
pbPersOL = pSoldier->bOppList;
pbPublOL = gbPublicOpplist[pSoldier->bTeam];
// look through this man's personal & public opplists for opponents heard
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
{
pTemp = MercSlots[ uiLoop ];
// if this merc is inactive, at base, on assignment, or dead
if (!pTemp || !pTemp->bLife)
continue; // next merc
// if this merc is neutral/on same side, he's not an opponent
if ( CONSIDERED_NEUTRAL( pSoldier, pTemp ) || (pSoldier->bSide == pTemp->bSide))
continue; // next merc
pbPersOL = pSoldier->bOppList + pTemp->ubID;
pbPublOL = gbPublicOpplist[pSoldier->bTeam] + pTemp->ubID;
psLastLoc = gsLastKnownOppLoc[pSoldier->ubID] + pTemp->ubID;
pbLastLevel = gbLastKnownOppLevel[pSoldier->ubID] + pTemp->ubID;
// if this guy's been personally heard within last 3 turns
if (*pbPersOL < NOT_HEARD_OR_SEEN)
{
// calculate how far this noise was, and its relative "importance"
iDistAway = SpacesAway(pSoldier->sGridNo,*psLastLoc);
iNoiseValue = (*pbPersOL) * iDistAway; // always a negative number!
if (iNoiseValue > iBestValue)
{
iBestValue = iNoiseValue;
sBestGridNo = *psLastLoc;
bBestLevel = *pbLastLevel;
}
}
// if this guy's been publicly heard within last 3 turns
if (*pbPublOL < NOT_HEARD_OR_SEEN)
{
// calculate how far this noise was, and its relative "importance"
iDistAway = SpacesAway(pSoldier->sGridNo,gsPublicLastKnownOppLoc[pSoldier->bTeam][pTemp->ubID]);
iNoiseValue = (*pbPublOL) * iDistAway; // always a negative number!
if (iNoiseValue > iBestValue)
{
iBestValue = iNoiseValue;
sBestGridNo = gsPublicLastKnownOppLoc[pSoldier->bTeam][pTemp->ubID];
bBestLevel = gbPublicLastKnownOppLevel[pSoldier->bTeam][pTemp->ubID];
}
}
}
// if any "misc. noise" was also heard recently
if (pSoldier->sNoiseGridno != NOWHERE)
{
if ( pSoldier->bNoiseLevel != pSoldier->bLevel || PythSpacesAway( pSoldier->sGridNo, pSoldier->sNoiseGridno ) >= 6 || SoldierTo3DLocationLineOfSightTest( pSoldier, pSoldier->sNoiseGridno, pSoldier->bNoiseLevel, 0, (UINT8) MaxDistanceVisible(), FALSE ) == 0 )
{
// calculate how far this noise was, and its relative "importance"
iDistAway = SpacesAway(pSoldier->sGridNo,pSoldier->sNoiseGridno);
iNoiseValue = ((pSoldier->ubNoiseVolume / 2) - 6) * iDistAway;
if (iNoiseValue > iBestValue)
{
iBestValue = iNoiseValue;
sBestGridNo = pSoldier->sNoiseGridno;
bBestLevel = pSoldier->bNoiseLevel;
}
}
else
{
// we are there or near
pSoldier->sNoiseGridno = NOWHERE; // wipe it out, not useful anymore
pSoldier->ubNoiseVolume = 0;
}
}
// if any recent PUBLIC "misc. noise" is also known
if ( (pSoldier->bTeam != CIV_TEAM) || ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP ) )
{
if (*psNoiseGridNo != NOWHERE)
{
// if we are NOT there (at the noise gridno)
if ( *pbNoiseLevel != pSoldier->bLevel || PythSpacesAway( pSoldier->sGridNo, *psNoiseGridNo ) >= 6 || SoldierTo3DLocationLineOfSightTest( pSoldier, *psNoiseGridNo, *pbNoiseLevel, 0, (UINT8) MaxDistanceVisible(), FALSE ) == 0 )
{
// calculate how far this noise was, and its relative "importance"
iDistAway = SpacesAway(pSoldier->sGridNo,*psNoiseGridNo);
iNoiseValue = ((*pubNoiseVolume / 2) - 6) * iDistAway;
if (iNoiseValue > iBestValue)
{
iBestValue = iNoiseValue;
sBestGridNo = *psNoiseGridNo;
bBestLevel = *pbNoiseLevel;
}
}
}
}
if (sBestGridNo != NOWHERE && pfReachable )
{
*pfReachable = TRUE;
// make civs not walk to noises outside their room if on close patrol/onguard
if ( pSoldier->bOrders <= CLOSEPATROL && (pSoldier->bTeam == CIV_TEAM || pSoldier->ubProfile != NO_PROFILE ) )
{
UINT8 ubRoom, ubNewRoom;
// any other combo uses the default of ubRoom == 0, set above
if ( InARoom( pSoldier->usPatrolGrid[0], &ubRoom ) )
{
if ( !InARoom( pSoldier->usPatrolGrid[0], &ubNewRoom ) || ubRoom != ubNewRoom )
{
*pfReachable = FALSE;
}
}
}
if ( *pfReachable )
{
// if there is a climb involved then we should store the location
// of where we have to climb to instead
sClimbingGridNo = GetInterveningClimbingLocation( pSoldier, sBestGridNo, bBestLevel, &fClimbingNecessary );
if ( fClimbingNecessary )
{
if ( sClimbingGridNo == NOWHERE )
{
// can't investigate!
*pfReachable = FALSE;
}
else
{
sBestGridNo = sClimbingGridNo;
fClimbingNecessary = TRUE;
}
}
else
{
fClimbingNecessary = FALSE;
}
}
}
if ( piRetValue )
{
*piRetValue = iBestValue;
}
if ( pfClimbingNecessary )
{
*pfClimbingNecessary = fClimbingNecessary;
}
#ifdef DEBUGDECISIONS
if (sBestGridNo != NOWHERE)
AINumMessage("MOST IMPORTANT NOISE HEARD FROM GRID #",sBestGridNo);
#endif
return(sBestGridNo);
}
INT16 WhatIKnowThatPublicDont(SOLDIERTYPE *pSoldier, UINT8 ubInSightOnly)
{
UINT8 ubTotal = 0;
UINT32 uiLoop;
INT8 *pbPersOL,*pbPublOL;
SOLDIERTYPE * pTemp;
// if merc knows of a more important misc. noise than his team does
if (!(CREATURE_OR_BLOODCAT( pSoldier )) && (pSoldier->ubNoiseVolume > gubPublicNoiseVolume[pSoldier->bTeam]))
{
// the difference in volume is added to the "new info" total
ubTotal += pSoldier->ubNoiseVolume - gubPublicNoiseVolume[pSoldier->bTeam];
}
// hang pointers at start of this guy's personal and public opponent opplists
pbPersOL = &(pSoldier->bOppList[0]);
pbPublOL = &(gbPublicOpplist[pSoldier->bTeam][0]);
// for every opponent
// for (iLoop = 0; iLoop < MAXMERCS; iLoop++,pbPersOL++,pbPublOL++)
// {
// pTemp = &(Menptr[iLoop]);
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
{
pTemp = MercSlots[ uiLoop ];
// if this merc is inactive, at base, on assignment, or dead
if (!pTemp)
{
continue; // next merc
}
// if this merc is neutral/on same side, he's not an opponent
if ( CONSIDERED_NEUTRAL( pSoldier, pTemp ) || (pSoldier->bSide == pTemp->bSide))
{
continue; // next merc
}
pbPersOL = pSoldier->bOppList + pTemp->ubID;
pbPublOL = gbPublicOpplist[pSoldier->bTeam] + pTemp->ubID;
// if we're only interested in guys currently is sight, and he's not
if (ubInSightOnly)
{
if ((*pbPersOL == SEEN_CURRENTLY) && (*pbPublOL != SEEN_CURRENTLY))
{
// just count the number of them
ubTotal++;
}
}
else
{
// add value of personal knowledge compared to public knowledge to total
ubTotal += gubKnowledgeValue[*pbPublOL - OLDEST_HEARD_VALUE][*pbPersOL - OLDEST_HEARD_VALUE];
}
}
#ifdef DEBUGDECISIONS
if (ubTotal > 0)
{
AINumMessage("WHAT I KNOW THAT PUBLIC DON'T = ",ubTotal);
}
#endif
return(ubTotal);
}
+459
View File
@@ -0,0 +1,459 @@
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "types.h"
#include "wcheck.h"
#include "Soldier Control.h"
#include "Soldier Functions.h"
#include "ai.h"
#include "AIInternals.h"
#include "Animation Control.h"
#include "pathai.h"
#include "overhead.h"
#include "items.h"
#include "Message.h"
#endif
extern BOOLEAN gfAutoBandageFailed;
//
// This file contains code devoted to the player AI-controlled medical system. Maybe it
// can be used or adapted for the enemies too...
//
#define NOT_GOING_TO_DIE -1
#define NOT_GOING_TO_COLLAPSE -1
// can this grunt be bandaged by a teammate?
BOOLEAN CanCharacterBeAutoBandagedByTeammate( SOLDIERTYPE *pSoldier );
//c an this grunt help anyone else out?
BOOLEAN CanCharacterAutoBandageTeammate( SOLDIERTYPE *pSoldier );
BOOLEAN FindAutobandageClimbPoint( INT16 sDesiredGridNo, BOOLEAN fClimbUp )
{
// checks for existance of location to climb up to building, not occupied by a medic
BUILDING * pBuilding;
UINT8 ubNumClimbSpots;
UINT8 ubLoop;
UINT8 ubWhoIsThere;
pBuilding = FindBuilding( sDesiredGridNo );
if (!pBuilding)
{
return( FALSE );
}
ubNumClimbSpots = pBuilding->ubNumClimbSpots;
for ( ubLoop = 0; ubLoop < ubNumClimbSpots; ubLoop++ )
{
ubWhoIsThere = WhoIsThere2( pBuilding->sUpClimbSpots[ ubLoop ], 1 );
if ( ubWhoIsThere != NOBODY && !CanCharacterAutoBandageTeammate( MercPtrs[ ubWhoIsThere ] ) )
{
continue;
}
ubWhoIsThere = WhoIsThere2( pBuilding->sDownClimbSpots[ ubLoop ], 0 );
if ( ubWhoIsThere != NOBODY && !CanCharacterAutoBandageTeammate( MercPtrs[ ubWhoIsThere ] ) )
{
continue;
}
return( TRUE );
}
return( FALSE );
}
BOOLEAN FullPatientCheck( SOLDIERTYPE * pPatient )
{
UINT8 cnt;
SOLDIERTYPE * pSoldier;
if ( CanCharacterAutoBandageTeammate( pPatient ) )
{
// can bandage self!
return( TRUE );
}
if ( pPatient->bLevel != 0 )
{ // look for a clear spot for jumping up
// special "closest" search that ignores climb spots IF they are occupied by non-medics
return( FindAutobandageClimbPoint( pPatient->sGridNo, TRUE ) );
}
else
{
// run though the list of chars on team
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
{
// can this character help out?
if ( CanCharacterAutoBandageTeammate( pSoldier ) == TRUE )
{
// can this guy path to the patient?
if ( pSoldier->bLevel == 0 )
{
// do a regular path check
if ( FindBestPath( pSoldier, pPatient->sGridNo, 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE ) )
{
return( TRUE );
}
}
else
{
// if on different levels, assume okay
return( TRUE );
}
}
}
}
return( FALSE );
}
BOOLEAN CanAutoBandage( BOOLEAN fDoFullCheck )
{
// returns false if we should stop being in auto-bandage mode
UINT8 cnt;
UINT8 ubMedics = 0, ubPatients = 0;
SOLDIERTYPE * pSoldier;
static UINT8 ubIDForFullCheck = NOBODY;
// run though the list of chars on team
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
{
// can this character help out?
if( CanCharacterAutoBandageTeammate( pSoldier ) == TRUE )
{
// yep, up the number of medics in sector
ubMedics++;
}
}
if ( ubMedics == 0 )
{
// no one that can help
return( FALSE );
}
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
{
// can this character be helped out by a teammate?
if ( CanCharacterBeAutoBandagedByTeammate( pSoldier ) == TRUE )
{
// yep, up the number of patients awaiting treatment in sector
ubPatients++;
if (fDoFullCheck)
{
if ( ubIDForFullCheck == NOBODY )
{
// do this guy NEXT time around
ubIDForFullCheck = cnt;
}
else if ( cnt == ubIDForFullCheck )
{
// test this guy
if ( FullPatientCheck( pSoldier ) == FALSE )
{
// shit!
gfAutoBandageFailed = TRUE;
return( FALSE );
}
// set ID for full check to NOBODY; will be set to someone later in loop, or to
// the first guy on the next pass
ubIDForFullCheck = NOBODY;
}
}
}
// is this guy REACHABLE??
}
if ( ubPatients == 0 )
{
// there is no one to help
return( FALSE );
}
else
{
// got someone that can help and help wanted
return( TRUE );
}
}
BOOLEAN CanCharacterAutoBandageTeammate( SOLDIERTYPE *pSoldier )
// can this soldier autobandage others in sector
{
// if the soldier isn't active or in sector, we have problems..leave
if ( !(pSoldier->bActive) || !(pSoldier->bInSector) || ( pSoldier->uiStatusFlags & SOLDIER_VEHICLE ) || (pSoldier->bAssignment == VEHICLE ) )
{
return( FALSE );
}
// they must have oklife or more, not be collapsed, have some level of medical competence, and have a med kit of some sort
if ( (pSoldier->bLife >= OKLIFE) && !(pSoldier->bCollapsed) && (pSoldier->bMedical > 0) && (FindObjClass( pSoldier, IC_MEDKIT ) != NO_SLOT) )
{
return( TRUE );
}
return( FALSE );
}
// can this soldier autobandage others in sector
BOOLEAN CanCharacterBeAutoBandagedByTeammate( SOLDIERTYPE *pSoldier )
{
// if the soldier isn't active or in sector, we have problems..leave
if ( !(pSoldier->bActive) || !(pSoldier->bInSector) || ( pSoldier->uiStatusFlags & SOLDIER_VEHICLE ) || (pSoldier->bAssignment == VEHICLE ) )
{
return( FALSE );
}
if ( (pSoldier->bLife > 0) && (pSoldier->bBleeding > 0) )
{
// someone's bleeding and not being given first aid!
return( TRUE );
}
return( FALSE );
}
INT8 FindBestPatient( SOLDIERTYPE * pSoldier, BOOLEAN * pfDoClimb )
{
UINT8 cnt, cnt2;
INT16 bBestPriority = 0, sBestAdjGridNo;
INT16 sPatientGridNo, sBestPatientGridNo;
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;
BOOLEAN fClimbingNecessary;
gubGlobalPathFlags = PATH_THROUGH_PEOPLE;
// search for someone who needs aid
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
for ( pPatient = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; cnt++,pPatient++)
{
if ( !(pPatient->bActive) || !(pPatient->bInSector) )
{
continue; // NEXT!!!
}
if (pPatient->bLife > 0 && pPatient->bBleeding && pPatient->ubServiceCount == 0)
{
if (pPatient->bLife < OKLIFE)
{
bPatientPriority = 3;
}
else if (pPatient->bLife < OKLIFE * 2)
{
bPatientPriority = 2;
}
else
{
bPatientPriority = 1;
}
if (bPatientPriority >= bBestPriority)
{
if ( !ClimbingNecessary( pSoldier, pPatient->sGridNo, pPatient->bLevel ) )
{
sPatientGridNo = pPatient->sGridNo;
sAdjacentGridNo = FindAdjacentGridEx( pSoldier, sPatientGridNo, &ubDirection, &sAdjustedGridNo, FALSE, FALSE );
if ( sAdjacentGridNo == -1 && gAnimControl[ pPatient->usAnimState ].ubEndHeight == ANIM_PRONE )
{
// prone; could be the base tile is inaccessible but the rest isn't...
for ( cnt2 = 0; cnt2 < NUM_WORLD_DIRECTIONS; cnt2++ )
{
sPatientGridNo = pPatient->sGridNo + DirectionInc( cnt2 );
if ( WhoIsThere2( sPatientGridNo, pPatient->bLevel ) == pPatient->ubID )
{
// patient is also here, try this location
sAdjacentGridNo = FindAdjacentGridEx( pSoldier, sPatientGridNo, &ubDirection, &sAdjustedGridNo, FALSE, FALSE );
if ( sAdjacentGridNo != -1 )
{
break;
}
}
}
}
if (sAdjacentGridNo != -1)
{
if (sAdjacentGridNo == pSoldier->sGridNo)
{
sPathCost = 1;
}
else
{
sPathCost = PlotPath( pSoldier, sAdjacentGridNo, FALSE, FALSE, FALSE, RUNNING, FALSE, FALSE, 0);
}
if ( sPathCost != 0 )
{
// we can get there... can anyone else?
if ( pPatient->ubAutoBandagingMedic != NOBODY && pPatient->ubAutoBandagingMedic != pSoldier->ubID )
{
// only switch to this patient if our distance is closer than
// the other medic's
pOtherMedic = MercPtrs[ pPatient->ubAutoBandagingMedic ];
sOtherAdjacentGridNo = FindAdjacentGridEx( pOtherMedic, sPatientGridNo, &ubDirection, &sAdjustedGridNo, FALSE, FALSE );
if (sOtherAdjacentGridNo != -1)
{
if (sOtherAdjacentGridNo == pOtherMedic->sGridNo)
{
sOtherMedicPathCost = 1;
}
else
{
sOtherMedicPathCost = PlotPath( pOtherMedic, sOtherAdjacentGridNo, FALSE, FALSE, FALSE, RUNNING, FALSE, FALSE, 0);
}
if (sPathCost >= sOtherMedicPathCost)
{
// this patient is best served by the merc moving to them now
continue;
}
}
}
if (bPatientPriority == bBestPriority)
{
// compare path distances
if ( sPathCost > sShortestPath )
{
continue;
}
}
sShortestPath = sPathCost;
pBestPatient = pPatient;
sBestPatientGridNo = sPatientGridNo;
bBestPriority = bPatientPriority;
sBestAdjGridNo = sAdjacentGridNo;
}
}
}
else
{
sClimbGridNo = NOWHERE;
// see if guy on another building etc and we need to climb somewhere
sPathCost = EstimatePathCostToLocation( pSoldier, pPatient->sGridNo, pPatient->bLevel, FALSE, &fClimbingNecessary, &sClimbGridNo );
// if we can get there
if ( sPathCost != 0 && fClimbingNecessary && sPathCost < sShortestClimbPath )
{
sBestClimbGridNo = sClimbGridNo;
sShortestClimbPath = sPathCost;
}
}
}
}
}
gubGlobalPathFlags = 0;
if (pBestPatient)
{
if (pBestPatient->ubAutoBandagingMedic != NOBODY)
{
// cancel that medic
CancelAIAction( MercPtrs[ pBestPatient->ubAutoBandagingMedic ], TRUE );
}
pBestPatient->ubAutoBandagingMedic = pSoldier->ubID;
*pfDoClimb = FALSE;
if ( CardinalSpacesAway( pSoldier->sGridNo, sBestPatientGridNo ) == 1 )
{
pSoldier->usActionData = sBestPatientGridNo;
return( AI_ACTION_GIVE_AID );
}
else
{
pSoldier->usActionData = sBestAdjGridNo;
return( AI_ACTION_GET_CLOSER );
}
}
else if (sBestClimbGridNo != NOWHERE )
{
*pfDoClimb = TRUE;
pSoldier->usActionData = sBestClimbGridNo;
return( AI_ACTION_MOVE_TO_CLIMB );
}
else
{
return( AI_ACTION_NONE );
}
}
INT8 DecideAutoBandage( SOLDIERTYPE * pSoldier )
{
INT8 bSlot;
BOOLEAN fDoClimb;
if (pSoldier->bMedical == 0 || pSoldier->ubServicePartner != NOBODY)
{
// don't/can't make decision
return( AI_ACTION_NONE );
}
bSlot = FindObjClass( pSoldier, IC_MEDKIT );
if (bSlot == NO_SLOT)
{
// no medical kit!
return( AI_ACTION_NONE );
}
if (pSoldier->bBleeding)
{
// heal self first!
pSoldier->usActionData = pSoldier->sGridNo;
if (bSlot != HANDPOS)
{
pSoldier->bSlotItemTakenFrom = bSlot;
SwapObjs( &(pSoldier->inv[HANDPOS]), &(pSoldier->inv[bSlot]) );
/*
memset( &TempObj, 0, sizeof( OBJECTTYPE ) );
// move the med kit out to temp obj
SwapObjs( &TempObj, &(pSoldier->inv[bSlot]) );
// swap the med kit with whatever was in the hand
SwapObjs( &TempObj, &(pSoldier->inv[HANDPOS]) );
// replace whatever was in the hand somewhere in inventory
AutoPlaceObject( pSoldier, &TempObj, FALSE );
*/
}
return( AI_ACTION_GIVE_AID );
}
// pSoldier->usActionData = FindClosestPatient( pSoldier );
pSoldier->bAction = FindBestPatient( pSoldier, &fDoClimb );
if (pSoldier->bAction != AI_ACTION_NONE)
{
pSoldier->usUIMovementMode = RUNNING;
if (bSlot != HANDPOS)
{
pSoldier->bSlotItemTakenFrom = bSlot;
SwapObjs( &(pSoldier->inv[HANDPOS]), &(pSoldier->inv[bSlot]) );
}
return( pSoldier->bAction );
}
// do nothing
return( AI_ACTION_NONE );
}
File diff suppressed because it is too large Load Diff
+3419
View File
File diff suppressed because it is too large Load Diff
+215
View File
@@ -0,0 +1,215 @@
#ifndef NPC_H
#define NPC_H
#include "mapscreen.h"
#include "FileMan.h"
#define NUM_NPC_QUOTE_RECORDS 50
//#define IRRELEVANT 255
//#define NO_QUEST 255
//#define NO_FACT 255
//#define NO_QUOTE 255
#define MUST_BE_NEW_DAY 254
#define INITIATING_FACTOR 30
#define TURN_FLAG_ON( a, b ) (a |= b)
#define TURN_FLAG_OFF( a, b ) (a &= ~(b))
#define CHECK_FLAG( a, b) (a & b)
#define QUOTE_FLAG_SAID 0x0001
#define QUOTE_FLAG_ERASE_ONCE_SAID 0x0002
#define QUOTE_FLAG_SAY_ONCE_PER_CONVO 0x0004
#define NPC_TALK_RADIUS 4
#define TURN_UI_OFF 65000
#define TURN_UI_ON 65001
#define SPECIAL_TURN_UI_OFF 65002
#define SPECIAL_TURN_UI_ON 65003
#define LARGE_AMOUNT_MONEY 1000
#define ACCEPT_ANY_ITEM 1000
#define ANY_RIFLE 1001
typedef struct
{
#if defined( CRIPPLED_VERSION ) || defined( RUSSIAN )
UINT8 ubIdentifier[4];
#endif
UINT16 fFlags;
// conditions
union
{
INT16 sRequiredItem; // item NPC must have to say quote
INT16 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 13 bytes
// quote to say (if any)
UINT8 ubQuoteNum; // this is the quote to say
UINT8 ubNumQuotes; // total # of quotes to say 15 bytes
// actions
UINT8 ubStartQuest;
UINT8 ubEndQuest;
UINT8 ubTriggerNPC;
UINT8 ubTriggerNPCRec;
UINT8 ubFiller; // 20 bytes
UINT16 usSetFactTrue;
UINT16 usGiftItem; // item NPC gives to merc after saying quote
UINT16 usGoToGridno;
INT16 sActionData; // special action value
#if !defined( CRIPPLED_VERSION ) && !defined( RUSSIAN )
UINT8 ubUnused[4];
#endif
} NPCQuoteInfo; // 32 bytes
typedef enum
{
APPROACH_FRIENDLY = 1,
APPROACH_DIRECT,
APPROACH_THREATEN,
APPROACH_RECRUIT,
APPROACH_REPEAT,
APPROACH_GIVINGITEM,
NPC_INITIATING_CONV,
NPC_INITIAL_QUOTE,
NPC_WHOAREYOU,
TRIGGER_NPC,
APPROACH_GIVEFIRSTAID,
APPROACH_SPECIAL_INITIAL_QUOTE,
APPROACH_ENEMY_NPC_QUOTE,
APPROACH_DECLARATION_OF_HOSTILITY,
APPROACH_EPC_IN_WRONG_SECTOR,
APPROACH_EPC_WHO_IS_RECRUITED,
APPROACH_INITIAL_QUOTE,
APPROACH_CLOSING_SHOP,
APPROACH_SECTOR_NOT_SAFE,
APPROACH_DONE_SLAPPED, // 20
APPROACH_DONE_PUNCH_0,
APPROACH_DONE_PUNCH_1,
APPROACH_DONE_PUNCH_2,
APPROACH_DONE_OPEN_STRUCTURE,
APPROACH_DONE_GET_ITEM, // 25
APPROACH_DONE_GIVING_ITEM,
APPROACH_DONE_TRAVERSAL,
APPROACH_BUYSELL,
APPROACH_ONE_OF_FOUR_STANDARD,
APPROACH_FRIENDLY_DIRECT_OR_RECRUIT, // 30
} Approaches;
typedef enum
{
QUOTE_INTRO = 0,
QUOTE_SUBS_INTRO,
QUOTE_FRIENDLY_DEFAULT1,
QUOTE_FRIENDLY_DEFAULT2,
QUOTE_GIVEITEM_NO,
QUOTE_DIRECT_DEFAULT,
QUOTE_THREATEN_DEFAULT,
QUOTE_RECRUIT_NO,
QUOTE_BYE,
QUOTE_GETLOST
} StandardQuoteIDs;
#define NUM_REAL_APPROACHES APPROACH_RECRUIT
#define CONVO_DIST 5
extern INT8 gbFirstApproachFlags[4];
extern UINT8 gubTeamPenalty;
extern void ShutdownNPCQuotes( void );
extern void SetQuoteRecordAsUsed( UINT8 ubNPC, UINT8 ubRecord );
// uiApproachData is used for approach things like giving items, etc.
extern UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach );
extern void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData );
extern BOOLEAN NPCOkToGiveItem( UINT8 ubNPC, UINT8 ubMerc, UINT16 usItem );
extern void NPCReachedDestination( SOLDIERTYPE * pNPC, BOOLEAN fAlreadyThere );
extern void PCsNearNPC( UINT8 ubNPC );
extern BOOLEAN PCDoesFirstAidOnNPC( UINT8 ubNPC );
extern void TriggerNPCRecord( UINT8 ubTriggerNPC, UINT8 ubTriggerNPCRec );
extern BOOLEAN TriggerNPCWithIHateYouQuote( UINT8 ubTriggerNPC );
extern void TriggerNPCRecordImmediately( UINT8 ubTriggerNPC, UINT8 ubTriggerNPCRec );
extern BOOLEAN TriggerNPCWithGivenApproach( UINT8 ubTriggerNPC, UINT8 ubApproach, BOOLEAN fShowPanel );
extern BOOLEAN ReloadQuoteFile( UINT8 ubNPC );
extern BOOLEAN ReloadAllQuoteFiles( void );
// Save and loads the npc info to a saved game file
extern BOOLEAN SaveNPCInfoToSaveGameFile( HWFILE hFile );
BOOLEAN LoadNPCInfoFromSavedGameFile( HWFILE hFile, UINT32 uiSaveGameVersion );
extern void TriggerFriendWithHostileQuote( UINT8 ubNPC );
extern void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT16 sOldGridNo, INT16 sNewGridNo );
extern UINT8 ActionIDForMovementRecord( UINT8 ubNPC, UINT8 ubRecord );
// total amount given to doctors
extern UINT32 uiTotalAmountGivenToDoctors;
// handle money being npc being
extern BOOLEAN HandleNPCBeingGivenMoneyByPlayer( UINT8 ubNPCId, UINT32 uiMoneyAmount, UINT8 *pQuoteValue );
// given a victory in this sector, handle specific facts
void HandleVictoryInNPCSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
// check if this shopkeep has been shutdown, if so do soething and return the fact
BOOLEAN HandleShopKeepHasBeenShutDown( UINT8 ubCharNum );
BOOLEAN NPCHasUnusedRecordWithGivenApproach( UINT8 ubNPC, UINT8 ubApproach );
BOOLEAN NPCWillingToAcceptItem( UINT8 ubNPC, UINT8 ubMerc, OBJECTTYPE * pObj );
BOOLEAN SaveBackupNPCInfoToSaveGameFile( HWFILE hFile );
BOOLEAN LoadBackupNPCInfoFromSavedGameFile( HWFILE hFile, UINT32 uiSaveGameVersion );
#ifdef JA2BETAVERSION
void ToggleNPCRecordDisplay( void );
#endif
void UpdateDarrelScriptToGoTo( SOLDIERTYPE * pSoldier );
#define WALTER_BRIBE_AMOUNT 20000
BOOLEAN GetInfoForAbandoningEPC( UINT8 ubNPC, UINT16 * pusQuoteNum, UINT16 * pusFactToSetTrue );
BOOLEAN RecordHasDialogue( UINT8 ubNPC, UINT8 ubRecord );
INT8 ConsiderCivilianQuotes( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, BOOLEAN fSetAsUsed );
void ResetOncePerConvoRecordsForNPC( UINT8 ubNPC );
void HandleNPCChangesForTacticalTraversal( SOLDIERTYPE * pSoldier );
BOOLEAN NPCHasUnusedHostileRecord( UINT8 ubNPC, UINT8 ubApproach );
void ResetOncePerConvoRecordsForAllNPCsInLoadedSector( void );
#endif
+540
View File
@@ -0,0 +1,540 @@
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "AIInternals.h"
#include "ai.h"
#include "pathai.h"
#include "items.h"
#include "World Items.h"
#endif
#include "Queen Command.h"
void MakeClosestEnemyChosenOne()
{
UINT32 cnt;
INT16 sPathCost, sShortestPath = 1000;
INT8 bOldKeys = -1;
UINT8 ubClosestEnemy = NOBODY;
SOLDIERTYPE * pSoldier;
INT8 bPanicTrigger;
INT16 sPanicTriggerGridNo;
if ( ! (gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE) )
{
#ifdef BETAVERSION
PopMessage("MakeClosestEnemyChosenOne: ERROR - Panic Trigger is NOWHERE");
#endif
return;
}
if (!NeedToRadioAboutPanicTrigger() )
{
// no active panic triggers
return;
}
// consider every enemy, looking for the closest capable, unbusy one
for (cnt = 0; cnt < guiNumMercSlots; cnt++)
{
pSoldier = MercSlots[cnt];
if (!pSoldier) // if this merc is inactive, or not here
{
continue;
}
// if this merc is unconscious, or dead
if (pSoldier->bLife < OKLIFE)
{
continue; // next soldier
}
// if this guy's too tired to go
if (pSoldier->bBreath < OKBREATH)
{
continue; // next soldier
}
if ( gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y )
{
if ( pSoldier->ubProfile != WARDEN )
{
continue;
}
}
else
{
// only consider for army guys
if (pSoldier->bTeam != ENEMY_TEAM )
{
continue;
}
}
// if this guy is in battle with opponent(s)
if (pSoldier->bOppCnt > 0)
{
continue; // next soldier
}
// if this guy is still in serious shock
if (pSoldier->bShock > 2)
{
continue; // next soldier
}
if ( pSoldier->bLevel != 0 )
{
// screw having guys on the roof go for panic triggers!
continue; // next soldier
}
bPanicTrigger = ClosestPanicTrigger( pSoldier );
if (bPanicTrigger == -1)
{
continue; // next soldier
}
sPanicTriggerGridNo = gTacticalStatus.sPanicTriggerGridNo[ bPanicTrigger ];
if (sPanicTriggerGridNo == NOWHERE)
{
// this should never happen!
continue;
}
// remember whether this guy had keys before
//bOldKeys = pSoldier->bHasKeys;
// give him keys to see if with them he can get to the panic trigger
pSoldier->bHasKeys = (pSoldier->bHasKeys << 1) | 1;
// we now path directly to the panic trigger
// if he can't get to a spot where he could get at the panic trigger
/*
if ( FindAdjacentGridEx( pSoldier, gTacticalStatus.sPanicTriggerGridno, &ubDirection, &sAdjSpot, FALSE, FALSE ) == -1 )
{
pSoldier->bHasKeys = bOldKeys;
continue; // next merc
}
*/
// ok, this enemy appears to be eligible
// FindAdjacentGrid set HandGrid for us. If we aren't at that spot already
if (pSoldier->sGridNo != sPanicTriggerGridNo)
{
// get the AP cost for this enemy to go to target position
sPathCost = PlotPath( pSoldier, sPanicTriggerGridNo, FALSE, FALSE, FALSE, WALKING, FALSE, FALSE, 0);
}
else
{
sPathCost = 0;
}
// set his keys value back to what it was before this hack
pSoldier->bHasKeys = (pSoldier->bHasKeys >> 1 );
// if he can get there (or is already there!)
if (sPathCost || (pSoldier->sGridNo == sPanicTriggerGridNo))
{
if (sPathCost < sShortestPath)
{
sShortestPath = sPathCost;
ubClosestEnemy = pSoldier->ubID;
}
}
//else
//NameMessage(pSoldier,"can't get there...");
}
// if we found have an eligible enemy, make him our "chosen one"
if (ubClosestEnemy < NOBODY)
{
gTacticalStatus.ubTheChosenOne = ubClosestEnemy; // flag him as the chosen one
#ifdef TESTVERSION
NumMessage("TEST MSG: The chosen one is ",TheChosenOne);
#endif
pSoldier = MercPtrs[gTacticalStatus.ubTheChosenOne];
if ( pSoldier->bAlertStatus < STATUS_RED )
{
pSoldier->bAlertStatus = STATUS_RED;
CheckForChangingOrders( pSoldier );
}
SetNewSituation( pSoldier ); // set new situation for the chosen one
pSoldier->bHasKeys = (pSoldier->bHasKeys << 1) | 1; // cheat and give him keys to every door
//pSoldier->bHasKeys = TRUE;
}
#ifdef TESTVERSION
else
PopMessage("TEST MSG: Couldn't find anyone eligible to become TheChosenOne!");
#endif
}
void PossiblyMakeThisEnemyChosenOne( SOLDIERTYPE * pSoldier )
{
INT32 iAPCost, iPathCost;
//INT8 bOldKeys;
INT8 bPanicTrigger;
INT16 sPanicTriggerGridNo;
UINT32 uiPercentEnemiesKilled;
if ( ! (gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE) )
{
return;
}
if ( pSoldier->bLevel != 0 )
{
// screw having guys on the roof go for panic triggers!
return;
}
bPanicTrigger = ClosestPanicTrigger( pSoldier );
if (bPanicTrigger == -1)
{
return;
}
sPanicTriggerGridNo = gTacticalStatus.sPanicTriggerGridNo[ bPanicTrigger ];
uiPercentEnemiesKilled = (UINT32)( 100 * (UINT32)(gTacticalStatus.ubArmyGuysKilled) / (UINT32)( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) );
if ( gTacticalStatus.ubPanicTolerance[ bPanicTrigger ] > uiPercentEnemiesKilled )
{
// not yet... not yet
return;
}
//bOldKeys = pSoldier->bHasKeys;
pSoldier->bHasKeys = (pSoldier->bHasKeys << 1) | 1;
// if he can't get to a spot where he could get at the panic trigger
iAPCost = AP_PULL_TRIGGER;
if (pSoldier->sGridNo != sPanicTriggerGridNo)
{
iPathCost = PlotPath( pSoldier, sPanicTriggerGridNo, FALSE, FALSE, FALSE, RUNNING, FALSE, FALSE, 0);
if (iPathCost == 0)
{
//pSoldier->bHasKeys = bOldKeys;
pSoldier->bHasKeys = (pSoldier->bHasKeys >> 1);
return;
}
iAPCost += iPathCost;
}
if ( iAPCost <= CalcActionPoints( pSoldier ) * 2)
{
// go!!!
gTacticalStatus.ubTheChosenOne = pSoldier->ubID;
return;
}
// else return keys to normal
//pSoldier->bHasKeys = bOldKeys;
pSoldier->bHasKeys = (pSoldier->bHasKeys >> 1);
}
INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove)
{
BOOLEAN fFoundRoute = FALSE;
INT8 bSlot;
INT32 iPathCost;
INT8 bPanicTrigger;
INT16 sPanicTriggerGridNo;
#ifdef DEBUGDECISIONS
STR16 tempstr;
#endif
// if there are panic bombs here
if (gTacticalStatus.fPanicFlags & PANIC_BOMBS_HERE)
{
// if enemy is holding a portable panic bomb detonator, he tries to use it
bSlot = FindTrigger( pSoldier );
if (bSlot != NO_SLOT)
{
//////////////////////////////////////////////////////////////////////
// ACTIVATE DETONATOR: blow up sector's panic bombs
//////////////////////////////////////////////////////////////////////
// if we have enough APs to activate it now
if (pSoldier->bActionPoints >= AP_USE_REMOTE)
{
#ifdef TESTVERSION
sprintf((CHAR *)tempstr,"TEST MSG: %s - ACTIVATING his DETONATOR!",pSoldier->name);
PopMessage(tempstr);
#endif
// blow up all the PANIC bombs!
return(AI_ACTION_USE_DETONATOR);
}
else // otherwise, wait a turn
{
pSoldier->usActionData = NOWHERE;
return(AI_ACTION_NONE);
}
}
}
// no panic bombs, or no portable detonator
// if there's a panic trigger here (DOESN'T MATTER IF ANY PANIC BOMBS EXIST!)
if ( gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE )
{
// Have WE been chosen to go after the trigger?
if (pSoldier->ubID == gTacticalStatus.ubTheChosenOne)
{
bPanicTrigger = ClosestPanicTrigger( pSoldier );
if (bPanicTrigger == -1)
{
// augh!
return( -1 );
}
sPanicTriggerGridNo = gTacticalStatus.sPanicTriggerGridNo[ bPanicTrigger ];
// if not standing on the panic trigger
if (pSoldier->sGridNo != sPanicTriggerGridNo)
{
// determine whether we can still get there
iPathCost = PlotPath( pSoldier, sPanicTriggerGridNo, FALSE, FALSE, FALSE, RUNNING, FALSE, FALSE, 0);
if (iPathCost != 0)
{
fFoundRoute = TRUE;
}
}
else
{
fFoundRoute = TRUE;
}
// if we managed to find an adjacent spot
if (fFoundRoute)
{
/*
*** COMMENTED OUT BECAUSE WE DON'T HAVE SUPPORT ROUTINES YET
// make sure it's not in water (those triggers can't be pulled)
if (Water(Terrain(gTacticalStatus.sHandGrid),Structure(gTacticalStatus.sHandGrid)))
{
#ifdef BETAVERSION
PopMessage("BAD SCENARIO DESIGN: Enemies can't use this panic trigger!");
#endif
gTacticalStatus.ubTheChosenOne = NOBODY; // strip him of his Chosen One status
// don't bother replacing him either, the next won't have more luck!
return(-1);
}
*/
// if we are at that spot now
if (pSoldier->sGridNo == sPanicTriggerGridNo)
{
////////////////////////////////////////////////////////////////
// PULL THE PANIC TRIGGER!
////////////////////////////////////////////////////////////////
// and we have enough APs left to pull the trigger
if (pSoldier->bActionPoints >= AP_PULL_TRIGGER)
{
// blow up the all the PANIC bombs (or just the journal)
pSoldier->usActionData = sPanicTriggerGridNo;
#ifdef TESTVERSION
sprintf((CHAR *)tempstr,"TEST MSG: %s - PULLS PANIC TRIGGER at grid %d",
pSoldier->name,pSoldier->usActionData);
PopMessage(tempstr);
#endif
return(AI_ACTION_PULL_TRIGGER);
}
else // otherwise, wait a turn
{
pSoldier->usActionData = NOWHERE;
return(AI_ACTION_NONE);
}
}
else // we are NOT at the HandGrid spot
{
// if we can move at least 1 square's worth
if (ubCanMove)
{
// if we can get to the HandGrid spot to yank the trigger
// animations don't allow trigger-pulling from water, so we won't!
if (LegalNPCDestination(pSoldier,sPanicTriggerGridNo,ENSURE_PATH,NOWATER,0))
{
pSoldier->usActionData = sPanicTriggerGridNo;
pSoldier->bPathStored = TRUE;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - GETTING CLOSER to PANIC TRIGGER at grid %d (Trigger at %d)", pSoldier->name,pSoldier->usActionData,sPanicTriggerGridNo);
AIPopMessage(tempstr);
#endif
return(AI_ACTION_GET_CLOSER);
}
else // Oh oh, the chosen one can't get to the trigger!
{
#ifdef TESTVERSION
PopMessage("TEST MSG: Oh oh! !legalDest - ChosenOne can't get to the trigger!");
#endif
gTacticalStatus.ubTheChosenOne = NOBODY; // strip him of his Chosen One status
MakeClosestEnemyChosenOne(); // and replace him!
}
}
else // can't move, wait 1 turn
{
pSoldier->usActionData = NOWHERE;
return(AI_ACTION_NONE);
}
}
}
else // Oh oh, the chosen one can't get to the trigger!
{
#ifdef TESTVERSION
PopMessage("TEST MSG: Oh oh! !adjacentFound - ChosenOne can't get to the trigger!");
#endif
gTacticalStatus.ubTheChosenOne = NOBODY; // strip him of his Chosen One status
MakeClosestEnemyChosenOne(); // and replace him!
}
}
}
// no action decided
return(-1);
}
void InitPanicSystem( void )
{
// start by assuming there is no panic bombs or triggers here
gTacticalStatus.ubTheChosenOne = NOBODY;
FindPanicBombsAndTriggers();
}
INT8 ClosestPanicTrigger( SOLDIERTYPE * pSoldier )
{
INT8 bLoop;
INT16 sDistance;
INT16 sClosestDistance = 1000;
INT8 bClosestTrigger = -1;
UINT32 uiPercentEnemiesKilled;
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 ( gTacticalStatus.ubPanicTolerance[ bLoop ] > uiPercentEnemiesKilled )
{
// not yet... not yet...
continue; // next trigger
}
// in Tixa
if ( gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y )
{
// screen out everyone but the warden
if ( pSoldier->ubProfile != WARDEN )
{
break;
}
// screen out the second/later panic trigger if the first one hasn't been triggered
if ( bLoop > 0 && gTacticalStatus.sPanicTriggerGridNo[ bLoop - 1 ] != NOWHERE )
{
break;
}
}
sDistance = PythSpacesAway( pSoldier->sGridNo, gTacticalStatus.sPanicTriggerGridNo[ bLoop ] );
if (sDistance < sClosestDistance)
{
sClosestDistance = sDistance;
bClosestTrigger = bLoop;
}
}
}
return( bClosestTrigger );
}
BOOLEAN NeedToRadioAboutPanicTrigger( void )
{
UINT32 uiPercentEnemiesKilled;
INT8 bLoop;
if ( !(gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE) || gTacticalStatus.ubTheChosenOne != NOBODY )
{
// already done!
return( FALSE );
}
if ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector == 0 )
{
return( FALSE );
}
if ( gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y )
{
SOLDIERTYPE * pSoldier;
pSoldier = FindSoldierByProfileID( WARDEN, FALSE );
if ( !pSoldier || pSoldier->ubID == gTacticalStatus.ubTheChosenOne )
{
return( FALSE );
}
}
uiPercentEnemiesKilled = (UINT32)( 100 * (UINT32)(gTacticalStatus.ubArmyGuysKilled) / (UINT32)( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) );
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 ] ) )
{
return( TRUE );
}
}
return( FALSE );
}
#define STAIRCASE_GRIDNO 12067
#define STAIRCASE_DIRECTION 0
INT8 HeadForTheStairCase( SOLDIERTYPE * pSoldier )
{
UNDERGROUND_SECTORINFO * pBasementInfo;
pBasementInfo = FindUnderGroundSector( 3, MAP_ROW_P, 1 );
if ( pBasementInfo && pBasementInfo->uiTimeCurrentSectorWasLastLoaded != 0 && ( pBasementInfo->ubNumElites + pBasementInfo->ubNumTroops + pBasementInfo->ubNumAdmins ) < 5 )
{
return( AI_ACTION_NONE );
}
if ( PythSpacesAway( pSoldier->sGridNo, STAIRCASE_GRIDNO ) < 2 )
{
return( AI_ACTION_TRAVERSE_DOWN );
}
else
{
if ( LegalNPCDestination( pSoldier, STAIRCASE_GRIDNO, ENSURE_PATH, WATEROK, 0 ) )
{
pSoldier->usActionData = STAIRCASE_GRIDNO;
return( AI_ACTION_GET_CLOSER );
}
}
return( AI_ACTION_NONE );
}
#define WARDEN_ALARM_GRIDNO 9376
#define WARDEN_GAS_GRIDNO 9216
// in both cases, direction 6
+167
View File
@@ -0,0 +1,167 @@
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "FileMan.h"
#include "QuestDebug.h"
#include "stdarg.h"
#include "stdio.h"
#include "Debug.h"
#include "Message.h"
#endif
#define QUEST_DEBUG_FILE "QuestDebug.txt"
//enums used for the current output level flags
enum
{
QD_OUTPUT_NONE, // no output
QD_OUTPUT_LEVEL_1, // Highest level
QD_OUTPUT_LEVEL_2,
QD_OUTPUT_LEVEL_3,
QD_OUTPUT_LEVEL_4,
QD_OUTPUT_LEVEL_ALL, // any message
};
//Mode and priority for the Quest Debug Messages
UINT8 gubQuestDebugOutPutLevel = QD_OUTPUT_LEVEL_ALL;
//Mode and priority for the NPC interaction Debug Messages
UINT8 gubNPCDebugOutPutLevel = QD_OUTPUT_LEVEL_ALL;
//set the current output mode for either the NPC or the quest output
void ToggleQuestDebugModes( UINT8 ubType )
{
wchar_t sType[16];
UINT8 ubLevel;
if( ubType == QD_NPC_MSG )
{
wcscpy( sType, L"NPC Debug:");
//check to see if its out of range
if( gubNPCDebugOutPutLevel <= QD_OUTPUT_NONE+1 )
gubNPCDebugOutPutLevel = QD_OUTPUT_LEVEL_ALL;
else
{
//decrement
gubNPCDebugOutPutLevel--;
}
ubLevel = gubNPCDebugOutPutLevel;
}
else
{
wcscpy( sType, L"QUEST Debug:");
//check to see if its out of range
if( gubQuestDebugOutPutLevel <= QD_OUTPUT_NONE )
gubQuestDebugOutPutLevel = QD_OUTPUT_LEVEL_ALL;
else
{
//decrement
gubQuestDebugOutPutLevel--;
}
ubLevel = gubQuestDebugOutPutLevel;
}
//Display a messasge to the screen
if( ubLevel == QD_OUTPUT_NONE )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"%s No Output", sType );
else if( ubLevel == QD_OUTPUT_LEVEL_ALL )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"%s All messages", sType );
else
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"%s Level %d", sType, ubLevel );
}
void QuestDebugFileMsg( UINT8 ubQuoteType, UINT8 ubPriority, STR pStringA, ...)
{
static BOOLEAN fFirstTimeIn = TRUE;
static UINT32 uiLineNumber = 1;
HWFILE hFile;
UINT32 uiByteWritten;
va_list argptr;
char TempString[1024];
char DestString[1024];
TempString[0] = '\0';
DestString[0] = '\0';
va_start(argptr, pStringA); // Set up variable argument pointer
vsprintf(TempString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
//
//determine if we should display the message
//
// if its a quest message
if( ubQuoteType == QD_QUEST_MSG )
{
//if the message is a lower priority then the current output mode, dont display it
if( ubPriority > gubQuestDebugOutPutLevel )
return;
}
else
{
//if the message is a lower priority then the current output mode, dont display it
if( ubPriority > gubNPCDebugOutPutLevel )
return;
}
//if its the first time in the game
if( fFirstTimeIn )
{
//open a new file for writing
//if the file exists
if( FileExists( QUEST_DEBUG_FILE ) )
{
//delete the file
if( !FileDelete( QUEST_DEBUG_FILE ) )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("FAILED to delete %s file", QUEST_DEBUG_FILE) );
return;
}
}
fFirstTimeIn = FALSE;
}
//open the file
hFile = FileOpen( QUEST_DEBUG_FILE, FILE_ACCESS_WRITE, FALSE);
if( !hFile )
{
FileClose(hFile);
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("FAILED to open Quest Debug File %s", QUEST_DEBUG_FILE) );
return;
}
sprintf( DestString, "#%5d. P%d:\n\t%s\n\n", uiLineNumber, ubPriority, TempString );
//open the file and append to it
if( !FileWrite( hFile, DestString, strlen(DestString), &uiByteWritten ) )
{
FileClose(hFile);
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("FAILED to write to %s", QUEST_DEBUG_FILE) );
return;
}
//increment the line number
uiLineNumber++;
}
+28
View File
@@ -0,0 +1,28 @@
#ifndef QUEST_DEBUG_H
#define QUEST_DEBUG_H
//Type of quote
enum
{
QD_NPC_MSG,
QD_QUEST_MSG,
};
// Output priority level for the npc and quest debug messages
enum
{
QD_LEVEL_1,
QD_LEVEL_2,
QD_LEVEL_3,
QD_LEVEL_4,
QD_LEVEL_5,
};
void ToggleQuestDebugModes( UINT8 ubType );
void QuestDebugFileMsg( UINT8 ubQuoteType, UINT8 ubPriority, STR pStringA, ...);
#endif
+264
View File
@@ -0,0 +1,264 @@
#ifdef PRECOMPILEDHEADERS
#include "AI All.h"
#else
#include "ai.h"
#include "AIInternals.h"
#include "Isometric utils.h"
#include "Points.h"
#include "overhead.h"
#include "opplist.h"
#include "rotting corpses.h"
#include "soldier add.h"
#include "Soldier Profile Type.h"
#include "Items.h"
#include "Weapons.h"
#endif
INT8 RTPlayerDecideAction( SOLDIERTYPE * pSoldier )
{
INT8 bAction=AI_ACTION_NONE;
if (gTacticalStatus.fAutoBandageMode)
{
bAction = DecideAutoBandage( pSoldier );
}
else
{
bAction = DecideAction( pSoldier );
}
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *)tempstr,"DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData);
DebugAI((STR) tempstr );
#endif
return(bAction);
}
INT8 RTDecideAction(SOLDIERTYPE *pSoldier)
{
if (CREATURE_OR_BLOODCAT( pSoldier ) )
{
return( CreatureDecideAction( pSoldier ) );
}
else if (pSoldier->ubBodyType == CROW)
{
return( CrowDecideAction( pSoldier ) );
}
else if (pSoldier->bTeam == gbPlayerNum)
{
return( RTPlayerDecideAction( pSoldier ) );
}
else
{
// handle traversal
if ( (pSoldier->ubProfile != NO_PROFILE) && (gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags3 & PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL ) )
{
TriggerNPCWithGivenApproach( pSoldier->ubProfile, APPROACH_DONE_TRAVERSAL, FALSE );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags3 &= (~PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL);
pSoldier->ubQuoteActionID = 0;
// wait a tiny bit
pSoldier->usActionData = 100;
return( AI_ACTION_WAIT );
}
return( DecideAction( pSoldier ) );
}
}
UINT16 RealtimeDelay( SOLDIERTYPE * pSoldier )
{
if ( PTR_CIV_OR_MILITIA && !(pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP ) )
{
return( (UINT16) REALTIME_CIV_AI_DELAY );
}
else if ( CREATURE_OR_BLOODCAT( pSoldier ) && !( pSoldier->bHunting ) )
{
return( (UINT16) REALTIME_CREATURE_AI_DELAY );
}
else
{
if ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP )
{
UINT8 ubRoom;
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) )
{
return( (UINT16) (REALTIME_AI_DELAY / 3) );
}
}
return( (UINT16) REALTIME_AI_DELAY );
}
}
void RTHandleAI( SOLDIERTYPE * pSoldier )
{
#ifdef AI_PROFILING
INT32 iLoop;
#endif
if ((pSoldier->bAction != AI_ACTION_NONE) && pSoldier->bActionInProgress)
{
// if action should remain in progress
if (ActionInProgress(pSoldier))
{
#ifdef DEBUGBUSY
AINumMessage("Busy with action, skipping guy#",pSoldier->ubID);
#endif
// let it continue
return;
}
}
// if man has nothing to do
if (pSoldier->bAction == AI_ACTION_NONE)
{
if (pSoldier->bNextAction == AI_ACTION_NONE)
{
// make sure this flag is turned off (it already should be!)
pSoldier->bActionInProgress = FALSE;
// truly nothing to do!
RefreshAI( pSoldier );
}
// Since we're NEVER going to "continue" along an old path at this point,
// then it would be nice place to reinitialize "pathStored" flag for
// insurance purposes.
//
// The "pathStored" variable controls whether it's necessary to call
// findNewPath() after you've called NewDest(). Since the AI calls
// findNewPath() itself, a speed gain can be obtained by avoiding
// redundancy.
//
// The "normal" way for pathStored to be reset is inside
// SetNewCourse() [which gets called after NewDest()].
//
// The only reason we would NEED to reinitialize it here is if I've
// incorrectly set pathStored to TRUE in a process that doesn't end up
// calling NewDest()
pSoldier->bPathStored = FALSE;
// decide on the next action
#ifdef AI_PROFILING
for (iLoop = 0; iLoop < 1000; iLoop++)
#endif
{
if (pSoldier->bNextAction != AI_ACTION_NONE)
{
if ( pSoldier->bNextAction == AI_ACTION_END_COWER_AND_MOVE )
{
if ( pSoldier->uiStatusFlags & SOLDIER_COWERING )
{
pSoldier->bAction = AI_ACTION_STOP_COWERING;
pSoldier->usActionData = ANIM_STAND;
}
else if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight < ANIM_STAND )
{
// stand up!
pSoldier->bAction = AI_ACTION_CHANGE_STANCE;
pSoldier->usActionData = ANIM_STAND;
}
else
{
pSoldier->bAction = AI_ACTION_NONE;
}
if ( pSoldier->sGridNo == pSoldier->usNextActionData )
{
// no need to walk after this
pSoldier->bNextAction = AI_ACTION_NONE;
pSoldier->usNextActionData = NOWHERE;
}
else
{
pSoldier->bNextAction = AI_ACTION_WALK;
// leave next-action-data as is since that's where we want to go
}
}
else
{
// do the next thing we have to do...
pSoldier->bAction = pSoldier->bNextAction;
pSoldier->usActionData = pSoldier->usNextActionData;
pSoldier->bTargetLevel = pSoldier->bNextTargetLevel;
pSoldier->bNextAction = AI_ACTION_NONE;
pSoldier->usNextActionData = 0;
pSoldier->bNextTargetLevel = 0;
}
if (pSoldier->bAction == AI_ACTION_PICKUP_ITEM)
{
// the item pool index was stored in the special data field
pSoldier->uiPendingActionData1 = pSoldier->iNextActionSpecialData;
}
}
else if ( pSoldier->sAbsoluteFinalDestination != NOWHERE )
{
if ( ACTING_ON_SCHEDULE( pSoldier ) )
{
pSoldier->bAction = AI_ACTION_SCHEDULE_MOVE;
}
else
{
pSoldier->bAction = AI_ACTION_WALK;
}
pSoldier->usActionData = pSoldier->sAbsoluteFinalDestination;
}
else
{
if (!(gTacticalStatus.uiFlags & ENGAGED_IN_CONV))
{
pSoldier->bAction = RTDecideAction( pSoldier );
}
}
}
// if he chose to continue doing nothing
if (pSoldier->bAction == AI_ACTION_NONE)
{
#ifdef RECORDNET
fprintf(NetDebugFile,"\tMOVED BECOMING TRUE: Chose to do nothing, guynum %d\n",pSoldier->ubID);
#endif
// do a standard wait before doing anything else!
pSoldier->bAction = AI_ACTION_WAIT;
//if (PTR_CIVILIAN && pSoldier->bAlertStatus != STATUS_BLACK)
if ( PTR_CIV_OR_MILITIA && !(pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP ) )
{
pSoldier->usActionData = (UINT16) REALTIME_CIV_AI_DELAY;
}
else if ( CREATURE_OR_BLOODCAT( pSoldier ) && !( pSoldier->bHunting ) )
{
pSoldier->usActionData = (UINT16) REALTIME_CREATURE_AI_DELAY;
}
else
{
pSoldier->usActionData = (UINT16) REALTIME_AI_DELAY;
if ( pSoldier->ubCivilianGroup == KINGPIN_CIV_GROUP )
{
UINT8 ubRoom;
if ( InARoom( pSoldier->sGridNo, &ubRoom ) && IN_BROTHEL( ubRoom ) )
{
pSoldier->usActionData /= 3;
}
}
}
}
else if (pSoldier->bAction == AI_ACTION_ABSOLUTELY_NONE)
{
pSoldier->bAction = AI_ACTION_NONE;
}
}
// to get here, we MUST have an action selected, but not in progress...
NPCDoesAct(pSoldier);
// perform the chosen action
pSoldier->bActionInProgress = ExecuteAction(pSoldier); // if started, mark us as busy
}
File diff suppressed because it is too large Load Diff
+326
View File
@@ -0,0 +1,326 @@
# 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
+907
View File
@@ -0,0 +1,907 @@
# 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
+256
View File
@@ -0,0 +1,256 @@
#ifndef __AI_H
#define __AI_H
#include "types.h"
#include "worlddef.h"
#include "Soldier Control.h"
#define TESTAICONTROL
extern INT8 gubAIPathCosts[19][19];
#define AI_PATHCOST_RADIUS 9
extern BOOLEAN gfDisplayCoverValues;
extern INT16 gsCoverValue[WORLD_MAX];
// AI actions
enum CreatureCalls
{
CALL_NONE = 0,
CALL_1_PREY,
CALL_MULTIPLE_PREY,
CALL_ATTACKED,
CALL_CRIPPLED,
NUM_CREATURE_CALLS
} ;
#define DONTFORCE 0
#define FORCE 1
// ANY NEW ACTIONS ADDED - UPDATE OVERHEAD.C ARRAY WITH ACTION'S STRING VALUE
#define FIRST_MOVEMENT_ACTION AI_ACTION_RANDOM_PATROL
#define LAST_MOVEMENT_ACTION AI_ACTION_MOVE_TO_CLIMB
typedef enum
{
AI_ACTION_NONE = 0, // maintain current position & facing
// actions that involve a move to another tile
AI_ACTION_RANDOM_PATROL, // move towards a random destination
AI_ACTION_SEEK_FRIEND, // move towards friend in trouble
AI_ACTION_SEEK_OPPONENT, // move towards a reported opponent
AI_ACTION_TAKE_COVER, // run for nearest cover from threat
AI_ACTION_GET_CLOSER, // move closer to a strategic location
AI_ACTION_POINT_PATROL, // move towards next patrol point
AI_ACTION_LEAVE_WATER_GAS, // seek nearest spot of ungassed land
AI_ACTION_SEEK_NOISE, // seek most important noise heard
AI_ACTION_ESCORTED_MOVE, // go where told to by escortPlayer
AI_ACTION_RUN_AWAY, // run away from nearby opponent(s)
AI_ACTION_KNIFE_MOVE, // preparing to stab an opponent
AI_ACTION_APPROACH_MERC, // move up to a merc in order to talk with them; RT
AI_ACTION_TRACK, // track a scent
AI_ACTION_EAT, // monster eats corpse
AI_ACTION_PICKUP_ITEM, // grab things lying on the ground
AI_ACTION_SCHEDULE_MOVE, // move according to schedule
AI_ACTION_WALK, // walk somewhere (NPC stuff etc)
AI_ACTION_RUN, // run somewhere (NPC stuff etc)
AI_ACTION_WITHDRAW, // back off
AI_ACTION_FLANK_LEFT, // move to the left
AI_ACTION_FLANK_RIGHT, // move to the right
AI_ACTION_MOVE_TO_CLIMB, // move to edge of roof/building
// miscellaneous movement actions
AI_ACTION_CHANGE_FACING, // turn to face a different direction
AI_ACTION_CHANGE_STANCE, // stand, crouch, or go prone
// actions related to items and attacks
AI_ACTION_YELLOW_ALERT, // tell friends opponent(s) heard
AI_ACTION_RED_ALERT, // tell friends opponent(s) seen
AI_ACTION_CREATURE_CALL, // creature communication
AI_ACTION_PULL_TRIGGER, // go off to activate a panic trigger
AI_ACTION_USE_DETONATOR, // grab detonator and set off bomb(s)
AI_ACTION_FIRE_GUN, // shoot at nearby opponent
AI_ACTION_TOSS_PROJECTILE, // throw grenade at/near opponent(s)
AI_ACTION_KNIFE_STAB, // during the actual knifing attack
AI_ACTION_THROW_KNIFE, // throw a knife
AI_ACTION_GIVE_AID, // help injured/dying friend
AI_ACTION_WAIT, // RT: don't do anything for a certain length of time
AI_ACTION_PENDING_ACTION, // RT: wait for pending action (pickup, door open, etc) to finish
AI_ACTION_DROP_ITEM, // duh
AI_ACTION_COWER, // for civilians: cower in fear and stay there!
AI_ACTION_STOP_COWERING, // stop cowering
AI_ACTION_OPEN_OR_CLOSE_DOOR, // schedule-provoked; open or close door
AI_ACTION_UNLOCK_DOOR, // schedule-provoked; unlock door (don't open)
AI_ACTION_LOCK_DOOR, // schedule-provoked; lock door (close if necessary)
AI_ACTION_LOWER_GUN, // lower gun prior to throwing knife
AI_ACTION_ABSOLUTELY_NONE, // like "none" but can't be converted to a wait by realtime
AI_ACTION_CLIMB_ROOF, // climb up or down roof
AI_ACTION_END_TURN, // end turn (after final stance change)
AI_ACTION_END_COWER_AND_MOVE, // sort of dummy value, special for civilians who are to go somewhere at end of battle
AI_ACTION_TRAVERSE_DOWN, // move down a level
AI_ACTION_OFFER_SURRENDER, // offer surrender to the player
} ActionType;
enum QuoteActionType
{
QUOTE_ACTION_ID_CHECKFORDEST = 1,
QUOTE_ACTION_ID_TURNTOWARDSPLAYER,
QUOTE_ACTION_ID_DRAWGUN,
QUOTE_ACTION_ID_LOWERGUN,
QUOTE_ACTION_ID_TRAVERSE_EAST,
QUOTE_ACTION_ID_TRAVERSE_SOUTH,
QUOTE_ACTION_ID_TRAVERSE_WEST,
QUOTE_ACTION_ID_TRAVERSE_NORTH,
} ;
#define RTP_COMBAT_AGGRESSIVE 1
#define RTP_COMBAT_CONSERVE 2
#define RTP_COMBAT_REFRAIN 3
// NB THESE THREE FLAGS SHOULD BE REMOVED FROM CODE
#define AI_RTP_OPTION_CAN_RETREAT 0x01
#define AI_RTP_OPTION_CAN_SEEK_COVER 0x02
#define AI_RTP_OPTION_CAN_HELP 0x04
#define AI_CAUTIOUS 0x08
#define AI_HANDLE_EVERY_FRAME 0x10
#define AI_ASLEEP 0x20
#define AI_LOCK_DOOR_INCLUDES_CLOSE 0x40
#define AI_CHECK_SCHEDULE 0x80
#define NOT_NEW_SITUATION 0
#define WAS_NEW_SITUATION 1
#define IS_NEW_SITUATION 2
#define DIFF_ENEMY_EQUIP_MOD 0
#define DIFF_ENEMY_TO_HIT_MOD 1
#define DIFF_ENEMY_INTERRUPT_MOD 2
#define DIFF_RADIO_RED_ALERT 3
#define DIFF_MAX_COVER_RANGE 4
#define MAX_DIFF_PARMS 5 // how many different difficulty variables?
extern INT8 gbDiff[MAX_DIFF_PARMS][5];
void ActionDone(SOLDIERTYPE *pSoldier);
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 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 );
BOOLEAN CanAutoBandage( BOOLEAN fDoFullCheck );
void DebugAI( STR szOutput );
INT8 DecideAction(SOLDIERTYPE *pSoldier);
INT8 DecideActionBlack(SOLDIERTYPE *pSoldier);
INT8 DecideActionEscort(SOLDIERTYPE *pSoldier);
INT8 DecideActionGreen(SOLDIERTYPE *pSoldier);
INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK);
INT8 DecideActionYellow(SOLDIERTYPE *pSoldier);
INT16 DistanceToClosestFriend( SOLDIERTYPE * pSoldier );
void EndAIDeadlock(void);
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 );
//Kris: Added these as I need specific searches on certain sides.
enum
{
NORTH_EDGEPOINT_SEARCH,
EAST_EDGEPOINT_SEARCH,
SOUTH_EDGEPOINT_SEARCH,
WEST_EDGEPOINT_SEARCH,
};
INT16 FindNearestEdgepointOnSpecifiedEdge( INT16 sGridNo, INT8 bEdgeCode );
INT16 FindNearestUngassedLand(SOLDIERTYPE *pSoldier);
BOOLEAN FindRoofClimbingPoints( SOLDIERTYPE * pSoldier, INT16 sDesiredSpot );
INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier);
INT16 FindSweetCoverSpot(SOLDIERTYPE *pSoldier);
void FreeUpNPCFromAttacking(UINT8 ubID);
void FreeUpNPCFromPendingAction( SOLDIERTYPE * pSoldier );
void FreeUpNPCFromTurning(SOLDIERTYPE *pSoldier, INT8 bLook);
void FreeUpNPCFromStanceChange(SOLDIERTYPE *pSoldier );
void FreeUpNPCFromLoweringGun( SOLDIERTYPE *pSoldier );
void FreeUpNPCFromRoofClimb(SOLDIERTYPE *pSoldier );
UINT8 GetClosestOpponent( SOLDIERTYPE *pSoldier );
UINT8 GetMostThreateningOpponent( SOLDIERTYPE *pSoldier );
void HandleSoldierAI( SOLDIERTYPE *pSoldier );
void HandleInitialRedAlert( INT8 bTeam, UINT8 ubCommunicate);
void InitPanicSystem();
INT16 InWaterOrGas(SOLDIERTYPE *pSoldier, INT16 sGridno);
BOOLEAN IsActionAffordable(SOLDIERTYPE *pSoldier);
BOOLEAN InitAI( void );
void MakeClosestEnemyChosenOne();
void ManChecksOnFriends(SOLDIERTYPE *pSoldier);
void NewDest(SOLDIERTYPE *pSoldier, UINT16 sGridno);
INT16 NextPatrolPoint(SOLDIERTYPE *pSoldier);
INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove);
void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier);
INT16 RandDestWithinRange(SOLDIERTYPE *pSoldier);
INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier);
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT16 * pFromGridno);
void SetCivilianDestination(UINT8 ubWho, INT16 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);
BOOLEAN ValidCreatureTurn( SOLDIERTYPE * pCreature, INT8 bNewDirection );
BOOLEAN WearGasMaskIfAvailable( SOLDIERTYPE * pSoldier );
INT16 WhatIKnowThatPublicDont(SOLDIERTYPE *pSoldier, UINT8 ubInSightOnly);
#ifdef DEBUGDECISIONS
void AIPopMessage ( STR16 str );
void AIPopMessage ( const char* str );
void AINumMessage(const char* str, INT32 num);
void AINameMessage(SOLDIERTYPE * pSoldier,const char* str,INT32 num);
#endif
INT16 FindClosestClimbPoint (SOLDIERTYPE *pSoldier, BOOLEAN fClimbUp );
INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction );
BOOLEAN CanClimbFromHere (SOLDIERTYPE * pSoldier, BOOLEAN fUp );
#endif