Subversion Repositories Games.Descent

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
/*
2
 * Portions of this file are copyright Rebirth contributors and licensed as
3
 * described in COPYING.txt.
4
 * Portions of this file are copyright Parallax Software and licensed
5
 * according to the Parallax license below.
6
 * See COPYING.txt for license details.
7
 
8
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9
SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
10
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12
IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14
FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
16
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
18
*/
19
 
20
/*
21
 *
22
 * Code to render and manipulate hostages
23
 *
24
 */
25
 
26
#include <stdio.h>
27
#include <stdlib.h>
28
#include <string.h>
29
#include "dxxerror.h"
30
#include "inferno.h"
31
#include "object.h"
32
#include "hudmsg.h"
33
#include "game.h"
34
#include "player.h"
35
#include "gauges.h"
36
#include "hostage.h"
37
#include "vclip.h"
38
#include "newdemo.h"
39
#include "text.h"
40
 
41
 
42
//------------- Globaly used hostage variables --------------------------------
43
 
44
namespace dcx {
45
unsigned N_hostage_types;                                       // Number of hostage types
46
std::array<int, MAX_HOSTAGE_TYPES> Hostage_vclip_num;   // vclip num for each tpye of hostage
47
}
48
 
49
namespace dsx {
50
 
51
//------------- Called once when a hostage is rescued -------------------------
52
void hostage_rescue()
53
{
54
        auto &Objects = LevelUniqueObjectState.Objects;
55
        auto &vmobjptr = Objects.vmptr;
56
        PALETTE_FLASH_ADD(0, 0, 25);            //small blue flash
57
 
58
        auto &player_info = get_local_plrobj().ctype.player_info;
59
        ++player_info.mission.hostages_on_board;
60
 
61
        // Do an audio effect
62
        if (Newdemo_state != ND_STATE_PLAYBACK)
63
                digi_play_sample(SOUND_HOSTAGE_RESCUED, F1_0);
64
 
65
        HUD_init_message_literal(HM_DEFAULT, TXT_HOSTAGE_RESCUED);
66
}
67
 
68
}