1 /* $Id: laser.h,v 1.4 2004-08-28 23:17:45 schaffner Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
17 * Definitions for the laser code.
24 #define LASER_ID 0 //0..3 are lasers
25 #define CONCUSSION_ID 8
26 #define FLARE_ID 9 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
27 #define VULCAN_ID 11 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
28 #define SPREADFIRE_ID 12 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
29 #define PLASMA_ID 13 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
30 #define FUSION_ID 14 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
32 #define PROXIMITY_ID 16
36 #define PLAYER_SMART_HOMING_ID 19
37 #define SUPER_MECH_MISS 21
38 #define REGULAR_MECH_MISS 22
39 #define SILENT_SPREADFIRE_ID 23
40 #define ROBOT_SMART_HOMING_ID 29
41 #define EARTHSHAKER_MEGA_ID 54
43 #define SUPER_LASER_ID 30 // 30,31 are super lasers (level 5,6)
45 #define GAUSS_ID 32 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
46 #define HELIX_ID 33 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
47 #define PHOENIX_ID 34 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
48 #define OMEGA_ID 35 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
51 #define GUIDEDMISS_ID 37
52 #define SUPERPROX_ID 38
54 #define EARTHSHAKER_ID 40
56 #define SMART_MINE_HOMING_ID 47
57 #define ROBOT_SMART_MINE_HOMING_ID 49
58 #define ROBOT_SUPERPROX_ID 53
59 #define ROBOT_EARTHSHAKER_ID 58
61 #define PMINE_ID 51 //the mine that the designers can place
63 #define OMEGA_MULTI_LIFELEFT (F1_0/6)
65 // These are new defines for the value of 'flags' passed to do_laser_firing.
66 // The purpose is to collect other flags like QUAD_LASER and Spreadfire_toggle
67 // into a single 8-bit quantity so it can be easily used in network mode.
70 #define LASER_SPREADFIRE_TOGGLED 2
71 #define LASER_HELIX_FLAG0 4 // helix uses 3 bits for angle
72 #define LASER_HELIX_FLAG1 8 // helix uses 3 bits for angle
73 #define LASER_HELIX_FLAG2 16 // helix uses 3 bits for angle
75 #define LASER_HELIX_SHIFT 2 // how far to shift count to put in flags
76 #define LASER_HELIX_MASK 7 // must match number of bits in flags
78 #define MAX_LASER_LEVEL 3 // Note, laser levels are numbered from 0.
79 #define MAX_SUPER_LASER_LEVEL 5 // Note, laser levels are numbered from 0.
81 #define MAX_LASER_BITMAPS 6
83 // For muzzle firing casting light.
84 #define MUZZLE_QUEUE_MAX 8
86 // Constants governing homing missile behavior.
87 // MIN_TRACKABLE_DOT gets inversely scaled by FrameTime and stuffed in
89 #define MIN_TRACKABLE_DOT (7*F1_0/8)
90 #define MAX_TRACKABLE_DIST (F1_0*250)
91 #define HOMING_MISSILE_STRAIGHT_TIME (F1_0/8) // Changed as per request of John, Adam, Yuan, but mostly John
93 extern fix Min_trackable_dot; // MIN_TRACKABLE_DOT inversely scaled by FrameTime
95 extern object *Guided_missile[];
96 extern int Guided_missile_sig[];
98 void Laser_render(object *obj);
99 void Laser_player_fire(object * obj, int type, int gun_num, int make_sound, int harmless_flag);
100 void Laser_player_fire_spread(object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless);
101 void Laser_do_weapon_sequence(object *obj);
102 void Flare_create(object *obj);
103 int laser_are_related(int o1, int o2);
105 extern int do_laser_firing_player(void);
106 extern void do_missile_firing(int do_autoselect);
107 extern void net_missile_firing(int player, int weapon, int flags);
109 int Laser_create_new(vms_vector * direction, vms_vector * position, int segnum, int parent, int type, int make_sound);
111 // Fires a laser-type weapon (a Primary weapon)
112 // Fires from object objnum, weapon type weapon_id.
113 // Assumes that it is firing from a player object, so it knows which
115 // Returns the number of shots actually fired, which will typically be
116 // 1, but could be higher for low frame rates when rapidfire weapons,
117 // such as vulcan or plasma are fired.
118 extern int do_laser_firing(int objnum, int weapon_id, int level, int flags, int nfires);
120 // Easier to call than Laser_create_new because it determines the
121 // segment containing the firing point and deals with it being stuck
122 // in an object or through a wall.
123 // Fires a laser of type "weapon_type" from an object (parent) in the
124 // direction "direction" from the position "position"
125 // Returns object number of laser fired or -1 if not possible to fire
127 int Laser_create_new_easy(vms_vector * direction, vms_vector * position, int parent, int weapon_type, int make_sound);
129 // creates a weapon object
130 int create_weapon_object(int weapon_type,int segnum,vms_vector *position);
132 // give up control of the guided missile
133 void release_guided_missile(int player_num);
135 extern void create_smart_children(object *objp, int count);
136 extern int object_to_object_visibility(object *obj1, object *obj2, int trans_type);
138 extern int Muzzle_queue_index;
140 typedef struct muzzle_info {
146 extern muzzle_info Muzzle_data[MUZZLE_QUEUE_MAX];
148 // Omega cannon stuff.
149 #define MAX_OMEGA_CHARGE (F1_0) // Maximum charge level for omega cannonw
150 extern fix Omega_charge;
151 // NOTE: OMEGA_CHARGE_SCALE moved to laser.c to avoid long rebuilds if changed
153 #endif /* _LASER_H */