1 /* $Id: hostage.c,v 1.3 2003-10-10 09:36:35 btb 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 * Code to render and manipulate hostages
20 * Revision 1.1 1995/05/16 15:26:24 allender
23 * Revision 2.0 1995/02/27 11:28:36 john
24 * New version 2.0, which has no anonymous unions, builds with
25 * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
27 * Revision 1.65 1995/02/22 13:45:54 allender
28 * remove anonymous unions from object structure
30 * Revision 1.64 1995/02/13 20:34:57 john
33 * Revision 1.63 1995/01/15 19:41:48 matt
34 * Ripped out hostage faces for registered version
36 * Revision 1.62 1995/01/14 19:16:53 john
37 * First version of new bitmap paging code.
39 * Revision 1.61 1994/12/19 16:35:09 john
40 * Made hoastage playback end when ship dies.
42 * Revision 1.60 1994/12/06 16:30:41 yuan
45 * Revision 1.59 1994/11/30 17:32:46 matt
46 * Put hostage_face_clip array back in so editor would work
48 * Revision 1.58 1994/11/30 17:22:13 matt
49 * Ripped out hostage faces in shareware version
51 * Revision 1.57 1994/11/30 16:11:25 matt
52 * Use correct constant for hostage voice
54 * Revision 1.56 1994/11/27 23:15:19 matt
55 * Made changes for new mprintf calling convention
57 * Revision 1.55 1994/11/19 19:53:44 matt
58 * Added code to full support different hostage head clip & message for
61 * Revision 1.54 1994/11/19 16:35:15 matt
62 * Got rid of unused code, & made an array smaller
64 * Revision 1.53 1994/11/14 12:42:03 matt
65 * Increased palette flash when hostage rescued
67 * Revision 1.52 1994/10/28 14:43:09 john
68 * Added sound volumes to all sound calls.
70 * Revision 1.51 1994/10/23 02:10:57 matt
71 * Got rid of obsolete hostage_info stuff
73 * Revision 1.50 1994/10/22 00:08:44 matt
74 * Fixed up problems with bonus & game sequencing
75 * Player doesn't get credit for hostages unless he gets them out alive
77 * Revision 1.49 1994/10/20 22:52:49 matt
78 * Fixed compiler warnings
80 * Revision 1.48 1994/10/20 21:25:44 matt
81 * Took out silly scale down/scale up code for hostage anim
83 * Revision 1.47 1994/10/20 12:47:28 matt
84 * Replace old save files (MIN/SAV/HOT) with new LVL files
86 * Revision 1.46 1994/10/04 15:33:33 john
87 * Took out the old PLAY_SOUND??? code and replaced it
88 * with direct calls into digi_link_??? so that all sounds
91 * Revision 1.45 1994/09/28 23:10:46 matt
92 * Made hostage rescue do palette flash
94 * Revision 1.44 1994/09/20 00:11:00 matt
95 * Finished gauges for Status Bar, including hostage video display.
97 * Revision 1.43 1994/09/15 21:24:19 matt
98 * Changed system to keep track of whether & what cockpit is up
99 * Made hostage clip not queue when no cockpit
102 * Revision 1.42 1994/08/25 13:45:19 matt
103 * Made hostage vclips queue
105 * Revision 1.41 1994/08/14 23:15:06 matt
106 * Added animating bitmap hostages, and cleaned up vclips a bit
108 * Revision 1.40 1994/08/12 22:41:11 john
109 * Took away Player_stats; add Players array.
111 * Revision 1.39 1994/07/14 22:06:35 john
112 * Fix radar/hostage vclip conflict.
114 * Revision 1.38 1994/07/12 18:40:21 yuan
115 * Tweaked location of radar and hostage screen...
119 * Revision 1.37 1994/07/07 09:52:17 john
120 * Moved hostage screen.
122 * Revision 1.36 1994/07/06 15:23:52 john
123 * Revamped hostage sound.
125 * Revision 1.35 1994/07/06 15:14:54 john
126 * Added hostage sound effect picking.
128 * Revision 1.34 1994/07/06 13:25:33 john
129 * Added compress hostages functions.
131 * Revision 1.33 1994/07/06 12:52:59 john
132 * Fixed compiler warnings.
134 * Revision 1.32 1994/07/06 12:43:50 john
135 * Made generic messages for hostages.
137 * Revision 1.31 1994/07/06 10:55:07 john
138 * New structures for hostages.
140 * Revision 1.30 1994/07/05 12:49:09 john
141 * Put functionality of New Hostage spec into code.
143 * Revision 1.29 1994/07/02 13:08:47 matt
144 * Increment stats when hostage rescued
146 * Revision 1.28 1994/07/01 18:07:46 john
149 * Revision 1.27 1994/07/01 18:07:03 john
150 * *** empty log message ***
152 * Revision 1.26 1994/07/01 17:55:26 john
153 * First version of not-working hostage system.
155 * Revision 1.25 1994/06/27 15:53:21 john
156 * #define'd out the newdemo stuff
159 * Revision 1.24 1994/06/20 16:08:52 john
160 * Added volume control; made doors 3d sounds.
162 * Revision 1.23 1994/06/16 10:15:32 yuan
163 * Fixed location of face.
165 * Revision 1.22 1994/06/15 15:05:33 john
166 * *** empty log message ***
168 * Revision 1.21 1994/06/14 21:15:20 matt
169 * Made rod objects draw lighted or not depending on a parameter, so the
170 * materialization effect no longer darkens.
172 * Revision 1.20 1994/06/08 18:16:26 john
173 * Bunch of new stuff that basically takes constants out of the code
174 * and puts them into bitmaps.tbl.
176 * Revision 1.19 1994/06/02 19:30:08 matt
177 * Moved texture-mapped rod drawing stuff (used for hostage & now for the
178 * materialization center) to object.c
188 static char rcsid[] = "$Id: hostage.c,v 1.3 2003-10-10 09:36:35 btb Exp $";
208 //------------- Globaly used hostage variables --------------------------------
210 int N_hostage_types = 0; // Number of hostage types
211 int Hostage_vclip_num[MAX_HOSTAGE_TYPES]; // vclip num for each tpye of hostage
214 //-------------- Renders a hostage --------------------------------------------
215 void draw_hostage(object *obj)
217 draw_object_tmap_rod(obj, Vclip[obj->rtype.vclip_info.vclip_num].frames[obj->rtype.vclip_info.framenum], 1);
221 //------------- Called once when a hostage is rescued -------------------------
222 void hostage_rescue(int blah)
224 //mprintf((0, "Rescued hostage %d", hostage_number));
226 PALETTE_FLASH_ADD(0, 0, 25); //small blue flash
228 Players[Player_num].hostages_on_board++;
230 // Do an audio effect
231 if (Newdemo_state != ND_STATE_PLAYBACK)
232 digi_play_sample(SOUND_HOSTAGE_RESCUED, F1_0);
234 HUD_init_message(TXT_HOSTAGE_RESCUED);