1 /* 2 =========================================================================== 3 Copyright (C) 1999-2005 Id Software, Inc. 4 5 This file is part of Quake III Arena source code. 6 7 Quake III Arena source code is free software; you can redistribute it 8 and/or modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the License, 10 or (at your option) any later version. 11 12 Quake III Arena source code is distributed in the hope that it will be 13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with Quake III Arena source code; if not, write to the Free Software 19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 =========================================================================== 21 */ 22 // 23 24 /***************************************************************************** 25 * name: be_ai_weap.h 26 * 27 * desc: weapon AI 28 * 29 * $Archive: /source/code/botlib/be_ai_weap.h $ 30 * 31 *****************************************************************************/ 32 33 //projectile flags 34 #define PFL_WINDOWDAMAGE 1 //projectile damages through window 35 #define PFL_RETURN 2 //set when projectile returns to owner 36 //weapon flags 37 #define WFL_FIRERELEASED 1 //set when projectile is fired with key-up event 38 //damage types 39 #define DAMAGETYPE_IMPACT 1 //damage on impact 40 #define DAMAGETYPE_RADIAL 2 //radial damage 41 #define DAMAGETYPE_VISIBLE 4 //damage to all entities visible to the projectile 42 43 typedef struct projectileinfo_s 44 { 45 char name[MAX_STRINGFIELD]; 46 char model[MAX_STRINGFIELD]; 47 int flags; 48 float gravity; 49 int damage; 50 float radius; 51 int visdamage; 52 int damagetype; 53 int healthinc; 54 float push; 55 float detonation; 56 float bounce; 57 float bouncefric; 58 float bouncestop; 59 } projectileinfo_t; 60 61 typedef struct weaponinfo_s 62 { 63 int valid; //true if the weapon info is valid 64 int number; //number of the weapon 65 char name[MAX_STRINGFIELD]; 66 char model[MAX_STRINGFIELD]; 67 int level; 68 int weaponindex; 69 int flags; 70 char projectile[MAX_STRINGFIELD]; 71 int numprojectiles; 72 float hspread; 73 float vspread; 74 float speed; 75 float acceleration; 76 vec3_t recoil; 77 vec3_t offset; 78 vec3_t angleoffset; 79 float extrazvelocity; 80 int ammoamount; 81 int ammoindex; 82 float activate; 83 float reload; 84 float spinup; 85 float spindown; 86 projectileinfo_t proj; //pointer to the used projectile 87 } weaponinfo_t; 88 89 //setup the weapon AI 90 int BotSetupWeaponAI(void); 91 //shut down the weapon AI 92 void BotShutdownWeaponAI(void); 93 //returns the best weapon to fight with 94 int BotChooseBestFightWeapon(int weaponstate, int *inventory); 95 //returns the information of the current weapon 96 void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t *weaponinfo); 97 //loads the weapon weights 98 int BotLoadWeaponWeights(int weaponstate, char *filename); 99 //returns a handle to a newly allocated weapon state 100 int BotAllocWeaponState(void); 101 //frees the weapon state 102 void BotFreeWeaponState(int weaponstate); 103 //resets the whole weapon state 104 void BotResetWeaponState(int weaponstate); 105