2012-08-04 10:54:37 +00:00
|
|
|
// Copyright (C) 1999-2000 Id Software, Inc.
|
2012-01-22 21:34:33 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* name: ai_dmq3.h
|
|
|
|
*
|
|
|
|
* desc: Quake3 bot AI
|
|
|
|
*
|
2012-08-04 10:54:37 +00:00
|
|
|
* $Archive: /StarTrek/Code-DM/game/ai_dmq3.h $
|
|
|
|
* $Author: Dkramer $
|
|
|
|
* $Revision: 2 $
|
|
|
|
* $Modtime: 6/21/00 4:35p $
|
|
|
|
* $Date: 6/27/00 10:06a $
|
2012-01-22 21:34:33 +00:00
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2012-08-04 10:54:37 +00:00
|
|
|
//!setup the deathmatch AI
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotSetupDeathmatchAI(void);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!shutdown the deathmatch AI
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotShutdownDeathmatchAI(void);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!let the bot live within it's deathmatch AI net
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotDeathmatchAI(bot_state_t *bs, float thinktime);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!free waypoints
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotFreeWaypoints(bot_waypoint_t *wp);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!choose a weapon
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotChooseWeapon(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!setup movement stuff
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotSetupForMovement(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!update the inventory
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotUpdateInventory(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!update the inventory during battle
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotUpdateBattleInventory(bot_state_t *bs, int enemy);
|
2012-08-04 10:54:37 +00:00
|
|
|
//! should I detonate the detpack now
|
|
|
|
qboolean BotShouldDetonateDetPack(bot_state_t *bs);
|
|
|
|
//!use holdable items during battle
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotBattleUseItems(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!return true if the bot is dead
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean BotIsDead(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot is in observer mode
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean BotIsObserver(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot is in the intermission
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean BotIntermission(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot is in lava or slime
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean BotInLavaOrSlime(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the entity is dead
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean EntityIsDead(aas_entityinfo_t *entinfo);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the entity is invisible
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean EntityIsInvisible(aas_entityinfo_t *entinfo);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the entity is shooting
|
2012-01-22 21:34:33 +00:00
|
|
|
qboolean EntityIsShooting(aas_entityinfo_t *entinfo);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns the name of the client
|
2012-01-22 21:34:33 +00:00
|
|
|
char *ClientName(int client, char *name, int size);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns an simplyfied client name
|
2012-01-22 21:34:33 +00:00
|
|
|
char *EasyClientName(int client, char *name, int size);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns the skin used by the client
|
2012-01-22 21:34:33 +00:00
|
|
|
char *ClientSkin(int client, char *skin, int size);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns the aggression of the bot in the range [0, 100]
|
2012-01-22 21:34:33 +00:00
|
|
|
float BotAggression(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot wants to retreat
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotWantsToRetreat(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot wants to chase
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotWantsToChase(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot wants to help
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotWantsToHelp(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot can and wants to rocketjump
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotCanAndWantsToRocketJump(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot wants to and goes camping
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotWantsToCamp(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!the bot will perform attack movements
|
2012-01-22 21:34:33 +00:00
|
|
|
bot_moveresult_t BotAttackMove(bot_state_t *bs, int tfl);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if the bot and the entity are in the same team
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotSameTeam(bot_state_t *bs, int entnum);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true if teamplay is on
|
2012-01-22 21:34:33 +00:00
|
|
|
int TeamPlayIsOn(void);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns visible team mate flag carrier if available
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotTeamFlagCarrierVisible(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns true and sets the .enemy field when an enemy is found
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotFindEnemy(bot_state_t *bs, int curenemy);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns a roam goal
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotRoamGoal(bot_state_t *bs, vec3_t goal);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns entity visibility in the range [0, 1]
|
2012-01-22 21:34:33 +00:00
|
|
|
float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int ent);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!the bot will aim at the current enemy
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotAimAtEnemy(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!check if the bot should attack
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotCheckAttack(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!AI when the bot is blocked
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns the CTF team the bot is in
|
|
|
|
int BotCTFTeam(bot_state_t *bs);
|
|
|
|
//!returns the flag the bot is carrying (CTFFLAG_?)
|
2012-01-22 21:34:33 +00:00
|
|
|
int BotCTFCarryingFlag(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!set ctf goals (defend base, get enemy flag) during seek
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotCTFSeekGoals(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!set ctf goals (defend base, get enemy flag) during retreat
|
2012-01-22 21:34:33 +00:00
|
|
|
void BotCTFRetreatGoals(bot_state_t *bs);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!create a new waypoint
|
2012-01-22 21:34:33 +00:00
|
|
|
bot_waypoint_t *BotCreateWayPoint(char *name, vec3_t origin, int areanum);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!find a waypoint with the given name
|
2012-01-22 21:34:33 +00:00
|
|
|
bot_waypoint_t *BotFindWayPoint(bot_waypoint_t *waypoints, char *name);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!strstr but case insensitive
|
2012-01-22 21:34:33 +00:00
|
|
|
char *stristr(char *str, char *charset);
|
2012-08-04 10:54:37 +00:00
|
|
|
//!returns the number of the client with the given name
|
2012-01-22 21:34:33 +00:00
|
|
|
int ClientFromName(char *name);
|
|
|
|
//
|
|
|
|
int BotPointAreaNum(vec3_t origin);
|
|
|
|
//
|
|
|
|
void BotMapScripts(bot_state_t *bs);
|
|
|
|
|
|
|
|
//ctf flags
|
|
|
|
#define CTF_FLAG_NONE 0
|
|
|
|
#define CTF_FLAG_RED 1
|
|
|
|
#define CTF_FLAG_BLUE 2
|
|
|
|
//CTF skins
|
|
|
|
#define CTF_SKIN_REDTEAM "red"
|
|
|
|
#define CTF_SKIN_BLUETEAM "blue"
|
2012-08-04 10:54:37 +00:00
|
|
|
//CTF teams
|
|
|
|
#define CTF_TEAM_NONE 0
|
|
|
|
#define CTF_TEAM_RED 1
|
|
|
|
#define CTF_TEAM_BLUE 2
|
2012-01-22 21:34:33 +00:00
|
|
|
|
2012-08-04 10:54:37 +00:00
|
|
|
extern int gametype; //!<game type
|
|
|
|
extern int maxclients; //!<maximum number of clients
|
2012-01-22 21:34:33 +00:00
|
|
|
|
|
|
|
extern vmCvar_t bot_grapple;
|
|
|
|
extern vmCvar_t bot_rocketjump;
|
|
|
|
extern vmCvar_t bot_fastchat;
|
|
|
|
extern vmCvar_t bot_nochat;
|
|
|
|
extern vmCvar_t bot_testrchat;
|
|
|
|
extern vmCvar_t bot_challenge;
|
|
|
|
|
|
|
|
extern bot_goal_t ctf_redflag;
|
|
|
|
extern bot_goal_t ctf_blueflag;
|
2012-08-04 10:54:37 +00:00
|
|
|
|