home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / laser.h < prev    next >
Text File  |  1998-06-08  |  10KB  |  269 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/laser.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:32:27 $
  18.  * 
  19.  * Definitions for the laser code.
  20.  * 
  21.  * $Log: laser.h $
  22.  * Revision 2.0  1995/02/27  11:32:27  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.50  1995/02/01  21:03:44  john
  27.  * Lintified.
  28.  * 
  29.  * Revision 1.49  1995/02/01  16:34:11  john
  30.  * Linted.
  31.  * 
  32.  * Revision 1.48  1995/01/31  16:16:16  mike
  33.  * Separate smart blobs for robot and player.
  34.  * 
  35.  * Revision 1.47  1995/01/27  17:02:55  mike
  36.  * Add LASER_ID -- why wasn't this added in June?
  37.  * 
  38.  * Revision 1.46  1995/01/25  10:53:27  mike
  39.  * make badass damage go through grates.
  40.  * 
  41.  * Revision 1.45  1994/12/12  17:17:32  mike
  42.  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
  43.  * 
  44.  * Revision 1.44  1994/12/04  16:17:23  mike
  45.  * spruce up homing missile behavior.
  46.  * 
  47.  * Revision 1.43  1994/12/03  12:48:30  mike
  48.  * make homing missile tracking not frame rate dependent (more-or-less)
  49.  * 
  50.  * Revision 1.42  1994/10/12  08:04:54  mike
  51.  * Clean up proximity/homing mess.
  52.  * 
  53.  * Revision 1.41  1994/10/09  20:07:04  rob
  54.  * Change prototype for do_laser_firing
  55.  * 
  56.  * Revision 1.40  1994/10/09  00:15:48  mike
  57.  * Add constants for super mech missile, regular mech missile, silent spreadfire.
  58.  * 
  59.  * Revision 1.39  1994/10/08  19:52:09  rob
  60.  * Added new weapon fire flags.
  61.  * 
  62.  * Revision 1.38  1994/10/07  15:31:12  mike
  63.  * Prototypes for new laser functions which don't necessarily make sound.
  64.  * 
  65.  * Revision 1.37  1994/10/05  17:08:29  matt
  66.  * Fixed a couple of small bugs, and made homing missiles alternate sides
  67.  * 
  68.  * Revision 1.36  1994/09/28  14:28:55  rob
  69.  * Added firing of missiles on networks/serial.
  70.  * 
  71.  * Revision 1.35  1994/09/24  14:17:02  mike
  72.  * Prototype do_laser_firing.
  73.  * 
  74.  * Revision 1.34  1994/09/23  11:36:49  mike
  75.  * Prototype Laser_create_new_easy.
  76.  * 
  77.  * Revision 1.33  1994/09/20  11:55:01  mike
  78.  * Fix bug.
  79.  * 
  80.  * Revision 1.32  1994/09/20  11:48:34  mike
  81.  * Change spreadfire laser to use new bitmap. (Define SPREADFIRE_ID)
  82.  * 
  83.  * Revision 1.31  1994/09/15  16:31:28  mike
  84.  * Prototype object_to_object_visibility.
  85.  * 
  86.  * Revision 1.30  1994/09/10  17:31:40  mike
  87.  * Add thrust to weapons.
  88.  * 
  89.  * Revision 1.29  1994/09/08  14:49:44  mike
  90.  * Bunch of IDs for new weapon types.
  91.  * 
  92.  * Revision 1.28  1994/09/07  19:16:40  mike
  93.  * Homing missile.
  94.  * 
  95.  * Revision 1.27  1994/09/07  15:59:47  mike
  96.  * Kill FLARE_MAX_TIME (now defined in bitmaps.tbl), add PROXIMITY_ID (shame!), prototype do_laser_firing, do_missile_firing.
  97.  * 
  98.  * Revision 1.26  1994/09/03  15:22:41  mike
  99.  * Kill Projectile_player_fire prototype.
  100.  * 
  101.  * Revision 1.25  1994/09/02  16:39:00  mike
  102.  * IDs for primary weapons.
  103.  * 
  104.  * Revision 1.24  1994/09/02  11:55:54  mike
  105.  * Define some illegal constants.
  106.  * 
  107.  * Revision 1.23  1994/08/25  18:12:06  matt
  108.  * Made player's weapons and flares fire from the positions on the 3d model.
  109.  * Also added support for quad lasers.
  110.  * 
  111.  * Revision 1.22  1994/08/19  15:22:28  mike
  112.  * Define constant for MAX_LASER_LEVEL.
  113.  * 
  114.  * Revision 1.21  1994/08/13  12:20:47  john
  115.  * Made the networking uise the Players array.
  116.  * 
  117.  * Revision 1.20  1994/08/10  10:44:05  john
  118.  * Made net players fire..
  119.  * 
  120.  * Revision 1.19  1994/06/27  18:30:57  mike
  121.  * Add flares.
  122.  * 
  123.  * Revision 1.18  1994/06/09  15:32:37  mike
  124.  * Muzzle flash
  125.  * 
  126.  * Revision 1.17  1994/05/19  09:09:00  mike
  127.  * Move a bunch of laser variables to bm.h, I think.
  128.  * Also, added Robot_laser_speed, instead of hard-coding Laser_speed/4.
  129.  * 
  130.  * Revision 1.16  1994/05/14  17:16:20  matt
  131.  * Got rid of externs in source (non-header) files
  132.  * 
  133.  * Revision 1.15  1994/05/13  20:27:39  john
  134.  * Version II of John's new object code.
  135.  * 
  136.  * Revision 1.14  1994/04/20  15:06:47  john
  137.  * Neatend laser code and fixed some laser bugs.
  138.  * 
  139.  * Revision 1.13  1994/04/01  13:35:15  matt
  140.  * Cleaned up laser code a bit; moved some code here object.c to laser.c
  141.  * 
  142.  * Revision 1.12  1994/04/01  11:14:24  yuan
  143.  * Added multiple bitmap functionality to all objects...
  144.  * (hostages, powerups, lasers, etc.)  
  145.  * Hostages and powerups are implemented in the object system,
  146.  * just need to finish function call to "affect" player.
  147.  * 
  148.  * Revision 1.11  1994/03/31  09:10:09  matt
  149.  * Added #define to turn crosshair off
  150.  * 
  151.  * Revision 1.10  1994/02/17  11:33:15  matt
  152.  * Changes in object system
  153.  * 
  154.  * Revision 1.9  1994/01/06  11:56:01  john
  155.  * Made lasers be lines, not purple blobs
  156.  * 
  157.  * Revision 1.8  1994/01/05  10:53:35  john
  158.  * New object code by John.  
  159.  * 
  160.  * Revision 1.7  1993/12/08  14:21:36  john
  161.  * Added ExplodeObject
  162.  * 
  163.  * Revision 1.6  1993/12/08  11:28:54  john
  164.  * Made lasers look like bolts.
  165.  * 
  166.  * Revision 1.5  1993/12/01  13:12:40  john
  167.  * made lasers frame-rate independant
  168.  * 
  169.  * Revision 1.4  1993/11/30  19:00:42  john
  170.  * lasers working kinda
  171.  * 
  172.  * Revision 1.3  1993/11/29  19:44:53  john
  173.  * *** empty log message ***
  174.  * 
  175.  * Revision 1.2  1993/11/29  17:44:55  john
  176.  * *** empty log message ***
  177.  * 
  178.  * Revision 1.1  1993/11/29  17:19:19  john
  179.  * Initial revision
  180.  * 
  181.  * 
  182.  */
  183.  
  184. #ifndef _LASER_H
  185. #define _LASER_H
  186.  
  187. #define    CONCUSSION_ID    8
  188. #define    FLARE_ID            9                            //    NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
  189. #define    LASER_ID            10
  190. #define    VULCAN_ID        11                            //    NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
  191. #define    XSPREADFIRE_ID    12                            //    NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
  192. #define    PLASMA_ID        13                            //    NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
  193. #define    FUSION_ID        14                            //    NOTE: This MUST correspond to the ID generated at bitmaps.tbl read time.
  194. #define    HOMING_ID        15
  195. #define    PROXIMITY_ID    16
  196. #define    SMART_ID            17
  197. #define    MEGA_ID            18
  198. #define    PLAYER_SMART_HOMING_ID 19
  199. #define    SPREADFIRE_ID    20
  200. #define    SUPER_MECH_MISS    21
  201. #define    REGULAR_MECH_MISS    22
  202. #define    SILENT_SPREADFIRE_ID    23
  203. #define    ROBOT_SMART_HOMING_ID 29
  204.  
  205. // These are new defines for the value of 'flags' passed to do_laser_firing.
  206. // The purpose is to collect other flags like QUAD_LASER and Spreadfire_toggle
  207. // into a single 8-bit quantity so it can be easily used in network mode.
  208.  
  209. #define LASER_QUAD 1
  210. #define LASER_SPREADFIRE_TOGGLED 2
  211.  
  212. #define MAX_LASER_LEVEL        3        //    Note, laser levels are numbered from 0.
  213. #define MAX_LASER_BITMAPS    6
  214.  
  215. //    For muzzle firing casting light.
  216. #define    MUZZLE_QUEUE_MAX    8
  217.  
  218. //    Constants governing homing missile behavior.
  219. //    MIN_TRACKABLE_DOT gets inversely scaled by FrameTime and stuffed in Min_trackable_dot
  220. #define    MIN_TRACKABLE_DOT                    (3*F1_0/4)
  221. #define    MAX_TRACKABLE_DIST                (F1_0*250)
  222. #define    HOMING_MISSILE_STRAIGHT_TIME    (F1_0/8)            //    Changed as per request of John, Adam, Yuan, but mostly John
  223.  
  224. extern fix Min_trackable_dot;                //    MIN_TRACKABLE_DOT inversely scaled by FrameTime
  225.  
  226. void Laser_render( object *obj );
  227. void Laser_player_fire( object * obj, int type, int gun_num, int make_sound, int harmless_flag );
  228. void Laser_player_fire_spread(object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless);
  229. void Laser_do_weapon_sequence( object *obj );
  230. void Flare_create(object *obj);
  231. int laser_are_related( int o1, int o2 );
  232.  
  233. extern int do_laser_firing_player(void);
  234. extern void do_missile_firing(void);
  235. extern void net_missile_firing(int player, int weapon, int flags);
  236.  
  237. int Laser_create_new( vms_vector * direction, vms_vector * position, int segnum, int parent, int type, int make_sound );
  238.  
  239. //    Fires a laser-type weapon (a Primary weapon)
  240. //    Fires from object objnum, weapon type weapon_id.
  241. //    Assumes that it is firing from a player object, so it knows which gun to fire from.
  242. //    Returns the number of shots actually fired, which will typically be 1, but could be
  243. //    higher for low frame rates when rapidfire weapons, such as vulcan or plasma are fired.
  244. extern int do_laser_firing(int objnum, int weapon_id, int level, int flags, int nfires);
  245.  
  246. //    Easier to call than Laser_create_new because it determines the segment containing the firing point
  247. //    and deals with it being stuck in an object or through a wall.
  248. //    Fires a laser of type "weapon_type" from an object (parent) in the direction "direction" from the position "position"
  249. //    Returns object number of laser fired or -1 if not possible to fire laser.
  250. int Laser_create_new_easy( vms_vector * direction, vms_vector * position, int parent, int weapon_type, int make_sound );
  251.  
  252. extern void create_smart_children(object *objp);
  253. extern int object_to_object_visibility(object *obj1, object *obj2, int trans_type);
  254.  
  255. extern int        Muzzle_queue_index;
  256.  
  257. typedef struct muzzle_info {
  258.     fix            create_time;
  259.     short            segnum;
  260.     vms_vector    pos;
  261. }    muzzle_info;
  262.  
  263. extern muzzle_info        Muzzle_data[MUZZLE_QUEUE_MAX];
  264.  
  265.  
  266. #endif
  267.  
  268. 
  269.