bg_public.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. #ifndef __BG_PUBLIC_H__
  2. #define __BG_PUBLIC_H__
  3. // bg_public.h -- definitions shared by both the server game and client game modules
  4. #include "weapons.h"
  5. #include "g_items.h"
  6. #include "teams.h"
  7. #include "statindex.h"
  8. #define DEFAULT_GRAVITY 800
  9. #define GIB_HEALTH -40
  10. #define ARMOR_PROTECTION 0.40
  11. #define MAX_ITEMS 128
  12. #define RANK_TIED_FLAG 0x4000
  13. #define DEFAULT_SHOTGUN_SPREAD 700
  14. #define DEFAULT_SHOTGUN_COUNT 11
  15. #define ITEM_RADIUS 15 // item sizes are needed for client side pickup detection
  16. //Player sizes
  17. extern float DEFAULT_MINS_0;
  18. extern float DEFAULT_MINS_1;
  19. extern float DEFAULT_MAXS_0;
  20. extern float DEFAULT_MAXS_1;
  21. extern float DEFAULT_PLAYER_RADIUS;
  22. #define DEFAULT_MINS_2 -24
  23. #define DEFAULT_MAXS_2 40// was 32, but too short for player
  24. #define CROUCH_MAXS_2 16
  25. #define ATST_MINS0 -40
  26. #define ATST_MINS1 -40
  27. #define ATST_MINS2 -24
  28. #define ATST_MAXS0 40
  29. #define ATST_MAXS1 40
  30. #define ATST_MAXS2 248
  31. //Player viewheights
  32. #define STANDARD_VIEWHEIGHT_OFFSET -4
  33. //#define RAVEN_VIEWHEIGHT_ADJ 2
  34. //#define DEFAULT_VIEWHEIGHT (26+RAVEN_VIEWHEIGHT_ADJ)
  35. //#define CROUCH_VIEWHEIGHT 12
  36. #define DEAD_VIEWHEIGHT -16
  37. //Player movement values
  38. #define MIN_WALK_NORMAL 0.7 // can't walk on very steep slopes
  39. #define JUMP_VELOCITY 225 // 270
  40. #define STEPSIZE 18
  41. /*
  42. ===================================================================================
  43. PMOVE MODULE
  44. The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t
  45. and some other output data. Used for local prediction on the client game and true
  46. movement on the server game.
  47. ===================================================================================
  48. */
  49. typedef enum {
  50. PM_NORMAL, // can accelerate and turn
  51. PM_NOCLIP, // noclip movement
  52. PM_SPECTATOR, // still run into walls
  53. PM_DEAD, // no acceleration or turning, but free falling
  54. PM_FREEZE, // stuck in place with no control
  55. PM_INTERMISSION // no movement or status bar
  56. } pmtype_t;
  57. typedef enum {
  58. WEAPON_READY,
  59. WEAPON_RAISING,
  60. WEAPON_DROPPING,
  61. WEAPON_FIRING,
  62. WEAPON_CHARGING,
  63. WEAPON_CHARGING_ALT,
  64. WEAPON_IDLE, //lowered
  65. } weaponstate_t;
  66. // pmove->pm_flags
  67. #define PMF_DUCKED (1<<0)//1
  68. #define PMF_JUMP_HELD (1<<1)//2
  69. #define PMF_JUMPING (1<<2)//4 // yes, I really am in a jump -- Mike, you may want to come up with something better here since this is really a temp fix.
  70. #define PMF_BACKWARDS_JUMP (1<<3)//8 // go into backwards land
  71. #define PMF_BACKWARDS_RUN (1<<4)//16 // coast down to backwards run
  72. #define PMF_TIME_LAND (1<<5)//32 // pm_time is time before rejump
  73. #define PMF_TIME_KNOCKBACK (1<<6)//64 // pm_time is an air-accelerate only time
  74. #define PMF_TIME_NOFRICTION (1<<7)//128 // pm_time is a no-friction time
  75. #define PMF_TIME_WATERJUMP (1<<8)//256 // pm_time is waterjump
  76. #define PMF_RESPAWNED (1<<9)//512 // clear after attack and jump buttons come up
  77. #define PMF_USEFORCE_HELD (1<<10)//1024 // for debouncing the button
  78. #define PMF_JUMP_DUCKED (1<<11)//2048 // viewheight changes in mid-air
  79. #define PMF_TRIGGER_PUSHED (1<<12)//4096 // pushed by a trigger_push or other such thing - cannot force jump and will not take impact damage
  80. #define PMF_STUCK_TO_WALL (1<<13)//8192 // grabbing a wall
  81. #define PMF_SLOW_MO_FALL (1<<14)//16384 // Fall slower until hit ground
  82. #define PMF_ATTACK_HELD (1<<15)//32768 // Holding down the attack button
  83. #define PMF_ALT_ATTACK_HELD (1<<16)//65536 // Holding down the alt-attack button
  84. #define PMF_BUMPED (1<<17)//131072 // Bumped into something
  85. #define PMF_FORCE_FOCUS_HELD (1<<18)//262144 // Holding down the saberthrow/kick button
  86. #define PMF_FIX_MINS (1<<19)//524288 // Mins raised for dual forward jump, fix them
  87. #define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK|PMF_TIME_NOFRICTION)
  88. #if defined(_XBOX) && !defined(_TRACE_FUNCTOR_T_DEFINED_)
  89. // Function objects to replace the function pointers used for trace in pmove_t
  90. // We can't have default arguments on function pointers, but this allows us to
  91. // do the same thing with minimal impact elsewhere.
  92. struct Trace_Functor_t
  93. {
  94. typedef void (*trace_func_t)(trace_t *, const vec3_t, const vec3_t, const vec3_t, const vec3_t,
  95. const int, const int, const EG2_Collision, const int);
  96. trace_func_t trace_func;
  97. void operator()( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
  98. const int passEntityNum, const int contentMask, const EG2_Collision eG2TraceType = (EG2_Collision)0, const int useLod = 0 )
  99. { trace_func(results, start, mins, maxs, end, passEntityNum, contentMask, eG2TraceType, useLod); }
  100. const Trace_Functor_t &operator=(trace_func_t traceRHS)
  101. {
  102. trace_func = traceRHS;
  103. return *this;
  104. }
  105. };
  106. // Always create this class exactly once
  107. #define _TRACE_FUNCTOR_T_DEFINED_
  108. #endif
  109. #define MAXTOUCH 32
  110. typedef struct gentity_s gentity_t;
  111. typedef struct {
  112. // state (in / out)
  113. playerState_t *ps;
  114. // command (in)
  115. usercmd_t cmd;
  116. int tracemask; // collide against these types of surfaces
  117. int debugLevel; // if set, diagnostic output will be printed
  118. qboolean noFootsteps; // if the game is setup for no footsteps by the server
  119. // results (out)
  120. int numtouch;
  121. int touchents[MAXTOUCH];
  122. int useEvent;
  123. vec3_t mins, maxs; // bounding box size
  124. int watertype;
  125. int waterlevel;
  126. float xyspeed;
  127. gentity_s *gent; // Pointer to entity in g_entities[]
  128. // callbacks to test the world
  129. // these will be different functions during game and cgame
  130. #ifdef _XBOX
  131. Trace_Functor_t trace;
  132. #else
  133. void (*trace)( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
  134. const int passEntityNum, const int contentMask, const EG2_Collision eG2TraceType = (EG2_Collision)0, const int useLod = 0 );
  135. #endif
  136. int (*pointcontents)( const vec3_t point, int passEntityNum );
  137. } pmove_t;
  138. // if a full pmove isn't done on the client, you can just update the angles
  139. void PM_UpdateViewAngles( playerState_t *ps, usercmd_t *cmd, gentity_t *gent );
  140. void Pmove( pmove_t *pmove );
  141. #define SETANIM_TORSO 1
  142. #define SETANIM_LEGS 2
  143. #define SETANIM_BOTH (SETANIM_TORSO|SETANIM_LEGS)//3
  144. #define SETANIM_FLAG_NORMAL 0//Only set if timer is 0
  145. #define SETANIM_FLAG_OVERRIDE 1//Override previous
  146. #define SETANIM_FLAG_HOLD 2//Set the new timer
  147. #define SETANIM_FLAG_RESTART 4//Allow restarting the anim if playing the same one (weapon fires)
  148. #define SETANIM_FLAG_HOLDLESS 8//Set the new timer
  149. #define SETANIM_BLEND_DEFAULT 100
  150. void PM_SetAnim(pmove_t *pm,int setAnimParts,int anim,int setAnimFlags, int blendTime=SETANIM_BLEND_DEFAULT);
  151. void PM_SetAnimFinal(int *torsoAnim,int *legsAnim,int type,int anim,int priority,int *torsoAnimTimer,int *legsAnimTimer,gentity_t *gent,int blendTime=SETANIM_BLEND_DEFAULT);
  152. //===================================================================================
  153. // player_state->persistant[] indexes
  154. // these fields are the only part of player_state that isn't
  155. // cleared on respawn
  156. //
  157. // NOTE!!! Even though this is an enum, the array that contains these uses #define MAX_PERSISTANT 16 in q_shared.h,
  158. // so be careful how many you add since it'll just overflow without telling you -slc
  159. //
  160. typedef enum {
  161. PERS_SCORE, // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!!
  162. PERS_HITS, // total points damage inflicted so damage beeps can sound on change
  163. PERS_TEAM,
  164. PERS_SPAWN_COUNT, // incremented every respawn
  165. // PERS_REWARD_COUNT, // incremented for each reward sound
  166. PERS_ATTACKER, // clientnum of last damage inflicter
  167. PERS_KILLED, // count of the number of times you died
  168. PERS_ACCURACY_SHOTS, // scoreboard - number of player shots
  169. PERS_ACCURACY_HITS, // scoreboard - number of player shots that hit an enemy
  170. PERS_ENEMIES_KILLED, // scoreboard - number of enemies player killed
  171. PERS_TEAMMATES_KILLED // scoreboard - number of teammates killed
  172. } persEnum_t;
  173. // entityState_t->eFlags
  174. #define EF_HELD_BY_SAND_CREATURE 0x00000001 // In a sand creature's mouth
  175. #define EF_HELD_BY_RANCOR 0x00000002 // Being held by Rancor
  176. #define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes
  177. #define EF_SHADER_ANIM 0x00000008 // Animating shader (by s.frame)
  178. #define EF_BOUNCE 0x00000010 // for missiles
  179. #define EF_BOUNCE_HALF 0x00000020 // for missiles
  180. #define EF_MISSILE_STICK 0x00000040 // missiles that stick to the wall.
  181. #define EF_NODRAW 0x00000080 // may have an event, but no model (unspawned items)
  182. #define EF_FIRING 0x00000100 // for lightning gun
  183. #define EF_ALT_FIRING 0x00000200 // for alt-fires, mostly for lightning guns though
  184. #define EF_VEH_BOARDING 0x00000400 // Whether a vehicle is being boarded or not.
  185. #define EF_AUTO_SIZE 0x00000800 // CG_Ents will create the mins & max itself based on model bounds
  186. #define EF_BOUNCE_SHRAPNEL 0x00001000 // special shrapnel flag
  187. #define EF_USE_ANGLEDELTA 0x00002000 // Not used.
  188. #define EF_ANIM_ALLFAST 0x00004000 // automatically cycle through all frames at 10hz
  189. #define EF_ANIM_ONCE 0x00008000 // cycle through all frames just once then stop
  190. #define EF_HELD_BY_WAMPA 0x00010000 // being held by the Wampa
  191. #define EF_PROX_TRIP 0x00020000 // Proximity trip mine has been activated
  192. #define EF_LOCKED_TO_WEAPON 0x00040000 // When we use an emplaced weapon, we turn this on to lock us to that weapon
  193. //rest not sent over net?
  194. #define EF_PERMANENT 0x00080000 // this entity is permanent and is never updated (sent only in the game state)
  195. #define EF_SPOTLIGHT 0x00100000 // Your lights are on...
  196. #define EF_PLANTED_CHARGE 0x00200000 // For detpack charge
  197. #define EF_POWERING_ROSH 0x00400000 // Only for Twins powering up Rosh
  198. #define EF_FORCE_VISIBLE 0x00800000 // Always visible with force sight
  199. #define EF_IN_ATST 0x01000000 // Driving an ATST
  200. #define EF_DISINTEGRATION 0x02000000 // Disruptor effect
  201. #define EF_LESS_ATTEN 0x04000000 // Use less sound attenuation (louder even when farther).
  202. #define EF_JETPACK_ACTIVE 0x08000000 // Not used
  203. #define EF_DISABLE_SHADER_ANIM 0x10000000 // Normally shader animation chugs along, but movers can force shader animation to be on frame 1
  204. #define EF_FORCE_GRIPPED 0x20000000 // Force gripped effect
  205. #define EF_FORCE_DRAINED 0x40000000 // Force drained effect
  206. #define EF_BLOCKED_MOVER 0x80000000 // for movers that are blocked - shared with previous
  207. typedef enum {
  208. PW_NONE,
  209. PW_QUAD,// This can go away
  210. PW_BATTLESUIT,
  211. PW_HASTE,// This can go away
  212. PW_CLOAKED,
  213. PW_UNCLOAKING,
  214. PW_DISRUPTION,
  215. PW_GALAK_SHIELD,
  216. // PW_WEAPON_OVERCHARGE,
  217. PW_SEEKER,
  218. PW_SHOCKED,//electricity effect
  219. PW_DRAINED,//drain effect
  220. PW_DISINT_2,//ghost
  221. PW_INVINCIBLE,
  222. PW_FORCE_PUSH,
  223. PW_FORCE_PUSH_RHAND,
  224. PW_NUM_POWERUPS
  225. } powerup_t;
  226. #define PW_REMOVE_AT_DEATH ((1<<PW_QUAD)|(1<<PW_BATTLESUIT)|(1<<PW_HASTE)|(1<<PW_CLOAKED)|(1<<PW_UNCLOAKING)|(1<<PW_UNCLOAKING)|(1<<PW_GALAK_SHIELD)|(1<<PW_DISINT_2)|(1<<PW_INVINCIBLE)|(1<<PW_SEEKER))
  227. // entityState_t->event values
  228. // entity events are for effects that take place relative
  229. // to an existing entities origin. Very network efficient.
  230. // two bits at the top of the entityState->event field
  231. // will be incremented with each change in the event so
  232. // that an identical event started twice in a row can
  233. // be distinguished. And off the value with ~EV_EVENT_BITS
  234. // to retrieve the actual event number
  235. #define EV_EVENT_BIT1 0x00000100
  236. #define EV_EVENT_BIT2 0x00000200
  237. #define EV_EVENT_BITS (EV_EVENT_BIT1|EV_EVENT_BIT2)
  238. typedef enum {
  239. EV_NONE,
  240. EV_FOOTSTEP,
  241. EV_FOOTSTEP_METAL,
  242. EV_FOOTSPLASH,
  243. EV_FOOTWADE,
  244. EV_SWIM,
  245. EV_STEP_4,
  246. EV_STEP_8,
  247. EV_STEP_12,
  248. EV_STEP_16,
  249. EV_FALL_SHORT,
  250. EV_FALL_MEDIUM,
  251. EV_FALL_FAR,
  252. EV_JUMP,
  253. EV_ROLL,
  254. EV_WATER_TOUCH, // foot touches
  255. EV_WATER_LEAVE, // foot leaves
  256. EV_WATER_UNDER, // head touches
  257. EV_WATER_CLEAR, // head leaves
  258. EV_WATER_GURP1, // need air 1
  259. EV_WATER_GURP2, // need air 2
  260. EV_WATER_DROWN, // drowned
  261. EV_LAVA_TOUCH, // foot touches
  262. EV_LAVA_LEAVE, // foot leaves
  263. EV_LAVA_UNDER, // head touches
  264. EV_ITEM_PICKUP,
  265. EV_NOAMMO,
  266. EV_CHANGE_WEAPON,
  267. EV_FIRE_WEAPON,
  268. EV_ALT_FIRE,
  269. EV_POWERUP_SEEKER_FIRE,
  270. EV_POWERUP_BATTLESUIT,
  271. EV_USE,
  272. EV_REPLICATOR,
  273. EV_BATTERIES_CHARGED,
  274. EV_GRENADE_BOUNCE, // eventParm will be the soundindex
  275. EV_MISSILE_STICK, // eventParm will be the soundindex
  276. EV_BMODEL_SOUND,
  277. EV_GENERAL_SOUND,
  278. EV_GLOBAL_SOUND, // no attenuation
  279. #ifdef _IMMERSION
  280. EV_ENTITY_FORCE,
  281. EV_AREA_FORCE,
  282. EV_GLOBAL_FORCE,
  283. EV_FORCE_STOP,
  284. #endif // _IMMERSION
  285. EV_PLAY_EFFECT,
  286. EV_PLAY_MUZZLE_EFFECT,
  287. EV_STOP_EFFECT,
  288. EV_TARGET_BEAM_DRAW,
  289. EV_DISRUPTOR_MAIN_SHOT,
  290. EV_DISRUPTOR_SNIPER_SHOT,
  291. EV_DISRUPTOR_SNIPER_MISS,
  292. EV_DEMP2_ALT_IMPACT,
  293. //NEW for JKA weapons:
  294. EV_CONC_ALT_SHOT,
  295. EV_CONC_ALT_MISS,
  296. //END JKA weapons
  297. EV_PAIN,
  298. EV_DEATH1,
  299. EV_DEATH2,
  300. EV_DEATH3,
  301. EV_MISSILE_HIT,
  302. EV_MISSILE_MISS,
  303. EV_DISINTEGRATION,
  304. EV_ANGER1, //Say when acquire an enemy when didn't have one before
  305. EV_ANGER2,
  306. EV_ANGER3,
  307. EV_VICTORY1, //Say when killed an enemy
  308. EV_VICTORY2,
  309. EV_VICTORY3,
  310. EV_CONFUSE1, //Say when confused
  311. EV_CONFUSE2,
  312. EV_CONFUSE3,
  313. EV_PUSHED1, //Say when pushed
  314. EV_PUSHED2,
  315. EV_PUSHED3,
  316. EV_CHOKE1, //Say when choking
  317. EV_CHOKE2,
  318. EV_CHOKE3,
  319. EV_FFWARN, //ffire founds
  320. EV_FFTURN,
  321. //extra sounds for ST
  322. EV_CHASE1,
  323. EV_CHASE2,
  324. EV_CHASE3,
  325. EV_COVER1,
  326. EV_COVER2,
  327. EV_COVER3,
  328. EV_COVER4,
  329. EV_COVER5,
  330. EV_DETECTED1,
  331. EV_DETECTED2,
  332. EV_DETECTED3,
  333. EV_DETECTED4,
  334. EV_DETECTED5,
  335. EV_LOST1,
  336. EV_OUTFLANK1,
  337. EV_OUTFLANK2,
  338. EV_ESCAPING1,
  339. EV_ESCAPING2,
  340. EV_ESCAPING3,
  341. EV_GIVEUP1,
  342. EV_GIVEUP2,
  343. EV_GIVEUP3,
  344. EV_GIVEUP4,
  345. EV_LOOK1,
  346. EV_LOOK2,
  347. EV_SIGHT1,
  348. EV_SIGHT2,
  349. EV_SIGHT3,
  350. EV_SOUND1,
  351. EV_SOUND2,
  352. EV_SOUND3,
  353. EV_SUSPICIOUS1,
  354. EV_SUSPICIOUS2,
  355. EV_SUSPICIOUS3,
  356. EV_SUSPICIOUS4,
  357. EV_SUSPICIOUS5,
  358. //extra sounds for Jedi
  359. EV_COMBAT1,
  360. EV_COMBAT2,
  361. EV_COMBAT3,
  362. EV_JDETECTED1,
  363. EV_JDETECTED2,
  364. EV_JDETECTED3,
  365. EV_TAUNT1,
  366. EV_TAUNT2,
  367. EV_TAUNT3,
  368. EV_JCHASE1,
  369. EV_JCHASE2,
  370. EV_JCHASE3,
  371. EV_JLOST1,
  372. EV_JLOST2,
  373. EV_JLOST3,
  374. EV_DEFLECT1,
  375. EV_DEFLECT2,
  376. EV_DEFLECT3,
  377. EV_GLOAT1,
  378. EV_GLOAT2,
  379. EV_GLOAT3,
  380. EV_PUSHFAIL,
  381. EV_USE_ITEM,
  382. EV_USE_INV_BINOCULARS,
  383. EV_USE_INV_BACTA,
  384. EV_USE_INV_SEEKER,
  385. EV_USE_INV_LIGHTAMP_GOGGLES,
  386. EV_USE_INV_SENTRY,
  387. EV_USE_FORCE,
  388. EV_DRUGGED, // hit by an interrogator
  389. EV_DEBUG_LINE,
  390. EV_KOTHOS_BEAM,
  391. } entity_event_t;
  392. #pragma pack(push, 1)
  393. typedef struct animation_s {
  394. unsigned short firstFrame;
  395. unsigned short numFrames;
  396. short frameLerp; // msec between frames
  397. //initial lerp is abs(frameLerp)
  398. signed char loopFrames; // 0 to numFrames, -1 = no loop
  399. unsigned char glaIndex;
  400. } animation_t;
  401. #pragma pack(pop)
  402. #ifdef _XBOX
  403. // Feel free to re-increase this if necessary, worst case right now is vjun3 -> 9
  404. #define MAX_ANIM_FILES 10
  405. #else
  406. #define MAX_ANIM_FILES 16
  407. #endif
  408. #define MAX_ANIM_EVENTS 300
  409. //size of Anim eventData array...
  410. #define MAX_RANDOM_ANIM_SOUNDS 4
  411. #define AED_ARRAY_SIZE (MAX_RANDOM_ANIM_SOUNDS+3)
  412. //indices for AEV_SOUND data
  413. #define AED_SOUNDINDEX_START 0
  414. #define AED_SOUNDINDEX_END (MAX_RANDOM_ANIM_SOUNDS-1)
  415. #define AED_SOUND_NUMRANDOMSNDS (MAX_RANDOM_ANIM_SOUNDS)
  416. #define AED_SOUND_PROBABILITY (MAX_RANDOM_ANIM_SOUNDS+1)
  417. //indices for AEV_SOUNDCHAN data
  418. #define AED_SOUNDCHANNEL (MAX_RANDOM_ANIM_SOUNDS+2)
  419. //indices for AEV_FOOTSTEP data
  420. #define AED_FOOTSTEP_TYPE 0
  421. #define AED_FOOTSTEP_PROBABILITY 1
  422. //indices for AEV_EFFECT data
  423. #define AED_EFFECTINDEX 0
  424. #define AED_BOLTINDEX 1
  425. #define AED_EFFECT_PROBABILITY 2
  426. #define AED_MODELINDEX 3
  427. //indices for AEV_FIRE data
  428. #define AED_FIRE_ALT 0
  429. #define AED_FIRE_PROBABILITY 1
  430. //indices for AEV_MOVE data
  431. #define AED_MOVE_FWD 0
  432. #define AED_MOVE_RT 1
  433. #define AED_MOVE_UP 2
  434. typedef enum
  435. {//NOTENOTE: Be sure to update animEventTypeTable and ParseAnimationEvtBlock(...) if you change this enum list!
  436. AEV_NONE,
  437. AEV_SOUND, //# animID AEV_SOUND framenum soundpath randomlow randomhi chancetoplay
  438. AEV_FOOTSTEP, //# animID AEV_FOOTSTEP framenum footstepType chancetoplay
  439. AEV_EFFECT, //# animID AEV_EFFECT framenum effectpath boltName chancetoplay
  440. AEV_FIRE, //# animID AEV_FIRE framenum altfire chancetofire
  441. AEV_MOVE, //# animID AEV_MOVE framenum forwardpush rightpush uppush
  442. AEV_SOUNDCHAN, //# animID AEV_SOUNDCHAN framenum CHANNEL soundpath randomlow randomhi chancetoplay
  443. AEV_NUM_AEV
  444. } animEventType_t;
  445. #ifdef _XBOX
  446. #pragma pack(push, 1)
  447. #endif
  448. typedef struct animevent_s
  449. {
  450. animEventType_t eventType;
  451. signed short modelOnly; //event is specific to a modelname to skeleton
  452. unsigned short glaIndex;
  453. unsigned short keyFrame; //Frame to play event on
  454. signed short eventData[AED_ARRAY_SIZE]; //Unique IDs, can be soundIndex of sound file to play OR effect index or footstep type, etc.
  455. char *stringData; //we allow storage of one string, temporarily (in case we have to look up an index later, then make sure to set stringData to NULL so we only do the look-up once)
  456. } animevent_t;
  457. #ifdef _XBOX
  458. #pragma pack(pop)
  459. #endif
  460. typedef enum
  461. {
  462. FOOTSTEP_R,
  463. FOOTSTEP_L,
  464. FOOTSTEP_HEAVY_R,
  465. FOOTSTEP_HEAVY_L,
  466. NUM_FOOTSTEP_TYPES
  467. } footstepType_t;
  468. // means of death
  469. typedef enum {
  470. MOD_UNKNOWN,
  471. // weapons
  472. MOD_SABER,
  473. MOD_BRYAR,
  474. MOD_BRYAR_ALT,
  475. MOD_BLASTER,
  476. MOD_BLASTER_ALT,
  477. MOD_DISRUPTOR,
  478. MOD_SNIPER,
  479. MOD_BOWCASTER,
  480. MOD_BOWCASTER_ALT,
  481. MOD_REPEATER,
  482. MOD_REPEATER_ALT,
  483. MOD_DEMP2,
  484. MOD_DEMP2_ALT,
  485. MOD_FLECHETTE,
  486. MOD_FLECHETTE_ALT,
  487. MOD_ROCKET,
  488. MOD_ROCKET_ALT,
  489. //NEW for JKA weapons:
  490. MOD_CONC,
  491. MOD_CONC_ALT,
  492. //END JKA weapons.
  493. MOD_THERMAL,
  494. MOD_THERMAL_ALT,
  495. MOD_DETPACK,
  496. MOD_LASERTRIP,
  497. MOD_LASERTRIP_ALT,
  498. MOD_MELEE,
  499. MOD_SEEKER,
  500. MOD_FORCE_GRIP,
  501. MOD_FORCE_LIGHTNING,
  502. MOD_FORCE_DRAIN,
  503. MOD_EMPLACED,
  504. // world / generic
  505. MOD_ELECTROCUTE,
  506. MOD_EXPLOSIVE,
  507. MOD_EXPLOSIVE_SPLASH,
  508. MOD_KNOCKOUT,
  509. MOD_ENERGY,
  510. MOD_ENERGY_SPLASH,
  511. MOD_WATER,
  512. MOD_SLIME,
  513. MOD_LAVA,
  514. MOD_CRUSH,
  515. MOD_IMPACT,
  516. MOD_FALLING,
  517. MOD_SUICIDE,
  518. MOD_TRIGGER_HURT,
  519. MOD_GAS,
  520. NUM_MODS,
  521. } meansOfDeath_t;
  522. //---------------------------------------------------------
  523. // gitem_t->type
  524. typedef enum
  525. {
  526. IT_BAD,
  527. IT_WEAPON,
  528. IT_AMMO,
  529. IT_ARMOR,
  530. IT_HEALTH,
  531. IT_HOLDABLE,
  532. IT_BATTERY,
  533. IT_HOLOCRON,
  534. } itemType_t;
  535. typedef struct gitem_s {
  536. char *classname; // spawning name
  537. char *pickup_sound;
  538. char *world_model;
  539. char *icon;
  540. int quantity; // for ammo how much, or duration of powerup
  541. itemType_t giType; // IT_* flags
  542. int giTag;
  543. char *precaches; // string of all models and images this item will use
  544. char *sounds; // string of all sounds this item will use
  545. vec3_t mins; // Bbox
  546. vec3_t maxs; // Bbox
  547. #ifdef _IMMERSION
  548. char *pickup_force;
  549. char *forces;
  550. #endif // _IMMERSION
  551. } gitem_t;
  552. // included in both the game dll and the client
  553. extern gitem_t bg_itemlist[];
  554. extern const int bg_numItems;
  555. //==============================================================================
  556. /*
  557. typedef struct ginfoitem_s
  558. {
  559. char *infoString;// Text message
  560. vec3_t color; // Text color
  561. } ginfoitem_t;
  562. */
  563. //==============================================================================
  564. extern weaponData_t weaponData[];
  565. //==============================================================================
  566. extern ammoData_t ammoData[];
  567. //==============================================================================
  568. gitem_t *FindItem( const char *className );
  569. gitem_t *FindItemForWeapon( weapon_t weapon );
  570. gitem_t *FindItemForInventory( int inv );
  571. #define ITEM_INDEX(x) ((x)-bg_itemlist)
  572. qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps );
  573. // content masks
  574. #define MASK_ALL (-1)
  575. #define MASK_SOLID (CONTENTS_SOLID|CONTENTS_TERRAIN)
  576. #define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY|CONTENTS_TERRAIN)
  577. #define MASK_NPCSOLID (CONTENTS_SOLID|CONTENTS_MONSTERCLIP|CONTENTS_BODY|CONTENTS_TERRAIN)
  578. #define MASK_DEADSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_TERRAIN)
  579. #define MASK_WATER (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME)
  580. #define MASK_OPAQUE (CONTENTS_OPAQUE|CONTENTS_SLIME|CONTENTS_LAVA)//was CONTENTS_SOLID, not CONTENTS_OPAQUE...?
  581. /*
  582. Ghoul2 Insert Start
  583. */
  584. #define MASK_SHOT (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE|CONTENTS_SHOTCLIP|CONTENTS_TERRAIN)
  585. /*
  586. Ghoul2 Insert End
  587. */
  588. //
  589. // entityState_t->eType
  590. //
  591. typedef enum {
  592. ET_GENERAL,
  593. ET_PLAYER,
  594. ET_ITEM,
  595. ET_MISSILE,
  596. ET_MOVER,
  597. ET_BEAM,
  598. ET_PORTAL,
  599. ET_SPEAKER,
  600. ET_PUSH_TRIGGER,
  601. ET_TELEPORT_TRIGGER,
  602. ET_INVISIBLE,
  603. ET_THINKER,
  604. ET_CLOUD, // dumb
  605. ET_TERRAIN,
  606. ET_EVENTS // any of the EV_* events can be added freestanding
  607. // by setting eType to ET_EVENTS + eventNum
  608. // this avoids having to set eFlags and eventNum
  609. } entityType_t;
  610. void EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result );
  611. void EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result );
  612. void AddEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps );
  613. int CurrentPlayerstateEvent( playerState_t *ps );
  614. void PlayerStateToEntityState( playerState_t *ps, entityState_t *s );
  615. qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime );
  616. #endif//#ifndef __BG_PUBLIC_H__