1 /*
2 ===========================================================================
3 
4 Return to Castle Wolfenstein single player GPL Source Code
5 Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Return to Castle Wolfenstein single player GPL Source Code (“RTCW SP Source Code”).
8 
9 RTCW SP Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 RTCW SP Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with RTCW SP Source Code.  If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code.  If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 
30 /*****************************************************************************
31  * name:		be_ai_weap.h
32  *
33  * desc:		weapon AI
34  *
35  *
36  *****************************************************************************/
37 
38 //projectile flags
39 #define PFL_WINDOWDAMAGE            1       //projectile damages through window
40 #define PFL_RETURN                  2       //set when projectile returns to owner
41 //weapon flags
42 #define WFL_FIRERELEASED            1       //set when projectile is fired with key-up event
43 //damage types
44 #define DAMAGETYPE_IMPACT           1       //damage on impact
45 #define DAMAGETYPE_RADIAL           2       //radial damage
46 #define DAMAGETYPE_VISIBLE          4       //damage to all entities visible to the projectile
47 
48 typedef struct projectileinfo_s
49 {
50 	char name[MAX_STRINGFIELD];
51 	char model[MAX_STRINGFIELD];
52 	int flags;
53 	float gravity;
54 	int damage;
55 	float radius;
56 	int visdamage;
57 	int damagetype;
58 	int healthinc;
59 	float push;
60 	float detonation;
61 	float bounce;
62 	float bouncefric;
63 	float bouncestop;
64 } projectileinfo_t;
65 
66 typedef struct weaponinfo_s
67 {
68 	int valid;                  //true if the weapon info is valid
69 	int number;                                 //number of the weapon
70 	char name[MAX_STRINGFIELD];
71 	char model[MAX_STRINGFIELD];
72 	int level;
73 	int weaponindex;
74 	int flags;
75 	char projectile[MAX_STRINGFIELD];
76 	int numprojectiles;
77 	float hspread;
78 	float vspread;
79 	float speed;
80 	float acceleration;
81 	vec3_t recoil;
82 	vec3_t offset;
83 	vec3_t angleoffset;
84 	float extrazvelocity;
85 	int ammoamount;
86 	int ammoindex;
87 	float activate;
88 	float reload;
89 	float spinup;
90 	float spindown;
91 	projectileinfo_t proj;                      //pointer to the used projectile
92 } weaponinfo_t;
93 
94 //setup the weapon AI
95 int BotSetupWeaponAI( void );
96 //shut down the weapon AI
97 void BotShutdownWeaponAI( void );
98 //returns the best weapon to fight with
99 int BotChooseBestFightWeapon( int weaponstate, int *inventory );
100 //returns the information of the current weapon
101 void BotGetWeaponInfo( int weaponstate, int weapon, weaponinfo_t *weaponinfo );
102 //loads the weapon weights
103 int BotLoadWeaponWeights( int weaponstate, char *filename );
104 //returns a handle to a newly allocated weapon state
105 int BotAllocWeaponState( void );
106 //frees the weapon state
107 void BotFreeWeaponState( int weaponstate );
108 //resets the whole weapon state
109 void BotResetWeaponState( int weaponstate );
110