be_ai_weap.h 3.1 KB

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