Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Macros | Functions | Variables
ai.cpp File Reference
#include <boost/algorithm/clamp.hpp>
#include <math.h>
#include <algorithm>
#include <memory>
#include "inexor/client/gamemode/gamemode_client.hpp"
#include "inexor/client/network.hpp"
#include "inexor/engine/particles.hpp"
#include "inexor/engine/rendergl.hpp"
#include "inexor/engine/renderparticles.hpp"
#include "inexor/engine/world.hpp"
#include "inexor/fpsgame/ai.hpp"
#include "inexor/fpsgame/client.hpp"
#include "inexor/fpsgame/entities.hpp"
#include "inexor/fpsgame/fps.hpp"
#include "inexor/fpsgame/fpsent.hpp"
#include "inexor/fpsgame/fpsstate.hpp"
#include "inexor/fpsgame/guns.hpp"
#include "inexor/fpsgame/render.hpp"
#include "inexor/fpsgame/teaminfo.hpp"
#include "inexor/fpsgame/weapon.hpp"
#include "inexor/gamemode/gamemode.hpp"
#include "inexor/io/Logging.hpp"
#include "inexor/model/ragdoll.hpp"
#include "inexor/network/SharedVar.hpp"
#include "inexor/network/legacy/game_types.hpp"
#include "inexor/physics/physics.hpp"
#include "inexor/shared/command.hpp"
#include "inexor/shared/cube_formatting.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_tools.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/ents.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/shared/tools.hpp"
#include "inexor/util/legacy_time.hpp"

Namespaces

 ai
 

Macros

#define rndaioffset(r)   ((rnd(int(r*aiskew[d->gunselect]*2)+1)-(r*aiskew[d->gunselect]))*(1.f/float(max(d->skill, 1))))
 

Functions

 ai::VAR (aidebug, 0, 0, 6)
 
 ai::VAR (aiforcegun,-1,-1, NUMGUNS-1)
 
 ai::ICOMMAND (addbot,"s",(char *s), addmsg(N_ADDBOT,"ri",*s?clamp(parseint(s), 1, 101):-1))
 
 ai::ICOMMAND (botbalance,"i",(int *n), addmsg(N_BOTBALANCE,"ri",*n))
 
 ai::ICOMMAND (botlimit,"i",(int *n), addmsg(N_BOTLIMIT,"ri",*n))
 
 ai::ICOMMAND (delbot,"",(), addmsg(N_DELBOT,"r"))
 
float ai::viewdist (int x)
 
float ai::viewfieldx (int x)
 
float ai::viewfieldy (int x)
 
bool ai::canmove (fpsent *d)
 
float ai::weapmindist (int weap)
 
float ai::weapmaxdist (int weap)
 
bool ai::weaprange (fpsent *d, int weap, float dist)
 
bool ai::targetable (fpsent *d, fpsent *e)
 
bool ai::getsight (vec &o, float yaw, float pitch, vec &q, vec &v, float mdist, float fovx, float fovy)
 
bool ai::cansee (fpsent *d, vec &x, vec &y, vec &targ)
 
bool ai::canshoot (fpsent *d, fpsent *e)
 
bool ai::canshoot (fpsent *d)
 
bool ai::hastarget (fpsent *d, aistate &b, fpsent *e, float yaw, float pitch, float dist)
 
vec ai::getaimpos (fpsent *d, fpsent *e)
 
void ai::create (fpsent *d)
 
void ai::destroy (fpsent *d)
 
void ai::init (fpsent *d, int at, int ocn, int sk, int bn, int pm, const char *name, const char *team, const char *tag)
 
void ai::update ()
 
bool ai::checkothers (vector< int > &targets, fpsent *d, int state, int targtype, int target, bool teams, int *members)
 
bool ai::makeroute (fpsent *d, aistate &b, int node, bool changed, int retries)
 
bool ai::makeroute (fpsent *d, aistate &b, const vec &pos, bool changed, int retries)
 
bool ai::randomnode (fpsent *d, aistate &b, const vec &pos, float guard, float wander)
 
bool ai::randomnode (fpsent *d, aistate &b, float guard, float wander)
 
bool ai::badhealth (fpsent *d)
 
