]> icculus.org git repositories - btb/d2x.git/blob - main/hostage.c
draw behind the shield number properly in OpenGL
[btb/d2x.git] / main / hostage.c
1 /* $Id: hostage.c,v 1.4 2004-08-28 23:17:45 schaffner Exp $ */
2 /*
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.
13 */
14
15 /*
16  *
17  * Code to render and manipulate hostages
18  *
19  */
20
21 #ifdef HAVE_CONFIG_H
22 #include <conf.h>
23 #endif
24
25 #ifdef RCS
26 static char rcsid[] = "$Id: hostage.c,v 1.4 2004-08-28 23:17:45 schaffner Exp $";
27 #endif
28
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32
33 #include "error.h"
34
35 #include "inferno.h"
36 #include "object.h"
37 #include "game.h"
38 #include "player.h"
39 #include "gauges.h"
40 #include "hostage.h"
41 #include "vclip.h"
42 #include "newdemo.h"
43 #include "text.h"
44
45
46 //------------- Globaly used hostage variables --------------------------------
47
48 int N_hostage_types = 0;                                        // Number of hostage types
49 int Hostage_vclip_num[MAX_HOSTAGE_TYPES];       // vclip num for each tpye of hostage
50
51
52 //-------------- Renders a hostage --------------------------------------------
53 void draw_hostage(object *obj)
54 {
55         draw_object_tmap_rod(obj, Vclip[obj->rtype.vclip_info.vclip_num].frames[obj->rtype.vclip_info.framenum], 1);
56 }
57
58
59 //------------- Called once when a hostage is rescued -------------------------
60 void hostage_rescue(int blah)
61 {
62         //mprintf((0, "Rescued hostage %d", hostage_number));
63
64         PALETTE_FLASH_ADD(0, 0, 25);            //small blue flash
65
66         Players[Player_num].hostages_on_board++;
67
68         // Do an audio effect
69         if (Newdemo_state != ND_STATE_PLAYBACK)
70                 digi_play_sample(SOUND_HOSTAGE_RESCUED, F1_0);
71
72         HUD_init_message(TXT_HOSTAGE_RESCUED);
73 }