| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#define MOVE_WALK 1 |
| 35 |
#define MOVE_CROUCH 2 |
| 36 |
#define MOVE_JUMP 4 |
| 37 |
#define MOVE_GRAPPLE 8 |
| 38 |
#define MOVE_ROCKETJUMP 16 |
| 39 |
#define MOVE_BFGJUMP 32 |
| 40 |
|
| 41 |
#define MFL_BARRIERJUMP 1 //bot is performing a barrier jump |
| 42 |
#define MFL_ONGROUND 2 //bot is in the ground |
| 43 |
#define MFL_SWIMMING 4 //bot is swimming |
| 44 |
#define MFL_AGAINSTLADDER 8 //bot is against a ladder |
| 45 |
#define MFL_WATERJUMP 16 //bot is waterjumping |
| 46 |
#define MFL_TELEPORTED 32 //bot is being teleported |
| 47 |
#define MFL_GRAPPLEPULL 64 //bot is being pulled by the grapple |
| 48 |
#define MFL_ACTIVEGRAPPLE 128 //bot is using the grapple hook |
| 49 |
#define MFL_GRAPPLERESET 256 //bot has reset the grapple |
| 50 |
#define MFL_WALK 512 //bot should walk slowly |
| 51 |
|
| 52 |
#define MOVERESULT_MOVEMENTVIEW 1 //bot uses view for movement |
| 53 |
#define MOVERESULT_SWIMVIEW 2 //bot uses view for swimming |
| 54 |
#define MOVERESULT_WAITING 4 //bot is waiting for something |
| 55 |
#define MOVERESULT_MOVEMENTVIEWSET 8 //bot has set the view in movement code |
| 56 |
#define MOVERESULT_MOVEMENTWEAPON 16 //bot uses weapon for movement |
| 57 |
#define MOVERESULT_ONTOPOFOBSTACLE 32 //bot is ontop of obstacle |
| 58 |
#define MOVERESULT_ONTOPOF_FUNCBOB 64 //bot is ontop of a func_bobbing |
| 59 |
#define MOVERESULT_ONTOPOF_ELEVATOR 128 //bot is ontop of an elevator (func_plat) |
| 60 |
#define MOVERESULT_BLOCKEDBYAVOIDSPOT 256 //bot is blocked by an avoid spot |
| 61 |
|
| 62 |
#define MAX_AVOIDREACH 1 |
| 63 |
#define MAX_AVOIDSPOTS 32 |
| 64 |
|
| 65 |
#define AVOID_CLEAR 0 //clear all avoid spots |
| 66 |
#define AVOID_ALWAYS 1 //avoid always |
| 67 |
#define AVOID_DONTBLOCK 2 //never totally block |
| 68 |
|
| 69 |
#define RESULTTYPE_ELEVATORUP 1 //elevator is up |
| 70 |
#define RESULTTYPE_WAITFORFUNCBOBBING 2 //waiting for func bobbing to arrive |
| 71 |
#define RESULTTYPE_BADGRAPPLEPATH 4 //grapple path is obstructed |
| 72 |
#define RESULTTYPE_INSOLIDAREA 8 //stuck in solid area, this is bad |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
typedef struct bot_initmove_s |
| 77 |
{ |
| 78 |
vec3_t origin; |
| 79 |
vec3_t velocity; |
| 80 |
vec3_t viewoffset; |
| 81 |
int entitynum; |
| 82 |
int client; |
| 83 |
float thinktime; |
| 84 |
int presencetype; |
| 85 |
vec3_t viewangles; |
| 86 |
int or_moveflags; |
| 87 |
} bot_initmove_t; |
| 88 |
|
| 89 |
|
| 90 |
typedef struct bot_moveresult_s |
| 91 |
{ |
| 92 |
int failure; |
| 93 |
int type; |
| 94 |
int blocked; |
| 95 |
int blockentity; |
| 96 |
int traveltype; |
| 97 |
int flags; |
| 98 |
int weapon; |
| 99 |
vec3_t movedir; |
| 100 |
vec3_t ideal_viewangles; |
| 101 |
} bot_moveresult_t; |
| 102 |
|
| 103 |
#define bot_moveresult_t_cleared(x) bot_moveresult_t (x) = {0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0}} |
| 104 |
|
| 105 |
typedef struct bot_avoidspot_s |
| 106 |
{ |
| 107 |
vec3_t origin; |
| 108 |
float radius; |
| 109 |
int type; |
| 110 |
} bot_avoidspot_t; |
| 111 |
|
| 112 |
|
| 113 |
void BotResetMoveState(int movestate); |
| 114 |
|
| 115 |
void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, int travelflags); |
| 116 |
|
| 117 |
int BotMoveInDirection(int movestate, vec3_t dir, float speed, int type); |
| 118 |
|
| 119 |
void BotResetAvoidReach(int movestate); |
| 120 |
|
| 121 |
void BotResetLastAvoidReach(int movestate); |
| 122 |
|
| 123 |
int BotReachabilityArea(vec3_t origin, int client); |
| 124 |
|
| 125 |
int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, float lookahead, vec3_t target); |
| 126 |
|
| 127 |
int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t *goal, int travelflags, vec3_t target); |
| 128 |
|
| 129 |
int BotAllocMoveState(void); |
| 130 |
|
| 131 |
void BotFreeMoveState(int handle); |
| 132 |
|
| 133 |
void BotInitMoveState(int handle, bot_initmove_t *initmove); |
| 134 |
|
| 135 |
void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type); |
| 136 |
|
| 137 |
void BotSetBrushModelTypes(void); |
| 138 |
|
| 139 |
int BotSetupMoveAI(void); |
| 140 |
|
| 141 |
void BotShutdownMoveAI(void); |
| 142 |
|