1 #ifndef _bhtypes_h_
2 #define _bhtypes_h_ 1
3 
4 #ifndef _equipmnt_h_
5 #include "equipmnt.h"
6 #endif
7 
8 #include "pmove.h"
9 
10 
11 #ifdef __cplusplus
12 
13 	extern "C" {
14 
15 #endif
16 
17 
18 
19 /*
20 	I think I am going to devide the behaviour of objects into two different forms
21 
22 	In terms of emulating 3d we need to think of multiple cluster of sprite sequences to
23 	descibe any one motion. In this respect I am going to have a list of capabilities for
24 	objects. If you supply One animation sequence that allows a capabiltity the animation capability
25 	language will allow that capabiltiy. If it is a front walk, the object will walk
26 	but it will always display the one type of sequence even if it is walking away from
27 	you. When we load up a sprite sequence we include an enum that tells us what capabiltiy_type
28 	these sequence is part of. The animation capabiltity language and capabiltiy_type can refer
29 	to morphing equally as to sprites (morphing is some what easier as the object will always look
30 	right
31 
32 
33 	Other objects are rather dull and the above capability system is too complex. A module
34 	playing a TV does not need such a comple behaviour. These objects have much simpler
35 	strategies and we will have specfifc low level functions to deal with them.
36 
37 */
38 
39 
40 typedef enum actor_capability_types
41 {
42 	BHTypeWalk,				/* gen movement */
43 	BHTypeCrawl,			/* gen movement */
44 	BHTypeRun,				/* gen movement */
45 	BHTypeFly,				/* gen movement */
46 	BHTypeStandUp,
47 	BHTypeSitDown,
48 	BHTypeKneelDown,
49 	BHTypeCroach,
50 	BHTypeAttack1,
51 	BHTypeAttack2,
52 	BHTypeAttack3,
53 	BHTypeRangedAttack1,
54 	BHTypeRangedAttack2,
55 	BHTypeRangedAttack3,
56 	BHTypeHit,
57 	BHTypeDying,
58 	BHTypeDead,
59 	BHTypeJump
60 } ACTOR_CAPABILITY_TYPES;
61 
62 
63 
64 
65 /* ****************** STRATEGY BLOCK Behaviour DESCRIPTION ************ */
66 
67 
68 typedef struct CapabilityDescription
69 {
70 	int num_animating_items;
71 	int **item_animations;
72 
73 } CAPABILITY_DESCRIPTION;
74 
75 
76 /* the item_animations are specific to each animating
77 item the have no formal description interms of a type
78 the theyare listed as.
79 
80 int item_num
81 seq_des1
82 seq_des2
83 seq_des3
84 seq_des4
85 term
86 
87 the list of void* pointers points to the initial
88 item_num for the following sequences
89 */
90 
91 typedef struct sequence_descriptor
92 {
93 	ACTOR_CAPABILITY_TYPES cap_type;
94 	TXANIMHEADER* txanim_header;
95 	int view_angle;
96 	int view_azimuth;
97 } SEQUENCE_DESCRIPTOR;
98 
99 
100 typedef struct SuicideTimer
101 {
102 	int time_left;	/*agrgggghhh*****/
103 
104 }SUICIDE_TIMER;
105 
106 
107 
108 
109 /**************************** SPECIFIC BEHAVIOUR TYPES ************************/
110 
111 
112 // ENUM now in Stratdef.h
113 
114 
115 /*-------------Patrick 21/10/96 --------------------
116   This structure is used in Player Status to represent
117   the various player input requests.  It consists
118   of single bit fields, which are used as a bit-mask
119   for recording key-combo sequences for special moves.
120   for the purposes of bit-masking, it is implemented as
121   a union with an unsigned int...
122 
123   NB it is easier to add new fields towards the end,
124   as otherwise you may have to change the special
125   move input bitmasks
126   --------------------------------------------------*/
127 typedef struct player_input_requests
128 {
129 	unsigned int Rqst_Forward :1;
130 	unsigned int Rqst_Backward :1;
131 	unsigned int Rqst_TurnLeft :1;
132 	unsigned int Rqst_TurnRight :1;
133 	unsigned int Rqst_LookUp :1;
134 	unsigned int Rqst_LookDown :1;
135 	unsigned int Rqst_FirePrimaryWeapon :1;
136 	unsigned int Rqst_Faster :1;
137 	unsigned int Rqst_SideStepLeft :1;
138 	unsigned int Rqst_SideStepRight :1;
139 	unsigned int Rqst_Strafe :1;
140 	unsigned int Rqst_Crouch :1;
141 	unsigned int Rqst_Jump :1;
142 	/* NB Lie Down is set by special moves only (ie doesn't require a user input, configuration entry, etc) */
143 	unsigned int Rqst_Operate :1;
144 	unsigned int Rqst_CentreView :1;
145 	unsigned int Rqst_NextWeapon :1;
146 	unsigned int Rqst_PreviousWeapon :1;
147 	unsigned int Rqst_WeaponNo :4;
148 	unsigned int Rqst_QuitGame :1;
149 	unsigned int Rqst_PauseGame :1;
150 
151 	/* KJL 16:58:37 04/11/98 - Change vision does a variety of things, dependent on the player's
152 	character. */
153 	unsigned int Rqst_ChangeVision :1;
154 	unsigned int Rqst_FireSecondaryWeapon :1;
155 
156 	/* Predator Specific */
157 	unsigned int Rqst_CycleVisionMode :1;
158 	unsigned int Rqst_ZoomIn :1;
159 	unsigned int Rqst_ZoomOut :1;
160 	unsigned int Rqst_GrapplingHook :1;
161 
162 	/* Alien Specific */
163 	unsigned int Rqst_Spit :1;
164 
165 	/* Marine Specific */
166 	unsigned int Rqst_ThrowFlare :1;
167 	unsigned int Rqst_Jetpack :1;
168 
169 	unsigned int :0;
170 
171 }PLAYER_INPUT_REQUESTS;
172 
173 /*-------------Patrick 23/10/96 --------------------
174   Some defines for key combo bit masks
175   these should correspond to the above request flags.
176   --------------------------------------------------*/
177 #define INPUT_BITMASK_FORWARD	0x00000001
178 #define INPUT_BITMASK_BACKWARD 0x00000002
179 #define INPUT_BITMASK_LEFT		0x00000004
180 #define INPUT_BITMASK_RIGHT		0x00000008
181 #define INPUT_BITMASK_FIRE		0x00000040
182 #define INPUT_BITMASK_FASTER 	0x00000080
183 #define INPUT_BITMASK_STRAFE 	0x00000100
184 #define INPUT_BITMASK_CROUCH 	0x00000200
185 #define INPUT_BITMASK_JUMP 		0x00000400
186 
187 
188 
189 /* KJL 14:16:52 09/20/96 - the new player status type
190    modified by patrick */
191 typedef struct player_status
192 {
193 	AVP_BEHAVIOUR_TYPE	bhvr_type;
194 
195     /* player's weapons */
196 	PLAYER_WEAPON_DATA	WeaponSlot[MAX_NO_OF_WEAPON_SLOTS];
197 	enum WEAPON_SLOT	SelectedWeaponSlot;
198 	enum WEAPON_SLOT	SwapToWeaponSlot;
199 	enum WEAPON_SLOT	PreviouslySelectedWeaponSlot;
200 
201     int	Health;	 /* in 16.16 */
202 	int	Energy;	 /* in 16.16 */
203 	int	Armour;	 /* in 16.16 */
204 
205     /* general info */
206 	/* KJL 17:28:20 09/19/96 - not yet used
207 
208 	int	ArmourType;
209 	int	HealingRate;
210 	int	CloakingType;
211 	int	VisionType;
212     */
213 
214 	/*-----Patrick 15/10/96---------
215 	Player movement bits...
216 	------------------------------*/
217 	enum player_morph_state ShapeState;		/* for controlling morphing */
218 
219 	/* and these are for free (ie normal) movement,
220 	and should be set by the (platform dependant) input
221 	device reading function */
222 	unsigned char Mvt_DeviceType;
223 	signed int Mvt_MotionIncrement;	/* 65536 (Forward) to -65536 (Backward) */
224 	signed int Mvt_TurnIncrement;		/* 65536 (Right) to -65536 (Left)*/
225 	signed int Mvt_PitchIncrement;	/* 65536 to -65536 */
226 	signed int Mvt_SideStepIncrement;	/* 65536 to -65536 */
227 
228 	/* KJL 10:48:33 03/26/97 - inertia data */
229 	signed int ForwardInertia;
230 	signed int StrafeInertia;
231 	signed int TurnInertia;
232 
233 	int ViewPanX; /* the looking up/down value that used to be in displayblock */
234 
235 	union Mvt_InputRequests
236 	{
237 		unsigned int Mask;
238 		unsigned int Mask2;
239 		PLAYER_INPUT_REQUESTS Flags;
240 	}Mvt_InputRequests;
241 
242 	/* security clearances */
243 	unsigned int securityClearances;
244 	/* useful flags */
245 	unsigned int IsAlive :1;
246 	unsigned int IsImmortal :1;
247 	unsigned int Mvt_AnalogueTurning :1;
248 	unsigned int Mvt_AnaloguePitching :1;
249 	unsigned int Absolute_Pitching :1;
250 	unsigned int SwappingIsDebounced :1;
251 	unsigned int DemoMode :1;
252 	unsigned int IHaveAPlacedAutogun :1;
253 	unsigned int IsMovingInWater :1;
254 	unsigned int JetpackEnabled :1;
255 	unsigned int GrapplingHookEnabled :1;
256 
257 	unsigned int MTrackerType;
258 
259 	/* Patrick: 1/7/97 : for predator-type cloaking stuff */
260 	unsigned int cloakOn :1;
261 	unsigned int cloakPositionGivenAway :1;
262 	int FieldCharge;
263 	int cloakPositionGivenAwayTimer;
264 	int PlasmaCasterCharge;
265 	/* KJL 99/2/3 - Cloaking Effectiveness
266 	ranges from 0 (useless) to ONE_FIXED (practically invisible) */
267 	int CloakingEffectiveness;
268 
269 	// John 28/7/97 Game Flow stuff
270 	int UNUSED_Enum_CurrentMission;
271 	unsigned long UNUSED_StateChangeObjectFlags;
272 
273 	/* Encumberance */
274 	ENCUMBERANCE_STATE Encumberance;
275 	STRATEGYBLOCK *MyFaceHugger;
276 	STRATEGYBLOCK *MyCorpse;
277 	int tauntTimer;
278 	int soundHandle;
279 	/* Why no 2, you ask? */
280 	int soundHandle3;
281 	/* Because '3' is always crackling fire, for *
282 	 * netghosts and corpses. Really, 2 should be*
283 	 * the voice and 1 should be weapon use.     */
284 	int soundHandle4;
285 	/* For the splash. */
286 	int soundHandle5;
287 	/* For the jetpack. */
288 
289 	int soundHandleForPredatorCloakDamaged;
290 	/* the above seemed better than soundHandle5 :) */
291 
292 	HMODELCONTROLLER HModelController;
293 	int incidentFlag;
294 	int incidentTimer;
295 	int fireTimer;
296 	int invulnerabilityTimer;
297 
298 } PLAYER_STATUS;
299 
300 #define TAUNT_LENGTH (ONE_FIXED<<1)
301 #define PLAYER_ON_FIRE_TIME	(ONE_FIXED*20)
302 
303 #define STARTOFGAME_MARINE_HEALTH (100*65536) /* ie. 100 in 16.16 notation */
304 #define STARTOFGAME_MARINE_ENERGY (100*65536) /* ie. 100 in 16.16 notation */
305 #define STARTOFGAME_MARINE_ARMOUR (100*65536) /* ie. 100 in 16.16 notation */
306 
307 /* Patrick 22/8/97------------------------------------------------
308 Cloaking stuff
309 ------------------------------------------------------------------*/
310 
311 #define PLAYERCLOAK_MAXENERGY 					(30*ONE_FIXED) /* fixed point seconds */
312 #define PLAYERCLOAK_RECHARGEFACTOR				(4) /* ... times slower than discharge */
313 #define PLAYERCLOAK_POSTIONGIVENAWAYTIME		(ONE_FIXED>>2) /*(2*ONE_FIXED) fixed point seconds */
314 #define PLAYERCLOAK_THRESHOLD					(5*ONE_FIXED)
315 #define PLAYERCLOAK_POWERON_DRAIN				(2*ONE_FIXED)
316 #define PLAYERCLOAK_DRAIN_FACTOR				(4)
317 
318 /* Moved mere from player.c, CDF 23/4/98 */
319 
320 extern PLAYER_STATUS* PlayerStatusPtr;
321 
322 
323 /******************** SIMPLE ANIMATIONS ********************/
324 
325 typedef struct simpleanimbehaviour
326 {
327 	AVP_BEHAVIOUR_TYPE bhvr_type;
328 	TXACTRLBLK *tacbSimple;
329 
330 }SIMPLE_ANIM_BEHAV_BLOCK;
331 
332 typedef struct simple_anim_tools_template
333 {
334 	int shape_num;
335 	MREF my_module;
336 	char nameID[SB_NAME_LENGTH];
337 } SIMPLE_ANIM_TOOLS_TEMPLATE;
338 
339 
340 /**********************************************************/
341 /**********************DOORS*******************************/
342 
343 typedef enum{					 /* this may be flags*/
344 	I_door_opening,
345 	I_door_closing,
346 	I_door_open,
347 	I_door_closed,
348 
349 } DOOR_STATES;
350 
351 
352 
353 
354 /********************  PROXIMITY DOORS ********************/
355 
356 
357 
358 typedef struct ProxDoorBehaviourType
359 {
360 	AVP_BEHAVIOUR_TYPE bhvr_type;
361 	int door_state;
362 	MORPHCTRL *PDmctrl;
363 
364 	/*---- Patrick 1/1/97 -----
365 	added for far ai stratgies
366 	--------------------------*/
367 	int	alienTimer;
368 	unsigned int alienTrigger :1;
369 	unsigned int marineTrigger :1;
370 	unsigned int triggeredByMarine :1;
371 
372 	/*---- Roxby 1/1/97 -----
373 	Added so that another door can lock
374 	this door closed
375 	--------------------------*/
376 
377 	BOOL lockable_door;
378 	BOOL door_locked;
379 	char target_name[SB_NAME_LENGTH];
380 	STRATEGYBLOCK* door_lock_target;
381   int SoundHandle;
382   int doorType;      // Used to determine door sound type
383 
384 	int door_opening_speed;
385 	int door_closing_speed;
386 } PROXDOOR_BEHAV_BLOCK;
387 
388 typedef struct prox_door_tools_template
389 {
390 	BOOL has_lock_target;
391 	char target_name [SB_NAME_LENGTH];
392 	MREF my_module;
393 	int shape_open;
394 	int shape_closed;
395 	char nameID[SB_NAME_LENGTH];
396 	BOOL door_is_locked;
397 
398 	int door_opening_speed;
399 	int door_closing_speed;
400 } PROX_DOOR_TOOLS_TEMPLATE;
401 
402 
403 
404 
405 /* Structures for Stat Initialisation */
406 
407 typedef enum {
408 	I_NPC_Civilian=0,
409 	I_NPC_FaceHugger,
410 	I_NPC_ChestBurster,
411 	I_NPC_Alien,
412 	I_NPC_Xenoborg,
413 	I_NPC_Marine,
414 	I_NPC_PredatorAlien,
415 	I_NPC_SFMarine,
416 	I_NPC_Predator,
417 	I_NPC_PraetorianGuard,
418 	I_NPC_AlienQueen,
419 	I_NPC_DefaultInanimate,
420 	I_PC_Alien_Easy,
421 	I_PC_Marine_Easy,
422 	I_PC_Predator_Easy,
423 	I_PC_Alien_Medium,
424 	I_PC_Marine_Medium,
425 	I_PC_Predator_Medium,
426 	I_PC_Alien_Hard,
427 	I_PC_Marine_Hard,
428 	I_PC_Predator_Hard,
429 	I_PC_Alien_Impossible,
430 	I_PC_Marine_Impossible,
431 	I_PC_Predator_Impossible,
432 	I_PC_Alien_MaxStats,
433 	I_NPC_SentryGun,
434 	I_NPC_Android,
435 	I_NPC_End,
436 } NPC_TYPES;
437 
438 typedef struct {
439 	NPC_TYPES Type;
440 	//int StartingHealth;
441 	//int StartingArmour;
442 	//SBHEALTHFLAGS SB_H_flags;
443 	DAMAGEBLOCK StartingStats;
444 } NPC_DATA;
445 
446 /* Interface function! */
447 
448 extern NPC_DATA *GetThisNpcData(NPC_TYPES NpcType);
449 
450 /********************************************************/
451 /*******************  Database behaviour************/
452 
453 /*
454 	we will need to include an enum into another menu
455 	graphic which contains the text to overlay onto
456 	the menugraphics
457 */
458 
459 typedef struct database
460 {
461 	AVP_BEHAVIOUR_TYPE bhvr_type;
462 	int num;
463 }DATABASE_BLOCK;
464 
465 typedef struct database_template
466 {
467 	int num;
468 	VECTORCH position;
469 	EULER orientation;
470 	int shape_num;
471 } DATABASE_TOOLS_TEMPLATE;
472 
473 extern void DatabaseMenus(DATABASE_BLOCK* db);
474 
475 /***********************************************************/
476 /****************** externs for bh_types.c ******************/
477 /* functions*/
478 
479 extern void AssignAllSBNames();
480 extern void AssignRunTimeBehaviours(STRATEGYBLOCK* sbptr);
481 extern void EnableBehaviourType(STRATEGYBLOCK* sbptr, AVP_BEHAVIOUR_TYPE sb_type, void *bhdata);
482 extern void ExecuteBehaviour(STRATEGYBLOCK* sbptr);
483 extern void ObjectBehaviours(void);
484 extern void RequestState(STRATEGYBLOCK* sb, int message, STRATEGYBLOCK * SBRequester);
485 extern BOOL GetState(STRATEGYBLOCK* sb);
486 extern void RemoveBehaviourStrategy(STRATEGYBLOCK* sbptr);
487 
488 extern void UnlockThisProxdoor(STRATEGYBLOCK* sbptr);
489 
490 extern void FindMaxZXandYAverages(VECTORCH* vect, SHAPEHEADER* shapeptr);
491 
492 extern DISPLAYBLOCK *MakeObject(AVP_BEHAVIOUR_TYPE bhvr, VECTORCH *positionPtr);
493 
494 extern void SetupPlayerAutoGun();
495 
496 #ifdef __cplusplus
497 
498 	};
499 
500 #endif
501 
502 
503 #endif
504 
505 
506 
507 
508 
509 
510 
511 
512 
513 
514 
515