1 #ifndef _equipmnt_h_ 2 #define _equipmnt_h_ 1 3 4 #ifdef __cplusplus 5 6 extern "C" { 7 8 #endif 9 #include "language.h" 10 /* has to come after gameplat.h in the setup*/ 11 #include "gamedef.h" 12 13 /* KJL 12:34:46 09/18/96 - new stuff under development */ 14 15 /* KJL 12:39:41 09/18/96 - 16 Okay, I think we should have two weapon structures: 17 18 TEMPLATE_WEAPON_DATA: First the basic template for each weapon, which remains constant 19 during the game & contains the base description of a weapon eg. 20 ammo type, weight, graphics, etc. 21 22 PLAYER_WEAPON_DATA: Second is the structure which describes a player's weapon 23 eg. a pointer to a TEMPLATE_WEAPON_DATA, ammo remaining, jam 24 status, and so on. 25 26 eg. PLAYER_WEAPON_DATA PlayerWeapons[]; 27 28 */ 29 /* KJL 16:09:51 09/20/96 - Weapon States */ 30 enum WEAPON_STATE 31 { 32 WEAPONSTATE_IDLE=0, 33 34 WEAPONSTATE_FIRING_PRIMARY, 35 WEAPONSTATE_RECOIL_PRIMARY, 36 WEAPONSTATE_RELOAD_PRIMARY, 37 38 WEAPONSTATE_FIRING_SECONDARY, 39 WEAPONSTATE_RECOIL_SECONDARY, 40 WEAPONSTATE_RELOAD_SECONDARY, 41 42 WEAPONSTATE_SWAPPING_IN, 43 WEAPONSTATE_SWAPPING_OUT, 44 WEAPONSTATE_JAMMED, 45 46 WEAPONSTATE_WAITING, 47 48 WEAPONSTATE_READYING, 49 WEAPONSTATE_UNREADYING, 50 51 MAX_NO_OF_WEAPON_STATES 52 }; 53 #define WEAPONSTATE_INITIALTIMEOUTCOUNT 65536 54 #define WEAPONSTATE_INSTANTTIMEOUT 0 55 56 /* KJL 10:42:38 09/19/96 - Weapon Enumerations */ 57 enum WEAPON_ID 58 { 59 /* USED TO DENOTE AN EMPTY SLOT */ 60 NULL_WEAPON=-1, 61 62 /* MARINE WEAPONS */ 63 WEAPON_PULSERIFLE, 64 WEAPON_AUTOSHOTGUN, 65 WEAPON_SMARTGUN, 66 WEAPON_FLAMETHROWER, 67 WEAPON_PLASMAGUN, 68 WEAPON_SADAR, 69 WEAPON_GRENADELAUNCHER, 70 WEAPON_MINIGUN, 71 WEAPON_SONICCANNON, 72 WEAPON_BEAMCANNON, 73 WEAPON_MYSTERYGUN, 74 75 /* PREDATOR WEAPONS */ 76 WEAPON_PRED_WRISTBLADE, 77 WEAPON_PRED_PISTOL, 78 WEAPON_PRED_RIFLE, 79 WEAPON_PRED_SHOULDERCANNON, 80 WEAPON_PRED_DISC, 81 WEAPON_PRED_MEDICOMP, 82 WEAPON_PRED_STAFF, 83 84 /* ALIEN WEAPONS */ 85 WEAPON_ALIEN_CLAW, 86 WEAPON_ALIEN_GRAB, 87 WEAPON_ALIEN_SPIT, 88 89 WEAPON_CUDGEL, 90 WEAPON_MARINE_PISTOL, 91 WEAPON_FRISBEE_LAUNCHER, 92 WEAPON_TWO_PISTOLS, 93 94 MAX_NO_OF_WEAPON_TEMPLATES 95 }; 96 97 enum WEAPON_SLOT 98 { 99 WEAPON_SLOT_1=0, 100 WEAPON_SLOT_2, 101 WEAPON_SLOT_3, 102 WEAPON_SLOT_4, 103 WEAPON_SLOT_5, 104 WEAPON_SLOT_6, 105 WEAPON_SLOT_7, 106 WEAPON_SLOT_8, 107 WEAPON_SLOT_9, 108 WEAPON_SLOT_10, 109 WEAPON_SLOT_11, 110 MAX_NO_OF_WEAPON_SLOTS, 111 112 WEAPON_FINISHED_SWAPPING 113 }; 114 115 116 enum AMMO_ID 117 { 118 AMMO_NONE=-1, 119 AMMO_10MM_CULW=0, 120 AMMO_SHOTGUN, 121 AMMO_SMARTGUN, 122 AMMO_FLAMETHROWER, 123 AMMO_PLASMA, 124 AMMO_SADAR_TOW, 125 AMMO_GRENADE, 126 AMMO_MINIGUN, 127 AMMO_PULSE_GRENADE, 128 AMMO_FLARE_GRENADE, 129 AMMO_FRAGMENTATION_GRENADE, 130 AMMO_PROXIMITY_GRENADE, 131 AMMO_PARTICLE_BEAM, 132 AMMO_SONIC_PULSE, 133 134 AMMO_PRED_WRISTBLADE, 135 AMMO_PRED_PISTOL, 136 AMMO_PRED_RIFLE, 137 AMMO_PRED_ENERGY_BOLT, 138 AMMO_PRED_DISC, 139 140 AMMO_ALIEN_CLAW, 141 AMMO_ALIEN_TAIL, 142 AMMO_ALIEN_SPIT, 143 144 AMMO_AUTOGUN, 145 AMMO_XENOBORG, 146 AMMO_FACEHUGGER, 147 AMMO_NPC_OBSTACLE_CLEAR, 148 AMMO_ALIEN_FRAG, 149 AMMO_ALIEN_DEATH, 150 151 AMMO_SHOTGUN_BLAST, 152 AMMO_SADAR_BLAST, 153 AMMO_ALIEN_BITE_KILLSECTION, 154 AMMO_PRED_DISC_PM, 155 156 AMMO_NPC_ALIEN_CLAW, 157 AMMO_NPC_PAQ_CLAW, 158 AMMO_PULSE_GRENADE_STRIKE, 159 AMMO_NPC_ALIEN_TAIL, 160 AMMO_NPC_ALIEN_BITE, 161 AMMO_NPC_PREDALIEN_CLAW, 162 AMMO_NPC_PREDALIEN_BITE, 163 AMMO_NPC_PREDALIEN_TAIL, 164 AMMO_NPC_PRAETORIAN_CLAW, 165 AMMO_NPC_PRAETORIAN_BITE, 166 AMMO_NPC_PRAETORIAN_TAIL, 167 AMMO_PRED_STAFF, 168 AMMO_NPC_PRED_STAFF, 169 AMMO_PC_ALIEN_BITE, 170 AMMO_HEAVY_PRED_WRISTBLADE, 171 AMMO_MARINE_PISTOL, 172 AMMO_PREDPISTOL_STRIKE, 173 AMMO_PLASMACASTER_NPCKILL, 174 AMMO_PLASMACASTER_PCKILL, 175 176 AMMO_10MM_CULW_NPC, 177 AMMO_SMARTGUN_NPC, 178 AMMO_MINIGUN_NPC, 179 AMMO_MOLOTOV, 180 AMMO_ALIEN_OBSTACLE_CLEAR, 181 AMMO_PRED_TROPHY_KILLSECTION, 182 183 AMMO_CUDGEL, 184 AMMO_ALIEN_BITE_KILLSECTION_SUPER, 185 AMMO_MARINE_PISTOL_PC, 186 AMMO_FRISBEE, 187 AMMO_FRISBEE_BLAST, 188 AMMO_FRISBEE_FIRE, 189 190 MAX_NO_OF_AMMO_TEMPLATES, 191 AMMO_FLECHETTE_POSTMAX, 192 AMMO_FALLING_POSTMAX, 193 AMMO_FIREDAMAGE_POSTMAX 194 195 }; 196 197 /* CDF - 15/9/97 New Damage System */ 198 199 typedef struct { 200 short Impact; 201 short Cutting; 202 short Penetrative; 203 short Fire; 204 short Electrical; 205 short Acid; 206 /* New additions, 4/8/98 */ 207 unsigned int ExplosivePower :3; 208 /* XP: 0 is nothing, 1 is little, 2 is big (SADAR), 209 3 is pred pistol, 4 is plasmacaster, 5 is molotov, 6 is big with no collisions, 210 7+ unused. */ 211 unsigned int Slicing :2; 212 unsigned int ProduceBlood :1; 213 unsigned int ForceBoom :2; 214 unsigned int BlowUpSections :1; 215 unsigned int Special :1; 216 unsigned int MakeExitWounds :1; 217 218 enum AMMO_ID Id; 219 220 } DAMAGE_PROFILE; 221 222 /* CDF - 15/9/97 New Damage System */ 223 224 typedef struct { 225 unsigned int MovementMultiple; 226 unsigned int TurningMultiple; 227 unsigned int JumpingMultiple; 228 unsigned int CanCrouch:1; 229 unsigned int CanRun:1; 230 } ENCUMBERANCE_STATE; 231 232 typedef struct 233 { 234 int AmmoPerMagazine; 235 236 DAMAGE_PROFILE MaxDamage[I_MaxDifficulties]; 237 int MaxRange; 238 239 enum TEXTSTRING_ID ShortName; 240 /* Added 20/11/97 by DHM: Abberviated name for ammo, to appear in HUD status panel */ 241 242 /* ammo flags */ 243 unsigned int CreatesProjectile :1; 244 unsigned int ExplosionIsFlat:1; 245 } TEMPLATE_AMMO_DATA; 246 247 typedef struct 248 { 249 enum WEAPON_ID WeaponIDNumber; 250 /* eg.==MARINE_WEAPON_PULSE. This can be used to access the TemplateWeapon[] data, graphics, etc. */ 251 252 enum WEAPON_STATE CurrentState; 253 254 int StateTimeOutCounter; /* in 16.16 */ 255 256 unsigned int PrimaryRoundsRemaining; /* in 'current' magazine */ 257 unsigned int SecondaryRoundsRemaining; /* in 'current' magazine */ 258 unsigned char PrimaryMagazinesRemaining; 259 unsigned char SecondaryMagazinesRemaining; 260 261 VECTORCH PositionOffset; 262 EULER DirectionOffset; 263 264 SHAPEANIMATIONCONTROLLER ShpAnimCtrl; 265 TXACTRLBLK *TxAnimCtrl; 266 267 /* general flags */ 268 signed int Possessed :2; /* meaning you are carrying the weapon, not that an evil spirit etc etc. */ 269 270 } PLAYER_WEAPON_DATA; 271 272 typedef struct 273 { 274 enum AMMO_ID PrimaryAmmoID; 275 enum AMMO_ID SecondaryAmmoID; 276 277 int (*FirePrimaryFunction)(PLAYER_WEAPON_DATA *); 278 int (*FireSecondaryFunction)(PLAYER_WEAPON_DATA *); 279 void (*WeaponInitFunction)(PLAYER_WEAPON_DATA *); 280 281 int TimeOutRateForState[MAX_NO_OF_WEAPON_STATES]; /* in 16.16 */ 282 void (*WeaponStateFunction[MAX_NO_OF_WEAPON_STATES])(void *, PLAYER_WEAPON_DATA *); // void * is for PLAYER_STATUS 283 int ProbabilityOfJamming; 284 int FiringRate; 285 286 /* display stuff */ 287 signed int SmartTargetSpeed; /* how fast crosshair moves */ 288 unsigned int GunCrosshairSpeed; /* how fast the gun moves to catch up */ 289 unsigned int SmartTargetRadius; 290 VECTORCH RestPosition; 291 292 int RecoilMaxZ; 293 int RecoilMaxRandomZ; 294 int RecoilMaxXTilt; 295 int RecoilMaxYTilt; 296 297 VECTORCH StrikePosition; 298 299 enum TEXTSTRING_ID Name; 300 301 /* shape reference */ 302 char * WeaponShapeName; 303 char * MuzzleFlashShapeName; 304 char * RiffName; 305 char * HierarchyName; 306 int InitialSequenceType; 307 int InitialSubSequence; 308 309 /* Encumberance */ 310 311 ENCUMBERANCE_STATE Encum_Idle; 312 ENCUMBERANCE_STATE Encum_FirePrime; 313 ENCUMBERANCE_STATE Encum_FireSec; 314 315 /* flags */ 316 unsigned int UseStateMovement :1; 317 unsigned int IsSmartTarget :1; 318 unsigned int PrimaryIsRapidFire :1; 319 unsigned int PrimaryIsAutomatic :1; 320 unsigned int PrimaryIsMeleeWeapon :1; 321 unsigned int SecondaryIsRapidFire :1; 322 unsigned int SecondaryIsAutomatic :1; 323 unsigned int SecondaryIsMeleeWeapon :1; 324 unsigned int HasShapeAnimation: 1; 325 unsigned int HasTextureAnimation: 1; 326 unsigned int FireWhenCloaked: 1; 327 unsigned int FireInChangeVision: 1; 328 unsigned int FirePrimaryLate: 1; 329 unsigned int FireSecondaryLate: 1; 330 unsigned int PrimaryMuzzleFlash: 1; 331 unsigned int SecondaryMuzzleFlash: 1; 332 unsigned int LogAccuracy: 1; 333 unsigned int LogShots: 1; 334 335 } TEMPLATE_WEAPON_DATA; 336 337 338 339 340 341 typedef struct 342 { 343 enum AMMO_ID SelectedAmmo; 344 345 unsigned int StandardRoundsRemaining; 346 unsigned char StandardMagazinesRemaining; 347 348 unsigned int FlareRoundsRemaining; 349 unsigned char FlareMagazinesRemaining; 350 351 unsigned int ProximityRoundsRemaining; 352 unsigned char ProximityMagazinesRemaining; 353 354 unsigned int FragmentationRoundsRemaining; 355 unsigned char FragmentationMagazinesRemaining; 356 357 } GRENADE_LAUNCHER_DATA; 358 359 typedef enum Pred_Disc_Modes { 360 I_Seek_Track, 361 I_Search_Destroy, 362 I_Proximity_Mine, 363 } PRED_DISC_MODES; 364 365 typedef enum Smartgun_Modes { 366 I_Track, 367 I_Free, 368 } SMARTGUN_MODES; 369 370 extern PRED_DISC_MODES ThisDiscMode; 371 extern SMARTGUN_MODES SmartgunMode; 372 373 extern TEMPLATE_WEAPON_DATA TemplateWeapon[]; 374 extern TEMPLATE_AMMO_DATA TemplateAmmo[]; 375 extern GRENADE_LAUNCHER_DATA GrenadeLauncherData; 376 377 extern enum WEAPON_ID MarineWeaponKey[MAX_NO_OF_WEAPON_SLOTS]; 378 extern enum WEAPON_ID PredatorWeaponKey[MAX_NO_OF_WEAPON_SLOTS]; 379 extern enum WEAPON_ID AlienWeaponKey[MAX_NO_OF_WEAPON_SLOTS]; 380 381 extern DAMAGE_PROFILE certainDeath; 382 extern DAMAGE_PROFILE console_nuke; 383 extern DAMAGE_PROFILE firedamage; 384 385 extern DAMAGE_PROFILE SmallExplosionDamage; 386 extern DAMAGE_PROFILE BigExplosionDamage; 387 388 extern void InitialiseEquipment(void); 389 390 /*compare two damage profiles to see if they are the same*/ 391 extern BOOL AreDamageProfilesEqual(DAMAGE_PROFILE* profile1,DAMAGE_PROFILE* profile2); 392 393 394 395 #ifdef __cplusplus 396 397 }; 398 399 #endif 400 #endif 401