1 /* 2 =========================================================================== 3 4 Return to Castle Wolfenstein single player GPL Source Code 5 Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 7 This file is part of the Return to Castle Wolfenstein single player GPL Source Code (RTCW SP Source Code). 8 9 RTCW SP Source Code is free software: you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation, either version 3 of the License, or 12 (at your option) any later version. 13 14 RTCW SP Source Code is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with RTCW SP Source Code. If not, see <http://www.gnu.org/licenses/>. 21 22 In addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code. If not, please request a copy in writing from id Software at the address below. 23 24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. 25 26 =========================================================================== 27 */ 28 29 30 /***************************************************************************** 31 * name: ai_dmq3.h 32 * 33 * desc: Quake3 bot AI 34 * 35 * 36 *****************************************************************************/ 37 38 //setup the deathmatch AI 39 void BotSetupDeathmatchAI( void ); 40 //shutdown the deathmatch AI 41 void BotShutdownDeathmatchAI( void ); 42 //let the bot live within its deathmatch AI net 43 void BotDeathmatchAI( bot_state_t *bs, float thinktime ); 44 //free waypoints 45 void BotFreeWaypoints( bot_waypoint_t *wp ); 46 //choose a weapon 47 void BotChooseWeapon( bot_state_t *bs ); 48 //setup movement stuff 49 void BotSetupForMovement( bot_state_t *bs ); 50 //update the inventory 51 void BotUpdateInventory( bot_state_t *bs ); 52 //update the inventory during battle 53 void BotUpdateBattleInventory( bot_state_t *bs, int enemy ); 54 //use holdable items during battle 55 void BotBattleUseItems( bot_state_t *bs ); 56 //return true if the bot is dead 57 qboolean BotIsDead( bot_state_t *bs ); 58 //returns true if the bot is in observer mode 59 qboolean BotIsObserver( bot_state_t *bs ); 60 //returns true if the bot is in the intermission 61 qboolean BotIntermission( bot_state_t *bs ); 62 //returns true if the bot is in lava 63 qboolean BotInLava( bot_state_t *bs ); 64 //returns true if the bot is in slime 65 qboolean BotInSlime( bot_state_t *bs ); 66 //returns true if the entity is dead 67 qboolean EntityIsDead( aas_entityinfo_t *entinfo ); 68 //returns true if the entity is invisible 69 qboolean EntityIsInvisible( aas_entityinfo_t *entinfo ); 70 //returns true if the entity is shooting 71 qboolean EntityIsShooting( aas_entityinfo_t *entinfo ); 72 //returns the name of the client 73 char *ClientName( int client, char *name, int size ); 74 //returns a simplified client name 75 char *EasyClientName( int client, char *name, int size ); 76 //returns the skin used by the client 77 char *ClientSkin( int client, char *skin, int size ); 78 //returns the aggression of the bot in the range [0, 100] 79 float BotAggression( bot_state_t *bs ); 80 //returns true if the bot wants to retreat 81 int BotWantsToRetreat( bot_state_t *bs ); 82 //returns true if the bot wants to chase 83 int BotWantsToChase( bot_state_t *bs ); 84 //returns true if the bot wants to help 85 int BotWantsToHelp( bot_state_t *bs ); 86 //returns true if the bot can and wants to rocketjump 87 int BotCanAndWantsToRocketJump( bot_state_t *bs ); 88 //returns true if the bot wants to and goes camping 89 int BotWantsToCamp( bot_state_t *bs ); 90 //the bot will perform attack movements 91 bot_moveresult_t BotAttackMove( bot_state_t *bs, int tfl ); 92 //returns true if the bot and the entity are in the same team 93 int BotSameTeam( bot_state_t *bs, int entnum ); 94 //returns true if teamplay is on 95 int TeamPlayIsOn( void ); 96 //returns true and sets the .enemy field when an enemy is found 97 int BotFindEnemy( bot_state_t *bs, int curenemy ); 98 //returns a roam goal 99 void BotRoamGoal( bot_state_t *bs, vec3_t goal ); 100 //returns entity visibility in the range [0, 1] 101 float BotEntityVisible( int viewer, vec3_t eye, vec3_t viewangles, float fov, int ent ); 102 //the bot will aim at the current enemy 103 void BotAimAtEnemy( bot_state_t *bs ); 104 //check if the bot should attack 105 void BotCheckAttack( bot_state_t *bs ); 106 //AI when the bot is blocked 107 void BotAIBlocked( bot_state_t *bs, bot_moveresult_t *moveresult, int activate ); 108 //returns the CTF team the bot is in 109 int BotCTFTeam( bot_state_t *bs ); 110 //returns the flag the bot is carrying (CTFFLAG_?) 111 int BotCTFCarryingFlag( bot_state_t *bs ); 112 //set ctf goals (defend base, get enemy flag) during seek 113 void BotCTFSeekGoals( bot_state_t *bs ); 114 //set ctf goals (defend base, get enemy flag) during retreat 115 void BotCTFRetreatGoals( bot_state_t *bs ); 116 //create a new waypoint 117 bot_waypoint_t *BotCreateWayPoint( char *name, vec3_t origin, int areanum ); 118 //find a waypoint with the given name 119 bot_waypoint_t *BotFindWayPoint( bot_waypoint_t *waypoints, char *name ); 120 //strstr but case insensitive 121 char *stristr( char *str, char *charset ); 122 //returns the number of the client with the given name 123 int ClientFromName( char *name ); 124 // 125 int BotPointAreaNum( vec3_t origin ); 126 // 127 void BotMapScripts( bot_state_t *bs ); 128 129 //ctf flags 130 #define CTF_FLAG_NONE 0 131 #define CTF_FLAG_RED 1 132 #define CTF_FLAG_BLUE 2 133 //CTF skins 134 #define CTF_SKIN_REDTEAM "red" 135 #define CTF_SKIN_BLUETEAM "blue" 136 //CTF teams 137 #define CTF_TEAM_NONE 0 138 #define CTF_TEAM_RED 1 139 #define CTF_TEAM_BLUE 2 140 141 extern int dmflags; //deathmatch flags 142 extern int gametype; //game type 143 144 // Rafael gameskill 145 extern int gameskill; 146 // done 147 148 extern vmCvar_t bot_grapple; 149 extern vmCvar_t bot_rocketjump; 150 extern vmCvar_t bot_fastchat; 151 extern vmCvar_t bot_nochat; 152 extern vmCvar_t bot_testrchat; 153 154 extern bot_goal_t ctf_redflag; 155 extern bot_goal_t ctf_blueflag; 156 157