| | 1 | struct strategyblock; |
| | 2 | |
| | 3 | typedef struct waypoint_link |
| | 4 | { |
| | 5 | int link_target_index; |
| | 6 | int link_flags; |
| | 7 | |
| | 8 | } WAYPOINT_LINK; |
| | 9 | |
| | 10 | #define linkflag_oneway 0x00000001 /* link is... get this... one way! */ |
| | 11 | #define linkflag_reversed_oneway 0x00000002 /* link is one way, only NOT this way. */ |
| | 12 | #define linkflag_alienonly 0x00000004 |
| | 13 | #define linkflag_largetarget 0x00000008 |
| | 14 | |
| | 15 | typedef struct waypoint_volume |
| | 16 | { |
| | 17 | VECTORCH centre; /* in MODULE space! */ |
| | 18 | VECTORCH max_extents; |
| | 19 | VECTORCH min_extents; |
| | 20 | int flags; |
| | 21 | int workspace:14; |
| | 22 | unsigned int contains_npc:1; |
| | 23 | unsigned int contains_target:1; |
| | 24 | int num_links; |
| | 25 | WAYPOINT_LINK *first_link; |
| | 26 | uint8_t weighting; |
| | 27 | |
| | 28 | } WAYPOINT_VOLUME; |
| | 29 | |
| | 30 | typedef struct waypoint_header |
| | 31 | { |
| | 32 | int num_waypoints; |
| | 33 | WAYPOINT_VOLUME *first_waypoint; |
| | 34 | |
| | 35 | } WAYPOINT_HEADER; |
| | 36 | |
| | 37 | typedef struct waypoint_route |
| | 38 | { |
| | 39 | int num_waypoints; |
| | 40 | WAYPOINT_VOLUME *start; |
| | 41 | WAYPOINT_VOLUME *second; |
| | 42 | WAYPOINT_VOLUME *last; |
| | 43 | WAYPOINT_LINK *first_link; |
| | 44 | |
| | 45 | } WAYPOINT_ROUTE; |
| | 46 | |
| | 47 | typedef struct waypoint_manager |
| | 48 | { |
| | 49 | WAYPOINT_VOLUME *current_container; |
| | 50 | WAYPOINT_VOLUME *current_target; |
| | 51 | WAYPOINT_LINK *current_link; |
| | 52 | VECTORCH current_target_point; |
| | 53 | |
| | 54 | } WAYPOINT_MANAGER; |
| | 55 | |
| | 56 | extern void InitWaypointSystem(int npctype); |
| | 57 | extern int NPCGetWaypointDirection(WAYPOINT_HEADER *waypoints, struct strategyblock *sbPtr, VECTORCH *velocityDirection, VECTORCH *targetPosition,
WAYPOINT_MANAGER *manager); |
| | 58 | extern int AlienIsEncouragedToCrawl(void); |
| | 59 | extern WAYPOINT_VOLUME *GetPositionValidity(struct module *conmod, VECTORCH *position, VECTORCH *suggestion); |
| | 60 | extern void InitWaypointManager(WAYPOINT_MANAGER *manager); |