ai.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef __AI__
  2. #define __AI__
  3. //Distance ratings
  4. enum distance_e
  5. {
  6. DIST_MELEE,
  7. DIST_LONG,
  8. };
  9. //Attack types
  10. enum attack_e
  11. {
  12. ATTACK_MELEE,
  13. ATTACK_RANGE,
  14. };
  15. enum
  16. {
  17. SQUAD_IDLE, //No target found, waiting
  18. SQUAD_STAND_AND_SHOOT, //Standing in position and shoot (no cover)
  19. SQUAD_RETREAT, //Running away from combat
  20. SQUAD_COVER, //Under protective cover
  21. SQUAD_TRANSITION, //Moving between points, not firing
  22. SQUAD_POINT, //On point, laying down suppressive fire
  23. SQUAD_SCOUT, //Poking out to draw enemy
  24. NUM_SQUAD_STATES,
  25. };
  26. //sigh... had to move in here for groupInfo
  27. typedef enum //# rank_e
  28. {
  29. RANK_CIVILIAN,
  30. RANK_CREWMAN,
  31. RANK_ENSIGN,
  32. RANK_LT_JG,
  33. RANK_LT,
  34. RANK_LT_COMM,
  35. RANK_COMMANDER,
  36. RANK_CAPTAIN
  37. } rank_t;
  38. qboolean NPC_CheckPlayerTeamStealth( void );
  39. //AI_GRENADIER
  40. void NPC_BSGrenadier_Default( void );
  41. //AI_TUSKEN
  42. void NPC_BSTusken_Default( void );
  43. //AI_SNIPER
  44. void NPC_BSSniper_Default( void );
  45. //AI_STORMTROOPER
  46. void Saboteur_Decloak( gentity_t *self, int uncloakTime = 2000 );
  47. void NPC_BSST_Investigate( void );
  48. void NPC_BSST_Default( void );
  49. void NPC_BSST_Sleep( void );
  50. //AI_JEDI
  51. void NPC_BSJedi_Investigate( void );
  52. void NPC_BSJedi_Default( void );
  53. void NPC_BSJedi_FollowLeader( void );
  54. // AI_DROID
  55. void NPC_BSDroid_Default( void );
  56. // AI_ImperialProbe
  57. void NPC_BSImperialProbe_Default( void );
  58. // AI_atst
  59. void NPC_BSATST_Default( void );
  60. void NPC_BSInterrogator_Default( void );
  61. // AI Mark 1
  62. void NPC_BSMark1_Default( void );
  63. // AI Mark 2
  64. void NPC_BSMark2_Default( void );
  65. //monsters
  66. void NPC_BSMineMonster_Default( void );
  67. void NPC_BSHowler_Default( void );
  68. void NPC_BSRancor_Default( void );
  69. void NPC_BSWampa_Default( void );
  70. void NPC_BSSandCreature_Default( void );
  71. // animals
  72. void NPC_BSAnimal_Default( void );
  73. //Utilities
  74. //Group AI
  75. #define MAX_FRAME_GROUPS 32
  76. // !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
  77. typedef struct AIGroupMember_s
  78. {
  79. int number;
  80. int waypoint;
  81. int pathCostToEnemy;
  82. int closestBuddy;
  83. } AIGroupMember_t;
  84. #define MAX_GROUP_MEMBERS 32
  85. // !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
  86. typedef struct AIGroupInfo_s
  87. {
  88. int numGroup;
  89. qboolean processed;
  90. team_t team;
  91. gentity_t *enemy;
  92. int enemyWP;
  93. int speechDebounceTime;
  94. int lastClearShotTime;
  95. int lastSeenEnemyTime;
  96. int morale;
  97. int moraleAdjust;
  98. int moraleDebounce;
  99. int memberValidateTime;
  100. int activeMemberNum;
  101. gentity_t *commander;
  102. vec3_t enemyLastSeenPos;
  103. int numState[ NUM_SQUAD_STATES ];
  104. AIGroupMember_t member[ MAX_GROUP_MEMBERS ];
  105. } AIGroupInfo_t;
  106. int AI_GetGroupSize( vec3_t origin, int radius, team_t playerTeam, gentity_t *avoid = NULL );
  107. int AI_GetGroupSize( gentity_t *ent, int radius );
  108. void AI_GetGroup( gentity_t *self );
  109. gentity_t *AI_DistributeAttack( gentity_t *attacker, gentity_t *enemy, team_t team, int threshold );
  110. #endif //__AI__