Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

be_ai_weap.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 //
00023 
00024 /*****************************************************************************
00025  * name:        be_ai_weap.h
00026  *
00027  * desc:        weapon AI
00028  *
00029  * $Archive: /source/code/botlib/be_ai_weap.h $
00030  *
00031  *****************************************************************************/
00032 
00033 //projectile flags
00034 #define PFL_WINDOWDAMAGE            1       //projectile damages through window
00035 #define PFL_RETURN                  2       //set when projectile returns to owner
00036 //weapon flags
00037 #define WFL_FIRERELEASED            1       //set when projectile is fired with key-up event
00038 //damage types
00039 #define DAMAGETYPE_IMPACT           1       //damage on impact
00040 #define DAMAGETYPE_RADIAL           2       //radial damage
00041 #define DAMAGETYPE_VISIBLE          4       //damage to all entities visible to the projectile
00042 
00043 typedef struct projectileinfo_s
00044 {
00045     char name[MAX_STRINGFIELD];
00046     char model[MAX_STRINGFIELD];
00047     int flags;
00048     float gravity;
00049     int damage;
00050     float radius;
00051     int visdamage;
00052     int damagetype;
00053     int healthinc;
00054     float push;
00055     float detonation;
00056     float bounce;
00057     float bouncefric;
00058     float bouncestop;
00059 } projectileinfo_t;
00060 
00061 typedef struct weaponinfo_s
00062 {
00063     int valid;                  //true if the weapon info is valid
00064     int number;                                 //number of the weapon
00065     char name[MAX_STRINGFIELD];
00066     char model[MAX_STRINGFIELD];
00067     int level;
00068     int weaponindex;
00069     int flags;
00070     char projectile[MAX_STRINGFIELD];
00071     int numprojectiles;
00072     float hspread;
00073     float vspread;
00074     float speed;
00075     float acceleration;
00076     vec3_t recoil;
00077     vec3_t offset;
00078     vec3_t angleoffset;
00079     float extrazvelocity;
00080     int ammoamount;
00081     int ammoindex;
00082     float activate;
00083     float reload;
00084     float spinup;
00085     float spindown;
00086     projectileinfo_t proj;                      //pointer to the used projectile
00087 } weaponinfo_t;
00088 
00089 //setup the weapon AI
00090 int BotSetupWeaponAI(void);
00091 //shut down the weapon AI
00092 void BotShutdownWeaponAI(void);
00093 //returns the best weapon to fight with
00094 int BotChooseBestFightWeapon(int weaponstate, int *inventory);
00095 //returns the information of the current weapon
00096 void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t *weaponinfo);
00097 //loads the weapon weights
00098 int BotLoadWeaponWeights(int weaponstate, char *filename);
00099 //returns a handle to a newly allocated weapon state
00100 int BotAllocWeaponState(void);
00101 //frees the weapon state
00102 void BotFreeWeaponState(int weaponstate);
00103 //resets the whole weapon state
00104 void BotResetWeaponState(int weaponstate);

Generated on Thu Aug 25 12:37:30 2005 for Quake III Arena by  doxygen 1.3.9.1