1 /*---------------------------Patrick 28/3/97----------------------------
2   Header for Multi-Player ghost object support header
3   ----------------------------------------------------------------------*/
4 #ifndef pldghost_h_included
5 #define pldghost_h_included
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #include "pvisible.h"
11 #include "pldnet.h"
12 
13 /*---------------------------Patrick 28/3/97----------------------------
14   Structures for ghosts and ghost data blocks
15   ----------------------------------------------------------------------*/
16 
17 typedef struct netghostdatablock
18 {
19 //	DPID playerId;
20 	int playerId;
21 
22 	signed int playerObjectId; /* -1 == player, all other numbers used for objects */
23 	AVP_BEHAVIOUR_TYPE type;
24 	INANIMATEOBJECT_TYPE IOType;
25 	int subtype;
26 	SHAPEANIMATIONCONTROLLER ShpAnimCtrl;
27 
28 	/* KJL 17:33:41 22/01/99 - I've made this a union because I needed a storage space,
29 	and the currentAnimSequence is only used by specific objects */
30 	//union
31 	//{
32 		int currentAnimSequence;
33 	//	int EventCounter; // used by grenades
34 	//};
35 
36 	DISPLAYBLOCK *myGunFlash;
37 	SECTION_DATA *GunflashSectionPtr;
38 	int GunFlashFrameStamp;
39 	int CurrentWeapon;
40 
41 	int SoundHandle;
42 	int SoundHandle2;
43 	int SoundHandle3;
44 	int SoundHandle4;
45 	int integrity;
46 	int timer;
47 
48 	int FlameHitCount;//number of fire particles that have hit since last frame
49 	int FlechetteHitCount;//number of flechette particles that have hit since last frame
50 
51 	HMODELCONTROLLER HModelController;
52 	HITLOCATIONTABLE *hltable;
53 
54 	int CloakingEffectiveness;
55 
56 	unsigned int IgnitionHandshaking :1;
57 
58 	unsigned int invulnerable :1; //for netghost's of players
59 	unsigned int onlyValidFar:1; //set for alien ai that are far from everyone
60 	unsigned int soundStartFlag:1;
61 
62 	#if EXTRAPOLATION_TEST
63 	VECTORCH velocity;
64 	int extrapTimerLast;
65 	int extrapTimer;
66 	unsigned int lastTimeRead;
67 	#endif
68 }NETGHOSTDATABLOCK;
69 
70 /*---------------------------Patrick 28/3/97----------------------------
71   Protoypes
72   ----------------------------------------------------------------------*/
73 extern void UpdateGhost(STRATEGYBLOCK *sbPtr,VECTORCH *position,EULER *orientation,int sequence, int special);
74 extern void RemoveGhost(STRATEGYBLOCK *sbPtr);
75 //extern void RemovePlayersGhosts(DPID id);
76 //extern void RemovePlayerGhost(DPID id);
77 //extern STRATEGYBLOCK *FindGhost(DPID Id, int obId);
78 //extern STRATEGYBLOCK *CreateNetGhost(DPID playerId, int objectId, VECTORCH *position, EULER* orientation, AVP_BEHAVIOUR_TYPE type, unsigned char IOType, unsigned char subtype);
79 extern void RemovePlayersGhosts(int id);
80 extern void RemovePlayerGhost(int id);
81 extern STRATEGYBLOCK *FindGhost(int Id, int obId);
82 extern STRATEGYBLOCK *CreateNetGhost(int playerId, int objectId, VECTORCH *position, EULER* orientation, AVP_BEHAVIOUR_TYPE type, unsigned char IOType, unsigned char subtype);
83 extern void MakeGhostNear(STRATEGYBLOCK *sbPtr);
84 extern void MakeGhostFar(STRATEGYBLOCK *sbPtr);
85 extern void DamageNetworkGhost(STRATEGYBLOCK *sbPtr, DAMAGE_PROFILE *damage, int multiple, SECTION_DATA *section,VECTORCH* incoming);
86 extern void HandleGhostGunFlashEffect(STRATEGYBLOCK *sbPtr, int gunFlashOn);
87 extern void HandlePlayerGhostWeaponSound(STRATEGYBLOCK *sbPtr, int weapon, int firingPrimary, int firingSecondary);
88 extern void HandleWeaponElevation(STRATEGYBLOCK *sbPtr, int elevation, int weapon);
89 extern void MaintainGhosts(void);
90 extern void HandleGhostAutoGunMuzzleFlash(STRATEGYBLOCK *sbPtr, int firing);
91 extern void HandleGhostAutoGunSound(STRATEGYBLOCK *sbPtr, int firing);
92 extern void MaintainGhostCloakingStatus(STRATEGYBLOCK *sbPtr, int IsCloaked);
93 extern void MaintainGhostFireStatus(STRATEGYBLOCK *sbPtr, int IsOnFire);
94 
95 extern void NetGhostBehaviour(STRATEGYBLOCK *sbPtr);
96 extern void KillGhost(STRATEGYBLOCK *sbPtr, int objectId);
97 extern int Deduce_PlayerDeathSequence(void);
98 extern STRATEGYBLOCK *MakeNewCorpse();
99 extern void ApplyGhostCorpseDeathAnim(STRATEGYBLOCK *sbPtr,int deathId);
100 extern void ApplyCorpseDeathAnim(STRATEGYBLOCK *sbPtr,int deathId);
101 
102 extern int Deduce_PlayerMarineDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* damage,int multiple,VECTORCH* incoming);
103 extern int Deduce_PlayerAlienDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* damage,int multiple,VECTORCH* incoming);
104 extern int Deduce_PlayerPredatorDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* damage,int multiple,VECTORCH* incoming);
105 
106 extern void UpdateAlienAIGhost(STRATEGYBLOCK *sbPtr,VECTORCH *position,EULER *orientation,int sequence_type,int sub_sequence, int sequence_length);
107 extern void KillAlienAIGhost(STRATEGYBLOCK *sbPtr,int death_code,int death_time,int GibbFactor);
108 
109 extern void Convert_DiscGhost_To_PickupGhost(STRATEGYBLOCK *sbPtr);
110 extern void PlayHitDeltaOnGhost(STRATEGYBLOCK *sbPtr,char delta_seq,char delta_sub_seq);
111 extern void PlayOtherSound(enum soundindex SoundIndex, VECTORCH *position, int explosion);
112 void CreateMarineHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
113 void CreateAlienHModel(NETGHOSTDATABLOCK *ghostDataPtr,int alienType);
114 void CreatePredatorHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
115 
116 /*---------------------------Patrick 29/3/97----------------------------
117   Defines
118   ----------------------------------------------------------------------*/
119 #define GHOST_PLAYEROBJECTID	-1
120 #define PLAYERGHOST_NUMBEROFFRAGMENTS			10
121 #define GHOST_INTEGRITY							(ONE_FIXED*8)
122 
123 #define MPPRED_MUZZLEFLASHOFFSET_INFRONT		800
124 #define MPPRED_MUZZLEFLASHOFFSET_ACROSS			200
125 #define MPPRED_MUZZLEFLASHOFFSET_UP				100
126 #define MPPRED_MUZZLEFLASHOFFSET_INFRONT_CROUCH	1000
127 #define MPPRED_MUZZLEFLASHOFFSET_ACROSS_CROUCH	200
128 #define MPPRED_MUZZLEFLASHOFFSET_UP_CROUCH		0
129 
130 #define MPMARINE_MUZZLEFLASHOFFSET_INFRONT			1100
131 #define MPMARINE_MUZZLEFLASHOFFSET_ACROSS			200
132 #define MPMARINE_MUZZLEFLASHOFFSET_UP				0
133 #define MPMARINE_MUZZLEFLASHOFFSET_INFRONT_CROUCHED	400
134 #define MPMARINE_MUZZLEFLASHOFFSET_ACROSS_CROUCHED	300
135 #define MPMARINE_MUZZLEFLASHOFFSET_UP_CROUCHED		(-400)
136 #define MPMARINE_MUZZLEFLASHOFFSET_INFRONT_RUNNING	1100
137 #define MPMARINE_MUZZLEFLASHOFFSET_ACROSS_RUNNING	50
138 #define MPMARINE_MUZZLEFLASHOFFSET_UP_RUNNING		400
139 
140 
141 /*---------------------------Patrick 28/3/97----------------------------
142   Globals
143   ----------------------------------------------------------------------*/
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif
150 
151