2006-03-20 16:43:15 +00:00
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ( " PARALLAX " ) . PARALLAX , IN DISTRIBUTING THE CODE TO
END - USERS , AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN , GRANTS A
ROYALTY - FREE , PERPETUAL LICENSE TO SUCH END - USERS FOR USE BY SUCH END - USERS
IN USING , DISPLAYING , AND CREATING DERIVATIVE WORKS THEREOF , SO LONG AS
SUCH USE , DISPLAY OR CREATION IS FOR NON - COMMERCIAL , ROYALTY OR REVENUE
FREE PURPOSES . IN NO EVENT SHALL THE END - USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE - BEARING PURPOSES . THE END - USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE .
COPYRIGHT 1993 - 1998 PARALLAX SOFTWARE CORPORATION . ALL RIGHTS RESERVED .
*/
2007-12-29 14:18:49 +00:00
2006-03-20 16:43:15 +00:00
/*
*
2007-12-29 14:18:49 +00:00
* Definitions for the laser code .
2006-03-20 16:43:15 +00:00
*
*/
# ifndef _LASER_H
# define _LASER_H
# define CONCUSSION_ID 8
# define FLARE_ID 9 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
# define LASER_ID 10
# define VULCAN_ID 11 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
# define XSPREADFIRE_ID 12 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
# define PLASMA_ID 13 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
# define FUSION_ID 14 // NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
# define HOMING_ID 15
# define PROXIMITY_ID 16
# define SMART_ID 17
# define MEGA_ID 18
# define PLAYER_SMART_HOMING_ID 19
# define SPREADFIRE_ID 20
# define SUPER_MECH_MISS 21
# define REGULAR_MECH_MISS 22
# define SILENT_SPREADFIRE_ID 23
2010-03-04 22:43:37 +00:00
# define ROBOT_SMART_HOMING_ID ((N_weapon_types<29)?(PLAYER_SMART_HOMING_ID):(29)) // NOTE: Shareware does not have it's own Smart structure for bots. It was introduced later to make Smart blobs from lvl 7 boss easier to dodge. So if we do not have this type, revert to player's Smart behaviour..
2006-03-20 16:43:15 +00:00
// These are new defines for the value of 'flags' passed to do_laser_firing.
// The purpose is to collect other flags like QUAD_LASER and Spreadfire_toggle
// into a single 8-bit quantity so it can be easily used in network mode.
# define LASER_QUAD 1
# define LASER_SPREADFIRE_TOGGLED 2
# define MAX_LASER_LEVEL 3 // Note, laser levels are numbered from 0.
# define MAX_LASER_BITMAPS 6
// For muzzle firing casting light.
# define MUZZLE_QUEUE_MAX 8
// Constants governing homing missile behavior.
// MIN_TRACKABLE_DOT gets inversely scaled by FrameTime and stuffed in Min_trackable_dot
# define MIN_TRACKABLE_DOT (3*F1_0 / 4)
# define MAX_TRACKABLE_DIST (F1_0*250)
# define HOMING_MISSILE_STRAIGHT_TIME (F1_0 / 8) // Changed as per request of John, Adam, Yuan, but mostly John
2010-02-07 07:28:49 +00:00
struct object ;
2006-03-20 16:43:15 +00:00
extern fix Min_trackable_dot ; // MIN_TRACKABLE_DOT inversely scaled by FrameTime
2010-02-07 07:28:49 +00:00
void Laser_render ( struct object * obj ) ;
void Laser_player_fire ( struct object * obj , int type , int gun_num , int make_sound , int harmless_flag ) ;
void Laser_player_fire_spread ( struct object * obj , int laser_type , int gun_num , fix spreadr , fix spreadu , int make_sound , int harmless ) ;
void Laser_do_weapon_sequence ( struct object * obj ) ;
void Flare_create ( struct object * obj ) ;
2006-03-20 16:43:15 +00:00
int laser_are_related ( int o1 , int o2 ) ;
extern int do_laser_firing_player ( void ) ;
2010-03-31 06:19:37 +00:00
extern void do_missile_firing ( int drop_bomb ) ;
2006-03-20 16:43:15 +00:00
extern void net_missile_firing ( int player , int weapon , int flags ) ;
int Laser_create_new ( vms_vector * direction , vms_vector * position , int segnum , int parent , int type , int make_sound ) ;
// Fires a laser-type weapon (a Primary weapon)
// Fires from object objnum, weapon type weapon_id.
// Assumes that it is firing from a player object, so it knows which gun to fire from.
// Returns the number of shots actually fired, which will typically be 1, but could be
// higher for low frame rates when rapidfire weapons, such as vulcan or plasma are fired.
extern int do_laser_firing ( int objnum , int weapon_id , int level , int flags , int nfires ) ;
// Easier to call than Laser_create_new because it determines the segment containing the firing point
// and deals with it being stuck in an object or through a wall.
// Fires a laser of type "weapon_type" from an object (parent) in the direction "direction" from the position "position"
// Returns object number of laser fired or -1 if not possible to fire laser.
int Laser_create_new_easy ( vms_vector * direction , vms_vector * position , int parent , int weapon_type , int make_sound ) ;
2010-02-07 07:28:49 +00:00
extern void create_smart_children ( struct object * objp ) ;
extern int object_to_object_visibility ( struct object * obj1 , struct object * obj2 , int trans_type ) ;
2006-03-20 16:43:15 +00:00
extern int Muzzle_queue_index ;
typedef struct muzzle_info {
2010-12-10 23:18:03 +00:00
fix64 create_time ;
short segnum ;
2006-03-20 16:43:15 +00:00
vms_vector pos ;
} muzzle_info ;
extern muzzle_info Muzzle_data [ MUZZLE_QUEUE_MAX ] ;
extern int Laser_drop_vulcan_ammo ;
# endif