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
+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;