g_ai.h

Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2002-2010 UFO: Alien Invasion.
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00017 
00018 See the GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 
00024 */
00025 
00026 #ifndef G_AI_H
00027 #define G_AI_H
00028 
00029 typedef struct {
00030     pos3_t to;          
00031     pos3_t stop;        
00032     shoot_types_t shootType;    
00033     byte shots;         
00034     edict_t *target;    
00035     const fireDef_t *fd;
00036     int z_align;        
00037 } aiAction_t;
00038 
00039 #define GUETE_HIDE          60
00040 #define GUETE_CLOSE_IN      20
00041 #define GUETE_KILL          30
00042 #define GUETE_RANDOM        10
00043 #define GUETE_REACTION_ERADICATION 30
00044 #define GUETE_REACTION_FEAR_FACTOR 20
00045 #define GUETE_CIV_FACTOR    0.25
00046 
00047 #define GUETE_CIV_RANDOM    10
00048 #define GUETE_RUN_AWAY      50
00049 #define GUETE_CIV_LAZINESS  5
00050 #define RUN_AWAY_DIST       160
00051 #define WAYPOINT_CIV_DIST   768
00052 
00053 #define GUETE_MISSION_OPPONENT_TARGET   50
00054 #define GUETE_MISSION_TARGET    60
00055 
00056 #define AI_ACTION_NOTHING_FOUND -10000.0
00057 
00058 #define CLOSE_IN_DIST       1200.0
00059 #define SPREAD_FACTOR       8.0
00060 #define SPREAD_NORM(x)      (x > 0 ? SPREAD_FACTOR/(x*torad) : 0)
00061 
00062 #define HIDE_DIST           7
00063 #define HERD_DIST           7
00064 
00065 /*
00066  * Shared functions (between C AI and LUA AI)
00067  */
00068 void AI_TurnIntoDirection(edict_t *ent, const pos3_t pos);
00069 qboolean AI_FindHidingLocation(int team, edict_t *ent, const pos3_t from, int *tuLeft);
00070 qboolean AI_FindHerdLocation(edict_t *ent, const pos3_t from, const vec3_t target, int tu);
00071 int AI_GetHidingTeam(const edict_t *ent);
00072 const item_t *AI_GetItemForShootType(shoot_types_t shootType, const edict_t *ent);
00073 
00074 /*
00075  * LUA functions
00076  */
00077 void AIL_ActorThink(player_t * player, edict_t * ent);
00078 int AIL_InitActor(edict_t * ent, char *type, char *subtype);
00079 void AIL_Cleanup(void);
00080 void AIL_Init(void);
00081 void AIL_Shutdown(void);
00082 
00083 #endif

Generated by  doxygen 1.6.2