New item flag: ItemFlag ATTENTION_ITEM (4096) makes an item 'interesting' to the AI. Upon checking for general pickup of items, these items have high priority. This can be used to lead the enemy into traps.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5575 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-09-18 22:16:23 +00:00
parent 3fdecfbcf4
commit f24e202fe7
2 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -740,7 +740,7 @@ extern OBJECTTYPE gTempObject;
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
//#define CLOTHES_CIVILIAN 0x00001000 //4096 // with this item you can disguise as a civilian // not used anymore
#define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up
#define GAROTTE 0x00002000 //8192 // this item is a garotte
#define COVERT 0x00004000 //16384 // if LBE, any gun inside will be covert. On a gun, it will covert in any LBE, even if the LBE does not have that tag itself
#define CORPSE 0x00008000 //32768 // a dead body
+14 -3
View File
@@ -1665,10 +1665,11 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
INT32 sGridNo;
INT32 sBestSpot = NOWHERE;
INT32 iTempValue, iValue, iBestValue = 0;
ITEM_POOL * pItemPool;
OBJECTTYPE * pObj;
INVTYPE * pItem;
ITEM_POOL * pItemPool;
OBJECTTYPE * pObj;
INVTYPE * pItem;
INT32 iItemIndex, iBestItemIndex;
BOOLEAN fDumbEnoughtoPickup = FALSE;
iTempValue = -1;
iItemIndex = iBestItemIndex = -1;
@@ -1755,6 +1756,10 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
FindBestPath( pSoldier, GRIDSIZE, pSoldier->pathing.bLevel, DetermineMovementMode( pSoldier, AI_ACTION_PICKUP_ITEM ), COPYREACHABLE, 0 );//dnl ch50 071009
// Flugente: if the soldier is 'dumb enough', he may pick up certain items... which can be used to lure the AI into traps
if ( pSoldier->stats.bWisdom < 70 )
fDumbEnoughtoPickup = TRUE;
// SET UP DOUBLE-LOOP TO STEP THROUGH POTENTIAL GRID #s
for (sYOffset = -sMaxUp; sYOffset <= sMaxDown; sYOffset++)
{
@@ -1954,6 +1959,12 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
}
}
}
// Flugente: if the soldier is 'dumb enough', he may pick up 'interesting items'. This can be used to lure him into traps (a certain scene in FMJ comes to mind)
else if ( fDumbEnoughtoPickup && pItem->usItemClass == IC_MISC && HasItemFlag(pObj->usItem, ATTENTION_ITEM) )
{
// oooh... shiny!
iTempValue = 1000;
}
else
{
iTempValue = 0;