1 #ifndef __WEAPON_DEFINITIONS_H
2 #define __WEAPON_DEFINITIONS_H
3 
4 /*
5 	WEAPON_DEFINITIONS2.H
6 
7 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
8 	and the "Aleph One" developers.
9 
10 	This program is free software; you can redistribute it and/or modify
11 	it under the terms of the GNU General Public License as published by
12 	the Free Software Foundation; either version 3 of the License, or
13 	(at your option) any later version.
14 
15 	This program is distributed in the hope that it will be useful,
16 	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 	GNU General Public License for more details.
19 
20 	This license is contained in the file "COPYING",
21 	which is included with this source code; it is available online at
22 	http://www.gnu.org/licenses/gpl.html
23 
24 	Saturday, May 13, 1995 8:28:14 PM
25 
26 	Sunday, May 14, 1995 3:11:52 AM- converted the piece of shit...
27 
28 4 Feb 2000 (Loren Petrich):
29 	Added SMG stuff
30 */
31 
32 #include "items.h"
33 #include "map.h"
34 #include "projectiles.h"
35 #include "SoundManagerEnums.h"
36 #include "weapons.h"
37 
38 /* TEMPORARY!!! */
39 enum {
40 	_projectile_ball_dropped= 1000
41 };
42 
43 /* ---------- constants */
44 #define NORMAL_WEAPON_DZ (20)
45 
46 /* This is the amount of ammo that charging weapons use at one time.. */
47 #define CHARGING_WEAPON_AMMO_COUNT 4
48 
49 enum /* weapon classes */
50 {
51 	_melee_class, /* normal weapon, no ammunition, both triggers do the same thing */
52 	_normal_class, /* normal weapon, one ammunition type, both triggers do the same thing */
53 	_dual_function_class, /* normal weapon, one ammunition type, trigger does something different */
54 	_twofisted_pistol_class, /* two can be held at once (differnet triggers), same ammunition */
55 	_multipurpose_class /* two weapons in one (assault rifle, grenade launcher), two different
56 		ammunition types with two separate triggers; secondary ammunition is discrete (i.e., it
57 		is never loaded explicitly but appears in the weapon) */
58 };
59 
60 enum /* weapon flags */
61 {
62 	_no_flags= 0x0,
63 	_weapon_is_automatic= 0x01,
64 	_weapon_disappears_after_use= 0x02,
65 	_weapon_plays_instant_shell_casing_sound= 0x04,
66 	_weapon_overloads= 0x08,
67 	_weapon_has_random_ammo_on_pickup= 0x10,
68 	_powerup_is_temporary= 0x20,
69 	_weapon_reloads_in_one_hand= 0x40,
70 	_weapon_fires_out_of_phase= 0x80,
71 	_weapon_fires_under_media= 0x100,
72 	_weapon_triggers_share_ammo= 0x200,
73 	_weapon_secondary_has_angular_flipping= 0x400,
74 
75 	// definitions for Marathon compatibility
76 	_weapon_disappears_after_use_m1 = 0x04,
77 	_weapon_is_marathon_1 = 0x1000,
78 	_weapon_flutters_while_firing = 0x2000,
79 };
80 
81 enum {
82 	_weapon_in_hand_collection= 1,
83 	_fist_idle= 0,
84 	_fist_punching,
85 	_pistol_idle,
86 	_pistol_firing,
87 	_pistol_reloading,
88 	_shotgun_idle,
89 	_shotgun_firing,
90 	_shotgun_reloading,
91 	_assault_rifle_idle,
92 	_assault_rifle_firing,
93 	_assault_rifle_reloading,
94 	_fusion_idle,
95 	_fusion_firing,
96 	_missile_launcher_idle,
97 	_missile_launcher_firing,
98 	_flamethrower_idle,
99 	_flamethrower_transit,
100 	_flamethrower_firing,
101 	_assault_rifle_shell_casing,
102 	_pistol_shell_casing,
103 	_fusion_charged,
104 	_alien_weapon_idle,
105 	_alien_weapon_firing,
106 	// LP additions:
107 	_smg_idle,
108 	_smg_firing,
109 	_smg_reloading,
110 	_smg_shell_casing
111 };
112 
113 /* ---------- shell casings */
114 
115 enum // shell casing types
116 {
117 	_shell_casing_assault_rifle,
118 	_shell_casing_pistol,
119 	_shell_casing_pistol_left,
120 	_shell_casing_pistol_right,
121 	// LP additions:
122 	_shell_casing_smg,
123 
124 	NUMBER_OF_SHELL_CASING_TYPES
125 };
126 
127 struct shell_casing_definition
128 {
129 	int16 collection, shape;
130 
131 	_fixed x0, y0;
132 	_fixed vx0, vy0;
133 	_fixed dvx, dvy;
134 };
135 
136 static struct shell_casing_definition shell_casing_definitions[NUMBER_OF_SHELL_CASING_TYPES]=
137 {
138 	{ // _shell_casing_assault_rifle,
139 		_collection_weapons_in_hand, 19, /* collection, shape */
140 
141 		FIXED_ONE/2 + FIXED_ONE/6, FIXED_ONE/8, /* x0, y0 */
142 		FIXED_ONE/8, FIXED_ONE/32, /* vx0, vy0 */
143 		0, -FIXED_ONE/256, /* dvx, dvy */
144 	},
145 
146 	{ // _shell_casing_pistol_center
147 		_collection_weapons_in_hand, 18, /* collection, shape */
148 
149 		FIXED_ONE/2 + FIXED_ONE/8, FIXED_ONE/4, /* x0, y0 */
150 		FIXED_ONE/16, FIXED_ONE/32, /* vx0, vy0 */
151 		0, -FIXED_ONE/400, /* dvx, dvy */
152 	},
153 
154 	{ // _shell_casing_pistol_left
155 		_collection_weapons_in_hand, 18, /* collection, shape */
156 
157 		FIXED_ONE/2 - FIXED_ONE/4, FIXED_ONE/4, /* x0, y0 */
158 		- FIXED_ONE/16, FIXED_ONE/32, /* vx0, vy0 */
159 		0, -FIXED_ONE/400, /* dvx, dvy */
160 	},
161 
162 	{ // _shell_casing_pistol_right
163 		_collection_weapons_in_hand, 18, /* collection, shape */
164 
165 		FIXED_ONE/2 + FIXED_ONE/4, FIXED_ONE/4, /* x0, y0 */
166 		FIXED_ONE/16, FIXED_ONE/32, /* vx0, vy0 */
167 		0, -FIXED_ONE/400, /* dvx, dvy */
168 	},
169 
170 	// LP addition: clone of assault-rifle casing
171 	{ // _shell_casing_smg,
172 		_collection_weapons_in_hand, 26, /* collection, shape */
173 
174 		FIXED_ONE/2 + FIXED_ONE/6, FIXED_ONE/8, /* x0, y0 */
175 		FIXED_ONE/8, FIXED_ONE/32, /* vx0, vy0 */
176 		0, -FIXED_ONE/256, /* dvx, dvy */
177 	},
178 };
179 
180 /* ---------- structures */
181 
182 struct trigger_definition {
183 	int16 rounds_per_magazine;
184 	int16 ammunition_type;
185 	int16 ticks_per_round;
186 	int16 recovery_ticks;
187 	int16 charging_ticks;
188 	world_distance recoil_magnitude;
189 	int16 firing_sound;
190 	int16 click_sound;
191 	int16 charging_sound;
192 	int16 shell_casing_sound;
193 	int16 reloading_sound;
194 	int16 charged_sound;
195 	int16 projectile_type;
196 	int16 theta_error;
197 	int16 dx, dz;
198 	int16 shell_casing_type;
199 	int16 burst_count;
200     int16 sound_activation_range; /* for Marathon compatibility */
201 };
202 
203 struct weapon_definition {
204 	int16 item_type;
205 	int16 powerup_type;
206 	int16 weapon_class;
207 	int16 flags;
208 
209 	_fixed firing_light_intensity;
210 	int16 firing_intensity_decay_ticks;
211 
212 	/* weapon will come up to FIXED_ONE when fired; idle_height�bob_amplitude should be in
213 		the range [0,FIXED_ONE] */
214 	_fixed idle_height, bob_amplitude, kick_height, reload_height;
215 	_fixed idle_width, horizontal_amplitude;
216 
217 	/* each weapon has three basic animations: idle, firing and reloading.  sounds and frames
218 		are pulled from the shape collection.  for automatic weapons the firing animation loops
219 		until the trigger is released or the gun is empty and the gun begins rising as soon as
220 		the trigger is depressed and is not lowered until the firing animation stops.  for single
221 		shot weapons the animation loops once; the weapon is raised and lowered as soon as the
222 		firing animation terminates */
223 	int16 collection;
224 	int16 idle_shape, firing_shape, reloading_shape;
225 	int16 unused;
226 	int16 charging_shape, charged_shape;
227 
228 	/* How long does it take to ready the weapon? */
229 	/* load_rounds_tick is the point which you actually load them. */
230 	int16 ready_ticks, await_reload_ticks, loading_ticks, finish_loading_ticks, powerup_ticks;
231 
232 	struct trigger_definition weapons_by_trigger[NUMBER_OF_TRIGGERS];
233 };
234 
235 /* ------------------------ globals */
236 
237 static int16 weapon_ordering_array[]= {
238 	_weapon_fist,
239 	_weapon_pistol,
240 	_weapon_plasma_pistol,
241 	_weapon_shotgun,
242 	_weapon_assault_rifle,
243 	// LP addition:
244 	_weapon_smg,
245 	_weapon_flamethrower,
246 	_weapon_missile_launcher,
247 	_weapon_alien_shotgun,
248 	_weapon_ball
249 };
250 
251 //#define NUMBER_OF_WEAPONS static_cast<int>(sizeof(weapon_definitions)/sizeof(struct weapon_definition))
252 #define NUMBER_OF_WEAPONS 10
253 
254 static struct weapon_definition weapon_definitions[NUMBER_OF_WEAPONS];
255 const struct weapon_definition original_weapon_definitions[NUMBER_OF_WEAPONS]=
256 {
257 	/* Fist*/
258 	{
259 		/* item type, powerup type, item class, item flags */
260 		_i_knife, NONE, _melee_class, _weapon_fires_under_media,
261 
262 		FIXED_ONE_HALF, 0, /* firing intensity, firing decay */
263 
264 		/* idle height, bob amplitude, kick height, reload height */
265 		FIXED_ONE+FIXED_ONE/15, FIXED_ONE/15, FIXED_ONE/16, 0,
266 
267 		/* horizontal positioning.. */
268 		FIXED_ONE_HALF, 0,
269 
270 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
271 		_weapon_in_hand_collection,
272 		_fist_idle, _fist_punching, _fist_idle,
273 		NONE,
274 		NONE, NONE,
275 
276 		/* ready/await/load/finish/powerup rounds ticks */
277 		TICKS_PER_SECOND/4, 0, 0, 0, 0,
278 
279 		{
280 			{
281 				/* rounds per magazine */
282 				1,
283 
284 				/* Ammunition type */
285 				NONE,
286 
287 				/* Ticks per round, recovery ticks, charging ticks */
288 				NONE, TICKS_PER_SECOND/3, 0,
289 
290 				/* recoil magnitude */
291 				0,
292 
293 				/* firing, click, charging, shell casing sound, reloading sound */
294 				NONE, NONE, NONE, NONE, NONE, NONE,
295 
296 				/* projectile type */
297 				_projectile_fist,
298 
299 				/* theta error */
300 				0,
301 
302 				/* dx, dz */
303 				0, 0,
304 
305 				/* shell casing type */
306 				NONE,
307 
308 				/* burst count */
309 				0
310 			},
311 			{
312 				/* rounds per magazine */
313 				1,
314 
315 				/* Ammunition type */
316 				NONE,
317 
318 				/* Ticks per round, recovery ticks, charging ticks */
319 				NONE, TICKS_PER_SECOND/3, 0,
320 
321 				/* recoil magnitude */
322 				0,
323 
324 				/* firing, click, charging, shell casing, reload sound */
325 				NONE, NONE, NONE, NONE, NONE, NONE,
326 
327 				/* projectile type */
328 				_projectile_fist,
329 
330 				/* theta error */
331 				0,
332 
333 				/* dx, dz */
334 				0, 0,
335 
336 				/* shell casing type */
337 				NONE,
338 
339 				/* burst count */
340 				0
341 			}
342 		}
343 	},
344 
345 	/* Magnum .45 "mega class"- dual fisted */
346 	{
347 		/* item type, powerup type, item class, item flags */
348 		_i_magnum, NONE, _twofisted_pistol_class, _weapon_fires_out_of_phase,
349 
350 		3*FIXED_ONE/4, TICKS_PER_SECOND/8, /* firing intensity, firing decay */
351 
352 		/* idle height, bob amplitude, kick height, reload height */
353 		FIXED_ONE+FIXED_ONE/15, FIXED_ONE/25, FIXED_ONE/8, FIXED_ONE,
354 
355 		/* horizontal positioning.. */
356 		FIXED_ONE_HALF, 0,
357 
358 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
359 		_weapon_in_hand_collection,
360 		_pistol_idle, _pistol_firing, _pistol_reloading,
361 		NONE,
362 		NONE, NONE,
363 
364 		/* ready/await/load/finish/powerup rounds ticks */
365 		TICKS_PER_SECOND/3, 5, 5, 5, 0, // was NONE
366 
367 		{
368 			{
369 				/* rounds per magazine */
370 				8,
371 
372 				/* Ammunition type */
373 				_i_magnum_magazine,
374 
375 				/* Ticks per round, recovery ticks, charging ticks */
376 				NONE, TICKS_PER_SECOND/3, 0,
377 
378 				/* recoil magnitude */
379 				10,
380 
381 				/* firing, click, charging, shell casing, reload sound */
382 				_snd_magnum_firing, _snd_empty_gun, NONE, NONE, _snd_magnum_reloading, NONE,
383 
384 				/* projectile type */
385 				_projectile_pistol_bullet,
386 
387 				/* theta error */
388 				1,
389 
390 				/* dx, dz */
391 				(WORLD_ONE_FOURTH/6), -NORMAL_WEAPON_DZ,		/* Primary */
392 
393 				/* shell casing type */
394 				_shell_casing_pistol,
395 
396 				/* burst count */
397 				0
398 			},
399 
400 			/* left weapon (for consistency)... */
401 			{
402 				/* rounds per magazine */
403 				8,
404 
405 				/* Ammunition type */
406 				_i_magnum_magazine,
407 
408 				/* Ticks per round, recovery ticks, charging ticks */
409 				NONE, TICKS_PER_SECOND/3, 0,
410 
411 				/* recoil magnitude */
412 				10,
413 
414 				/* firing, click, charging, shell casing, reload sound */
415 				_snd_magnum_firing, _snd_empty_gun, NONE, NONE, _snd_magnum_reloading, NONE,
416 
417 				/* projectile type */
418 				_projectile_pistol_bullet,
419 
420 				/* theta error */
421 				1,
422 
423 				/* dx, dz */
424 				-(WORLD_ONE_FOURTH/6), -NORMAL_WEAPON_DZ,		/* Primary */
425 
426 				/* shell casing type */
427 				_shell_casing_pistol,
428 
429 				/* burst count */
430 				0
431 			}
432 		}
433 	},
434 
435 	/* Fusion Pistol */
436 	{
437 		/* item type, powerup type, item class, item flags */
438 		_i_plasma_pistol, NONE, _dual_function_class, _weapon_overloads | _weapon_fires_under_media | _weapon_triggers_share_ammo,
439 
440 		3*FIXED_ONE/4, TICKS_PER_SECOND/3, /* firing intensity, firing decay */
441 
442 		/* idle height, bob amplitude, kick height, reload height */
443 		FIXED_ONE, FIXED_ONE/25, FIXED_ONE/8, FIXED_ONE,
444 
445 		/* horizontal positioning.. */
446 		FIXED_ONE_HALF, 0,
447 
448 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
449 		_weapon_in_hand_collection,
450 		_fusion_idle, _fusion_firing, NONE,
451 		NONE,
452 		NONE, _fusion_charged,
453 
454 		/* ready/await/load/finish/powerup rounds ticks */
455 		TICKS_PER_SECOND/3, TICKS_PER_SECOND/2, TICKS_PER_SECOND/2, TICKS_PER_SECOND/2, 0,
456 
457 		{
458 			{
459 				/* rounds per magazine */
460 				20,
461 
462 				/* Ammunition type */
463 				_i_plasma_magazine,
464 
465 				/* Ticks per round, recovery ticks, charging ticks */
466 				NONE, TICKS_PER_SECOND/6, 0,
467 
468 				/* recoil magnitude */
469 				5,
470 
471 				/* firing, click, charging, shell casing, reload sound */
472 				_snd_fusion_firing, _snd_empty_gun, _snd_fusion_charging, NONE, NONE, NONE,
473 
474 				/* projectile type */
475 				_projectile_fusion_bolt_minor,
476 
477 				/* theta error */
478 				1,
479 
480 				/* dx, dz */
481 				0, -4*NORMAL_WEAPON_DZ,
482 
483 				/* shell casing type */
484 				NONE,
485 
486 				/* burst count */
487 				0
488 			},
489 			{
490 				/* rounds per magazine */
491 				20,  // this should not be used...
492 
493 				/* Ammunition type */
494 				_i_plasma_magazine,
495 
496 				/* Ticks per round, recovery ticks, charging ticks */
497 				5, 4, TICKS_PER_SECOND/2,
498 
499 				/* recoil magnitude */
500 				20,
501 
502 				/* firing, click, charging, shell casing, reload sound */
503 				_snd_major_fusion_firing, _snd_empty_gun, _snd_fusion_charging, NONE, NONE, _snd_major_fusion_charged,
504 
505 				/* projectile type */
506 				_projectile_fusion_bolt_major,
507 
508 				/* theta error */
509 				1,
510 
511 				/* dx, dz */
512 				0, 0,
513 
514 				/* shell casing type */
515 				NONE,
516 
517 				/* burst count */
518 				0
519 			}
520 		}
521 	},
522 
523 	/* Assault Rifle */
524 	{
525 		/* item type, powerup type, item class, item flags */
526 		_i_assault_rifle, NONE, _multipurpose_class, _weapon_is_automatic,
527 
528 		3*FIXED_ONE/4, TICKS_PER_SECOND/5, /* firing intensity, firing decay */
529 
530 
531 		/* idle height, bob amplitude, kick height, reload height */
532 		FIXED_ONE+FIXED_ONE/6, FIXED_ONE/35, FIXED_ONE/16, 3*FIXED_ONE/4,
533 
534 		/* horizontal positioning.. */
535 		FIXED_ONE_HALF, 0,
536 
537 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
538 		_weapon_in_hand_collection,
539 		_assault_rifle_idle, _assault_rifle_firing, _assault_rifle_reloading,
540 		NONE,
541 		NONE, NONE,
542 
543 		/* ready/await/load/finish/powerup rounds ticks */
544 		TICKS_PER_SECOND/2, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, 0,
545 
546 		{
547 			{
548 				/* rounds per magazine */
549 				52,
550 
551 				/* Ammunition type */
552 				_i_assault_rifle_magazine,
553 
554 				/* Ticks per round, recovery ticks, charging ticks */
555 				NONE, 0, 0,
556 
557 				/* recoil magnitude */
558 				5,
559 
560 				/* firing, click, charging, shell casing, reload sound */
561 				_snd_assault_rifle_firing, _snd_empty_gun, NONE, _snd_assault_rifle_shell_casings, _snd_assault_rifle_reloading, NONE,
562 
563 				/* projectile type */
564 				_projectile_rifle_bullet,
565 
566 				/* theta error */
567 				10,
568 
569 				/* dx, dz */
570 				0, -NORMAL_WEAPON_DZ,
571 
572 				/* shell casing type */
573 				_shell_casing_assault_rifle,
574 
575 				/* burst count */
576 				0
577 			},
578 			{
579 				/* rounds per magazine */
580 				7,
581 
582 				/* Ammunition type */
583 				_i_assault_grenade_magazine,
584 
585 				/* Ticks per round, recovery ticks, charging ticks */
586 				TICKS_PER_SECOND/6, (3*TICKS_PER_SECOND)/4 - TICKS_PER_SECOND/6, 0,
587 
588 				/* recoil magnitude */
589 				40,
590 
591 				/* firing, click, charging, shell casing, reload sound */
592 				_snd_grenade_launcher_firing, _snd_empty_gun, NONE, NONE, NONE, NONE,
593 
594 				/* projectile type */
595 				_projectile_grenade,
596 
597 				/* theta error */
598 				0,
599 
600 				/* dx, dz */
601 				0, -5*NORMAL_WEAPON_DZ,
602 
603 				/* shell casing type */
604 				NONE,
605 
606 				/* burst count */
607 				0
608 			}
609 		}
610 	},
611 
612 	/* Rocket Launcher */
613 	{
614 		/* item type, powerup_type, item class, item flags */
615 		_i_missile_launcher, NONE, _normal_class, _no_flags,
616 
617 		FIXED_ONE, TICKS_PER_SECOND/3, /* firing intensity, firing decay */
618 
619 		/* idle height, bob amplitude, kick height, reload height */
620 		(3*FIXED_ONE)/4, FIXED_ONE/50, FIXED_ONE/20, FIXED_ONE,
621 
622 		/* horizontal positioning.. */
623 		(FIXED_ONE_HALF/4), 0,
624 
625 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
626 		_weapon_in_hand_collection,
627 		_missile_launcher_idle, _missile_launcher_firing, NONE,
628 		NONE,
629 		NONE, NONE,
630 
631 		/* ready/await/load/finish/powerup rounds ticks */
632 		TICKS_PER_SECOND, TICKS_PER_SECOND, TICKS_PER_SECOND, TICKS_PER_SECOND, 0,
633 
634 		{
635 			{
636 				/* rounds per magazine */
637 				2,
638 
639 				/* Ammunition type */
640 				_i_missile_launcher_magazine,
641 
642 				/* Ticks per round, recovery ticks, charging ticks */
643 				TICKS_PER_SECOND/2, TICKS_PER_SECOND/10, 0,
644 
645 				/* recoil magnitude */
646 				100,
647 
648 				/* firing, click, charging, shell casing, reload sound */
649 				_snd_rocket_firing, _snd_empty_gun, NONE, NONE, NONE, NONE,
650 
651 				/* projectile type */
652 				_projectile_rocket,
653 
654 				/* theta error */
655 				0,
656 
657 				/* dx, dz */
658 				-WORLD_ONE_FOURTH, 0,
659 
660 				/* shell casing type */
661 				NONE,
662 
663 				/* burst count */
664 				0
665 			},
666 
667 			/* unused */
668 			{
669 				/* rounds per magazine */
670 				1,
671 
672 				/* Ammunition type */
673 				NONE,
674 
675 				/* Ticks per round, recovery ticks, charging ticks */
676 				NONE, TICKS_PER_SECOND/3, 0,
677 
678 				/* recoil magnitude */
679 				0,
680 
681 				/* firing, click, charging, shell casing, reload sound */
682 				NONE, NONE, NONE, NONE, NONE, NONE,
683 
684 				/* projectile type */
685 				_projectile_fist,
686 
687 				/* theta error */
688 				0,
689 
690 				/* dx, dz */
691 				0, 0,
692 
693 				/* shell casing type */
694 				NONE,
695 
696 				/* burst count */
697 				0
698 			}
699 		}
700 	},
701 
702 	/* flamethrower */
703 	{
704 		/* item type, powerup type, item class, item flags */
705 		_i_flamethrower, NONE, _normal_class, _weapon_is_automatic,
706 
707 		3*FIXED_ONE/4, TICKS_PER_SECOND/3, /* firing intensity, firing decay */
708 
709 		/* idle height, bob amplitude, kick height, reload height */
710 		FIXED_ONE, FIXED_ONE/35, FIXED_ONE/15, FIXED_ONE/2,
711 
712 		/* horizontal positioning.. */
713 		FIXED_ONE_HALF, 0,
714 
715 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
716 		_weapon_in_hand_collection,
717 		_flamethrower_idle, _flamethrower_firing, NONE,
718 		NONE,
719 		NONE, NONE,
720 
721 		/* ready/await/load/finish/powerup rounds ticks */
722 		TICKS_PER_SECOND, (2*TICKS_PER_SECOND)/3, (2*TICKS_PER_SECOND)/3, (2*TICKS_PER_SECOND)/3, 0,
723 
724 		{
725 			{
726 				/* rounds per magazine */
727 				7*TICKS_PER_SECOND,
728 
729 				/* Ammunition type */
730 				_i_flamethrower_canister,
731 
732 				/* Ticks per round, recovery ticks, charging ticks */
733 				NONE, TICKS_PER_SECOND/3, 0,
734 
735 				/* recoil magnitude */
736 				2,
737 
738 				/* firing, click, charging, shell casing, reload sound */
739 				_snd_flamethrower, NONE, NONE, NONE, NONE, NONE,
740 
741 				/* projectile type */
742 				_projectile_flamethrower_burst,
743 
744 				/* theta error */
745 				0,
746 
747 				/* dx, dz */
748 				20, -50,
749 
750 				/* shell casing type */
751 				NONE,
752 
753 				/* burst count */
754 				0
755 			},
756 
757 			/* unused */
758 			{
759 				/* rounds per magazine */
760 				1,
761 
762 				/* Ammunition type */
763 				NONE,
764 
765 				/* Ticks per round, recovery ticks, charging ticks */
766 				NONE, TICKS_PER_SECOND/3, 0,
767 
768 				/* recoil magnitude */
769 				0,
770 
771 				/* firing, click, charging, shell casing, reload sound */
772 				NONE, NONE, NONE, NONE, NONE, NONE,
773 
774 				/* projectile type */
775 				_projectile_fist,
776 
777 				/* theta error */
778 				0,
779 
780 				/* dx, dz */
781 				0, 0,
782 
783 				/* shell casing type */
784 				NONE,
785 
786 				/* burst count */
787 				0
788 			}
789 		}
790 	},
791 
792 	/* alien weapon */
793 	{
794 		/* item type, powerup type, item class, item flags */
795 		_i_alien_shotgun, NONE, _multipurpose_class, _weapon_is_automatic | _weapon_disappears_after_use | _weapon_has_random_ammo_on_pickup | _weapon_triggers_share_ammo | _weapon_secondary_has_angular_flipping,
796 
797 		3*FIXED_ONE/4, TICKS_PER_SECOND/5, /* firing intensity, firing decay */
798 
799 		/* idle height, bob amplitude, kick height, reload height */
800 		FIXED_ONE+FIXED_ONE/6, FIXED_ONE/35, FIXED_ONE/16, 3*FIXED_ONE/4,
801 
802 		/* horizontal positioning.. */
803 		FIXED_ONE_HALF, 0,
804 
805 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
806 		_weapon_in_hand_collection,
807 		_alien_weapon_idle, _alien_weapon_firing, NONE,
808 		NONE,
809 		NONE, NONE,
810 
811 		/* ready/await/load/finish/powerup rounds ticks */
812 		TICKS_PER_SECOND/2, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, 0,
813 
814 		{
815 			{
816 				/* rounds per magazine */
817 				2000,
818 
819 				/* Ammunition type */
820 				_i_alien_shotgun_magazine,
821 
822 				/* Ticks per round, recovery ticks, charging ticks */
823 				NONE, 0, 0,
824 
825 				/* recoil magnitude */
826 				5,
827 
828 				/* firing, click, charging, shell casing, reload sound */
829 				_snd_enforcer_attack, NONE, NONE, NONE, NONE, NONE,
830 
831 				/* projectile type */
832 				_projectile_alien_weapon,
833 
834 				/* theta error */
835 				1,
836 
837 				/* dx, dz */
838 				0, -8*NORMAL_WEAPON_DZ,
839 
840 				/* shell casing type */
841 				NONE,
842 
843 				/* burst count */
844 				0
845 			},
846 
847 			{
848 				/* rounds per magazine */
849 				50,
850 
851 				/* Ammunition type */
852 				_i_alien_shotgun_magazine,
853 
854 				/* Ticks per round, recovery ticks, charging ticks */
855 				NONE, 0, 0,
856 
857 				/* recoil magnitude */
858 				5,
859 
860 				/* firing, click, charging, shell casing, reload sound */
861 				_snd_enforcer_attack, NONE, NONE, NONE, NONE, NONE,
862 
863 				/* projectile type */
864 				_projectile_alien_weapon,
865 
866 				/* theta error */
867 				1,
868 
869 				/* dx, dz */
870 				0, -8*NORMAL_WEAPON_DZ,
871 
872 				/* shell casing type */
873 				NONE,
874 
875 				/* burst count */
876 				0
877 			}
878 		}
879 	},
880 
881 #define SHOTGUN_BURST_COUNT 10
882 #define SHOTGUN_SPREAD 5
883 	/* Shotgun- dual fisted */
884 	{
885 		/* item type, powerup type, item class, item flags */
886 		_i_shotgun, NONE, _twofisted_pistol_class, _weapon_reloads_in_one_hand,
887 
888 		3*FIXED_ONE/4, TICKS_PER_SECOND/8, /* firing intensity, firing decay */
889 
890 		/* idle height, bob amplitude, kick height, reload height */
891 		FIXED_ONE+FIXED_ONE/15, FIXED_ONE/25, FIXED_ONE/8, FIXED_ONE,
892 
893 		/* horizontal positioning.. */
894 		FIXED_ONE_HALF, 0,
895 
896 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
897 		_weapon_in_hand_collection,
898 		_shotgun_idle, _shotgun_firing, _shotgun_reloading,
899 		NONE,
900 		NONE, NONE,
901 
902 		/* ready/await/load/finish/powerup rounds ticks */
903 		TICKS_PER_SECOND/3, 5, 5, 5, 0, // was NONE
904 
905 		{
906 			{
907 				/* rounds per magazine */
908 				SHOTGUN_BURST_COUNT,
909 
910 				/* Ammunition type */
911 				_i_shotgun_magazine,
912 
913 				/* Ticks per round, recovery ticks, charging ticks */
914 				NONE, TICKS_PER_SECOND/3, 0,
915 
916 				/* recoil magnitude */
917 				25,
918 
919 				/* firing, click, charging, shell casing, reload sound */
920 				_snd_shotgun_firing, _snd_empty_gun, NONE, NONE, _snd_shotgun_reloading, NONE,
921 
922 				/* projectile type */
923 				_projectile_shotgun_bullet,
924 
925 				/* theta error */
926 				SHOTGUN_SPREAD,
927 
928 				/* dx, dz */
929 				(WORLD_ONE_FOURTH/6), -NORMAL_WEAPON_DZ,		/* Primary */
930 
931 				/* shell casing type */
932 				NONE,
933 
934 				/* burst count */
935 				SHOTGUN_BURST_COUNT
936 			},
937 
938 			/* left weapon (for consistency)... */
939 			{
940 				/* rounds per magazine */
941 				SHOTGUN_BURST_COUNT,
942 
943 				/* Ammunition type */
944 				_i_shotgun_magazine,
945 
946 				/* Ticks per round, recovery ticks, charging ticks */
947 				NONE, TICKS_PER_SECOND/3, 0,
948 
949 				/* recoil magnitude */
950 				25,
951 
952 				/* firing, click, charging, shell casing, reload sound */
953 				_snd_shotgun_firing, _snd_empty_gun, NONE, NONE, _snd_shotgun_reloading, NONE,
954 
955 				/* projectile type */
956 				_projectile_shotgun_bullet,
957 
958 				/* theta error */
959 				SHOTGUN_SPREAD,
960 
961 				/* dx, dz */
962 				(WORLD_ONE_FOURTH/6), -NORMAL_WEAPON_DZ,		/* Primary */
963 
964 				/* shell casing type */
965 				NONE,
966 
967 				/* burst count */
968 				SHOTGUN_BURST_COUNT
969 			}
970 		}
971 	},
972 
973 	/* The Ball- Don't Drop It. */
974 	{
975 		/* item type, powerup type, item class, item flags */
976 		_i_red_ball, NONE, _normal_class, 0,
977 
978 		0, 0, /* firing intensity, firing decay */
979 
980 		/* idle height, bob amplitude, kick height, reload height */
981 		FIXED_ONE+FIXED_ONE/15, FIXED_ONE/15, FIXED_ONE/16, 0,
982 
983 		/* horizontal positioning.. */
984 		FIXED_ONE_HALF, 0,
985 
986 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
987 		_collection_player,
988 		30, 30, 30,
989 		NONE,
990 		NONE, NONE,
991 
992 		/* ready/await/load/finish/powerup rounds ticks */
993 		TICKS_PER_SECOND/4, 0, 0, 0, 0,
994 
995 		{
996 			{
997 				/* rounds per magazine */
998 				1,
999 
1000 				/* Ammunition type */
1001 				NONE,
1002 
1003 				/* Ticks per round, recovery ticks, charging ticks */
1004 				NONE, TICKS_PER_SECOND/3, 0,
1005 
1006 				/* recoil magnitude */
1007 				0,
1008 
1009 				/* firing, click, charging, shell casing, reload sound */
1010 				NONE, NONE, NONE, NONE, NONE, NONE,
1011 
1012 				/* projectile type */
1013 				_projectile_ball_dropped,
1014 
1015 				/* theta error */
1016 				0,
1017 
1018 				/* dx, dz */
1019 				0, -150,		/* Primary */
1020 
1021 				/* shell casing type */
1022 				NONE,
1023 
1024 				/* burst count */
1025 				0
1026 			},
1027 
1028 			{
1029 				/* rounds per magazine */
1030 				1,
1031 
1032 				/* Ammunition type */
1033 				NONE,
1034 
1035 				/* Ticks per round, recovery ticks, charging ticks */
1036 				NONE, TICKS_PER_SECOND/3, 0,
1037 
1038 				/* recoil magnitude */
1039 				0,
1040 
1041 				/* firing, click, charging, shell casing, reload sound */
1042 				NONE, NONE, NONE, NONE, NONE, NONE,
1043 
1044 				/* projectile type */
1045 				_projectile_ball_dropped,
1046 
1047 				/* theta error */
1048 				0,
1049 
1050 				/* dx, dz */
1051 				0, 0,		/* Primary */
1052 
1053 				/* shell casing type */
1054 				NONE,
1055 
1056 				/* burst count */
1057 				0
1058 			}
1059 		}
1060 	},
1061 
1062 	/* LP addition: SMG */
1063 	{
1064 		/* item type, powerup type, item class, item flags */
1065 		_i_smg, NONE, _normal_class, _weapon_is_automatic|_weapon_fires_under_media,
1066 
1067 		3*FIXED_ONE/4, TICKS_PER_SECOND/5, /* firing intensity, firing decay */
1068 
1069 
1070 		/* idle height, bob amplitude, kick height, reload height */
1071 		FIXED_ONE+FIXED_ONE/6, FIXED_ONE/35, FIXED_ONE/16, 3*FIXED_ONE/4,
1072 
1073 		/* horizontal positioning.. */
1074 		FIXED_ONE_HALF, 0,
1075 
1076 		/* collection, idle, firing, reloading shapes; shell casing, charging, charged */
1077 		_weapon_in_hand_collection,
1078 		_smg_idle, _smg_firing, _smg_reloading,
1079 		NONE,
1080 		NONE, NONE,
1081 
1082 		/* ready/await/load/finish/powerup rounds ticks */
1083 		TICKS_PER_SECOND/2, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, TICKS_PER_SECOND/3, 0,
1084 
1085 		{
1086 			{
1087 				/* rounds per magazine */
1088 				32,
1089 
1090 				/* Ammunition type */
1091 				_i_smg_ammo,
1092 
1093 				/* Ticks per round, recovery ticks, charging ticks */
1094 				NONE, 0, 0,
1095 
1096 				/* recoil magnitude */
1097 				5,
1098 
1099 				/* firing, click, charging, shell casing, reload sound */
1100 				_snd_smg_firing, _snd_empty_gun, NONE, _snd_assault_rifle_shell_casings, _snd_smg_reloading, NONE,
1101 
1102 				/* projectile type */
1103 				_projectile_smg_bullet,
1104 
1105 				/* theta error */
1106 				3,
1107 
1108 				/* dx, dz */
1109 				0, -NORMAL_WEAPON_DZ,
1110 
1111 				/* shell casing type */
1112 				_shell_casing_smg,
1113 
1114 				/* burst count */
1115 				2
1116 			},
1117 			{
1118 				/* rounds per magazine */
1119 				32,
1120 
1121 				/* Ammunition type */
1122 				_i_smg_ammo,
1123 
1124 				/* Ticks per round, recovery ticks, charging ticks */
1125 				NONE, 0, 0,
1126 
1127 				/* recoil magnitude */
1128 				5,
1129 
1130 				/* firing, click, charging, shell casing, reload sound */
1131 				_snd_smg_firing, _snd_empty_gun, NONE, _snd_assault_rifle_shell_casings, _snd_smg_reloading, NONE,
1132 
1133 				/* projectile type */
1134 				_projectile_smg_bullet,
1135 
1136 				/* theta error */
1137 				3,
1138 
1139 				/* dx, dz */
1140 				0, -NORMAL_WEAPON_DZ,
1141 
1142 				/* shell casing type */
1143 				_shell_casing_smg,
1144 
1145 				/* burst count */
1146 				2
1147 			}
1148 		}
1149 	},
1150 };
1151 
1152 // Added for the convenience of the 1-2-3 Converter
1153 uint8 *unpack_weapon_definition(uint8 *Stream, weapon_definition *Objects, size_t Count);
1154 uint8 *pack_weapon_definition(uint8 *Stream, weapon_definition *Objects, size_t Count);
1155 
1156 #endif
1157