bool ai::enemy (fpsent *d, aistate &b, const vec &pos, float guard=SIGHTMIN, int pursue=0)
 
bool ai::patrol (fpsent *d, aistate &b, const vec &pos, float guard, float wander, int walk, bool retry)
 
bool ai::defend (fpsent *d, aistate &b, const vec &pos, float guard, float wander, int walk)
 
bool ai::violence (fpsent *d, aistate &b, fpsent *e, int pursue)
 
bool ai::target (fpsent *d, aistate &b, int pursue=0, bool force=false, float mindist=0.f)
 
int ai::isgoodammo (int gun)
 
bool ai::hasgoodammo (fpsent *d)
 
void ai::assist (fpsent *d, aistate &b, vector< interest > &interests, bool all, bool force)
 
static void ai::tryitem (fpsent *d, extentity &e, int id, aistate &b, vector< interest > &interests, bool force=false)
 
void ai::items (fpsent *d, aistate &b, vector< interest > &interests, bool force=false)
 
bool ai::parseinterests (fpsent *d, aistate &b, vector< interest > &interests, bool override, bool ignore)
 
bool ai::find (fpsent *d, aistate &b, bool override=false)
 
bool ai::findassist (fpsent *d, aistate &b, bool override=false)
 
void ai::damaged (fpsent *d, fpsent *e)
 
void ai::findorientation (vec &o, float yaw, float pitch, vec &pos)
 
void ai::setup (fpsent *d)
 
void ai::spawned (fpsent *d)
 
void ai::killed (fpsent *d, fpsent *e)
 
void ai::itemspawned (int ent)
 
bool ai::check (fpsent *d, aistate &b)
 
int ai::dowait (fpsent *d, aistate &b)
 
int ai::dodefend (fpsent *d, aistate &b)
 
int ai::dointerest (fpsent *d, aistate &b)
 
int ai::dopursue (fpsent *d, aistate &b)
 
int ai::closenode (fpsent *d)
 
int ai::wpspot (fpsent *d, int n, bool check=false)
 
int ai::randomlink (fpsent *d, int n)
 
bool ai::anynode (fpsent *d, aistate &b, int len=NUMPREVNODES)
 
bool ai::checkroute (fpsent *d, int n)
 
bool ai::hunt (fpsent *d, aistate &b)
 
void ai::jumpto (fpsent *d, aistate &b, const vec &pos)
 
void ai::fixfullrange (float &yaw, float &pitch, float &roll, bool full)
 
void ai::fixrange (float &yaw, float &pitch)
 
void ai::getyawpitch (const vec &from, const vec &pos, float &yaw, float &pitch)
 
void ai::scaleyawpitch (float &yaw, float &pitch, float targyaw, float targpitch, float frame, float scale)
 
bool ai::lockon (fpsent *d, fpsent *e, float maxdist)
 
int ai::process (fpsent *d, aistate &b)
 
bool ai::hasrange (fpsent *d, fpsent *e, int weap)
 
bool ai::request (fpsent *d, aistate &b)
 
void ai::timeouts (fpsent *d, aistate &b)
 
void ai::logic (fpsent *d, aistate &b, bool run)
 
void ai::avoid ()
 
void ai::think (fpsent *d, bool run)
 
void ai::drawroute (fpsent *d, float amt=1.f)
 
 ai::VAR (showwaypoints, 0, 0, 1)
 
 ai::VAR (showwaypointsradius, 0, 200, 10000)
 
void ai::render ()
 

Variables

SharedVar< int > fog
 
avoidset ai::obstacles
 
int ai::updatemillis = 0
 
int ai::iteration = 0
 
int ai::itermillis = 0
 
int ai::forcegun = -1
 
vec ai::aitarget (0, 0, 0)
 
static vector< int > ai::targets
 
const char * ai::stnames [AI_S_MAX]
 
const char * ai::sttypes [AI_T_MAX+1]
 

Macro Definition Documentation

#define rndaioffset (   r)    ((rnd(int(r*aiskew[d->gunselect]*2)+1)-(r*aiskew[d->gunselect]))*(1.f/float(max(d->skill, 1))))

Referenced by ai::getaimpos().

Variable Documentation

SharedVar<int> fog