codemp/game/be_ai_weap.h

Go to the documentation of this file.
00001 // Copyright (C) 1999-2000 Id Software, Inc.
00002 //
00003 
00004 /*****************************************************************************
00005  * name:                be_ai_weap.h
00006  *
00007  * desc:                weapon AI
00008  *
00009  * $Archive: /source/code/botlib/be_ai_weap.h $
00010  * $Author: osman $ 
00011  * $Revision: 1.4 $
00012  * $Modtime: 10/05/99 3:32p $
00013  * $Date: 2003/03/15 23:44:00 $
00014  *
00015  *****************************************************************************/
00016 
00017 //projectile flags
00018 #define PFL_WINDOWDAMAGE                        1               //projectile damages through window
00019 #define PFL_RETURN                                      2               //set when projectile returns to owner
00020 //weapon flags
00021 #define WFL_FIRERELEASED                        1               //set when projectile is fired with key-up event
00022 //damage types
00023 #define DAMAGETYPE_IMPACT                       1               //damage on impact
00024 #define DAMAGETYPE_RADIAL                       2               //radial damage
00025 #define DAMAGETYPE_VISIBLE                      4               //damage to all entities visible to the projectile
00026 
00027 typedef struct projectileinfo_s
00028 {
00029         char name[MAX_STRINGFIELD];
00030         char model[MAX_STRINGFIELD];
00031         int flags;
00032         float gravity;
00033         int damage;
00034         float radius;
00035         int visdamage;
00036         int damagetype;
00037         int healthinc;
00038         float push;
00039         float detonation;
00040         float bounce;
00041         float bouncefric;
00042         float bouncestop;
00043 } projectileinfo_t;
00044 
00045 typedef struct weaponinfo_s
00046 {
00047         int valid;                                      //true if the weapon info is valid
00048         int number;                                                                     //number of the weapon
00049         char name[MAX_STRINGFIELD];
00050         char model[MAX_STRINGFIELD];
00051         int level;
00052         int weaponindex;
00053         int flags;
00054         char projectile[MAX_STRINGFIELD];
00055         int numprojectiles;
00056         float hspread;
00057         float vspread;
00058         float speed;
00059         float acceleration;
00060         vec3_t recoil;
00061         vec3_t offset;
00062         vec3_t angleoffset;
00063         float extrazvelocity;
00064         int ammoamount;
00065         int ammoindex;
00066         float activate;
00067         float reload;
00068         float spinup;
00069         float spindown;
00070         projectileinfo_t proj;                                          //pointer to the used projectile
00071 } weaponinfo_t;
00072 
00073 //setup the weapon AI
00074 int BotSetupWeaponAI(void);
00075 //shut down the weapon AI
00076 void BotShutdownWeaponAI(void);
00077 //returns the best weapon to fight with
00078 int BotChooseBestFightWeapon(int weaponstate, int *inventory);
00079 //returns the information of the current weapon
00080 void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t *weaponinfo);
00081 //loads the weapon weights
00082 int BotLoadWeaponWeights(int weaponstate, char *filename);
00083 //returns a handle to a newly allocated weapon state
00084 int BotAllocWeaponState(void);
00085 //frees the weapon state
00086 void BotFreeWeaponState(int weaponstate);
00087 //resets the whole weapon state
00088 void BotResetWeaponState(int weaponstate);