diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index f53433b4f..632bd4a65 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -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 diff --git a/TacticalAI/FindLocations.cpp b/TacticalAI/FindLocations.cpp index 117ae0141..937da429d 100644 --- a/TacticalAI/FindLocations.cpp +++ b/TacticalAI/FindLocations.cpp @@ -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;