1 // 2 // Filename : pathai.h 3 // Author : Ray E. Bornert II 4 // Date : 1992-MAR-15 5 // 6 // Copyright (C) 1993 HixoxiH Software 7 // 8 9 #ifndef _PATHAI_H 10 #define _PATHAI_H 11 12 #include "JA2Types.h" 13 14 15 void InitPathAI(void); 16 void ShutDownPathAI( void ); 17 INT16 PlotPath( SOLDIERTYPE* pSold, INT16 sDestGridno, INT8 bCopyRoute, INT8 bPlot, UINT16 usMovementMode, INT16 sAPBudget); 18 INT16 UIPlotPath( SOLDIERTYPE* pSold, INT16 sDestGridno, INT8 bCopyRoute, INT8 bPlot, UINT16 usMovementMode, INT16 sAPBudget); 19 INT16 EstimatePlotPath(SOLDIERTYPE* pSold, INT16 sDestGridno, INT8 bCopyRoute, INT8 bPlot, UINT16 usMovementMode, INT16 sAPBudget); 20 21 void ErasePath(); 22 INT32 FindBestPath(SOLDIERTYPE* s, INT16 sDestination, INT8 ubLevel, INT16 usMovementMode, INT8 bCopy, UINT8 fFlags); 23 void GlobalReachableTest( INT16 sStartGridNo ); 24 void GlobalItemsReachableTest( INT16 sStartGridNo1, INT16 sStartGridNo2 ); 25 void RoofReachableTest( INT16 sStartGridNo, UINT8 ubBuildingID ); 26 void LocalReachableTest( INT16 sStartGridNo, INT8 bRadius ); 27 28 UINT8 DoorTravelCost(const SOLDIERTYPE* pSoldier, INT32 iGridNo, UINT8 ubMovementCost, BOOLEAN fReturnPerceivedValue, INT32* piDoorGridNo); 29 UINT8 InternalDoorTravelCost(const SOLDIERTYPE* pSoldier, INT32 iGridNo, UINT8 ubMovementCost, BOOLEAN fReturnPerceivedValue, INT32* piDoorGridNo, BOOLEAN fReturnDoorCost); 30 31 INT16 RecalculatePathCost( SOLDIERTYPE *pSoldier, UINT16 usMovementMode ); 32 33 // Exporting these global variables 34 extern UINT8 guiPathingData[256]; 35 extern UINT8 gubNPCAPBudget; 36 extern UINT8 gubNPCDistLimit; 37 extern UINT8 gubNPCPathCount; 38 extern BOOLEAN gfPlotPathToExitGrid; 39 extern BOOLEAN gfNPCCircularDistLimit; 40 extern BOOLEAN gfEstimatePath; 41 extern BOOLEAN gfPathAroundObstacles; 42 extern UINT8 gubGlobalPathFlags; 43 44 // Ian's terrain values for travelling speed/pathing purposes 45 // Fixed by CJC March 4, 1998. Please do not change these unless familiar 46 // with how this will affect the path code! 47 48 #define TRAVELCOST_NONE 0 49 #define TRAVELCOST_FLAT 10 50 #define TRAVELCOST_BUMPY 12 51 #define TRAVELCOST_GRASS 12 52 #define TRAVELCOST_THICK 16 53 #define TRAVELCOST_DEBRIS 20 54 #define TRAVELCOST_SHORE 30 55 #define TRAVELCOST_KNEEDEEP 36 56 #define TRAVELCOST_DEEPWATER 50 57 #define TRAVELCOST_FENCE 40 58 59 // these values are used to indicate "this is an obstacle 60 // if there is a door (perceived) open/closed in this tile 61 #define TRAVELCOST_DOOR_CLOSED_HERE 220 62 #define TRAVELCOST_DOOR_CLOSED_N 221 63 #define TRAVELCOST_DOOR_CLOSED_W 222 64 #define TRAVELCOST_DOOR_OPEN_HERE 223 65 #define TRAVELCOST_DOOR_OPEN_N 224 66 #define TRAVELCOST_DOOR_OPEN_NE 225 67 #define TRAVELCOST_DOOR_OPEN_E 226 68 #define TRAVELCOST_DOOR_OPEN_SE 227 69 #define TRAVELCOST_DOOR_OPEN_S 228 70 #define TRAVELCOST_DOOR_OPEN_SW 229 71 #define TRAVELCOST_DOOR_OPEN_W 230 72 #define TRAVELCOST_DOOR_OPEN_NW 231 73 #define TRAVELCOST_DOOR_OPEN_N_N 232 74 #define TRAVELCOST_DOOR_OPEN_NW_N 233 75 #define TRAVELCOST_DOOR_OPEN_NE_N 234 76 #define TRAVELCOST_DOOR_OPEN_W_W 235 77 #define TRAVELCOST_DOOR_OPEN_SW_W 236 78 #define TRAVELCOST_DOOR_OPEN_NW_W 237 79 #define TRAVELCOST_NOT_STANDING 248 80 #define TRAVELCOST_OFF_MAP 249 81 #define TRAVELCOST_CAVEWALL 250 82 #define TRAVELCOST_HIDDENOBSTACLE 251 83 #define TRAVELCOST_DOOR 252 84 #define TRAVELCOST_OBSTACLE 253 85 #define TRAVELCOST_WALL 254 86 #define TRAVELCOST_EXITGRID 255 87 88 #define TRAVELCOST_TRAINTRACKS 30 89 #define TRAVELCOST_DIRTROAD 9 90 #define TRAVELCOST_PAVEDROAD 9 91 #define TRAVELCOST_FLATFLOOR 10 92 93 #define TRAVELCOST_BLOCKED (TRAVELCOST_OFF_MAP) 94 #define IS_TRAVELCOST_DOOR( x ) (x >= TRAVELCOST_DOOR_CLOSED_HERE && x <= TRAVELCOST_DOOR_OPEN_NW_W) 95 #define IS_TRAVELCOST_CLOSED_DOOR( x ) (x >= TRAVELCOST_DOOR_CLOSED_HERE && x << TRAVELCOST_DOOR_CLOSED_W) 96 97 // ------------------------------------------ 98 // PLOT PATH defines 99 #define NO_PLOT 0 100 #define PLOT 1 101 102 #define NO_COPYROUTE 0 103 #define COPYROUTE 1 104 #define COPYREACHABLE 2 105 #define COPYREACHABLE_AND_APS 3 106 107 #define PATH_THROUGH_PEOPLE 0x01 108 #define PATH_IGNORE_PERSON_AT_DEST 0x02 109 #define PATH_CLOSE_GOOD_ENOUGH 0x04 110 111 #define PATH_CLOSE_RADIUS 5 112 113 // ------------------------------------------ 114 115 #endif 116