| 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 "inferno.h" |
| 30 |
#include "object.h" |
| 31 |
#include "hudmsg.h" |
| 32 |
#include "game.h" |
| 33 |
#include "player.h" |
| 34 |
#include "hostage.h" |
| 35 |
#include "newdemo.h" |
| 36 |
#include "text.h" |
| 37 |
#include "d_levelstate.h" |
| 38 |
#include "digi.h" |
| 39 |
|
| 40 |
//------------- Globaly used hostage variables -------------------------------- |
| 41 |
|
| 42 |
namespace dcx { |
| 43 |
unsigned N_hostage_types; // Number of hostage types |
| 44 |
std::array<vclip_index, MAX_HOSTAGE_TYPES> Hostage_vclip_num; // vclip num for each tpye of hostage |
| 45 |
} |
| 46 |
|
| 47 |
namespace dsx { |
| 48 |
|
| 49 |
//------------- Called once when a hostage is rescued ------------------------- |
| 50 |
void hostage_rescue() |
| 51 |
{ |
| 52 |
auto &Objects = LevelUniqueObjectState.Objects; |
| 53 |
auto &vmobjptr = Objects.vmptr; |
| 54 |
PALETTE_FLASH_ADD(0, 0, 25); //small blue flash |
| 55 |
|
| 56 |
auto &player_info = get_local_plrobj().ctype.player_info; |
| 57 |
++player_info.mission.hostages_on_board; |
| 58 |
|
| 59 |
// Do an audio effect |
| 60 |
if (Newdemo_state != ND_STATE_PLAYBACK) |
| 61 |
digi_play_sample(sound_effect::SOUND_HOSTAGE_RESCUED, F1_0); |
| 62 |
|
| 63 |
const auto &&m = TXT_HOSTAGE_RESCUED; |
| 64 |
HUD_init_message_literal(HM_DEFAULT, std::span<const char>(m, strlen(m))); |
| 65 |
} |
| 66 |
|
| 67 |
} |