diff options
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/detection.cpp | 183 | ||||
-rw-r--r-- | engines/drascula/drascula.cpp | 6859 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 702 | ||||
-rw-r--r-- | engines/drascula/module.mk | 14 | ||||
-rw-r--r-- | engines/drascula/texts.h | 753 |
5 files changed, 8511 insertions, 0 deletions
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp new file mode 100644 index 0000000000..d875a52d71 --- /dev/null +++ b/engines/drascula/detection.cpp @@ -0,0 +1,183 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" + +#include "base/plugins.h" + +#include "common/advancedDetector.h" +#include "common/file.h" + +#include "drascula/drascula.h" + + +namespace Drascula { + +struct DrasculaGameDescription { + Common::ADGameDescription desc; + + int gameID; + int gameType; + uint32 features; + uint16 version; +}; + +uint32 DrasculaEngine::getGameID() const { + return _gameDescription->gameID; +} + +uint32 DrasculaEngine::getFeatures() const { + return _gameDescription->features; +} + +Common::Platform DrasculaEngine::getPlatform() const { + return _gameDescription->desc.platform; +} + +uint16 DrasculaEngine::getVersion() const { + return _gameDescription->version; +} + +} + +static const PlainGameDescriptor drasculaGames[] = { + {"drascula", "Drascula game"}, + + {0, 0} +}; + + +namespace Drascula { + +static const DrasculaGameDescription gameDescriptions[] = { + + { + // Drascula English version + { + "drascula", + "English", + AD_ENTRY1("14.ald", "09b2735953edcd43af115c65ae00b10e"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + 0, + 0, + 0, + 0, + }, + + { + // Drascula Spanish version + { + "drascula", + "Spanish", + AD_ENTRY1("14.ald", "0746ed1a5cc8d9728f790c29813f4b43"), + Common::ES_ESP, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + 0, + 0, + 0, + 0, + }, + + { AD_TABLE_END_MARKER, 0, 0, 0, 0 } +}; + +/** + * The fallback game descriptor used by the Drascula engine's fallbackDetector. + * Contents of this struct are to be overwritten by the fallbackDetector. + */ +static DrasculaGameDescription g_fallbackDesc = { + { + "", // Not used by the fallback descriptor, it uses the EncapsulatedADGameDesc's gameid + "", // Not used by the fallback descriptor, it uses the EncapsulatedADGameDesc's extra + AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor + Common::UNK_LANG, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + 0, + 0, + 0, + 0, +}; + +Common::EncapsulatedADGameDesc fallbackDetector(const FSList *fslist) { + // Set the default values for the fallback descriptor's ADGameDescription part. + g_fallbackDesc.desc.language = Common::UNK_LANG; + g_fallbackDesc.desc.platform = Common::kPlatformPC; + g_fallbackDesc.desc.flags = Common::ADGF_NO_FLAGS; + + // Set default values for the fallback descriptor's DrasculaGameDescription part. + g_fallbackDesc.gameID = 0; + g_fallbackDesc.features = 0; + g_fallbackDesc.version = 0; + + Common::EncapsulatedADGameDesc result; + + return result; +} + +} // End of namespace Drascula + +static const Common::ADParams detectionParams = { + // Pointer to ADGameDescription or its superset structure + (const byte *)Drascula::gameDescriptions, + // Size of that superset structure + sizeof(Drascula::DrasculaGameDescription), + // Number of bytes to compute MD5 sum for + 5000, + // List of all engine targets + drasculaGames, + // Structure for autoupgrading obsolete targets + 0, + // Name of single gameid (optional) + "drascula", + // List of files for file-based fallback detection (optional) + 0, + // Fallback callback + Drascula::fallbackDetector, + // Flags + Common::kADFlagAugmentPreferredTarget +}; + +ADVANCED_DETECTOR_DEFINE_PLUGIN(DRASCULA, Drascula::DrasculaEngine, detectionParams); + +REGISTER_PLUGIN(DRASCULA, "Drascula Engine", "Drascula Engine (C) 2000 Alcachofa Soft, 1996 (C) Digital Dreams Multimedia, 1994 (C) Emilio de Paz"); + +namespace Drascula { + +bool DrasculaEngine::initGame() { + Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); + _gameDescription = (const DrasculaGameDescription *)(encapsulatedDesc.realDesc); + + return (_gameDescription != 0); +} + +} // End of namespace Drascula + diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp new file mode 100644 index 0000000000..df433e12f0 --- /dev/null +++ b/engines/drascula/drascula.cpp @@ -0,0 +1,6859 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" + +#include "common/events.h" +#include "common/keyboard.h" +#include "common/file.h" +#include "common/savefile.h" +#include "common/config-manager.h" + +#include "base/plugins.h" +#include "base/version.h" + +#include "sound/mixer.h" + +#include "drascula/drascula.h" +#include "drascula/texts.h" + +namespace Drascula { + +struct GameSettings { + const char *gameid; + const char *description; + byte id; + uint32 features; + const char *detectname; +}; + +static const GameSettings drasculaSettings[] = { + {"drascula", "Drascula game", 0, 0, 0}, + + {NULL, NULL, 0, 0, NULL} +}; + +DrasculaEngine::DrasculaEngine(OSystem *syst) : Engine(syst) { + + // Setup mixer + if (!_mixer->isReady()) { + warning("Sound initialization failed."); + } + + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + + const GameSettings *g; + + const char *gameid = ConfMan.get("gameid").c_str(); + for (g = drasculaSettings; g->gameid; ++g) + if (!scumm_stricmp(g->gameid, gameid)) + _gameId = g->id; + + _rnd = new Common::RandomSource(); + + int cd_num = ConfMan.getInt("cdrom"); + if (cd_num >= 0) + _system->openCD(cd_num); +} + +DrasculaEngine::~DrasculaEngine() { + salir_al_dos(0); + + delete _rnd; +} + +static int x_obj[44] = {0, X_OBJ1, X_OBJ2, X_OBJ3, X_OBJ4, X_OBJ5, X_OBJ6, X_OBJ7, X_OBJ8, X_OBJ9, X_OBJ10, + X_OBJ11, X_OBJ12, X_OBJ13, X_OBJ14, X_OBJ15, X_OBJ16, X_OBJ17, X_OBJ18, X_OBJ19, X_OBJ20, + X_OBJ21, X_OBJ22, X_OBJ23, X_OBJ24, X_OBJ25, X_OBJ26, X_OBJ27, X_OBJ28, X_OBJ29, X_OBJ30, + X_OBJ31, X_OBJ32, X_OBJ33, X_OBJ34, X_OBJ35, X_OBJ36, X_OBJ37, X_OBJ38, X_OBJ39, X_OBJ40, + X_OBJ41, X_OBJ42, X_OBJ43}; +static int y_obj[44] = {0, Y_OBJ1, Y_OBJ2, Y_OBJ3, Y_OBJ4, Y_OBJ5, Y_OBJ6, Y_OBJ7, Y_OBJ8, Y_OBJ9, Y_OBJ10, + Y_OBJ11, Y_OBJ12, Y_OBJ13, Y_OBJ14, Y_OBJ15, Y_OBJ16, Y_OBJ17, Y_OBJ18, Y_OBJ19, Y_OBJ20, + Y_OBJ21, Y_OBJ22, Y_OBJ23, Y_OBJ24, Y_OBJ25, Y_OBJ26, Y_OBJ27, Y_OBJ28, Y_OBJ29, Y_OBJ30, + Y_OBJ31, Y_OBJ32, Y_OBJ33, Y_OBJ34, Y_OBJ35, Y_OBJ36, Y_OBJ37, Y_OBJ38, Y_OBJ39, Y_OBJ40, + Y_OBJ41, Y_OBJ42, Y_OBJ43}; +static int x_pol[44] = {0, 1, 42, 83, 124, 165, 206, 247, 83, 1, 206, + 1, 42, 83, 124, 165, 206, 247, 83, 1, 206, + 247, 83, 165, 1, 206, 42, 124, 83, 1, 247, + 83, 165, 1, 206, 42, 124, 83, 1, 247, 42, + 1, 165, 206}; +static int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1, + 27, 27, 27, 27, 27, 27, 27, 1, 1, 27, + 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, + 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, + 27, 1, 1}; +static int x_barra[] = {6, 51, 96, 141, 186, 232, 276, 321}; +static int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120, + 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0, + 40, 80, 120, 160, 200, 240, 0}; +static int y1d_menu[] = {0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, + 50, 50, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 100}; +static int frame_x[20] = {43, 87, 130, 173, 216, 259}; +static int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 }; +static int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 }; +static char mirar_t[3][88] = {TEXT100, TEXT101, TEXT54}; +static char mirar_v[3][14] = {"100.als", "101.als", "54.als"}; +static char poder_t[6][88] = {TEXT11, TEXT109, TEXT111, TEXT110, TEXT115, TEXT116}; +static char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"}; + +int DrasculaEngine::init() { + // Detect game + if (!initGame()) { + GUIErrorMessage("No valid games were found in the specified directory."); + return -1; + } + + // Initialize backend + _system->beginGFXTransaction(); + initCommonGFX(false); + _system->initSize(320, 200); + _system->endGFXTransaction(); + + return 0; +} + + +int DrasculaEngine::go() { + num_ejec = 1; + + for (;;) { + VGA = (byte *)malloc(320 * 200); + memset(VGA, 0, 64000); + + lleva_objeto = 0; + menu_bar = 0; menu_scr = 0; hay_nombre = 0; + frame_y = 0; + hare_x = -1; hare_se_mueve = 0; sentido_hare = 3; num_frame = 0; hare_se_ve = 1; + comprueba_flags = 1; + rompo = 0; rompo2 = 0; + anda_a_objeto = 0; + paso_x = PASO_HARE_X; paso_y = PASO_HARE_Y; + alto_hare = ALTO_PERSONAJE; ancho_hare = ANCHO_PERSONAJE; alto_pies = PIES_HARE; + alto_habla = ALTO_HABLA_HARE; ancho_habla = ANCHO_HABLA_HARE; + hay_respuesta = 0; + conta_ciego_vez = 0; + cambio_de_color = 0; + rompo_y_salgo = 0; + vb_x = 120; sentido_vb = 1; vb_se_mueve = 0; frame_vb = 1; + frame_piano = 0; + frame_borracho = 0; + frame_velas = 0; + cont_sv = 0; + term_int = 0; + cual_ejec = 0; hay_que_load = 0; + corta_musica = 0; + hay_seleccion = 0; + Leng = 0; + UsingMem = 0; + GlobalSpeed = 0; + frame_ciego = 0; + frame_ronquido = 0; + frame_murcielago = 0; + c_mirar = 0; + c_poder = 0; + + asigna_memoria(); + carga_info(); + + lee_dibujos("95.alg"); + descomprime_dibujo(dir_mesa, 1); + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + if (num_ejec == 1) { + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + } else if (num_ejec == 2) { + lee_dibujos("pts.alg"); + descomprime_dibujo(dir_dibujo2, 1); + } + strcpy(nombre_icono[1], "look"); + strcpy(nombre_icono[2], "take"); + strcpy(nombre_icono[3], "open"); + strcpy(nombre_icono[4], "close"); + strcpy(nombre_icono[5], "talk"); + strcpy(nombre_icono[6], "push"); + + paleta_hare(); + if (escoba()) { + salir_al_dos(0); + break; + } + salir_al_dos(0); + } + return 0; +} + +void DrasculaEngine::salir_al_dos(int r) { + if (hay_sb == 1) + ctvd_end(); + borra_pantalla(); + Negro(); + MusicFadeout(); + stopmusic(); + libera_memoria(); + free(VGA); +} + +void DrasculaEngine::asigna_memoria() { + dir_zona_pantalla = (byte *)malloc(64000); + assert(dir_zona_pantalla); + dir_dibujo1 = (byte *)malloc(64000); + assert(dir_dibujo1); + dir_hare_fondo = (byte *)malloc(64000); + assert(dir_hare_fondo); + dir_dibujo3 = (byte *)malloc(64000); + assert(dir_dibujo3); + dir_dibujo2 = (byte *)malloc(64000); + assert(dir_dibujo2); + dir_mesa = (byte *)malloc(64000); + assert(dir_mesa); + dir_hare_dch = (byte *)malloc(64000); + assert(dir_hare_dch); + dir_hare_frente = (byte *)malloc(64000); + assert(dir_hare_frente); +} + +void DrasculaEngine::libera_memoria() { + free(dir_zona_pantalla); + free(dir_dibujo1); + free(dir_hare_fondo); + free(dir_dibujo2); + free(dir_mesa); + free(dir_dibujo3); + free(dir_hare_dch); + free(dir_hare_frente); +} + +void DrasculaEngine::carga_info() { + hay_sb = 1; + con_voces = 0; + hay_que_load = 0; +} + +void DrasculaEngine::lee_dibujos(const char *NamePcc) { + unsigned int con, x = 0; + unsigned int fExit = 0; + byte ch, rep; + Common::File file; + byte *auxPun; + + file.open(NamePcc); + if (!file.isOpen()) + error("missing game data %s %c", NamePcc, 7); + + Buffer_pcx = (byte *)malloc(65000); + auxPun = Buffer_pcx; + file.seek(128); + while (!fExit) { + ch = file.readByte(); + rep = 1; + if ((ch & 192) == 192) { + rep = (ch & 63); + ch = file.readByte(); + } + for (con = 0; con < rep; con++) { + *auxPun++ = ch; + x++; + if (x > 64000) + fExit = 1; + } + } + + file.read(cPal, 768); + file.close(); +} + +void DrasculaEngine::descomprime_dibujo(byte *dir_escritura, int plt) { + memcpy(dir_escritura, Buffer_pcx, 64000); + free(Buffer_pcx); + asigna_rgb((byte *)cPal, plt); + if (plt > 1) + funde_rgb(plt); +} + +void DrasculaEngine::paleta_hare() { + int color, componente; + + for (color = 235; color < 253; color++) + for (componente = 0; componente < 3; componente++) + palHare[color][componente] = palJuego[color][componente]; + +} + +void DrasculaEngine::hare_oscuro() { + int color, componente; + + for (color = 235; color < 253; color++ ) + for (componente = 0; componente < 3; componente++) + palJuego[color][componente] = palHareOscuro[color][componente]; + + ActualizaPaleta(); +} + +void DrasculaEngine::asigna_rgb(byte *dir_lectura, int plt) { + int x, cnt = 0; + + for (x = 0; x < plt; x++) { + palJuego[x][0] = dir_lectura[cnt++] / 4; + palJuego[x][1] = dir_lectura[cnt++] / 4; + palJuego[x][2] = dir_lectura[cnt++] / 4; + } + ActualizaPaleta(); +} + +void DrasculaEngine::funde_rgb(int plt) {} + +void DrasculaEngine::Negro() { + int color, componente; + DacPalette256 palNegra; + + for (color = 0; color < 256; color++) + for (componente = 0; componente < 3; componente++) + palNegra[color][componente] = 0; + + palNegra[254][0] = 0x3F; + palNegra[254][1] = 0x3F; + palNegra[254][2] = 0x15; + + setvgapalette256((byte *)&palNegra); +} + +void DrasculaEngine::ActualizaPaleta() { + setvgapalette256((byte *)&palJuego); +} + +void DrasculaEngine::setvgapalette256(byte *PalBuf) { + byte pal[256 * 4]; + int i; + + for (i = 0; i < 256; i++) { + pal[i * 4 + 0] = PalBuf[i * 3 + 0] * 4; + pal[i * 4 + 1] = PalBuf[i * 3 + 1] * 4; + pal[i * 4 + 2] = PalBuf[i * 3 + 2] * 4; + pal[i * 4 + 3] = 0; + } + _system->setPalette(pal, 0, 256); + _system->updateScreen(); +} + +void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho, + int Alto, byte *Origen, byte *Destino) { + int x; + Destino += xdes + ydes * 320; + Origen += xorg + yorg * 320; + for (x = 0; x < Alto; x++) { + memcpy(Destino, Origen, Ancho); + Destino += 320; + Origen += 320; + } +} + +void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho, + int Alto, byte *Origen, byte *Destino) { + int y, x; + + Destino += xdes + ydes * 320; + Origen += xorg + yorg * 320; + + for (y = 0; y < Alto; y++) + for (x = 0; x < Ancho; x++) + if (Origen[x + y * 320] != 255) + Destino[x + y * 320] = Origen[x + y * 320]; +} + +void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino) { + int y, x; + int xorg = Array[0]; + int yorg = Array[1]; + int xdes = Array[2]; + int ydes = Array[3]; + int Ancho = Array[4]; + int Alto = Array[5]; + + if (ydes < 0) { + yorg += -ydes; + Alto += ydes; + ydes = 0; + } + if (xdes < 0) { + xorg += -xdes; + Ancho += xdes; + xdes = 0; + } + if ((xdes + Ancho) > 319) + Ancho -= (xdes + Ancho) - 320; + if ((ydes + Alto) > 199) + Alto -= (ydes + Alto) - 200; + + Destino += xdes + ydes * 320; + Origen += xorg + yorg * 320; + + for (y = 0; y < Alto; y++) + for (x = 0; x < Ancho; x++) + if (Origen[x + y * 320] != 255) + Destino[x + y * 320] = Origen[x + y * 320]; +} + +void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) { + int x; + byte *ptr = VGA; + + ptr += xdes + ydes * 320; + Buffer += xorg + yorg * 320; + for (x = 0; x < Alto; x++) { + memcpy(ptr, Buffer, Ancho); + ptr += 320; + Buffer += 320; + } + + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + _system->updateScreen(); +} + +bool DrasculaEngine::escoba() { + int soc, l, n; + + dir_texto = dir_mesa; + + musica_antes = -1; + + soc = 0; + for (l = 0; l < 6; l++) { + soc = soc + ANCHO_PERSONAJE; + frame_x[l] = soc; + } + + for (n = 1; n < 43; n++) + objetos_que_tengo[n] = 0; + + for (n = 0; n < NUM_BANDERAS; n++) + flags[n] = 0; + + if (num_ejec == 2) { + flags[16] = 1; + flags[17] = 1; + flags[27] = 1; + } + + for (n = 1; n < 7; n++) + objetos_que_tengo[n] = n; + + if (num_ejec == 1) { + agarra_objeto(28); + buffer_teclado(); + + if (hay_que_load == 0) + animacion_1_1(); + + sin_verbo(); + lee_dibujos("2aux62.alg"); + descomprime_dibujo(dir_dibujo2, 1); + sentido_hare = 1; + obj_saliendo = 104; + if (hay_que_load != 0) + para_cargar(nom_partida); + else { + carga_escoba_1("62.ald"); + hare_x = -20; + hare_y = 56; + lleva_al_hare(65, 145); + } + } else if (num_ejec == 2) { + suma_objeto(28); + buffer_teclado(); + sentido_hare = 3; + obj_saliendo = 162; + if (hay_que_load == 0) + carga_escoba_2("14.ald"); + else + para_cargar(nom_partida); + } + +bucles: + if (hare_se_mueve == 0) { + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + } + if (hare_se_mueve == 0 && anda_a_objeto == 1) { + sentido_hare = sentido_final; + anda_a_objeto = 0; + } + + if (num_ejec == 2) { + if ((!strcmp(num_room, "3.alg")) && (hare_x == 279) && (hare_y + alto_hare == 101)) + animacion_1_2(); + else if ((!strcmp(num_room, "14.alg")) && (hare_x == 214) && (hare_y + alto_hare == 121)) + lleva_al_hare(190, 130); + else if ((!strcmp(num_room, "14.alg")) && (hare_x == 246) && (hare_y + alto_hare == 112)) + lleva_al_hare(190, 130); + } + + mueve_cursor(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (music_status() == 0 && musica_room != 0) + playmusic(musica_room); + + MirarRaton(); + + if (menu_scr == 0 && lleva_objeto == 1) + comprueba_objetos(); + + if (boton_dch == 1 && menu_scr == 1) { + if (num_ejec == 1) + lee_dibujos("99.alg"); + else if (num_ejec == 2) + lee_dibujos(fondo_y_menu); + descomprime_dibujo(dir_hare_fondo, 1); + setvgapalette256((byte *)&palJuego); + menu_scr = 0; + espera_soltar(); + cont_sv = 0; + } + if (boton_dch == 1 && menu_scr == 0) { + hare_se_mueve = 0; + if (sentido_hare == 2) + sentido_hare = 1; + lee_dibujos("icons.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + menu_scr = 1; + espera_soltar(); + sin_verbo(); + cont_sv = 0; + } + + if (boton_izq == 1 && menu_bar == 1) { + elige_en_barra(); + cont_sv = 0; + } else if (boton_izq == 1 && lleva_objeto == 0) { + if (comprueba1()) + return true; + cont_sv = 0; + } else if (boton_izq == 1 && lleva_objeto == 1) { + comprueba2(); + cont_sv = 0; + } + + if (y_raton < 24 && menu_scr == 0) + menu_bar = 1; + else + menu_bar = 0; + + Common::KeyCode key = getscan(); + if (key == Common::KEYCODE_F1 && menu_scr == 0) { + elige_verbo(1); + cont_sv = 0; + } else if (key == Common::KEYCODE_F2 && menu_scr == 0) { + elige_verbo(2); + cont_sv = 0; + } else if (key == Common::KEYCODE_F3 && menu_scr == 0) { + elige_verbo(3); + cont_sv = 0; + } else if (key == Common::KEYCODE_F4 && menu_scr == 0) { + elige_verbo(4); + cont_sv = 0; + } else if (key == Common::KEYCODE_F5 && menu_scr == 0) { + elige_verbo(5); + cont_sv = 0; + } else if (key == Common::KEYCODE_F6 && menu_scr == 0) { + elige_verbo(6); + cont_sv = 0; + } else if (key == Common::KEYCODE_F9) { + mesa(); + cont_sv = 0; + } else if (key == Common::KEYCODE_F10) { + saves(); + cont_sv = 0; + } else if (key == Common::KEYCODE_F8) { + sin_verbo(); + cont_sv = 0; + } else if (key == Common::KEYCODE_v) { + con_voces = 1; + print_abc(SYS2, 96, 86); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(1410); + cont_sv = 0; + } else if (key == Common::KEYCODE_t) { + con_voces = 0; + print_abc(SYS3, 94, 86); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(1460); + cont_sv = 0; + } else if (key == Common::KEYCODE_DELETE) { + confirma_go(); + cont_sv = 0; + } else if (key == Common::KEYCODE_ESCAPE) { + confirma_salir(); + cont_sv = 0; + } else if (cont_sv == 1500) { + salva_pantallas(); + cont_sv = 0; + } else + cont_sv++; + goto bucles; +} + +void DrasculaEngine::agarra_objeto(int objeto) { + lee_dibujos("icons.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + elige_objeto(objeto); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); +} + +void DrasculaEngine::elige_objeto(int objeto) { + if (lleva_objeto == 1 && menu_scr == 0) + suma_objeto(objeto_que_lleva); + DIBUJA_FONDO(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3); + lleva_objeto = 1; + objeto_que_lleva = objeto; +} + +int DrasculaEngine::resta_objeto(int osj) { + int h, q = 0; + + for (h = 1; h < 43; h++) { + if (objetos_que_tengo[h] == osj) { + objetos_que_tengo[h] = 0; + q = 1; + break; + } + } + + if (q == 1) + return 0; + else + return 1; +} + +void DrasculaEngine::animacion_1_1() { + int l, l2, p; + int pos_pixel[6]; + + while (term_int == 0) { + playmusic(29); + fliplay("logoddm.bin", 9); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + delay(600); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + delay(340); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + playmusic(26); + delay(500); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + fliplay("logoalc.bin", 8); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + lee_dibujos("cielo.alg"); + descomprime_dibujo(dir_zona_pantalla, 256); + Negro(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(2); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + delay(900); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + color_abc(ROJO); + centra_texto("Transilvanya, 1993 d.c.", 160, 100); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + delay(1000); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + delay(1200); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + fliplay("scrollb.bin", 9); + + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + comienza_sound("s5.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("scr2.bin", 17); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + fin_sound_corte(); + anima("scr3.bin", 17); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lee_dibujos("cielo2.alg"); + descomprime_dibujo(dir_zona_pantalla, 256); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + FundeAlNegro(1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("103.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("104.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("aux104.alg"); + descomprime_dibujo(dir_dibujo2, 1); + + playmusic(4); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + delay(400); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + for (l2 = 0; l2 < 3; l2++) + for (l = 0; l < 7; l++) { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_FONDO(interf_x[l], interf_y[l], 156, 45, 63, 31, dir_dibujo2, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (getscan() == Common::KEYCODE_ESCAPE) { + term_int = 1; + break; + } + pausa(3); + } + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + l2 = 0; p = 0; + pos_pixel[3] = 45; + pos_pixel[4] = 63; + pos_pixel[5] = 31; + + for (l = 0; l < 180; l++) { + DIBUJA_FONDO(0, 0, 320 - l, 0, l, 200, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(l, 0, 0, 0, 320 - l, 200, dir_dibujo1, dir_zona_pantalla); + + pos_pixel[0] = interf_x[l2]; + pos_pixel[1] = interf_y[l2]; + pos_pixel[2] = 156 - l; + + DIBUJA_BLOQUE_CUT(pos_pixel, dir_dibujo2, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + p++; + if (p == 6) { + p = 0; + l2++; + } + if (l2 == 7) + l2 = 0; + if (getscan() == Common::KEYCODE_ESCAPE) { + term_int = 1; + break; + } + } + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1); + + habla_dr_grande(TEXTD1, "D1.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + borra_pantalla(); + + lee_dibujos("100.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("auxigor.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("auxdr.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + sentido_dr = 0; + x_dr = 129; + y_dr = 95; + sentido_igor = 1; + x_igor = 66; + y_igor = 97; + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_igor_dch(TEXTI8, "I8.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_dr_izq(TEXTD2, "d2.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_dr_izq(TEXTD3, "d3.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("lib.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("lib2.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + color_solo = ROJO; + lee_dibujos("plan1.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(10); + habla_solo(TEXTD4,"d4.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lee_dibujos("plan1.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_solo(TEXTD5, "d5.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("lib2.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + lee_dibujos("plan2.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(20); + habla_solo(TEXTD6, "d6.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("lib2.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + lee_dibujos("plan3.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(20); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_solo(TEXTD7, "d7.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lee_dibujos("plan3.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_solo(TEXTD8, "d8.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + lee_dibujos("100.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + MusicFadeout(); + stopmusic(); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_dch(TEXTI9, "I9.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_dr_izq(TEXTD9, "d9.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_dch(TEXTI10, "I10.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + playmusic(11); + habla_dr_izq(TEXTD10, "d10.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("rayo1.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + comienza_sound("s5.als"); + anima("rayo2.bin", 15); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("frel2.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("frel.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("frel.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + fin_sound_corte(); + borra_pantalla(); + Negro(); + playmusic(23); + FundeDelNegro(0); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_dr = 1; + habla_igor_dch(TEXTI1, "I1.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_dr_dch(TEXTD11, "d11.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_dr = 3; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(1); + sentido_dr = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_dr_izq(TEXTD12, "d12.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_dr = 3; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(1); + sentido_dr = 1; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_igor_dch(TEXTI2, "I2.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + pausa(13); + habla_dr_dch(TEXTD13,"d13.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_dr = 3; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(1); + sentido_dr = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_dr_izq(TEXTD14, "d14.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_dch(TEXTI3, "I3.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_dr_izq(TEXTD15, "d15.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_dch(TEXTI4, "I4.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_dr_izq(TEXTD16, "d16.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_dch(TEXTI5, "I5.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_igor = 3; + habla_dr_izq(TEXTD17, "d17.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + pausa(18); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_igor_frente(TEXTI6, "I6.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + FundeAlNegro(0); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + + playmusic(2); + pausa(5); + fliplay("intro.bin", 12); + term_int = 1; + } + borra_pantalla(); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); +} + +bool DrasculaEngine::animacion_2_1() { + int l; + + lleva_al_hare(231, 91); + hare_se_ve = 0; + + term_int = 0; + + for (;;) { + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + anima("ag.bin", 14); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + lee_dibujos("an11y13.alg"); + descomprime_dibujo(dir_hare_dch, 1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + habla_tabernero(TEXTT22, "T22.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + pausa(4); + comienza_sound("s1.als"); + hipo(18); + fin_sound(); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + borra_pantalla(); + stopmusic(); + corta_musica = 1; + memset(dir_zona_pantalla, 0, 64000); + color_solo = BLANCO; + pausa(80); + + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_solo(TEXTBJ1, "BJ1.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + lee_dibujos("bj.alg"); + descomprime_dibujo(dir_zona_pantalla, MEDIA); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + Negro(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + color_solo = AMARILLO; + habla_solo(TEXT214, "214.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + borra_pantalla(); + + lee_dibujos("16.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lee_dibujos("auxbj.alg"); + descomprime_dibujo(dir_dibujo3, 1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + strcpy(num_room,"16.alg"); + + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + for (l = 0; l < 200; l++) + factor_red[l] = 99; + x_bj = 170; + y_bj = 90; + sentido_bj = 0; + hare_x = 91; + hare_y = 95; + sentido_hare = 1; + hare_se_ve = 1; + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + lee_dibujos("97g.alg"); + descomprime_dibujo(dir_hare_dch, 1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + anima("lev.bin", 15); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + + lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_hare = 1; + hare_x = 100; + hare_y = 95; + + habla_bj(TEXTBJ2, "BJ2.als"); + hablar(TEXT215, "215.als"); + habla_bj(TEXTBJ3, "BJ3.als"); + hablar(TEXT216, "216.als"); + habla_bj(TEXTBJ4, "BJ4.als"); + habla_bj(TEXTBJ5, "BJ5.als"); + habla_bj(TEXTBJ6, "BJ6.als"); + hablar(TEXT217, "217.als"); + habla_bj(TEXTBJ7, "BJ7.als"); + hablar(TEXT218, "218.als"); + habla_bj(TEXTBJ8, "BJ8.als"); + hablar(TEXT219, "219.als"); + habla_bj(TEXTBJ9, "BJ9.als"); + hablar(TEXT220, "220.als"); + hablar(TEXT221, "221.als"); + habla_bj(TEXTBJ10, "BJ10.als"); + hablar(TEXT222, "222.als"); + anima("gaf.bin", 15); + anima("bjb.bin", 14); + playmusic(9); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lee_dibujos("97.alg"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + descomprime_dibujo(dir_hare_dch, 1); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + pausa(120); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_solo(TEXT223, "223.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + color_solo = BLANCO; + refresca_pantalla(); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(110); + habla_solo(TEXTBJ11, "BJ11.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + refresca_pantalla(); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + pausa(118); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + lleva_al_hare(132, 97 + alto_hare); + pausa(60); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + hablar(TEXT224, "224.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + habla_bj(TEXTBJ12, "BJ12.als"); + lleva_al_hare(157, 98 + alto_hare); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + anima("bes.bin", 16); + playmusic(11); + anima("rap.bin", 16); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_hare = 3; + strcpy(num_room, "no_bj.alg"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + pausa(8); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hablar(TEXT225, "225.als"); + pausa(76); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + sentido_hare = 1; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hablar(TEXT226, "226.als"); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(30); + if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) + break; + hablar(TEXT227,"227.als"); + FundeAlNegro(0); + break; + } + + num_ejec = 2; + return true; +} + +void DrasculaEngine::sin_verbo() { + int c = 171; + if (menu_scr == 1) + c = 0; + if (lleva_objeto == 1) + suma_objeto(objeto_que_lleva); + DIBUJA_FONDO(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3); + + lleva_objeto = 0; + hay_nombre = 0; +} + +void DrasculaEngine::para_cargar(char nom_game[]) { + musica_antes = musica_room; + menu_scr = 0; + if (num_ejec == 2) + borra_pantalla(); + carga_partida(nom_game); + if (num_ejec == 1) { + carga_escoba_1(datos_actuales); + } else if (num_ejec == 2) { + ald->close(); + carga_escoba_2(datos_actuales); + } + sin_verbo(); +} + +static char *getLine(Common::File *fp, char *buf, int len) { + int c; + char *b; + + for (;;) { + b = buf; + while (!fp->eos()) { + c = fp->readByte() ^ 0xff; + if (c == '\r') + continue; + if (c == '\n') + break; + if (b - buf >= (len - 1)) + break; + *b++ = c; + } + *b = '\0'; + if (fp->eos() && b == buf) + return NULL; + if (b != buf) + break; + } + return buf; +} + +void DrasculaEngine::carga_escoba_1(const char *nom_fich) { + int l, obj_salir; + float chiquez, pequegnez = 0; + char para_codificar[13]; + char buffer[256]; + + hay_nombre = 0; + + strcpy(para_codificar, nom_fich); + canal_p(para_codificar); + strcpy(datos_actuales, nom_fich); + + buffer_teclado(); + + ald = new Common::File; + ald->open(nom_fich); + if (!ald->isOpen()) { + error("missing data file"); + } + int size = ald->size(); + + getLine(ald, buffer, size); + sscanf(buffer, "%s", num_room); + strcat(num_room, ".alg"); + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &musica_room); + getLine(ald, buffer, size); + sscanf(buffer, "%s", pantalla_disco); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &nivel_osc); + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &objs_room); + + for (l = 0; l < objs_room; l++) { + getLine(ald, buffer, size); + sscanf(buffer, "%d", &num_obj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%s", nombre_obj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x1[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y1[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x2[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y2[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sitiobj_x[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sitiobj_y[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sentidobj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &visible[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &espuerta[l]); + if (espuerta[l] != 0) { + getLine(ald, buffer, size); + sscanf(buffer, "%s", alapantallakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x_alakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y_alakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sentido_alkeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &alapuertakeva[l]); + puertas_cerradas(l); + } + } + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_x1); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_y1); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_x2); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_y2); + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &lejos); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &cerca); + delete ald; + + canal_p(para_codificar); + + for (l = 0; l < objs_room; l++) { + if (num_obj[l] == obj_saliendo) + obj_salir = l; + } + + lee_dibujos(pantalla_disco); + descomprime_dibujo(dir_dibujo3, 1); + + lee_dibujos(num_room); + descomprime_dibujo(dir_dibujo1, MEDIA); + + DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); + + color_hare(); + if (nivel_osc != 0) + funde_hare(nivel_osc); + paleta_hare_claro(); + color_hare(); + funde_hare(nivel_osc + 2); + paleta_hare_oscuro(); + + hare_claro(); + cambio_de_color = -1; + + for (l = 0; l <= suelo_y1; l++) + factor_red[l] = lejos; + for (l = suelo_y1; l <= 201; l++) + factor_red[l] = cerca; + + chiquez = (float)(cerca-lejos) / (float)(suelo_y2 - suelo_y1); + for (l = suelo_y1; l <= suelo_y2; l++) { + factor_red[l] = (int)(lejos + pequegnez); + pequegnez = pequegnez + chiquez; + } + + if (hare_x == -1) { + hare_x = x_alakeva[obj_salir]; + hare_y = y_alakeva[obj_salir]; + alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; + ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; + hare_y = hare_y - alto_hare; + } else { + alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; + ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; + } + hare_se_mueve = 0; + + actualiza_datos(); + + espuerta[7] = 0; + + if (musica_antes != musica_room) + playmusic(musica_room); + refresca_pantalla(); +} + +void DrasculaEngine::carga_escoba_2(const char *nom_fich) { + int soc, l, martin, obj_salir; + char pant1[20], pant2[20], pant3[20], pant4[20]; + char para_codificar[20]; + char buffer[256]; + + hay_nombre = 0; + + strcpy(para_codificar, nom_fich); + canal_p(para_codificar); + strcpy(datos_actuales, nom_fich); + + buffer_teclado(); + + ald = new Common::File; + ald->open(nom_fich); + if (!ald->isOpen()) { + error("missing data file"); + } + int size = ald->size(); + + getLine(ald, buffer, size); + sscanf(buffer, "%s", num_room); + strcat(num_room, ".alg"); + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &musica_room); + getLine(ald, buffer, size); + sscanf(buffer, "%s", pantalla_disco); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &nivel_osc); + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &martin); + if (martin == 0) + goto martini; + ancho_hare = martin; + getLine(ald, buffer, size); + sscanf(buffer, "%d",&alto_hare); + getLine(ald, buffer, size); + sscanf(buffer, "%d",&alto_pies); + getLine(ald, buffer, size); + sscanf(buffer, "%d",&paso_x); + getLine(ald, buffer, size); + sscanf(buffer, "%d",&paso_y); + + getLine(ald, buffer, size); + sscanf(buffer, "%s",pant1); + getLine(ald, buffer, size); + sscanf(buffer, "%s",pant2); + getLine(ald, buffer, size); + sscanf(buffer, "%s",pant3); + getLine(ald, buffer, size); + sscanf(buffer, "%s",pant4); + + lee_dibujos(pant2); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos(pant1); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos(pant4); + descomprime_dibujo(dir_hare_fondo, 1); + + strcpy(fondo_y_menu, pant4); + +martini: + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &objs_room); + + for (l = 0; l < objs_room; l++) { + getLine(ald, buffer, size); + sscanf(buffer, "%d", &num_obj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%s", nombre_obj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x1[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y1[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x2[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y2[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sitiobj_x[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sitiobj_y[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sentidobj[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &visible[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &espuerta[l]); + if (espuerta[l] != 0) { + getLine(ald, buffer, size); + sscanf(buffer, "%s", alapantallakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &x_alakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &y_alakeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &sentido_alkeva[l]); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &alapuertakeva[l]); + puertas_cerradas(l); + } + } + + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_x1); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_y1); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_x2); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &suelo_y2); + + delete ald; + + canal_p(para_codificar); + + if (martin == 0) { + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + alto_hare = ALTO_PERSONAJE; + ancho_hare = ANCHO_PERSONAJE; + alto_pies = PIES_HARE; + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + strcpy(fondo_y_menu,"99.alg"); + } + + for (l = 0; l < objs_room; l++) { + if (num_obj[l] == obj_saliendo) + obj_salir = l; + } + + if (hare_x == -1) { + hare_x = x_alakeva[obj_salir]; + hare_y = y_alakeva[obj_salir] - alto_hare; + } + hare_se_mueve = 0; + + lee_dibujos(pantalla_disco); + descomprime_dibujo(dir_dibujo3, 1); + + lee_dibujos(num_room); + descomprime_dibujo(dir_dibujo1, MEDIA); + + DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); + + color_hare(); + if (nivel_osc != 0) + funde_hare(nivel_osc); + paleta_hare_claro(); + color_hare(); + funde_hare(nivel_osc + 2); + paleta_hare_oscuro(); + + hare_claro(); + cambio_de_color = -1; + + color_abc(VERDE_CLARO); + + soc = 0; + for (l = 0; l < 6; l++) { + soc = soc + ancho_hare; + frame_x[l] = soc; + } + + actualiza_datos(); + + if (!strcmp(num_room, "14.alg") && flags[39] == 1) + musica_room = 16; + else if (!strcmp(num_room, "15.alg") && flags[39] == 1) + musica_room = 16; + if (!strcmp(num_room, "14.alg") && flags[5]==1) + musica_room = 0; + else if (!strcmp(num_room, "15.alg") && flags[5] == 1) + musica_room = 0; + + if (musica_antes != musica_room && musica_room != 0) + playmusic(musica_room); + if (musica_room == 0) + stopmusic(); + + if ((!strcmp(num_room, "9.alg")) || (strcmp(num_room, "2.alg")) + || (!strcmp(num_room, "14.alg")) || (!strcmp(num_room, "18.alg"))) + conta_ciego_vez = vez(); + + refresca_pantalla(); +} + +void DrasculaEngine::borra_pantalla() { + memset(VGA, 0, 64000); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + _system->updateScreen(); +} + +void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) { + sitio_x = punto_x; + sitio_y = punto_y; + empieza_andar(); + + for(;;) { + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (hare_se_mueve == 0) + break; + } + + if (anda_a_objeto == 1) { + anda_a_objeto = 0; + sentido_hare = sentido_final; + } + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::mueve_cursor() { + int pos_cursor[8]; + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + pon_hare(); + actualiza_refresco(); + + if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) { + if (_color != ROJO && menu_scr == 0) + color_abc(ROJO); + } else if (menu_scr == 0 && _color != VERDE_CLARO) + color_abc(VERDE_CLARO); + if (hay_nombre == 1 && menu_scr == 0) + centra_texto(texto_nombre, x_raton, y_raton); + if (menu_scr == 1) + menu_sin_volcar(); + else if (menu_bar == 1) + barra_menu(); + + pos_cursor[0] = 0; + pos_cursor[1] = 0; + pos_cursor[2] = x_raton - 20; + pos_cursor[3] = y_raton - 17; + pos_cursor[4] = ANCHOBJ; + pos_cursor[5] = ALTOBJ; + DIBUJA_BLOQUE_CUT(pos_cursor, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::comprueba_objetos() { + int l, veo = 0; + + for (l = 0; l < objs_room; l++) { + if (x_raton > x1[l] && y_raton > y1[l] + && x_raton < x2[l] && y_raton < y2[l] + && visible[l] == 1 && espuerta[l] == 0) { + strcpy(texto_nombre, nombre_obj[l]); + hay_nombre = 1; + veo = 1; + } + } + + if (num_ejec == 1) + if (x_raton > hare_x + 2 && y_raton > hare_y + 2 + && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2 && veo == 0) { + strcpy(texto_nombre, "hacker"); + hay_nombre = 1; + veo = 1; + } + else if (num_ejec == 2) + if (x_raton > hare_x + 2 && y_raton > hare_y + 2 + && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2) { + strcpy(texto_nombre, "hacker"); + hay_nombre = 1; + veo = 1; + } + + if (veo == 0) + hay_nombre = 0; +} + +void DrasculaEngine::espera_soltar() { + update_events(); +} + +void DrasculaEngine::MirarRaton() { + update_events(); +} + +void DrasculaEngine::elige_en_barra() { + int n, num_verbo = -1; + + for (n = 0; n < 7; n++) + if (x_raton > x_barra[n] && x_raton < x_barra[n + 1]) + num_verbo = n; + + if (num_verbo < 1) + sin_verbo(); + else + elige_verbo(num_verbo); +} + +bool DrasculaEngine::comprueba1() { + int l; + + if (menu_scr == 1) + saca_objeto(); + else { + for (l = 0; l < objs_room; l++) { + if (x_raton >= x1[l] && y_raton >= y1[l] + && x_raton <= x2[l] && y_raton <= y2[l] && rompo == 0) { + if (sal_de_la_habitacion(l)) + return true; + if (rompo == 1) + break; + } + } + + if (x_raton > hare_x && y_raton > hare_y + && x_raton < hare_x + ancho_hare && y_raton < hare_y + alto_hare) + rompo = 1; + + for (l = 0; l < objs_room; l++) { + if (x_raton > x1[l] && y_raton > y1[l] + && x_raton < x2[l] && y_raton < y2[l] && rompo == 0) { + sitio_x = sitiobj_x[l]; + sitio_y = sitiobj_y[l]; + sentido_final = sentidobj[l]; + rompo = 1; + anda_a_objeto = 1; + empieza_andar(); + } + } + + if (rompo == 0) { + sitio_x = x_raton; + sitio_y = y_raton; + + if (sitio_x < suelo_x1) + sitio_x = suelo_x1; + if (sitio_x > suelo_x2) + sitio_x = suelo_x2; + if (sitio_y < suelo_y1 + alto_pies) + sitio_y = suelo_y1 + alto_pies; + if (sitio_y > suelo_y2) + sitio_y = suelo_y2; + + empieza_andar(); + } + rompo = 0; + } + + return false; +} + +void DrasculaEngine::comprueba2() { + int l; + + if (menu_scr == 1) + coge_objeto(); + else { + if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) + banderas(50); + else + for (l = 0; l < objs_room; l++) { + if (x_raton > x1[l] && y_raton > y1[l] + && x_raton < x2[l] && y_raton < y2[l] && visible[l] == 1) { + sentido_final = sentidobj[l]; + anda_a_objeto = 1; + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + banderas(num_obj[l]); + } + } + } +} + +Common::KeyCode DrasculaEngine::getscan() { + update_events(); + + return _keyPressed.keycode; +} + +void DrasculaEngine::update_events() { + Common::Event event; + Common::EventManager *eventMan = _system->getEventManager(); + + AudioCD.updateCD(); + + while (eventMan->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_KEYDOWN: + _keyPressed = event.kbd; + break; + case Common::EVENT_KEYUP: + _keyPressed.keycode = Common::KEYCODE_INVALID; + break; + case Common::EVENT_MOUSEMOVE: + x_raton = event.mouse.x; + y_raton = event.mouse.y; + break; + case Common::EVENT_LBUTTONDOWN: + boton_izq = 1; + break; + case Common::EVENT_LBUTTONUP: + boton_izq = 0; + break; + case Common::EVENT_RBUTTONDOWN: + boton_dch = 1; + break; + case Common::EVENT_RBUTTONUP: + boton_dch = 0; + break; + case Common::EVENT_QUIT: + // TODO + salir_al_dos(0); + exit(0); + break; + default: + break; + } + } +} + +void DrasculaEngine::elige_verbo(int verbo) { + int c = 171; + + if (menu_scr == 1) + c = 0; + if (lleva_objeto == 1) + suma_objeto(objeto_que_lleva); + + DIBUJA_FONDO(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); + + lleva_objeto = 1; + objeto_que_lleva = verbo; +} + +void DrasculaEngine::mesa() { + int nivel_master, nivel_voc, nivel_cd; + + DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla); + VUELCA_PANTALLA(73, 63, 73, 63, 177, 97, dir_zona_pantalla); + + for (;;) { + nivel_master = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4); + nivel_voc = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4); + nivel_cd = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4); + + refresca_pantalla(); + + DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla); + + DIBUJA_FONDO(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla); + DIBUJA_FONDO(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla); + DIBUJA_FONDO(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla); + + cursor_mesa(); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + MirarRaton(); + + if (boton_dch == 1) + break; + if (boton_izq == 1) { + if (x_raton > 80 && x_raton < 121) { + int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16; + if (y_raton < nivel_master && vol < 15) + vol++; + if (y_raton > nivel_master && vol > 0) + vol--; + _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol * 16); + } + + if (x_raton > 136 && x_raton < 178) { + int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16; + if (y_raton < nivel_voc && vol < 15) + vol++; + if (y_raton > nivel_voc && vol > 0) + vol--; + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol * 16); + } + + if (x_raton > 192 && x_raton < 233) { + int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16; + if (y_raton < nivel_cd && vol < 15) + vol++; + if (y_raton > nivel_cd && vol > 0) + vol--; + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol * 16); + } + } + + } + + espera_soltar(); +} + +void DrasculaEngine::saves() { + char nombres[10][23]; + char fichero[13]; + int n, n2, num_sav, y = 27; + Common::InSaveFile *sav; + + borra_pantalla(); + + if (!(sav = _saveFileMan->openForLoading("saves.epa"))) { + error("Can't open saves.epa file."); + } + for (n = 0; n < NUM_SAVES; n++) + sav->read(nombres[n], 23); + delete sav; + + lee_dibujos("savescr.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + + color_abc(VERDE_CLARO); + + for (;;) { + y = 27; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + for (n = 0; n < NUM_SAVES; n++) { + print_abc(nombres[n], 116, y); + y = y + 9; + } + print_abc(select, 117, 15); + cursor_mesa(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + y = 27; + + MirarRaton(); + + if (boton_izq == 1) { + for (n = 0; n < NUM_SAVES; n++) { + if (x_raton > 115 && y_raton > y + (9 * n) && x_raton < 115 + 175 && y_raton < y + 10 + (9 * n)) { + strcpy(select, nombres[n]); + + if (strcmp(select, "*")) + hay_seleccion = 1; + else { + introduce_nombre(); + strcpy(nombres[n], select); + if (hay_seleccion == 1) { + if (n == 0) + strcpy(fichero, "gsave01"); + if (n == 1) + strcpy(fichero, "gsave02"); + if (n == 2) + strcpy(fichero, "gsave03"); + if (n == 3) + strcpy(fichero, "gsave04"); + if (n == 4) + strcpy(fichero, "gsave05"); + if (n == 5) + strcpy(fichero, "gsave06"); + if (n == 6) + strcpy(fichero, "gsave07"); + if (n == 7) + strcpy(fichero, "gsave08"); + if (n == 8) + strcpy(fichero, "gsave09"); + if (n == 9) + strcpy(fichero, "gsave10"); + para_grabar(fichero); + Common::OutSaveFile *tsav; + if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) { + error("Can't open saves.epa file."); + } + for (n = 0; n < NUM_SAVES; n++) + tsav->write(nombres[n], 23); + tsav->finalize(); + delete tsav; + } + } + + print_abc(select, 117, 15); + y = 27; + for (n2 = 0; n2 < NUM_SAVES; n2++) { + print_abc(nombres[n2], 116, y); + y = y + 9; + } + if (hay_seleccion == 1) { + if (n == 0) + strcpy(fichero, "gsave01"); + if (n == 1) + strcpy(fichero, "gsave02"); + if (n == 2) + strcpy(fichero, "gsave03"); + if (n == 3) + strcpy(fichero, "gsave04"); + if (n == 4) + strcpy(fichero, "gsave05"); + if (n == 5) + strcpy(fichero, "gsave06"); + if (n == 6) + strcpy(fichero, "gsave07"); + if (n == 7) + strcpy(fichero, "gsave08"); + if (n == 8) + strcpy(fichero, "gsave09"); + if (n == 9) + strcpy(fichero, "gsave10");} + num_sav = n; + } + } + + if (x_raton > 117 && y_raton > 15 && x_raton < 295 && y_raton < 24 && hay_seleccion == 1) { + introduce_nombre(); + strcpy(nombres[num_sav], select); + print_abc(select, 117, 15); + y = 27; + for (n2 = 0; n2 < NUM_SAVES; n2++) { + print_abc(nombres[n2], 116, y); + y = y + 9; + } + } + + if (x_raton > 125 && y_raton > 123 && x_raton < 199 && y_raton < 149 && hay_seleccion == 1) { + para_cargar(fichero); + break; + } else if (x_raton > 208 && y_raton > 123 && x_raton < 282 && y_raton < 149 && hay_seleccion == 1) { + para_grabar(fichero); + Common::OutSaveFile *tsav; + if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) { + error("Can't open saves.epa file."); + } + for (n = 0; n < NUM_SAVES; n++) + tsav->write(nombres[n], 23); + tsav->finalize(); + delete tsav; + } else if (x_raton > 168 && y_raton > 154 && x_raton < 242 && y_raton < 180) + break; + else if (hay_seleccion == 0) { + print_abc("elige una partida",117,15); + } + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(400); + } + y = 26; + } + + borra_pantalla(); + lee_dibujos(num_room); + descomprime_dibujo(dir_dibujo1, MEDIA); + buffer_teclado(); + hay_seleccion = 0; +} + +void DrasculaEngine::print_abc(const char *dicho, int x_pantalla, int y_pantalla) { + int pos_texto[8]; + int y_de_letra = 0, x_de_letra = 0, h, longitud; + longitud = strlen(dicho); + + for (h = 0; h < longitud; h++) { + y_de_letra = Y_ABC; + char c = toupper(dicho[h]); + if (c == 'A') + x_de_letra = X_A; + else if (c == 'B') + x_de_letra = X_B; + else if (c == 'C') + x_de_letra = X_C; + else if (c == 'D') + x_de_letra = X_D; + else if (c == 'E') + x_de_letra = X_E; + else if (c == 'F') + x_de_letra = X_F; + else if (c == 'G') + x_de_letra = X_G; + else if (c == 'H') + x_de_letra = X_H; + else if (c == 'I') + x_de_letra = X_I; + else if (c == 'J') + x_de_letra = X_J; + else if (c == 'K') + x_de_letra = X_K; + else if (c == 'L') + x_de_letra = X_L; + else if (c == 'M') + x_de_letra = X_M; + else if (c == 'N') + x_de_letra = X_N; +//TODO else if (c == 'Ľ') +// x_de_letra = X_GN; + else if (c == '¤') + x_de_letra = X_GN; + else if (c == 'O') + x_de_letra = X_O; + else if (c == 'P') + x_de_letra = X_P; + else if (c == 'Q') + x_de_letra = X_Q; + else if (c == 'R') + x_de_letra = X_R; + else if (c == 'S') + x_de_letra = X_S; + else if (c == 'T') + x_de_letra = X_T; + else if (c == 'U') + x_de_letra = X_U; + else if (c == 'V') + x_de_letra = X_V; + else if (c == 'W') + x_de_letra = X_W; + else if (c == 'X') + x_de_letra = X_X; + else if (c == 'Y') + x_de_letra = X_Y; + else if (c == 'Z') + x_de_letra = X_Z; + else if (/*c == 0xa7 ||*/ c == ' ') + x_de_letra = ESPACIO; + else { + y_de_letra = Y_SIGNOS; + if (c == '.') + x_de_letra = X_PUNTO; + else if (c == ',') + x_de_letra = X_COMA; + else if (c == '-') + x_de_letra = X_GUION; + else if (c == '?') + x_de_letra = X_CIERRA_INTERROGACION; +//TODO else if (c == '¨') +// x_de_letra = X_ABRE_INTERROGACION; + else if (c == '"') + x_de_letra = X_COMILLAS; + else if (c == '!') + x_de_letra = X_CIERRA_EXCLAMACION; +//TODO else if (c == '') +// x_de_letra = X_ABRE_EXCLAMACION; + else if (c == ';') + x_de_letra = X_PUNTO_Y_COMA; + else if (c == '>') + x_de_letra = X_MAYOR_QUE; + else if (c == '<') + x_de_letra = X_MENOR_QUE; + else if (c == '$') + x_de_letra = X_DOLAR; + else if (c == '%') + x_de_letra = X_POR_CIENTO; + else if (c == ':') + x_de_letra = X_DOS_PUNTOS; + else if (c == '&') + x_de_letra = X_AND; + else if (c == '/') + x_de_letra = X_BARRA; + else if (c == '(') + x_de_letra = X_ABRE_PARENTESIS; + else if (c == ')') + x_de_letra = X_CIERRA_PARENTESIS; + else if (c == '*') + x_de_letra = X_ASTERISCO; + else if (c == '+') + x_de_letra = X_MAS; + else if (c == '1') + x_de_letra = X_N1; + else if (c == '2') + x_de_letra = X_N2; + else if (c == '3') + x_de_letra = X_N3; + else if (c == '4') + x_de_letra = X_N4; + else if (c == '5') + x_de_letra = X_N5; + else if (c == '6') + x_de_letra = X_N6; + else if (c == '7') + x_de_letra = X_N7; + else if (c == '8') + x_de_letra = X_N8; + else if (c == '9') + x_de_letra = X_N9; + else if (c == '0') + x_de_letra = X_N0; + else + y_de_letra = Y_ACENTOS; +/* + if (c == ' ') + x_de_letra = X_A; + else if (c == '') + x_de_letra = X_B; + else if (c == 'Ą') + x_de_letra = X_C; + else if (c == '˘') + x_de_letra = X_D; + else if (c == 'Ł') + x_de_letra = X_E; + else if (c == '
') + x_de_letra = X_F; + else if (c == '') + x_de_letra = X_G; + else if (c == '') + x_de_letra = X_H; + else if (c == '') + x_de_letra = X_I; + else if (c == '') + x_de_letra = X_J; + else if (c == '') + x_de_letra = X_K; + else if (c == '') + x_de_letra = X_L; + else if (c == '') + x_de_letra = X_M; + else if (c == '') + x_de_letra = X_N; + else if (c == '') + x_de_letra = X_GN; + else if (c == '\'') + x_de_letra = X_O; + else if (c == '') + x_de_letra = X_P; + else if (c == '') + x_de_letra = X_P; + else if (c == 'ľ') + x_de_letra = X_A; + else if (c == '') + x_de_letra = X_B; + else if (c == 'Ö') + x_de_letra = X_C; + else if (c == 'ŕ') + x_de_letra = X_D; + else if (c == 'é') + x_de_letra = X_E; + else if (c == 'ˇ') + x_de_letra = X_F; + else if (c == 'Ô') + x_de_letra = X_G; + else if (c == 'Ţ') + x_de_letra = X_H; + else if (c == 'ă') + x_de_letra = X_I; + else if (c == 'ë') + x_de_letra = X_J; + else if (c == 'ś') + x_de_letra = X_K; + else if (c == 'Ň') + x_de_letra = X_L; + else if (c == '×') + x_de_letra = X_M; + else if (c == 'â') + x_de_letra = X_N; + else if (c == 'ę') + x_de_letra = X_GN; +*/ } + + pos_texto[0] = x_de_letra; + pos_texto[1] = y_de_letra; + pos_texto[2] = x_pantalla; + pos_texto[3] = y_pantalla; + pos_texto[4] = ANCHO_LETRAS; + pos_texto[5] = ALTO_LETRAS; + + DIBUJA_BLOQUE_CUT(pos_texto, dir_texto, dir_zona_pantalla); + + x_pantalla = x_pantalla + ANCHO_LETRAS; + if (x_pantalla > 317) { + x_pantalla = 0; + y_pantalla = y_pantalla + ALTO_LETRAS + 2; + } + } +} + +void DrasculaEngine::delay(int ms) { + _system->delayMillis(ms * 2); // originaly was 1 +} + +void DrasculaEngine::confirma_go() { + byte key; + + color_abc(ROJO); + refresca_pantalla(); + centra_texto(SYS0, 160, 87); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + for (;;) { + key = getscan(); + if (key != 0) + break; + } + + if (key == Common::KEYCODE_DELETE) { + stopmusic(); + carga_partida("gsave00"); + } +} + +void DrasculaEngine::confirma_salir() { + byte key; + + color_abc(ROJO); + refresca_pantalla(); + centra_texto(SYS1, 160, 87); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + for (;;) { + key = getscan(); + if (key != 0) + break; + } + + if (key == Common::KEYCODE_ESCAPE) { + stopmusic(); + salir_al_dos(0); + } +} + +void DrasculaEngine::salva_pantallas() { + int xr, yr; + + borra_pantalla(); + + lee_dibujos("sv.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + //TODO inicio_ghost(); + //TODO carga_ghost(); + + MirarRaton(); + xr = x_raton; + yr = y_raton; + + for (;;) { + //TODO efecto(dir_dibujo1); + MirarRaton(); + if (boton_dch == 1 || boton_izq == 1) + break; + if (x_raton != xr) + break; + if (y_raton != yr) + break; + } + //TODO fin_ghost(); + lee_dibujos(num_room); + descomprime_dibujo(dir_dibujo1, MEDIA); +} + +void DrasculaEngine::fliplay(const char *filefli, int vel) { + OpenSSN(filefli, vel); + while (PlayFrameSSN() && (!term_int)) { + if (getscan() == Common::KEYCODE_ESCAPE) + term_int = 1; + } + EndSSN(); +} + +void DrasculaEngine::FundeDelNegro(int VelocidadDeFundido) { + char fundido; + unsigned int color, componente; + + DacPalette256 palFundido; + + for (fundido = 0; fundido < 64; fundido++) { + for (color = 0; color < 256; color++) { + for (componente = 0; componente < 3; componente++) { + palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido); + } + } + pausa(VelocidadDeFundido); + + setvgapalette256((byte *)&palFundido); + } +} + +void DrasculaEngine::color_abc(int cl) { + _color = cl; + + if (cl == 0) { + palJuego[254][0] = 0; + palJuego[254][1] = 0; + palJuego[254][2] = 0; + } else if (cl == 1) { + palJuego[254][0] = 0x10; + palJuego[254][1] = 0x3E; + palJuego[254][2] = 0x28; + } else if (cl == 3) { + palJuego[254][0] = 0x16; + palJuego[254][1] = 0x3F; + palJuego[254][2] = 0x16; + } else if (cl == 4) { + palJuego[254][0] = 0x9; + palJuego[254][1] = 0x3F; + palJuego[254][2] = 0x12; + } else if (cl == 5) { + palJuego[254][0] = 0x3F; + palJuego[254][1] = 0x3F; + palJuego[254][2] = 0x15; + } else if (cl == 7) { + palJuego[254][0] = 0x38; + palJuego[254][1] = 0; + palJuego[254][2] = 0; + } else if (cl == 8) { + palJuego[254][0] = 0x3F; + palJuego[254][1] = 0x27; + palJuego[254][2] = 0x0B; + } else if (cl == 9) { + palJuego[254][0] = 0x2A; + palJuego[254][1] = 0; + palJuego[254][2] = 0x2A; + } else if (cl == 10) { + palJuego[254][0] = 0x30; + palJuego[254][1] = 0x30; + palJuego[254][2] = 0x30; + } else if (cl == 11) { + palJuego[254][0] = 98; + palJuego[254][1] = 91; + palJuego[254][2] = 100; + }; + + setvgapalette256((byte *)&palJuego); +} + +char DrasculaEngine::LimitaVGA(char valor) { + return (valor & 0x3F) * (valor > 0); +} + +void DrasculaEngine::centra_texto(const char *mensaje, int x_texto, int y_texto) { + char bb[190], m2[190], m1[190], mb[10][40]; + char m3[190]; + int h, fil, x_texto3, x_texto2, x_texto1, conta_f = 0, ya = 0; + + strcpy(m1, " "); + strcpy(m2, " "); + strcpy(m3, " "); + strcpy(bb, " "); + + for (h = 0; h < 10; h++) + strcpy(mb[h], " "); + + if (x_texto > 160) + ya = 1; + + strcpy(m1, mensaje); + if (x_texto < 60) + x_texto = 60; + if (x_texto > 255) + x_texto = 255; + + x_texto1 = x_texto; + + if (ya == 1) + x_texto1 = 315 - x_texto; + + x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS; + +tut: + strcpy(bb, m1); + scumm_strrev(bb); + + if (x_texto1 < x_texto2) { + strcpy(m3, strrchr(m1, ' ')); + strcpy(m1, strstr(bb, " ")); + scumm_strrev(m1); + m1[strlen(m1) - 1] = '\0'; + strcat(m3, m2); + strcpy(m2, m3); + }; + + x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS; + if (x_texto1 < x_texto2) + goto tut; + strcpy(mb[conta_f], m1); + + if (!strcmp(m2, "")) + goto imprimir; + scumm_strrev(m2); + m2[strlen(m2) - 1] = '\0'; + scumm_strrev(m2); + strcpy(m1, m2); + strcpy(m2, ""); + conta_f++; + + goto tut; + +imprimir: + + fil = y_texto - (((conta_f + 3) * ALTO_LETRAS)); + + for (h = 0; h < conta_f + 1; h++) { + x_texto3 = strlen(mb[h]) / 2; + print_abc(mb[h], ((x_texto) - x_texto3 * ANCHO_LETRAS) - 1, fil); + fil = fil + ALTO_LETRAS + 2; + } +} + +void DrasculaEngine::comienza_sound(const char *fichero) { + if (hay_sb == 1) { + sku = new Common::File; + sku->open(fichero); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); +} + +void DrasculaEngine::anima(const char *animacion, int FPS) { + Common::File FileIn; + unsigned j; + int NFrames = 1; + int cnt = 2; + + AuxBuffLast = (byte *)malloc(65000); + AuxBuffDes = (byte *)malloc(65000); + + FileIn.open(animacion); + + if (!FileIn.isOpen()) { + error("No encuentro un fichero de animacion."); + } + + FileIn.read(&NFrames, sizeof(NFrames)); + FileIn.read(&Leng, sizeof(Leng)); + AuxBuffOrg = (byte *)malloc(Leng); + FileIn.read(AuxBuffOrg, Leng); + FileIn.read(cPal, 768); + carga_pcx(AuxBuffOrg); + free(AuxBuffOrg); + memcpy(VGA, AuxBuffDes, 64000); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + _system->updateScreen(); + set_dac(cPal); + memcpy(AuxBuffLast, AuxBuffDes, 64000); + WaitForNext(FPS); + while (cnt < NFrames) { + FileIn.read(&Leng, sizeof(Leng)); + AuxBuffOrg = (byte *)malloc(Leng); + FileIn.read(AuxBuffOrg, Leng); + FileIn.read(cPal, 768); + carga_pcx(AuxBuffOrg); + free(AuxBuffOrg); + for (j = 0;j < 64000; j++) { + VGA[j] = AuxBuffLast[j] = AuxBuffDes[j] ^ AuxBuffLast[j]; + } + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + _system->updateScreen(); + WaitForNext(FPS); + cnt++; + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + break; + } + free(AuxBuffLast); + free(AuxBuffDes); + FileIn.close(); +} + +void DrasculaEngine::animafin_sound_corte() { + if (hay_sb == 1) { + ctvd_stop(); + delete sku; + ctvd_terminate(); + } +} + +void DrasculaEngine::FundeAlNegro(int VelocidadDeFundido) { + char fundido; + unsigned int color, componente; + + DacPalette256 palFundido; + + for (fundido = 63; fundido >= 0; fundido--) { + for (color = 0; color < 256; color++) { + for (componente = 0; componente < 3; componente++) { + palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido); + } + } + pausa(VelocidadDeFundido); + + setvgapalette256((byte *)&palFundido); + } +} + +void DrasculaEngine::pausa(int cuanto) { + _system->delayMillis(cuanto * 30); // was originaly 2 +} + +void DrasculaEngine::habla_dr_grande(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + int x_habla[4] = {47, 93, 139, 185}; + int cara; + int l = 0; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(ROJO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(3); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_FONDO(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, dir_dibujo2, dir_zona_pantalla); + DIBUJA_FONDO(x_habla[cara], 1, 171, 68, 45, 48, dir_dibujo2, dir_zona_pantalla); + l++; + if (l == 7) + l = 0; + + if (con_voces == 0) + centra_texto(dicho, 191, 69); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } +} + +void DrasculaEngine::pon_igor() { + int pos_igor[6]; + + pos_igor[0] = 1; + if (sentido_igor == 3) + pos_igor[1] = 138; + else if (sentido_igor == 1) + pos_igor[1] = 76; + pos_igor[2] = x_igor; + pos_igor[3] = y_igor; + pos_igor[4] = 54; + pos_igor[5] = 61; + + DIBUJA_BLOQUE_CUT(pos_igor, dir_hare_frente, dir_zona_pantalla); +} + +void DrasculaEngine::pon_dr() { + int pos_dr[6]; + + if (sentido_dr == 1) + pos_dr[0] = 47; + else if (sentido_dr == 0) + pos_dr[0] = 1; + else if (sentido_dr == 3) + pos_dr[0] = 93; + pos_dr[1] = 122; + pos_dr[2] = x_dr; + pos_dr[3] = y_dr; + pos_dr[4] = 45; + pos_dr[5] = 77; + + DIBUJA_BLOQUE_CUT(pos_dr, dir_hare_fondo, dir_zona_pantalla); +} + +void DrasculaEngine::pon_bj() { + int pos_bj[6]; + + if (sentido_bj == 3) + pos_bj[0] = 10; + else if (sentido_bj == 0) + pos_bj[0] = 37; + pos_bj[1] = 99; + pos_bj[2] = x_bj; + pos_bj[3] = y_bj; + pos_bj[4] = 26; + pos_bj[5] = 76; + + DIBUJA_BLOQUE_CUT(pos_bj, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::habla_igor_dch(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 56, 82, 108, 134, 160, 186, 212, 238}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = time (NULL); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + pon_igor(); + pon_dr(); + DIBUJA_FONDO(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, + dir_dibujo1, dir_zona_pantalla); + + DIBUJA_BLOQUE(x_habla[cara], 148, x_igor + 17, y_igor, 25, 24, + dir_hare_frente, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, x_igor + 26, y_igor); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_dr_izq(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 }; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(ROJO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + pon_igor(); + pon_dr(); + + DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31, + dir_hare_fondo, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, x_dr + 19, y_dr); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_dr_dch(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 }; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(ROJO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + + pon_igor(); + pon_dr(); + + DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31, + dir_hare_fondo, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, x_dr + 19, y_dr); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_solo(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + color_abc(color_solo); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + if (con_voces == 0) + centra_texto(dicho, 156, 90); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } +} + +void DrasculaEngine::habla_igor_frente(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 56, 86, 116, 146, 176, 206, 236, 266}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + pon_igor(); + pon_dr(); + DIBUJA_FONDO(x_igor, y_igor, x_igor, y_igor, 29, 25, + dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 173, x_igor, y_igor, 29, 25, + dir_hare_frente, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, x_igor + 26, y_igor); + + VUELCA_PANTALLA(0,0, 0,0, 320,200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_igor(); + pon_dr(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_tabernero(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(MARRON); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + if (music_status() == 0) + playmusic(musica_room); + + cara = _rnd->getRandomNumber(8); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 132, 45); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete(sku); + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::hipo(int contador) { + int y = 0, sentido = 0; + + contador = contador; + +comienza: + contador--; + + refresca_pantalla(); + VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + + if (sentido == 0) + y++; + else + y--; + if (y == 2) + sentido = 1; + if (y == 0) + sentido = 0; + if (contador > 0) + goto comienza; + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::fin_sound() { + delay(1); + + if (hay_sb == 1) { + while (LookForFree() != 0); + delete sku; + } +} + +void DrasculaEngine::habla_bj(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[5] = { 64, 92, 120, 148, 176}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(4); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40, + dir_dibujo1, dir_zona_pantalla); + + DIBUJA_BLOQUE(x_habla[cara], 99, x_bj + 2, y_bj - 1, 27, 40, + dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, x_bj + 7, y_bj); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::hablar(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int suma_1_pixel = 1; + + int y_mask_habla = 170; + int x_habla_dch[6] = { 1, 25, 49, 73, 97, 121 }; + int x_habla_izq[6] = { 145, 169, 193, 217, 241, 265 }; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + if (factor_red[hare_y + alto_hare] == 100) + suma_1_pixel = 0; + + if (num_ejec == 2) + buffer_teclado(); + + color_abc(AMARILLO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(5); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + if (num_ejec == 1) + DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, + ancho_hare * factor_red[hare_y + alto_hare] / 100, + (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, + dir_zona_pantalla, dir_dibujo3); + else if (num_ejec == 2) + DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_habla - 1, + dir_zona_pantalla, dir_dibujo3); + pon_hare(); + + if (num_ejec == 1) + DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, + ancho_hare * factor_red[hare_y + alto_hare] / 100, + (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, + dir_dibujo3, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, + ancho_hare, alto_habla - 1, + dir_dibujo3, dir_zona_pantalla); + + if (sentido_hare == 0) { + if (num_ejec == 1) + reduce_hare_chico(x_habla_izq[cara], y_mask_habla, + hare_x + 8 * factor_red[hare_y + alto_hare] / 100, + hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, + hare_x + 12, hare_y, ancho_habla, alto_habla, + dir_hare_dch, dir_zona_pantalla); + actualiza_refresco(); + } else if (sentido_hare == 1) { + if (num_ejec == 1) + reduce_hare_chico(x_habla_dch[cara], y_mask_habla, + hare_x + 12 * factor_red[hare_y + alto_hare] / 100, + hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, + hare_x + 8, hare_y, ancho_habla, alto_habla, + dir_hare_dch, dir_zona_pantalla); + actualiza_refresco(); + } else if (sentido_hare == 2) { + reduce_hare_chico(x_habla_izq[cara], y_mask_habla, + suma_1_pixel + hare_x + 12 * factor_red[hare_y + alto_hare] / 100, + hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], + dir_hare_frente, dir_zona_pantalla); + actualiza_refresco(); + } else if (sentido_hare == 3) { + reduce_hare_chico(x_habla_dch[cara], y_mask_habla, + suma_1_pixel + hare_x + 8 * factor_red[hare_y + alto_hare] / 100, + hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare], + dir_hare_frente, dir_zona_pantalla); + actualiza_refresco(); + } + + if (con_voces == 0) + centra_texto(dicho, hare_x, hare_y); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (num_ejec == 1) + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + if (num_ejec == 1) + if (music_status() == 0 && flags[11] == 0 && corta_musica == 0) + playmusic(musica_room); +} + +void DrasculaEngine::playmusic(int p) { + AudioCD.stop(); + AudioCD.play(p - 1, 1, 0, 0); +} + +void DrasculaEngine::stopmusic() { + AudioCD.stop(); +} + +int DrasculaEngine::music_status() { + return AudioCD.isPlaying(); +} + +void DrasculaEngine::refresca_pantalla() { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + pon_hare(); + actualiza_refresco(); +} + +void DrasculaEngine::carga_partida(const char *nom_game) { + int l, n_ejec2; + Common::InSaveFile *sav; + + canal_p(nom_game); + if (!(sav = _saveFileMan->openForLoading("nom_game"))) { + error("missing savegame file"); + } + + n_ejec2 = sav->readSint32LE(); + if (n_ejec2 != num_ejec) { + canal_p(nom_game); + strcpy(nom_partida, nom_game); + error("TODO"); + salir_al_dos(n_ejec2); + } + sav->read(datos_actuales, 20); + hare_x = sav->readSint32LE(); + hare_y = sav->readSint32LE(); + sentido_hare = sav->readSint32LE(); + + for (l = 1; l < 43; l++) { + objetos_que_tengo[l] = sav->readSint32LE(); + } + + for (l = 0; l < NUM_BANDERAS; l++) { + flags[l] = sav->readSint32LE(); + } + + lleva_objeto = sav->readSint32LE(); + objeto_que_lleva = sav->readSint32LE(); + + canal_p(nom_game); +} + +void DrasculaEngine::canal_p(const char *fich){ + return; + // TODO + + Common::File ald2, ald3; + + char fich2[13]; + char car; + + strcpy(fich2, "top"); + + ald3.open(fich); + if (!ald3.isOpen()) { + error("no puedo abrir el archivo codificado"); + } + + ald2.open(fich2, Common::File::kFileWriteMode); + if (!ald2.isOpen()) { + error("no puedo abrir el archivo destino"); + } + + car = ald3.readByte(); + while (!ald3.eos()) { + ald2.writeByte(codifica(car)); + car = ald3.readByte(); + } + + ald2.close(); + ald3.close(); + remove(fich); + rename(fich2, fich); +} + +void DrasculaEngine::puertas_cerradas (int l) { + if (num_ejec == 1) + return; + + if (num_obj[l] == 138 && flags[0] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 138 && flags[0] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 136 && flags[8] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 136 && flags[8] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 156 && flags[16] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 156 && flags[16] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 163 && flags[17] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 163 && flags[17] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 177 && flags[15] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 177 && flags[15] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 175 && flags[40] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 175 && flags[40] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 173 && flags[36] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 173 && flags[36] == 1) + espuerta[l] = 1; +} + +void DrasculaEngine::color_hare() { + int color, componente; + + for (color = 235; color < 253; color++) { + for (componente = 0; componente < 3; componente++) { + palJuego[color][componente] = palHare[color][componente]; + } + } + ActualizaPaleta(); +} + +void DrasculaEngine::funde_hare(int oscuridad) { + char fundido; + unsigned int color, componente; + + for (fundido = oscuridad; fundido >= 0; fundido--) { + for (color = 235; color < 253; color++) { + for (componente = 0; componente < 3; componente++) + palJuego[color][componente] = LimitaVGA(palJuego[color][componente] - 8 + fundido); + } + } + + ActualizaPaleta(); +} + +void DrasculaEngine::paleta_hare_claro() { + int color, componente; + + for (color = 235; color < 253; color++) { + for (componente = 0; componente < 3; componente++) + palHareClaro[color][componente] = palJuego[color][componente]; + } +} + +void DrasculaEngine::paleta_hare_oscuro() { + int color, componente; + + for (color = 235; color < 253; color++) { + for (componente = 0; componente < 3; componente++) + palHareOscuro[color][componente] = palJuego[color][componente]; + } +} + +void DrasculaEngine::hare_claro() { + int color, componente; + + for (color = 235; color < 253; color++) { + for (componente = 0; componente < 3; componente++) + palJuego[color][componente] = palHareClaro[color][componente]; + } + + ActualizaPaleta(); +} + +void DrasculaEngine::empieza_andar() { + hare_se_mueve = 1; + + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + + if (num_ejec == 1) { + if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_1(); + else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) + cuadrante_3(); + else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_2(); + else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) + cuadrante_4(); + else + hare_se_mueve = 0; + } else if (num_ejec == 2) { + if ((sitio_x < hare_x) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_1(); + else if ((sitio_x < hare_x) && (sitio_y > (hare_y + alto_hare))) + cuadrante_3(); + else if ((sitio_x > hare_x + ancho_hare) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_2(); + else if ((sitio_x > hare_x + ancho_hare) && (sitio_y > (hare_y + alto_hare))) + cuadrante_4(); + else if (sitio_y < hare_y + alto_hare) + anda_parriba(); + else if (sitio_y > hare_y + alto_hare) + anda_pabajo(); + } + conta_vez = vez(); +} + +void DrasculaEngine::actualiza_refresco() { + if (!strcmp(num_room, "63.alg")) + refresca_63(); + else if (!strcmp(num_room, "62.alg")) + refresca_62(); + else if (!strcmp(num_room, "3.alg")) + refresca_3(); + else if (!strcmp(num_room, "2.alg")) + refresca_2(); + else if (!strcmp(num_room, "4.alg")) + refresca_4(); + else if (!strcmp(num_room, "5.alg")) + refresca_5(); + else if (!strcmp(num_room, "15.alg")) + refresca_15(); + else if (!strcmp(num_room, "17.alg")) + refresca_17(); + else if (!strcmp(num_room, "18.alg")) + refresca_18(); + else if (!strcmp(num_room, "10.alg")) + mapa(); +} + +void DrasculaEngine::actualiza_refresco_antes() { + if (!strcmp(num_room, "62.alg")) + refresca_62_antes(); + else if (!strcmp(num_room, "1.alg")) + refresca_1_antes(); + else if (!strcmp(num_room, "3.alg")) + refresca_3_antes(); + else if (!strcmp(num_room, "5.alg")) + refresca_5_antes(); + else if (!strcmp(num_room, "6.alg")) + refresca_6_antes(); + else if (!strcmp(num_room, "7.alg")) + refresca_7_antes(); + else if (!strcmp(num_room, "9.alg")) + refresca_9_antes(); + else if (!strcmp(num_room, "12.alg")) + refresca_12_antes(); + else if (!strcmp(num_room, "14.alg")) + refresca_14_antes(); + else if (!strcmp(num_room, "16.alg")) + if (num_ejec == 1) + pon_bj(); + else if (num_ejec == 2) { + refresca_16_antes(); + } + else if (!strcmp(num_room,"17.alg")) + refresca_17_antes(); + else if (!strcmp(num_room,"18.alg")) + refresca_18_antes(); +} + +void DrasculaEngine::pon_hare() { + int pos_hare[6]; + int r; + + if (hare_se_mueve == 1 && paso_x == PASO_HARE_X) { + for (r = 0; r < paso_x; r++) { + if (num_ejec == 1) { + if (sentido_hare == 0 && sitio_x - r == hare_x + ancho_hare / 2) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + } + if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare / 2) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + hare_x = sitio_x - ancho_hare / 2; + hare_y = sitio_y - alto_hare; + } + } else if (num_ejec == 2) { + if (sentido_hare == 0 && sitio_x - r == hare_x) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + } + if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + hare_x = sitio_x - ancho_hare + 4; + hare_y = sitio_y - alto_hare; + } + } + } + } + if (hare_se_mueve == 1 && paso_y == PASO_HARE_Y) { + for (r = 0; r < paso_y; r++) { + if (sentido_hare == 2 && sitio_y - r == hare_y + alto_hare) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + } + if (sentido_hare == 3 && sitio_y + r == hare_y + alto_hare) { + hare_se_mueve = 0; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + } + } + } + + if (num_ejec == 1) + if (hare_se_ve == 0) + goto no_vuelco; + + if (hare_se_mueve == 0) { + pos_hare[0] = 0; + pos_hare[1] = DIF_MASK_HARE; + pos_hare[2] = hare_x; + pos_hare[3] = hare_y; + if (num_ejec == 1) { + pos_hare[4] = ANCHO_PERSONAJE; + pos_hare[5] = ALTO_PERSONAJE; + } else if (num_ejec == 2) { + pos_hare[4] = ancho_hare; + pos_hare[5] = alto_hare; + } + + if (sentido_hare == 0) { + pos_hare[1] = 0; + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + } else if (sentido_hare == 1) + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else if (sentido_hare == 2) + if (num_ejec == 1) + reduce_hare_chico( pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_fondo, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla); + else + if (num_ejec == 1) + reduce_hare_chico( pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_frente, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla); + } else if (hare_se_mueve == 1) { + pos_hare[0] = frame_x[num_frame]; + pos_hare[1] = frame_y + DIF_MASK_HARE; + pos_hare[2] = hare_x; + pos_hare[3] = hare_y; + if (num_ejec == 1) { + pos_hare[4] = ANCHO_PERSONAJE; + pos_hare[5] = ALTO_PERSONAJE; + } else if (num_ejec == 2) { + pos_hare[4] = ancho_hare; + pos_hare[5] = alto_hare; + } + if (sentido_hare == 0) { + pos_hare[1] = 0; + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + } else if (sentido_hare == 1) + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_dch, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else if (sentido_hare == 2) + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_fondo, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla); + else + if (num_ejec == 1) + reduce_hare_chico(pos_hare[0], pos_hare[1], + pos_hare[2], pos_hare[3], + pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], + dir_hare_frente, dir_zona_pantalla); + else if (num_ejec == 2) + DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla); + +no_vuelco: + aumenta_num_frame(); + } +} + +void DrasculaEngine::menu_sin_volcar() { + int h, n, x; + char texto_icono[13]; + + x = sobre_que_objeto(); + strcpy(texto_icono, nombre_icono[x]); + + for (n = 1; n < 43; n++) { + h = objetos_que_tengo[n]; + + if (h != 0) + DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n], + ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla); + + DIBUJA_BLOQUE(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n], + ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla); + } + + if (x < 7) + print_abc(texto_icono, x_obj[x] - 2, y_obj[x] - 7); +} + +void DrasculaEngine::barra_menu() { + int n, sobre_verbo = 1; + + for (n = 0; n < 7; n++) { + if (x_raton > x_barra[n] && x_raton < x_barra[n + 1]) + sobre_verbo = 0; + DIBUJA_BLOQUE(ANCHOBJ * n, ALTOBJ * sobre_verbo, + x_barra[n], 2, ANCHOBJ, ALTOBJ, + dir_hare_fondo, dir_zona_pantalla); + sobre_verbo = 1; + } +} + +void DrasculaEngine::saca_objeto() { + int h = 0, n; + + refresca_pantalla(); + + for (n = 1; n < 43; n++){ + if (sobre_que_objeto() == n) { + h = objetos_que_tengo[n]; + objetos_que_tengo[n] = 0; + if (h != 0) + lleva_objeto = 1; + } + } + + espera_soltar(); + + if (lleva_objeto == 1) + elige_objeto(h); +} + +bool DrasculaEngine::sal_de_la_habitacion(int l) { + char salgo[13]; + + if (num_ejec == 1) { + if (num_obj[l] == 105 && flags[0] == 0) + hablar(TEXT442, "442.als"); + else { + puertas_cerradas(l); + + if (espuerta[l] != 0) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + sentido_hare = sentidobj[l]; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + + if (num_obj[l] == 105) + if (animacion_2_1()) + return true; + borra_pantalla(); + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x = -1; + carga_escoba_1(salgo); + } + } + } else if (num_ejec == 2) { + puertas_cerradas(l); + if (espuerta[l] != 0) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + if (num_obj[l] == 136) + animacion_2_2(); + if (num_obj[l] == 124) + animacion_3_2(); + if (num_obj[l] == 173) + animacion_35(); + if (num_obj[l] == 146 && flags[39] == 1) { + flags[5] = 1; + flags[11] = 1; + } + if (num_obj[l] == 176 && flags[29] == 1) { + flags[29] = 0; + resta_objeto(23); + suma_objeto(11); + } + borra_pantalla(); + ald->close(); + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x =- 1; + carga_escoba_2(salgo); + } + } + + return false; +} + +void DrasculaEngine::coge_objeto() { + int h, n; + h = objeto_que_lleva; + comprueba_flags = 1; + + refresca_pantalla(); + menu_sin_volcar(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + if (objeto_que_lleva < 7) + goto usando_verbos; + + for (n = 1; n < 43; n++) { + if (sobre_que_objeto() == n && objetos_que_tengo[n] == 0) { + objetos_que_tengo[n] = h; + lleva_objeto = 0; + comprueba_flags = 0; + } + } + +usando_verbos: + + if (comprueba_flags == 1) { + comprueba_banderas_menu(); + } + espera_soltar(); + if (lleva_objeto == 0) + sin_verbo(); +} + +void DrasculaEngine::banderas(int fl) { + hare_se_mueve = 0; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + hay_respuesta = 1; + + if (menu_scr == 1) { + if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + if ((objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 0) + || (objeto_que_lleva == ABRIR && fl == 22 && flags[23] == 0)) { + hablar(TEXT164, "164.als"); + flags[23] = 1; + sin_verbo(); + suma_objeto(7); + suma_objeto(18); + } else if (objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 1) + hablar(TEXT307, "307.als"); + else if (objeto_que_lleva == MIRAR && fl == 7) + hablar(TEXT143, "143.als"); + else if (objeto_que_lleva == HABLAR && fl == 7) + hablar(TEXT144, "144.als"); + else if (objeto_que_lleva == MIRAR && fl == 8) + hablar(TEXT145, "145.als"); + else if (objeto_que_lleva == HABLAR && fl == 8) + hablar(TEXT146, "146.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) + hablar(TEXT147, "147.als"); + else if (objeto_que_lleva == HABLAR && fl == 9) + hablar(TEXT148, "148.als"); + else if (objeto_que_lleva == MIRAR && fl == 10) + hablar(TEXT151, "151.als"); + else if (objeto_que_lleva == MIRAR && fl == 11) + hablar(TEXT152, "152.als"); + else if (objeto_que_lleva == HABLAR && fl == 11) + hablar(TEXT153, "153.als"); + else if (objeto_que_lleva == MIRAR && fl == 12) + hablar(TEXT154, "154.als"); + else if (objeto_que_lleva == MIRAR && fl == 13) + hablar(TEXT155, "155.als"); + else if (objeto_que_lleva == MIRAR && fl == 14) + hablar(TEXT157, "157.als"); + else if (objeto_que_lleva == MIRAR && fl == 15) + hablar(TEXT58, "58.als"); + else if (objeto_que_lleva == MIRAR && fl == 16) + hablar(TEXT158, "158.als"); + else if (objeto_que_lleva == MIRAR && fl == 17) + hablar(TEXT159, "159.als"); + else if (objeto_que_lleva == MIRAR && fl == 18) + hablar(TEXT160, "160.als"); + else if (objeto_que_lleva == MIRAR && fl == 19) + hablar(TEXT161, "161.als"); + else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT162, "162.als"); + else if (objeto_que_lleva == MIRAR && fl == 23) + hablar(TEXT152, "152.als"); + else + hay_respuesta = 0; + } else { + if (objeto_que_lleva == MIRAR && fl == 50) + hablar(TEXT308, "308.als"); + else if (objeto_que_lleva == ABRIR && fl == 50) + hablar(TEXT310, "310.als" ); + else if (objeto_que_lleva == CERRAR && fl == 50) + hablar(TEXT311, "311.als" ); + else if (objeto_que_lleva == MOVER && fl == 50) + hablar(TEXT312, "312.als" ); + else if (objeto_que_lleva == COGER && fl == 50) + hablar(TEXT313, "313.als" ); + else if (objeto_que_lleva == HABLAR && fl == 50) + hablar(TEXT314,"314.als" ); + else if (!strcmp(num_room, "62.alg")) + pantalla_62(fl); + else if (!strcmp(num_room, "63.alg")) + pantalla_63(fl); + else + hay_respuesta = 0; + } + if (hay_respuesta == 0 && hay_nombre == 1) + pantalla_0(); + else if (hay_respuesta == 0 && menu_scr == 1) + pantalla_0(); +} + +void DrasculaEngine::cursor_mesa() { + int pos_cursor[8]; + + pos_cursor[0] = 225; + pos_cursor[1] = 56; + pos_cursor[2] = x_raton - 20; + pos_cursor[3] = y_raton - 12; + pos_cursor[4] = 40; + pos_cursor[5] = 25; + + DIBUJA_BLOQUE_CUT(pos_cursor, dir_mesa, dir_zona_pantalla); +} + +void DrasculaEngine::introduce_nombre() { + Common::KeyCode key; + int v = 0, h = 0; + char select2[23]; + strcpy(select2, " "); + for (;;) { + buffer_teclado(); + select2[v] = '-'; + DIBUJA_FONDO(115, 14, 115, 14, 176, 9, dir_dibujo1, dir_zona_pantalla); + print_abc(select2, 117, 15); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + key = getscan(); + if (key != 0) { + if (key == Common::KEYCODE_q) + select2[v] = 'q'; + else if (key == Common::KEYCODE_w) + select2[v] = 'w'; + else if (key == Common::KEYCODE_e) + select2[v] = 'e'; + else if (key == Common::KEYCODE_r) + select2[v] = 'r'; + else if (key == Common::KEYCODE_t) + select2[v] = 't'; + else if (key == Common::KEYCODE_y) + select2[v] = 'y'; + else if (key == Common::KEYCODE_u) + select2[v] = 'u'; + else if (key == Common::KEYCODE_i) + select2[v] = 'i'; + else if (key == Common::KEYCODE_o) + select2[v] = 'o'; + else if (key == Common::KEYCODE_p) + select2[v] = 'p'; + else if (key == Common::KEYCODE_a) + select2[v] = 'a'; + else if (key == Common::KEYCODE_s) + select2[v] = 's'; + else if (key == Common::KEYCODE_d) + select2[v] = 'd'; + else if (key == Common::KEYCODE_f) + select2[v] = 'f'; + else if (key == Common::KEYCODE_g) + select2[v] = 'g'; + else if (key == Common::KEYCODE_h) + select2[v] = 'h'; + else if (key == Common::KEYCODE_j) + select2[v] = 'j'; + else if (key == Common::KEYCODE_k) + select2[v] = 'k'; + else if (key == Common::KEYCODE_l) + select2[v] = 'l'; + else if ((key == Common::KEYCODE_LCTRL) || (key == Common::KEYCODE_RCTRL)) + select2[v] = '¤'; + else if (key == Common::KEYCODE_z) + select2[v] = 'z'; + else if (key == Common::KEYCODE_x) + select2[v] = 'x'; + else if (key == Common::KEYCODE_c) + select2[v] = 'c'; + else if (key == Common::KEYCODE_v) + select2[v] = 'v'; + else if (key == Common::KEYCODE_b) + select2[v] = 'b'; + else if (key == Common::KEYCODE_n) + select2[v] = 'n'; + else if (key == Common::KEYCODE_m) + select2[v] = 'm'; + else if (key == Common::KEYCODE_1) + select2[v] = '1'; + else if (key == Common::KEYCODE_2) + select2[v] = '2'; + else if (key == Common::KEYCODE_3) + select2[v] = '3'; + else if (key == Common::KEYCODE_4) + select2[v] = '4'; + else if (key == Common::KEYCODE_5) + select2[v] = '5'; + else if (key == Common::KEYCODE_6) + select2[v] = '6'; + else if (key == Common::KEYCODE_7) + select2[v] = '7'; + else if (key == Common::KEYCODE_8) + select2[v] = '8'; + else if (key == Common::KEYCODE_9) + select2[v] = '9'; + else if (key == Common::KEYCODE_0) + select2[v] = '0'; + else if (key == Common::KEYCODE_SPACE) + select2[v] = '§'; + else if (key == ESC) + break; + else if (key == Common::KEYCODE_RETURN) { + select2[v] = '\0'; + h = 1; + break; + } else if (key == Common::KEYCODE_BACKSPACE) + select2[v] = '\0'; + else + v--; + + if (key == Common::KEYCODE_BACKSPACE) + v--; + else + v++; + } + if (v == 22) + v = 21; + else if (v == -1) + v = 0; + } + if (h == 1) { + strcpy(select, select2); + hay_seleccion = 1; + } +} + +void DrasculaEngine::para_grabar(char nom_game[]) { + graba_partida(nom_game); + comienza_sound("99.als"); + fin_sound(); +} + +void DrasculaEngine::OpenSSN(const char *Name, int Pause) { + MiVideoSSN = (byte *)malloc(64256); + GlobalSpeed = CLOCKS_PER_SEC / Pause; + FrameSSN = 0; + UsingMem = 0; + if (MiVideoSSN == NULL) + return; + _Sesion = new Common::File; + _Sesion->open(Name); + mSesion = TryInMem(_Sesion); + LastFrame = clock(); +} + +int DrasculaEngine::PlayFrameSSN() { + int Exit = 0; + int Lengt; + byte *BufferSSN; + + if (!UsingMem) + _Sesion->read(&CHUNK, 1); + else { + memcpy(&CHUNK, mSesion, 1); + mSesion += 1; + } + switch (CHUNK) { + case SET_PALET: + if (!UsingMem) + _Sesion->read(dacSSN, 768); + else { + memcpy(dacSSN, mSesion, 768); + mSesion += 768; + } + set_dacSSN(dacSSN); + break; + case EMPTY_FRAME: + WaitFrameSSN(); + break; + case INIT_FRAME: + if (!UsingMem) { + _Sesion->read(&CMP, 1); + _Sesion->read(&Lengt, 4); + } else { + memcpy(&CMP, mSesion, 1); + mSesion += 1; + memcpy(&Lengt, mSesion, 4); + mSesion += 4; + } + if (CMP == CMP_RLE) { + if (!UsingMem) { + BufferSSN = (byte *)malloc(Lengt); + _Sesion->read(BufferSSN, Lengt); + } else { + BufferSSN = (byte *)malloc(Lengt); + memcpy(BufferSSN, mSesion, Lengt); + mSesion += Lengt; + } + Des_RLE(BufferSSN, MiVideoSSN); + free(BufferSSN); + if (FrameSSN) { + WaitFrameSSN(); + MixVideo(VGA, MiVideoSSN); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } else { + WaitFrameSSN(); + memcpy(VGA, MiVideoSSN, 64000); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } + _system->updateScreen(); + FrameSSN++; + } else { + if (CMP == CMP_OFF) { + if (!UsingMem) { + BufferSSN = (byte *)malloc(Lengt); + _Sesion->read(BufferSSN, Lengt); + } else { + BufferSSN = (byte *)malloc(Lengt); + memcpy(BufferSSN, mSesion, Lengt); + mSesion += Lengt; + } + Des_OFF(BufferSSN, MiVideoSSN, Lengt); + free(BufferSSN); + if (FrameSSN) { + WaitFrameSSN(); + MixVideo(VGA, MiVideoSSN); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } else { + WaitFrameSSN(); + memcpy(VGA, MiVideoSSN, 64000); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } + _system->updateScreen(); + FrameSSN++; + } + } + break; + case END_ANIM: + Exit = 1; + break; + default: + Exit = 1; + break; + } + return (!Exit); +} + +void DrasculaEngine::EndSSN() { + free(MiVideoSSN); + if (UsingMem) + free(pointer); + else { + _Sesion->close(); + delete _Sesion; + } +} + +byte *DrasculaEngine::TryInMem(Common::File *Sesion) { + int Lengt; + + Sesion->seek(0, SEEK_END); + Lengt = Sesion->pos(); + Sesion->seek(0, SEEK_SET); + pointer = (byte *)malloc(Lengt); + if (pointer == NULL) + return NULL; + Sesion->read(pointer, Lengt); + UsingMem = 1; + Sesion->close(); + delete Sesion; + return pointer; +} + +void DrasculaEngine::set_dacSSN(byte *PalBuf) { + setvgapalette256((byte *)PalBuf); +} + +void DrasculaEngine::Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght) { + int x = 0; + unsigned char Reps; + int Offset; + + memset(MiVideoSSN, 0, 64000); + while (x < Lenght) { + Offset = BufferOFF[x] + BufferOFF[x + 1] * 256; + Reps = BufferOFF[x + 2]; + memcpy(MiVideoOFF + Offset, &BufferOFF[x + 3], Reps); + x += 3 + Reps; + } +} + +void DrasculaEngine::Des_RLE(byte *BufferRLE, byte *MiVideoRLE) { + signed int con = 0; + unsigned int X = 0; + unsigned int fExit = 0; + char ch, rep; + while (!fExit) { + ch = *BufferRLE++; + rep = 1; + if ((ch & 192) == 192) { + rep = (ch & 63); + ch =* BufferRLE++; + } + for (con = 0; con < rep; con++) { + *MiVideoRLE++ = ch; + X++; + if (X > 64000) + fExit = 1; + } + } +} + +void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) { + int x; + for (x = 0; x < 64000; x++) + OldScreen[x] ^= NewScreen[x]; +} + +void DrasculaEngine::WaitFrameSSN() { + while (clock() < LastFrame + GlobalSpeed) {}; + LastFrame = LastFrame + GlobalSpeed; +} + +byte *DrasculaEngine::carga_pcx(byte *NamePcc) { + signed int con = 0; + unsigned int X = 0; + unsigned int fExit = 0; + char ch, rep; + byte *AuxPun; + + AuxPun = AuxBuffDes; + + while (!fExit) { + ch = *NamePcc++; + rep = 1; + if ((ch & 192) == 192) { + rep = (ch & 63); + ch = *NamePcc++; + } + for (con = 0; con< rep; con++) { + *AuxPun++ = ch; + X++; + if (X > 64000) + fExit = 1; + } + } + return AuxBuffDes; +} + +void DrasculaEngine::set_dac(byte *dac) { + setvgapalette256((byte *)dac); +} + +void DrasculaEngine::WaitForNext(int FPS) { + _system->delayMillis(1000 / FPS); +} + +float DrasculaEngine::vez() { + return _system->getMillis() / 20; // originaly was 1 +} + +void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int ancho, int alto, int factor, byte *dir_inicio, byte *dir_fin) { + float suma_x, suma_y; + int n, m; + float pixel_x, pixel_y; + int pos_pixel[6]; + + nuevo_ancho = (ancho * factor) / 100; + nuevo_alto = (alto * factor) / 100; + + suma_x = ancho / nuevo_ancho; + suma_y = alto / nuevo_alto; + + pixel_x = xx1; + pixel_y = yy1; + + for (n = 0;n < nuevo_alto; n++){ + for (m = 0; m < nuevo_ancho; m++){ + pos_pixel[0] = (int)pixel_x; + pos_pixel[1] = (int)pixel_y; + pos_pixel[2] = xx2 + m; + pos_pixel[3] = yy2 + n; + pos_pixel[4] = 1; + pos_pixel[5] = 1; + + DIBUJA_BLOQUE_CUT(pos_pixel, dir_inicio, dir_fin); + + pixel_x = pixel_x + suma_x; + } + pixel_x = xx1; + pixel_y = pixel_y + suma_y; + } +} + +char DrasculaEngine::codifica(char car) { + return ~car; +} + +void DrasculaEngine::cuadrante_1() { + float distancia_x = 0, distancia_y; + + if (num_ejec == 1) + distancia_x = hare_x + ancho_hare / 2 - sitio_x; + else if (num_ejec == 2) + distancia_x = hare_x + ancho_hare - sitio_x; + + distancia_y = (hare_y + alto_hare) - sitio_y; + + if (distancia_x < distancia_y) { + direccion_hare = 0; + sentido_hare = 2; + paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y); + } else { + direccion_hare = 7; + sentido_hare = 0; + paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X); + } +} + +void DrasculaEngine::cuadrante_2() { + float distancia_x = 0, distancia_y; + + if (num_ejec == 1) + distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); + else if (num_ejec == 2) + distancia_x = abs(hare_x + ancho_hare - sitio_x); + + distancia_y = (hare_y + alto_hare) - sitio_y; + + if (distancia_x < distancia_y) { + direccion_hare = 1; + sentido_hare = 2; + paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y); + } else { + direccion_hare = 2; + sentido_hare = 1; + paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X); + } +} + +void DrasculaEngine::cuadrante_3() { + float distancia_x = 0, distancia_y; + + if (num_ejec == 1) + distancia_x = hare_x + ancho_hare / 2 - sitio_x; + else if (num_ejec == 2) + distancia_x = hare_x + ancho_hare - sitio_x; + + distancia_y = sitio_y - (hare_y + alto_hare); + + if (distancia_x < distancia_y) { + direccion_hare = 5; + sentido_hare = 3; + paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y); + } else { + direccion_hare = 6; + sentido_hare = 0; + paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X); + } +} + +void DrasculaEngine::cuadrante_4() { + float distancia_x = 0, distancia_y; + + if (num_ejec == 1) + distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); + else if (num_ejec == 2) + distancia_x = abs(hare_x + ancho_hare - sitio_x); + + distancia_y = sitio_y - (hare_y + alto_hare); + + if (distancia_x <distancia_y) { + direccion_hare = 4; + sentido_hare = 3; + paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y); + } else { + direccion_hare = 3; + sentido_hare = 1; + paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X); + } +} + +void DrasculaEngine::refresca_62() { + int borracho_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 }; + + DIBUJA_BLOQUE(1, 1, 0, 0, 62, 142, dir_dibujo2, dir_zona_pantalla); + + if (hare_y + alto_hare < 89) { + DIBUJA_BLOQUE(205, 1, 180, 9, 82, 80, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla); + } +} + +void DrasculaEngine::refresca_63() { + DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_62_antes() { + int velas_y[] = { 158, 172, 186}; + int cirio_x[] = { 14, 19, 24 }; + int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 }; + int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 }; + int diferencia; + + DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla); + + if (parpadeo == 5) + DIBUJA_FONDO(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla); + + if (hare_x > 101 && hare_x < 155) + DIBUJA_FONDO(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla); + + if (flags[11] == 0) + DIBUJA_FONDO(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla); + else if (flags[5] == 0) + DIBUJA_FONDO(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla); + else + DIBUJA_FONDO(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla); + + if (flags[12] == 1) + DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla); + + diferencia = (int)vez() - conta_ciego_vez; + if (diferencia > 6) { + if (flags[12] == 1) { + frame_borracho++; + if (frame_borracho == 8) { + frame_borracho = 0; + flags[12] = 0; + } + } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0)) + flags[12] = 1; + + frame_velas++; + if (frame_velas == 3) + frame_velas = 0; + frame_piano++; + if (frame_piano == 9) + frame_piano = 0; + parpadeo = _rnd->getRandomNumber(10); + conta_ciego_vez = (int)vez(); + } +} + +void DrasculaEngine::graba_partida(char nom_game[]) { + Common::OutSaveFile *out; + int l; + + if (!(out = _saveFileMan->openForSaving(nom_game))) { + error("no puedo abrir el archivo"); + } + out->writeSint32LE(num_ejec); + out->write(datos_actuales, 20); + out->writeSint32LE(hare_x); + out->writeSint32LE(hare_y); + out->writeSint32LE(sentido_hare); + + for (l = 1; l < 43; l++) { + out->writeSint32LE(objetos_que_tengo[l]); + } + + for (l = 0; l < NUM_BANDERAS; l++) { + out->writeSint32LE(flags[l]); + } + + out->writeSint32LE(lleva_objeto); + out->writeSint32LE(objeto_que_lleva); + + out->finalize(); + if (out->ioFailed()) + warning("Can't write file '%s'. (Disk full?)", nom_game); + + delete out; + canal_p(nom_game); +} + +void DrasculaEngine::aumenta_num_frame() { + diff_vez = vez() - conta_vez; + + if (diff_vez >= 5.7) { + conta_vez = vez(); + num_frame++; + if (num_frame == 6) + num_frame = 0; + + if (direccion_hare == 0) { + hare_x = hare_x - paso_x; + hare_y = hare_y - paso_y; + } else if (direccion_hare == 7) { + hare_x = hare_x - paso_x; + hare_y = hare_y - paso_y; + } else if (direccion_hare == 1) { + hare_x = hare_x + paso_x; + hare_y = hare_y - paso_y; + } else if (direccion_hare == 2) { + hare_x = hare_x + paso_x; + hare_y = hare_y - paso_y; + } else if (direccion_hare == 3) { + hare_x = hare_x + paso_x; + hare_y = hare_y + paso_y; + } else if (direccion_hare == 4) { + hare_x = hare_x + paso_x; + hare_y = hare_y + paso_y; + } else if (direccion_hare == 5) { + hare_x = hare_x - paso_x; + hare_y = hare_y + paso_y; + } else if (direccion_hare == 6) { + hare_x = hare_x - paso_x; + hare_y = hare_y + paso_y; + } + } + + if (num_ejec == 1) { + diferencia_y = alto_hare - (int)nuevo_alto; + diferencia_x = ancho_hare - (int)nuevo_ancho; + hare_y = hare_y + diferencia_y; + hare_x = hare_x + diferencia_x; + alto_hare = (int)nuevo_alto; + ancho_hare = (int)nuevo_ancho; + } +} + +int DrasculaEngine::sobre_que_objeto() { + int n; + + for (n = 1; n < 43; n++) { + if (x_raton > x_obj[n] && y_raton > y_obj[n] + && x_raton < x_obj[n] + ANCHOBJ && y_raton < y_obj[n] + ALTOBJ) + break; + } + + return n; +} + +void DrasculaEngine::comprueba_banderas_menu() { + int h, n; + + for (n = 0; n < 43; n++){ + if (sobre_que_objeto() == n) { + h = objetos_que_tengo[n]; + if (h != 0) + banderas(h); + } + } +} + +void DrasculaEngine::pantalla_0() { + if (objeto_que_lleva == MIRAR) { + if (num_ejec == 1) + hablar(TEXT54, "54.als"); + else if (num_ejec == 2) { + hablar(mirar_t[c_mirar], mirar_v[c_mirar]); + c_mirar++; + if (c_mirar == 3) + c_mirar = 0; + } + } else if (objeto_que_lleva == MOVER) + hablar(TEXT19, "19.als" ); + else if (objeto_que_lleva == COGER) + if (num_ejec == 1) + hablar(TEXT11, "11.als" ); + else if (num_ejec == 2) { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } + else if (objeto_que_lleva == ABRIR) + hablar(TEXT9, "9.als" ); + else if (objeto_que_lleva == CERRAR) + hablar(TEXT9, "9.als" ); + else if (objeto_que_lleva == HABLAR) + hablar(TEXT16, "16.als" ); + else { + if (num_ejec == 1) + hablar(TEXT11, "11.als"); + else if (num_ejec == 1) { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } + } +} + +void DrasculaEngine::pantalla_62(int fl) { + if (objeto_que_lleva == HABLAR && fl == 53) + conversa("op_13.cal"); + else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 0) + animacion_3_2(); + else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 1) + hablar(TEXT109, "109.als"); + else if (objeto_que_lleva == HABLAR && fl == 54) + animacion_4_1(); + else if (objeto_que_lleva == MIRAR && fl == 100) + hablar(TEXT168, "168.als"); + else if (objeto_que_lleva == HABLAR && fl == 100) + hablar(TEXT169, "169.als"); + else if (objeto_que_lleva == COGER && fl == 100) + hablar(TEXT170, "170.als"); + else if (objeto_que_lleva == MIRAR && fl == 101) + hablar(TEXT171, "171.als"); + else if (objeto_que_lleva == MIRAR && fl == 102) + hablar(TEXT167, "167.als"); + else if (objeto_que_lleva == MIRAR && fl == 103) + hablar(TEXT166, "166.als"); + else hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_63(int fl) { + if (objeto_que_lleva == MIRAR && fl == 110) + hablar(TEXT172, "172.als"); + else if (objeto_que_lleva == MIRAR && fl == 109) + hablar(TEXT173, "173.als"); + else if (objeto_que_lleva == MOVER && fl == 109) + hablar(TEXT174, "174.als"); + else if (objeto_que_lleva == MIRAR && fl == 108) + hablar(TEXT334, "334.als"); + else if (objeto_que_lleva == HABLAR && fl == 108) + hablar(TEXT333, "333.als"); + else + hay_respuesta = 0; +} + +void DrasculaEngine::conversa(const char *nom_fich) { + int h; + int juego1 = 1, juego2 = 1, juego3 = 1, juego4 = 1; + char frase1[78]; + char frase2[78]; + char frase3[78]; + char frase4[78]; + char para_codificar[13]; + char suena1[13]; + char suena2[13]; + char suena3[13]; + char suena4[13]; + int longitud; + int respuesta1; + int respuesta2; + int respuesta3; + int usado1 = 0; + int usado2 = 0; + int usado3 = 0; + char buffer[256]; + + rompo_y_salgo = 0; + + strcpy(para_codificar, nom_fich); + canal_p(para_codificar); + + ald = new Common::File; + ald->open(nom_fich); + if (!ald->isOpen()) { + error("missing data file"); + } + int size = ald->size(); + + getLine(ald, buffer, size); + sscanf(buffer, "%s", frase1); + getLine(ald, buffer, size); + sscanf(buffer, "%s", frase2); + getLine(ald, buffer, size); + sscanf(buffer, "%s", frase3); + getLine(ald, buffer, size); + sscanf(buffer, "%s", frase4); + getLine(ald, buffer, size); + sscanf(buffer, "%s", suena1); + getLine(ald, buffer, size); + sscanf(buffer, "%s", suena2); + getLine(ald, buffer, size); + sscanf(buffer, "%s", suena3); + getLine(ald, buffer, size); + sscanf(buffer, "%s", suena4); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &respuesta1); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &respuesta2); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &respuesta3); + delete ald; + canal_p(para_codificar); + + if (num_ejec == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) { + strcpy(frase3, TEXT405); + strcpy(suena3, "405.als"); + respuesta3 = 31; + } + + longitud = strlen(frase1); + for (h = 0; h < longitud; h++) + if (frase1[h] == (char)0xa7) + frase1[h] = ' '; + + longitud = strlen(frase2); + for (h = 0; h < longitud; h++) + if (frase2[h] == (char)0xa7) + frase2[h] = ' '; + + longitud = strlen(frase3); + for (h = 0; h < longitud; h++) + if (frase3[h] == (char)0xa7) + frase3[h] = ' '; + + longitud = strlen(frase4); + for (h = 0; h < longitud; h++) + if (frase4[h] == (char)0xa7) + frase4[h] = ' '; + + lee_dibujos("car.alg"); + descomprime_dibujo(dir_hare_fondo,1); +/* TODO + ent.w.ax = 8; + ent.w.cx = 1; + ent.w.dx = 31; + int386(0x33, &ent, &sal); +*/ + color_abc(VERDE_CLARO); + +bucle_opc: + + refresca_pantalla(); + + if (num_ejec == 1) + if (music_status() == 0 && flags[11] == 0) + playmusic(musica_room); + else if (num_ejec == 2) + if (music_status() == 0 && flags[11] == 0 && musica_room != 0) + playmusic(musica_room); + + MirarRaton(); + + if ( y_raton > 0 && y_raton < 9) { + if (usado1 == 1 && _color != BLANCO) + color_abc(BLANCO); + else if (usado1 == 0 && _color != VERDE_CLARO) + color_abc(VERDE_CLARO); + } else if (y_raton > 8 && y_raton < 17) { + if (usado2 == 1 && _color != BLANCO) + color_abc(BLANCO); + else if (usado2 == 0 && _color != VERDE_CLARO) + color_abc(VERDE_CLARO); + } else if (y_raton > 16 && y_raton < 25) { + if (usado3 == 1 && _color != BLANCO) + color_abc(BLANCO); + else if (usado3 == 0 && _color != VERDE_CLARO) + color_abc(VERDE_CLARO); + } else if (_color != VERDE_CLARO) + color_abc(VERDE_CLARO); + + if (y_raton > 0 && y_raton < 9) + juego1 = 2; + else if (y_raton > 8 && y_raton < 17) + juego2 = 2; + else if (y_raton > 16 && y_raton < 25) + juego3 = 2; + else if (y_raton > 24 && y_raton < 33) + juego4 = 2; + + print_abc_opc(frase1, 1, 2, juego1); + print_abc_opc(frase2, 1, 10, juego2); + print_abc_opc(frase3, 1, 18, juego3); + print_abc_opc(frase4, 1, 26, juego4); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + if ((boton_izq == 1) && (juego1 == 2)) { + usado1 = 1; + hablar(frase1, suena1); + responde(respuesta1); + } else if ((boton_izq == 1) && (juego2 == 2)) { + usado2 = 1; + hablar(frase2, suena2); + responde(respuesta2); + } else if ((boton_izq == 1) && (juego3 == 2)) { + usado3 = 1; + hablar(frase3, suena3); + responde(respuesta3); + } else if ((boton_izq == 1) && (juego4 == 2)) { + hablar(frase4, suena4); + rompo_y_salgo = 1; + } + + if (boton_izq == 1) + color_abc(VERDE_CLARO); + + if (usado1 == 0) + juego1 = 1; + else + juego1 = 3; + if (usado2 == 0) + juego2 = 1; + else + juego2 = 3; + if (usado3 == 0) + juego3 = 1; + else + juego3 = 3; + + juego4 = 1; + + if (rompo_y_salgo == 0) + goto bucle_opc; + + if (num_ejec == 1) + lee_dibujos("99.alg"); + else if (num_ejec == 2) + lee_dibujos(fondo_y_menu); + descomprime_dibujo(dir_hare_fondo, 1); + sin_verbo(); +} + +void DrasculaEngine::animacion_3_1() { + lee_dibujos("an11y13.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + hablar(TEXT192, "192.als"); + habla_tabernero(TEXTT1, "t1.als"); + hablar(TEXT193, "193.als"); + habla_tabernero(TEXTT2, "t2.als"); + hablar(TEXT194, "194.als"); + habla_tabernero(TEXTT3, "t3.als"); + hablar(TEXT195, "195.als"); + habla_tabernero(TEXTT4, "t4.als"); + hablar(TEXT196, "196.als"); + habla_tabernero(TEXTT5, "t5.als"); + habla_tabernero(TEXTT6, "t6.als"); + hablar(TEXT197, "197.als"); + habla_tabernero(TEXTT7, "t7.als"); + hablar(TEXT198, "198.als"); + habla_tabernero(TEXTT8, "t8.als"); + hablar(TEXT199, "199.als"); + habla_tabernero(TEXTT9, "t9.als"); + hablar(TEXT200, "200.als"); + hablar(TEXT201, "201.als"); + hablar(TEXT202, "202.als"); + + flags[0] = 1; + + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); +} + +void DrasculaEngine::animacion_4_1() { + lee_dibujos("an12.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + hablar(TEXT205,"205.als"); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(228,112, 228,112, 47,60, dir_zona_pantalla); + + pausa(3); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla); + pon_hare(); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + stopmusic(); + flags[11] = 1; + + habla_pianista(TEXTP1, "p1.als"); + hablar(TEXT206, "206.als"); + habla_pianista(TEXTP2, "p2.als"); + hablar(TEXT207, "207.als"); + habla_pianista(TEXTP3, "p3.als"); + hablar(TEXT208, "208.als"); + habla_pianista(TEXTP4, "p4.als"); + hablar(TEXT209, "209.als"); + + flags[11] = 0; + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); +} + +void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pantalla, int juego) { + int pos_texto[6]; + int y_de_signos, y_de_letra, x_de_letra = 0, h, longitud; + longitud = strlen(dicho); + + for (h = 0; h < longitud; h++) { + if (juego == 1) { + y_de_letra = Y_ABC_OPC_1; + y_de_signos = Y_SIGNOS_OPC_1; + } else if (juego == 3) { + y_de_letra = Y_ABC_OPC_3; + y_de_signos = Y_SIGNOS_OPC_3; + } else { + y_de_letra = Y_ABC_OPC_2; + y_de_signos = Y_SIGNOS_OPC_2; + } + + char c = toupper(dicho[h]); + if (c == 'A') + x_de_letra = X_A_OPC; +// else if (c == 'ľ') +// x_de_letra = X_A_OPC; +// else if (c == 'ˇ') +// x_de_letra = X_A_OPC; +// else if (c == 'ś') +// x_de_letra = X_A_OPC; + else if (c == 'B' + )x_de_letra = X_B_OPC; + else if (c == 'C') + x_de_letra = X_C_OPC; +// else if (c == '') +// x_de_letra = X_C_OPC; +// else if (c == '') +// x_de_letra = X_C_OPC; + else if (c == 'D') + x_de_letra = X_D_OPC; + else if (c == 'E') + x_de_letra = X_E_OPC; +// else if (c == '') +// x_de_letra = X_E_OPC; +// else if (c == 'Ô') +// x_de_letra = X_E_OPC; +// else if (c == 'Ň') +// x_de_letra = X_E_OPC; + else if (c == 'F') + x_de_letra = X_F_OPC; + else if (c == 'G') + x_de_letra = X_G_OPC; + else if (c == 'H') + x_de_letra = X_H_OPC; + else if (c == 'I') + x_de_letra = X_I_OPC; +// else if (c == 'Ö') +// x_de_letra = X_I_OPC; +// else if (c == 'Ţ') +// x_de_letra = X_I_OPC; +// else if (c == '×') +// x_de_letra = X_I_OPC; + else if (c == 'J') + x_de_letra = X_J_OPC; + else if (c == 'K') + x_de_letra = X_K_OPC; + else if (c == 'L') + x_de_letra = X_L_OPC; + else if (c == 'M') + x_de_letra = X_M_OPC; + else if (c == 'N') + x_de_letra = X_N_OPC; +// else if (c == ''') +// x_de_letra = X_GN_OPC; + else if (c == 'O') + x_de_letra = X_O_OPC; +// else if (c == 'ŕ') +// x_de_letra = X_O_OPC; +// else if (c == 'â') +// x_de_letra = X_O_OPC; +// else if (c == 'ă') +// x_de_letra = X_O_OPC; + else if (c == 'P') + x_de_letra = X_P_OPC; + else if (c == 'Q') + x_de_letra = X_Q_OPC; + else if (c == 'R') + x_de_letra = X_R_OPC; + else if (c == 'S') + x_de_letra = X_S_OPC; + else if (c == 'T') + x_de_letra = X_T_OPC; + else if (c == 'U') + x_de_letra = X_U_OPC; +// else if (c == 'ë') +// x_de_letra = X_U_OPC; +// else if (c == 'ę') +// x_de_letra = X_U_OPC; +// else if (c == 'é') +// x_de_letra = X_U_OPC; + else if (c == 'V') + x_de_letra = X_V_OPC; + else if (c == 'W') + x_de_letra = X_W_OPC; + else if (c == 'X') + x_de_letra = X_X_OPC; + else if (c == 'Y') + x_de_letra = X_Y_OPC; + else if (c == 'Z') + x_de_letra = X_Z_OPC; +// else if (c == ' ') +// x_de_letra = ESPACIO_OPC; + else + y_de_letra = y_de_signos; + + if (c == '.') + x_de_letra = X_PUNTO_OPC; + else if (c == ',') + x_de_letra = X_COMA_OPC; + else if (c == '-') + x_de_letra = X_GUION_OPC; + else if (c == '?') + x_de_letra = X_CIERRA_INTERROGACION_OPC; +// else if (c == '¨') +// x_de_letra = X_ABRE_INTERROGACION_OPC; + else if (c == '"') + x_de_letra = X_COMILLAS_OPC; +// else if (c == '!') +// x_de_letra = X_CIERRA_EXCLAMACION_OPC; + else if (c == '') + x_de_letra = X_ABRE_EXCLAMACION_OPC; + else if (c == ';') + x_de_letra = X_PUNTO_Y_COMA_OPC; + else if (c == '>') + x_de_letra = X_MAYOR_QUE_OPC; + else if (c == '<') + x_de_letra = X_MENOR_QUE_OPC; + else if (c == '$') + x_de_letra = X_DOLAR_OPC; + else if (c == '%') + x_de_letra = X_POR_CIENTO_OPC; + else if (c == ':') + x_de_letra = X_DOS_PUNTOS_OPC; + else if (c == '&') + x_de_letra = X_AND_OPC; + else if (c == '/') + x_de_letra = X_BARRA_OPC; + else if (c == '(') + x_de_letra = X_ABRE_PARENTESIS_OPC; + else if (c == ')') + x_de_letra = X_CIERRA_PARENTESIS_OPC; + else if (c == '*') + x_de_letra = X_ASTERISCO_OPC; + else if (c == '+') + x_de_letra = X_MAS_OPC; + else if (c == '1') + x_de_letra = X_N1_OPC; + else if (c == '2') + x_de_letra = X_N2_OPC; + else if (c == '3') + x_de_letra = X_N3_OPC; + else if (c == '4') + x_de_letra = X_N4_OPC; + else if (c == '5') + x_de_letra = X_N5_OPC; + else if (c == '6') + x_de_letra = X_N6_OPC; + else if (c == '7') + x_de_letra = X_N7_OPC; + else if (c == '8') + x_de_letra = X_N8_OPC; + else if (c == '9') + x_de_letra = X_N9_OPC; + else if (c == '0') + x_de_letra = X_N0_OPC; + + pos_texto[0] = x_de_letra; + pos_texto[1] = y_de_letra; + pos_texto[2] = x_pantalla; + pos_texto[3] = y_pantalla; + pos_texto[4] = ANCHO_LETRAS_OPC; + pos_texto[5] = ALTO_LETRAS_OPC; + + DIBUJA_BLOQUE_CUT(pos_texto, dir_hare_fondo, dir_zona_pantalla); + + x_pantalla = x_pantalla + ANCHO_LETRAS_OPC; + } +} + +void DrasculaEngine::responde(int funcion) { + if (funcion == 10) + habla_borracho(TEXTB1, "B1.als"); + else if (funcion == 11) + habla_borracho(TEXTB2, "B2.als"); + else if (funcion == 12) + habla_borracho(TEXTB3, "B3.als"); + else if (funcion == 8) + animacion_8(); + else if (funcion == 9) + animacion_9(); + else if (funcion == 10) + animacion_10(); + else if (funcion == 15) + animacion_15(); + else if (funcion == 16) + animacion_16(); + else if (funcion == 17) + animacion_17(); + else if (funcion == 19) + animacion_19(); + else if (funcion == 20) + animacion_20(); + else if (funcion == 21) + animacion_21(); + else if (funcion == 23) + animacion_23(); + else if (funcion == 28) + animacion_28(); + else if (funcion == 29) + animacion_29(); + else if (funcion == 30) + animacion_30(); + else if (funcion == 31) + animacion_31(); +} + +void DrasculaEngine::habla_pianista(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + int x_habla[4] = { 97, 145, 193, 241}; + int cara; + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(3); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 139, 228, 112, 47, 60, + dir_hare_dch, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 221, 128); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_borracho(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 1, 21, 41, 61, 81, 101, 121, 141 }; + int cara; + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + lee_dibujos("an11y13.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + flags[13] = 1; + +bebiendo: + + if (flags[12] == 1) { + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + goto bebiendo; + } + + buffer_teclado(); + + color_abc(VERDE_OSCURO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz\n"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 181, 54); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + byte key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + flags[13] = 0; + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + if (music_status() == 0 && flags[11] == 0) + playmusic(musica_room); +} + +void DrasculaEngine::suma_objeto(int osj) { + int h, puesto = 0; + + for (h = 1; h < 43; h++) { + if (objetos_que_tengo[h] == osj) + puesto = 1; + } + + if (puesto == 0) { + for (h = 1; h < 43; h++) { + if (objetos_que_tengo[h] == 0) { + objetos_que_tengo[h]=osj; + puesto = 1; + break; + } + } + } +} + +void DrasculaEngine::fin_sound_corte() { + if (hay_sb == 1) { + ctvd_stop(); + delete sku; + ctvd_terminate(); + } +} + +void DrasculaEngine::MusicFadeout() { + int org_vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType); + for (;;) { + int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType); + vol -= 10; + if (vol < 0) + vol = 0; + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol); + if (vol == 0) + break; + update_events(); + _system->updateScreen(); + _system->delayMillis(50); + } + AudioCD.stop(); + _system->delayMillis(100); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol); +} + +void DrasculaEngine::ctvd_end() { + _mixer->stopHandle(_soundHandle); +} + +void DrasculaEngine::ctvd_stop() { + _mixer->stopHandle(_soundHandle); +} + +void DrasculaEngine::ctvd_terminate() { +// _mixer->stopHandle(_soundHandle); +} + +void DrasculaEngine::ctvd_speaker(int flag) {} + +void DrasculaEngine::ctvd_output(Common::File *file_handle) {} + +void DrasculaEngine::ctvd_init(int b) { + int soundSize = sku->size(); + byte *soundData = (byte *)malloc(soundSize); + sku->seek(32); + sku->read(soundData, soundSize); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64, + 11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED); +} + +int DrasculaEngine::LookForFree() { + return _mixer->isSoundHandleActive(_soundHandle); +} + +void DrasculaEngine::actualiza_datos() { + if (!strcmp(num_room,"2.alg") && flags[40] == 0) + visible[3] = 0; + else if (!strcmp(num_room, "3.alg") && flags[3] == 1) + visible[8] = 0; + else if (!strcmp(num_room, "6.alg") && flags[1] == 1 && flags[10] == 0) { + visible[2] = 0; + visible[4] = 1; + } else if (!strcmp(num_room, "7.alg") && flags[35] == 1) + visible[3] = 0; + else if (!strcmp(num_room, "14.alg") && flags[5] == 1) + visible[4] = 0; + else if (!strcmp(num_room, "18.alg") && flags[28] == 1) + visible[2] = 0; +} + +void DrasculaEngine::animacion_1_2() { + lleva_al_hare(178, 121); + lleva_al_hare(169, 135); +} + +void DrasculaEngine::animacion_2_2() { + int n, x=0; + + sentido_hare = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + lee_dibujos("an2_1.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("an2_2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_FONDO(1, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(201,87, 201,87, 50,52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + + x = 0; + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 55, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + + x = 0; + + for (n = 0; n < 6; n++){ + x++; + DIBUJA_FONDO(x, 109, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + + x = 0; + comienza_sound("s2.als"); + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 1, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(201,87, 201,87, 50,52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + + x = 0; + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 55, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + x = 0; + + for (n = 0; n < 2; n++) { + x++; + DIBUJA_FONDO(x, 109, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla); + x = x + 50; + pausa(3); + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + fin_sound(); + + pausa (4); + + comienza_sound("s1.als"); + hipo_sin_nadie(12); + fin_sound(); + } + +void DrasculaEngine::animacion_3_2() { + lleva_al_hare(163, 106); + lleva_al_hare(287, 101); + sentido_hare = 0; +} + +void DrasculaEngine::animacion_4_2() { + stopmusic(); + flags[9] = 1; + + pausa(12); + hablar(TEXTD56, "d56.als" ); + pausa(8); + + borra_pantalla(); + lee_dibujos("ciego1.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("ciego2.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("ciego3.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("ciego4.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("ciego5.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(10); + + habla_ciego(TEXTD68, "d68.als", "44472225500022227555544444664447222550002222755554444466"); + pausa(5); + habla_hacker(TEXTD57, "d57.als"); + pausa(6); + habla_ciego(TEXTD69,"d69.als","444722255000222275555444446655033336666664464402256555005504450005446"); + pausa(4); + habla_hacker(TEXTD58,"d58.als"); + habla_ciego(TEXTD70,"d70.als", "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046"); + delay(14); + habla_hacker(TEXTD59,"d59.als"); + habla_ciego(TEXTD71,"d71.als", "550330227556444744446660004446655544444722255000222275555444446644444"); + habla_hacker(TEXTD60,"d60.als"); + habla_ciego(TEXTD72,"d72.als", "55033022755644455550444744400044504447222550002222755554444466000"); + habla_hacker(TEXTD61,"d61.als"); + habla_ciego(TEXTD73,"d73.als", "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446"); + habla_hacker(TEXTD62,"d62.als"); + habla_ciego(TEXTD74,"d74.als", "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666"); + habla_hacker(TEXTD63,"d63.als"); + habla_ciego(TEXTD75,"d75.als", "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555"); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + _system->delayMillis(1); + habla_hacker(TEXTD64, "d64.als"); + habla_ciego(TEXTD76, "d76.als", "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444"); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(14); + + borra_pantalla(); + + playmusic(musica_room); + lee_dibujos("9.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("aux9.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + sin_verbo(); + + flags[9] = 0; + flags[4] = 1; +} + +void DrasculaEngine::animacion_8() { + habla_pianista(TEXTP6, "P6.als"); + hablar(TEXT358, "358.als"); + habla_pianista(TEXTP7, "P7.als"); + habla_pianista(TEXTP8, "P8.als"); +} + +void DrasculaEngine::animacion_9() { + habla_pianista(TEXTP9, "P9.als"); + habla_pianista(TEXTP10, "P10.als"); + habla_pianista(TEXTP11, "P11.als"); +} + +void DrasculaEngine::animacion_10() { + habla_pianista(TEXTP12, "P12.als"); + hablar(TEXT361, "361.als"); + pausa(40); + habla_pianista(TEXTP13, "P13.als"); + hablar(TEXT362, "362.als"); + habla_pianista(TEXTP14, "P14.als"); + hablar(TEXT363, "363.als"); + habla_pianista(TEXTP15, "P15.als"); + hablar(TEXT364, "364.als"); + habla_pianista(TEXTP16, "P16.als"); +} + +void DrasculaEngine::animacion_14() { + int n, pos_cabina[6]; + int l = 0; + + lee_dibujos("an14_2.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("an14_1.alg"); + + pos_cabina[0]=150; + pos_cabina[1]=6; + pos_cabina[2]=69; + pos_cabina[3]=-160; + pos_cabina[4]=158; + pos_cabina[5]=161; + + for (n = -160; n <= 0; n = n + 5 + l) { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + pon_hare(); + pon_vb(); + pos_cabina[3] = n; + DIBUJA_BLOQUE_CUT(pos_cabina, dir_hare_fondo, dir_zona_pantalla); + actualiza_refresco(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + l = l + 1; + } + + flags[24] = 1; + + descomprime_dibujo(dir_dibujo1, 1); + + comienza_sound("s7.als"); + hipo(15); + + fin_sound(); + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); +} + +void DrasculaEngine::animacion_15() { + habla_borracho(TEXTB8, "B8.als"); + pausa(7); + habla_borracho(TEXTB9, "B9.als"); + habla_borracho(TEXTB10, "B10.als"); + habla_borracho(TEXTB11, "B11.als"); +} + +void DrasculaEngine::animacion_16() { + int l; + + habla_borracho(TEXTB12, "B12.als"); + hablar(TEXT371, "371.als"); + + borra_pantalla(); + + playmusic(32); + int key = getscan(); + if (key != 0) + goto asco; + + color_abc(VERDE_OSCURO); + + lee_dibujos("his1.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + centra_texto(HIS1, 180, 180); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + key = getscan(); + if (key != 0) + goto asco; + + _system->delayMillis(4); + key = getscan(); + if (key != 0) + goto asco; + + FundeAlNegro(1); + key = getscan(); + if (key != 0) + goto asco; + + borra_pantalla(); + lee_dibujos("his2.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + centra_texto(HIS2, 180, 180); + VUELCA_PANTALLA(0,0,0,0, 320,200, dir_zona_pantalla); + key = getscan(); + if (key != 0) + goto asco; + + _system->delayMillis(4); + key = getscan(); + if (key != 0) + goto asco; + + FundeAlNegro(1); + key = getscan(); + if (key != 0) + goto asco; + + borra_pantalla(); + lee_dibujos("his3.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + centra_texto(HIS3, 180, 180); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + key = getscan(); + if (key != 0) + goto asco; + + _system->delayMillis(4); + key = getscan(); + if (key != 0) + goto asco; + + FundeAlNegro(1); + + borra_pantalla(); + lee_dibujos("his4_1.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("his4_2.alg"); + descomprime_dibujo(dir_dibujo3, 1); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo3, dir_zona_pantalla); + centra_texto(HIS1, 180, 180); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + key = getscan(); + if (key != 0) + goto asco; + + _system->delayMillis(4); + key = getscan(); + if (key != 0) + goto asco; + + for (l = 1; l < 200; l++){ + DIBUJA_FONDO(0, 0, 0, l, 320, 200 - l, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(0, 200 - l, 0, 0, 320, l, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0,0,0,0, 320,200, dir_zona_pantalla); + key = getscan(); + if (key != 0) + goto asco; + } + + pausa(5); + FundeAlNegro(2); + borra_pantalla(); + +asco: + lee_dibujos(pantalla_disco); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos(num_room); + descomprime_dibujo(dir_dibujo1, MEDIA); + Negro(); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(0); + if (musica_room != 0) + playmusic(musica_room); + else + stopmusic(); +} + +void DrasculaEngine::animacion_17() { + habla_borracho(TEXTB13, "B13.als"); + habla_borracho(TEXTB14, "B14.als"); + flags[40] = 1; +} + +void DrasculaEngine::animacion_19() { + habla_vbpuerta(TEXTVB5, "VB5.als"); +} + +void DrasculaEngine::animacion_20() { + habla_vbpuerta(TEXTVB7, "VB7.als"); + habla_vbpuerta(TEXTVB8, "VB8.als"); + hablar(TEXT383, "383.als"); + habla_vbpuerta(TEXTVB9, "VB9.als"); + hablar(TEXT384, "384.als"); + habla_vbpuerta(TEXTVB10, "VB10.als"); + hablar(TEXT385, "385.als"); + habla_vbpuerta(TEXTVB11, "VB11.als"); + if (flags[23] == 0) { + hablar(TEXT350, "350.als"); + habla_vbpuerta(TEXTVB57, "VB57.als"); + } else { + hablar(TEXT386, "386.als"); + habla_vbpuerta(TEXTVB12, "VB12.als"); + flags[18] = 0; + flags[14] = 1; + abre_puerta(15, 1); + sal_de_la_habitacion(1); + animacion_23(); + sal_de_la_habitacion(0); + flags[21] = 0; + flags[24] = 0; + sentido_vb = 1; + vb_x = 120; + + rompo_y_salgo = 1; + } +} + +void DrasculaEngine::animacion_21() { + habla_vbpuerta(TEXTVB6, "VB6.als"); +} + +void DrasculaEngine::animacion_23() { + lee_dibujos("an24.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + flags[21] = 1; + + if (flags[25] == 0) { + habla_vb(TEXTVB13, "VB13.als"); + habla_vb(TEXTVB14, "VB14.als"); + pausa(10); + hablar(TEXT387, "387.als"); + } + + habla_vb(TEXTVB15, "VB15.als"); + lleva_vb(42); + sentido_vb = 1; + habla_vb(TEXTVB16, "VB16.als"); + sentido_vb = 2; + lleva_al_hare(157, 147); + lleva_al_hare(131, 149); + sentido_hare = 0; + animacion_14(); + if (flags[25] == 0) + habla_vb(TEXTVB17, "VB17.als"); + pausa(8); + sentido_vb = 1; + habla_vb(TEXTVB18, "VB18.als"); + + if (flags[29] == 0) + animacion_23_anexo(); + else + animacion_23_anexo2(); + + sentido_vb = 2; + animacion_25(); + lleva_vb(99); + + if (flags[29] == 0) { + habla_vb(TEXTVB19, "VB19.als"); + if (flags[25] == 0) { + habla_vb(TEXTVB20,"VB20.als"); + if (resta_objeto(7) == 0) + flags[30] = 1; + if (resta_objeto(18) == 0) + flags[31] = 1; + if (resta_objeto(19) == 0) + flags[32] = 1; + } + habla_vb(TEXTVB21, "VB21.als"); + } else + animacion_27(); + + flags[25] = 1; + rompo_y_salgo = 1; +} + +void DrasculaEngine::animacion_23_anexo() { + int n, p_x = hare_x + 2, p_y = hare_y - 3; + int x[] = {1,38,75,112,75,112,75,112,149,112,149,112,149,186,223,260,1,38,75,112,149,112,149,112,149,112,149,186,223,260,260,260,260,223}; + int y[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,76,76,76,76,76,76,76,76,76,76,76,76,76,76,1,1,1,1}; + + lee_dibujos("an23.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (n = 0; n < 34; n++) { + DIBUJA_BLOQUE(p_x, p_y, p_x, p_y, 36, 74, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x[n], y[n], p_x, p_y, 36, 74, dir_hare_fondo, dir_zona_pantalla); + actualiza_refresco(); + VUELCA_PANTALLA(p_x, p_y, p_x, p_y, 36, 74, dir_zona_pantalla); + pausa(5); + } + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); +} + +void DrasculaEngine::animacion_23_anexo2() { + int n, p_x = hare_x + 4, p_y = hare_y; + int x[] = {1,35,69,103,137,171,205,239,273,1,35,69,103,137}; + int y[] = {1,1,1,1,1,1,1,1,1,73,73,73,73,73}; + + pausa(50); + + lee_dibujos("an23_2.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (n = 0; n < 14; n++) { + DIBUJA_BLOQUE(p_x, p_y, p_x, p_y, 33, 71, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x[n], y[n], p_x, p_y, 33, 71, dir_hare_fondo, dir_zona_pantalla); + actualiza_refresco(); + VUELCA_PANTALLA(p_x,p_y, p_x,p_y, 33,71, dir_zona_pantalla); + pausa(5); + } + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo,1); +} + +void DrasculaEngine::animacion_25() { + int n, pos_cabina[6]; + + lee_dibujos("an14_2.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("18.alg"); + descomprime_dibujo(dir_dibujo1, 1); + + pos_cabina[0] = 150; + pos_cabina[1] = 6; + pos_cabina[2] = 69; + pos_cabina[3] = 0; + pos_cabina[4] = 158; + pos_cabina[5] = 161; + + flags[24] = 0; + + comienza_sound("s6.als"); + + for (n = 0; n >= -160; n = n - 8) { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + pon_hare(); + pon_vb(); + + pos_cabina[3] = n; + + DIBUJA_BLOQUE_CUT(pos_cabina, dir_hare_fondo, dir_zona_pantalla); + + actualiza_refresco(); + VUELCA_PANTALLA(0,0, 0,0, 320,200, dir_zona_pantalla); + } + + fin_sound(); + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); +} + +void DrasculaEngine::animacion_27() { + flags[22] = 1; + + sin_verbo(); + resta_objeto(23); + suma_objeto(11); + + habla_vb(TEXTVB23, "VB23.als"); + habla_vb(TEXTVB24, "VB24.als"); + if (flags[30] == 1) + suma_objeto(7); + if (flags[31] == 1) + suma_objeto(18); + if (flags[32] == 1) + suma_objeto(19); + habla_vb(TEXTVB25,"VB25.als"); + habla_vb(TEXTVB26,"VB26.als"); +} + +void DrasculaEngine::animacion_28(){ + habla_vb(TEXTVB27, "VB27.als"); + habla_vb(TEXTVB28, "VB28.als"); + habla_vb(TEXTVB29, "VB29.als"); + habla_vb(TEXTVB30, "VB30.als"); +} + +void DrasculaEngine::animacion_29(){ + if (flags[33] == 0) { + habla_vb(TEXTVB32, "VB32.als"); + hablar(TEXT398, "398.als"); + habla_vb(TEXTVB33, "VB33.als"); + hablar(TEXT399, "399.als"); + habla_vb(TEXTVB34, "VB34.als"); + habla_vb(TEXTVB35, "VB35.als"); + hablar(TEXT400, "400.als"); + habla_vb(TEXTVB36, "VB36.als"); + habla_vb(TEXTVB37, "VB37.als"); + hablar(TEXT386, "386.als"); + habla_vb(TEXTVB38, "VB38.als"); + habla_vb(TEXTVB39, "VB39.als"); + hablar(TEXT401, "401.als"); + habla_vb(TEXTVB40, "VB40.als"); + habla_vb(TEXTVB41, "VB41.als"); + flags[33] = 1; + } else + habla_vb(TEXTVB43, "VB43.als"); + + hablar(TEXT402, "402.als"); + habla_vb(TEXTVB42, "VB42.als"); + + if (flags[38] == 0) { + hablar(TEXT403, "403.als"); + rompo_y_salgo = 1; + } else + hablar(TEXT386, "386.als"); +} + +void DrasculaEngine::animacion_30(){ + habla_vb(TEXTVB31, "VB31.als"); + hablar(TEXT396, "396.als"); +} + +void DrasculaEngine::animacion_31(){ + habla_vb(TEXTVB44, "VB44.als"); + lleva_vb(-50); + pausa(15); + lleva_al_hare(159, 140); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + sentido_hare = 2; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(78); + sentido_hare = 0; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(22); + hablar(TEXT406, "406.als"); + lleva_vb(98); + habla_vb(TEXTVB45, "VB45.als"); + habla_vb(TEXTVB46, "VB46.als"); + habla_vb(TEXTVB47, "VB47.als"); + hablar(TEXT407, "407.als"); + habla_vb(TEXTVB48, "VB48.als"); + habla_vb(TEXTVB49, "VB49.als"); + hablar(TEXT408, "408.als"); + habla_vb(TEXTVB50, "VB50.als"); + habla_vb(TEXTVB51, "VB51.als"); + hablar(TEXT409, "409.als"); + habla_vb(TEXTVB52, "VB52.als"); + habla_vb(TEXTVB53, "VB53.als"); + pausa(12); + habla_vb(TEXTVB54, "VB54.als"); + habla_vb(TEXTVB55, "VB55.als"); + hablar(TEXT410, "410.als"); + habla_vb(TEXTVB56, "VB56.als"); + + rompo_y_salgo = 1; + + flags[38] = 0; + flags[36] = 1; + sin_verbo(); + resta_objeto(8); + resta_objeto(13); + resta_objeto(15); + resta_objeto(16); + resta_objeto(17); + suma_objeto(20); +} + +void DrasculaEngine::animacion_35() { + int n, x = 0; + + lleva_al_hare(96, 165); + lleva_al_hare(79, 165); + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + lee_dibujos("an35_1.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("an35_2.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 1, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(70,90, 70,90, 46,80,dir_zona_pantalla); + x = x + 46; + pausa(3); + } + x = 0; + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(70, 90, 70, 90, 46, 80, dir_zona_pantalla); + x = x + 46; + pausa(3); + } + + x = 0; + + for (n = 0; n < 6; n++) { + x++; + DIBUJA_FONDO(x, 1, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(70, 90, 70, 90, 46, 80, dir_zona_pantalla); + + x = x + 46; + + pausa(3); + } + x = 0; + + for (n = 0; n < 2; n++) { + x++; + DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(70, 90, 70,90, 46, 80,dir_zona_pantalla); + x = x + 46; + pausa(3); + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(19); + + comienza_sound("s1.als"); + hipo_sin_nadie(18); + fin_sound(); + + pausa(10); + + FundeAlNegro(2); + + // TODO + salir_al_dos(3); +} + +void DrasculaEngine::habla_vb(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[6] = {1,27,53,79,105,131}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(VON_BRAUN); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + + DIBUJA_FONDO(vb_x + 5, 64, ANCHOBJ + 1, 0, 25, 27, dir_dibujo1, dir_dibujo3); + +bucless: + + if (sentido_vb == 1) { + cara = _rnd->getRandomNumber(5); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + pon_hare(); + pon_vb(); + + DIBUJA_FONDO(ANCHOBJ + 1, 0, vb_x + 5, 64, 25, 27, dir_dibujo3, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 34, vb_x + 5, 64, 25, 27, dir_hare_frente, dir_zona_pantalla); + actualiza_refresco(); + } + + if (con_voces == 0) + centra_texto(dicho, vb_x, 66); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (music_status() == 0 && flags[11] == 0 && musica_room != 0) + playmusic(musica_room); +} + +void DrasculaEngine::habla_vbpuerta(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(VON_BRAUN); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + refresca_pantalla(); + if (con_voces == 0) + centra_texto(dicho, 150, 80); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (music_status() == 0 && flags[11] == 0 && musica_room != 0) + playmusic(musica_room); +} + +void DrasculaEngine::habla_ciego(const char *dicho, const char *filename, const char *sincronia) { + byte *num_cara; + int p; + int pos_ciego[6]; + int cara = 0; + + int longitud; + longitud = strlen(dicho); + + buffer_teclado(); + + color_abc(VON_BRAUN); + + // FIXME: We can't do this to a read-only string! +#if 0 + for (p = 0; sincronia[p]; p++) + sincronia[p] = toupper(sincronia[p]); +#endif + + p = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + + pos_ciego[1] = 2; + pos_ciego[2] = 73; + pos_ciego[3] = 1; + pos_ciego[4] = 126; + pos_ciego[5] = 149; + +bucless: + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + pos_ciego[5] = 149; + if (sincronia[p] == '0') + cara = 0; + if (sincronia[p] == '1') + cara = 1; + if (sincronia[p] == '2') + cara = 2; + if (sincronia[p] == '3') + cara = 3; + if (sincronia[p] == '4') + cara = 4; + if (sincronia[p] == '5') + cara = 5; + if (sincronia[p] == '6') + cara = 6; + if (sincronia[p] == '7') + cara = 7; + + if (cara == 0 || cara == 2 || cara == 4 || cara == 6) + pos_ciego[0] = 1; + else + pos_ciego[0] = 132; + + if (cara == 0) + num_cara = dir_dibujo3; + else if (cara == 1) + num_cara = dir_dibujo3; + else if (cara == 2) + num_cara = dir_hare_dch; + else if (cara == 3) + num_cara = dir_hare_dch; + else if (cara == 4) + num_cara = dir_hare_fondo; + else if (cara == 5) + num_cara = dir_hare_fondo; + else { + num_cara = dir_hare_frente; + pos_ciego[5] = 146; + } + + DIBUJA_BLOQUE_CUT( pos_ciego, num_cara, dir_zona_pantalla); + + if (con_voces == 0) + centra_texto(dicho, 310, 71); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(2); + p++; + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } +} + +void DrasculaEngine::habla_hacker(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + color_abc(AMARILLO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + if (con_voces == 0) + centra_texto(dicho, 156, 170); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + int key = getscan(); + if (key!=0) + ctvd_stop(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + key = 0; +} + +void DrasculaEngine::anda_pabajo() { + direccion_hare = 4; + sentido_hare = 3; + paso_x = 0; +} + +void DrasculaEngine::anda_parriba() { + direccion_hare = 0; + sentido_hare = 2; + paso_x = 0; +} + +void DrasculaEngine::pon_vb() { + int pos_vb[6]; + + if (vb_se_mueve == 0) { + pos_vb[0] = 256; + pos_vb[1] = 129; + pos_vb[2] = vb_x; + pos_vb[3] = 66; + pos_vb[4] = 33; + pos_vb[5] = 69; + if (sentido_vb == 0) + pos_vb[0] = 222; + else if (sentido_vb == 1) + pos_vb[0] = 188; + } else { + pos_vb[2] = vb_x; + pos_vb[3] = 66; + pos_vb[4] = 28; + pos_vb[5] = 68; + + if (sentido_vb == 0) { + pos_vb[0] = frame_vb; + pos_vb[1] = 62; + } else { + pos_vb[0] = frame_vb; + pos_vb[1] = 131; + } + + frame_vb = frame_vb + 29; + if (frame_vb > 146) + frame_vb = 1; + } + + DIBUJA_BLOQUE_CUT(pos_vb, dir_hare_frente, dir_zona_pantalla); +} + +void DrasculaEngine::lleva_vb(int punto_x) { + if (punto_x < vb_x) + sentido_vb = 0; + else + sentido_vb = 1; + + vb_se_mueve = 1; + + for (;;) { + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + if (sentido_vb == 0) { + vb_x = vb_x - 5; + if (vb_x <= punto_x) + break; + } else { + vb_x = vb_x + 5; + if (vb_x >= punto_x) + break; + } + pausa(5); + } + + vb_se_mueve = 0; +} + +void DrasculaEngine::hipo_sin_nadie(int contador){ + int y = 0, sentido = 0; + contador = contador; + +comienza: + contador--; + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + + if (sentido == 0) + y++; + else + y--; + if (y == 2) + sentido = 1; + if (y == 0) + sentido = 0; + if (contador > 0) + goto comienza; + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::abre_puerta(int nflag, int n_puerta) { + if (flags[nflag] == 0) { + comienza_sound("s3.als"); + flags[nflag] = 1; + if (n_puerta != NO_PUERTA) + puertas_cerradas(n_puerta); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + fin_sound(); + sin_verbo(); + } +} + +void DrasculaEngine::mapa() { + int l, veo = 0; + + for (l = 0; l < objs_room; l++) { + if (x_raton > x1[l] && y_raton > y1[l] + && x_raton < x2[l] && y_raton < y2[l] + && visible[l] == 1) { + strcpy(texto_nombre, nombre_obj[l]); + hay_nombre = 1; + veo = 1; + } + } + + if (veo == 0) + hay_nombre = 0; +} + +void DrasculaEngine::refresca_1_antes() { + int cambio_col_antes = cambio_de_color; + + if (hare_x > 98 && hare_x < 153) + cambio_de_color = 1; + else + cambio_de_color = 0; + + if (cambio_col_antes != cambio_de_color && cambio_de_color == 1) + hare_oscuro(); + if (cambio_col_antes != cambio_de_color && cambio_de_color == 0) + hare_claro(); + + if (flags[8] == 0) + DIBUJA_FONDO(2, 158, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_2(){ + int pos_murci[6]; + int diferencia; + int murci_x[] = {0,38,76,114,152,190,228,266, + 0,38,76,114,152,190,228,266, + 0,38,76,114,152,190, + 0,48,96,144,192,240, + 30,88,146,204,262, + 88,146,204,262, + 88,146,204,262}; + + int murci_y[] = {179,179,179,179,179,179,179,179, + 158,158,158,158,158,158,158,158, + 137,137,137,137,137,137, + 115,115,115,115,115,115, + 78,78,78,78,78, + 41,41,41,41, + 4,4,4,4}; + + if (frame_murcielago == 41) + frame_murcielago = 0; + + pos_murci[0] = murci_x[frame_murcielago]; + pos_murci[1] = murci_y[frame_murcielago]; + + if (frame_murcielago < 22) { + pos_murci[4] = 37; + pos_murci[5] = 21; + } else if (frame_murcielago > 27) { + pos_murci[4] = 57; + pos_murci[5] = 36; + } else { + pos_murci[4] = 47; + pos_murci[5] = 22; + } + + pos_murci[2] = 239; + pos_murci[3] = 19; + + DIBUJA_BLOQUE_CUT(pos_murci, dir_dibujo3, dir_zona_pantalla); + diferencia = vez() - conta_ciego_vez; + if (diferencia >= 6) { + frame_murcielago++; + conta_ciego_vez = vez(); + } + + DIBUJA_BLOQUE(29, 37, 58, 114, 57, 39, dir_dibujo3, dir_zona_pantalla); + mapa(); +} + +void DrasculaEngine::refresca_3_antes() { + if (flags[3] == 1) + DIBUJA_FONDO(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_3() { + if (hare_y + alto_hare < 118) + DIBUJA_BLOQUE(129, 110, 194, 36, 126, 88, dir_dibujo3, dir_zona_pantalla); + DIBUJA_BLOQUE(47, 57, 277, 143, 43, 50, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_4() { + int cambio_col_antes = cambio_de_color; + if (hare_x > 190) + cambio_de_color = 1; + else + cambio_de_color=0; + + if (cambio_col_antes != cambio_de_color && cambio_de_color == 1) + hare_oscuro(); + if (cambio_col_antes != cambio_de_color && cambio_de_color == 0) + hare_claro(); +} + +void DrasculaEngine::refresca_5() { + DIBUJA_BLOQUE(114, 130, 211, 87, 109, 69, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_15() { + DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_17() { + DIBUJA_BLOQUE(48, 135, 78, 139, 80, 30, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_18() { + if (flags[24] == 1) + DIBUJA_BLOQUE(177, 1, 69, 29, 142, 130, dir_dibujo3, dir_zona_pantalla); + DIBUJA_BLOQUE(105, 132, 109, 108, 196, 65, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_5_antes(){ + if (flags[8] == 0) + DIBUJA_FONDO(256, 152, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_6_antes() { + int cambio_col_antes=cambio_de_color; + + if ((hare_x > 149 && hare_y + alto_hare > 160 && hare_x < 220 && hare_y + alto_hare < 188) || + (hare_x > 75 && hare_y + alto_hare > 183 && hare_x < 145)) + cambio_de_color = 0; + else + cambio_de_color=1; + + if (cambio_col_antes != cambio_de_color && cambio_de_color == 1) + hare_oscuro(); + if (cambio_col_antes != cambio_de_color && cambio_de_color == 0) + hare_claro(); + + if (flags[1] == 0) + DIBUJA_FONDO(97, 117, 34, 148, 36, 31, dir_dibujo3, dir_zona_pantalla); + if (flags[0] == 0) + DIBUJA_FONDO(3, 103, 185, 69, 23, 76, dir_dibujo3, dir_zona_pantalla); + if (flags[2] == 0) + DIBUJA_FONDO(28, 100, 219, 72, 64, 97, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_7_antes() { + if (flags[35] == 0) + DIBUJA_FONDO(1, 72, 158, 162, 19, 12, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_9_antes() { + int ciego_x[] = {26,68,110,152,194,236,278,26,68}; + int ciego_y[] = {51,51,51,51,51,51,51,127,127}; + int diferencia; + + DIBUJA_BLOQUE(ciego_x[frame_ciego], ciego_y[frame_ciego], 122, 57, 41, 72, dir_dibujo3, dir_zona_pantalla); + if (flags[9] == 0) { + diferencia = vez() - conta_ciego_vez; + if (diferencia >= 11) { + frame_ciego++; + conta_ciego_vez = vez(); + } + if (frame_ciego == 9) + frame_ciego = 0; + } else + frame_ciego=3; +} + +void DrasculaEngine::refresca_12_antes() { + if (flags[16] == 0) + DIBUJA_FONDO(1, 131, 106, 117, 55, 68, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_14_antes() { + int velas_y[] = {158,172,186}; + int cirio_x[] = {14,19,24}; + int pianista_x[] = {1,91,61,31,91,31,1,61,31}; + int borracho_x[] = {1,42,83,124,165,206,247,1}; + int diferencia; + + DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla); + + if (parpadeo == 5) + DIBUJA_FONDO(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla); + if (hare_x > 101 && hare_x < 155) + DIBUJA_FONDO(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla); + if (flags[11] == 0) + DIBUJA_FONDO(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla); + else if (flags[5] == 0) + DIBUJA_FONDO(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla); + else + DIBUJA_FONDO(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla); + + if (flags[12] == 1) + DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla); + diferencia = vez() - conta_ciego_vez; + if (diferencia > 6) { + if (flags[12] == 1) { + frame_borracho++; + if (frame_borracho == 8) { + frame_borracho = 0; + flags[12] = 0; + } + } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0)) + flags[12] = 1; + + frame_velas++; + if (frame_velas == 3) + frame_velas = 0; + frame_piano++; + if (frame_piano == 9) + frame_piano = 0; + parpadeo = _rnd->getRandomNumber(10); + conta_ciego_vez=vez(); + } +} + +void DrasculaEngine::refresca_16_antes() { + if (flags[17] == 0) + DIBUJA_FONDO(1, 103, 24, 72, 33, 95, dir_dibujo3, dir_zona_pantalla); + if (flags[19] == 1) + DIBUJA_FONDO(37, 151, 224, 115, 56, 47, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_17_antes() { + if (flags[15] == 1) + DIBUJA_FONDO(1, 135, 108, 65, 44, 63, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_18_antes() { + int diferencia; + int ronquido_x[] = {95,136,95,136,95,95,95,95,136,95,95,95,95,95,95,95}; + int ronquido_y[] = {18,18,56,56,94,94,94,94,94,18,18,18,18,18,18,18}; + + if (flags[21] == 0) { + DIBUJA_FONDO(1, 69, 120, 58, 56, 61, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(ronquido_x[frame_ronquido], ronquido_y[frame_ronquido], 124, 59, 40, 37, dir_dibujo3, dir_zona_pantalla); + } else + pon_vb(); + + diferencia = vez() - conta_ciego_vez; + if (diferencia > 9) { + frame_ronquido++; + if (frame_ronquido == 16) + frame_ronquido = 0; + conta_ciego_vez = vez(); + } +} + + + +} // End of namespace Drascula diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h new file mode 100644 index 0000000000..d8e49ba930 --- /dev/null +++ b/engines/drascula/drascula.h @@ -0,0 +1,702 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef DRASCULA_H +#define DRASCULA_H + +#include "common/stdafx.h" +#include "common/scummsys.h" +#include "common/endian.h" +#include "common/util.h" +#include "common/file.h" +#include "common/savefile.h" +#include "common/system.h" +#include "common/hash-str.h" +#include "common/events.h" +#include "common/keyboard.h" + +#include "sound/audiostream.h" +#include "sound/mixer.h" +#include "sound/voc.h" +#include "sound/audiocd.h" + +#include "engines/engine.h" + +namespace Drascula { + +enum DrasculaGameFeatures { +}; + +struct DrasculaGameDescription; + +#define NUM_SAVES 10 +#define NUM_BANDERAS 50 +#define ESC 0x01 +#define F1 0x3B +#define F2 0x3C +#define F3 0x3D +#define F4 0x3E +#define F5 0x3F +#define F6 0x40 +#define F8 0x42 +#define F9 0x43 +#define F10 0x44 +#define MIRAR 1 +#define COGER 2 +#define ABRIR 3 +#define CERRAR 4 +#define HABLAR 5 +#define MOVER 6 +#define INICISOUND 6 +#define FINALSOUND 8 +#define FINDRV 9 +#define DIF_MASK 55 +#define ANCHOBJ 40 +#define ALTOBJ 25 + +#define X_OBJ1 5 +#define Y_OBJ1 10 +#define X_OBJ2 50 +#define Y_OBJ2 10 +#define X_OBJ3 95 +#define Y_OBJ3 10 +#define X_OBJ4 140 +#define Y_OBJ4 10 +#define X_OBJ5 185 +#define Y_OBJ5 10 +#define X_OBJ6 230 +#define Y_OBJ6 10 +#define X_OBJ7 275 +#define Y_OBJ7 10 +#define X_OBJ8 5 +#define Y_OBJ8 40 +#define X_OBJ9 50 +#define Y_OBJ9 40 +#define X_OBJ10 95 +#define Y_OBJ10 40 +#define X_OBJ11 140 +#define Y_OBJ11 40 +#define X_OBJ12 185 +#define Y_OBJ12 40 +#define X_OBJ13 230 +#define Y_OBJ13 40 +#define X_OBJ14 275 +#define Y_OBJ14 40 +#define X_OBJ15 5 +#define Y_OBJ15 70 +#define X_OBJ16 50 +#define Y_OBJ16 70 +#define X_OBJ17 95 +#define Y_OBJ17 70 +#define X_OBJ18 140 +#define Y_OBJ18 70 +#define X_OBJ19 185 +#define Y_OBJ19 70 +#define X_OBJ20 230 +#define Y_OBJ20 70 +#define X_OBJ21 275 +#define Y_OBJ21 70 +#define X_OBJ22 5 +#define Y_OBJ22 100 +#define X_OBJ23 50 +#define Y_OBJ23 100 +#define X_OBJ24 95 +#define Y_OBJ24 100 +#define X_OBJ25 140 +#define Y_OBJ25 100 +#define X_OBJ26 185 +#define Y_OBJ26 100 +#define X_OBJ27 230 +#define Y_OBJ27 100 +#define X_OBJ28 275 +#define Y_OBJ28 100 +#define X_OBJ29 5 +#define Y_OBJ29 130 +#define X_OBJ30 50 +#define Y_OBJ30 130 +#define X_OBJ31 95 +#define Y_OBJ31 130 +#define X_OBJ32 140 +#define Y_OBJ32 130 +#define X_OBJ33 185 +#define Y_OBJ33 130 +#define X_OBJ34 230 +#define Y_OBJ34 130 +#define X_OBJ35 275 +#define Y_OBJ35 130 +#define X_OBJ36 5 +#define Y_OBJ36 160 +#define X_OBJ37 50 +#define Y_OBJ37 160 +#define X_OBJ38 95 +#define Y_OBJ38 160 +#define X_OBJ39 140 +#define Y_OBJ39 160 +#define X_OBJ40 185 +#define Y_OBJ40 160 +#define X_OBJ41 230 +#define Y_OBJ41 160 +#define X_OBJ42 275 +#define Y_OBJ42 160 +#define X_OBJ43 275 +#define Y_OBJ43 160 + +#define DIF_MASK_HARE 72 +#define DIF_MASK_ABC 22 +#define ANCHO_LETRAS 8 +#define ALTO_LETRAS 6 + +#define Y_ABC 158 +#define Y_SIGNOS 169 +#define Y_ACENTOS 180 + +#define X_A 6 +#define X_B 15 +#define X_C 24 +#define X_D 33 +#define X_E 42 +#define X_F 51 +#define X_G 60 +#define X_H 69 +#define X_I 78 +#define X_J 87 +#define X_K 96 +#define X_L 105 +#define X_M 114 +#define X_N 123 +#define X_GN 132 +#define X_O 141 +#define X_P 150 +#define X_Q 159 +#define X_R 168 +#define X_S 177 +#define X_T 186 +#define X_U 195 +#define X_V 204 +#define X_W 213 +#define X_X 222 +#define X_Y 231 +#define X_Z 240 +#define X_PUNTO 6 +#define X_COMA 15 +#define X_GUION 24 +#define X_CIERRA_INTERROGACION 33 +#define X_ABRE_INTERROGACION 42 +#define X_COMILLAS 51 +#define X_CIERRA_EXCLAMACION 60 +#define X_ABRE_EXCLAMACION 69 +#define X_PUNTO_Y_COMA 78 +#define X_MAYOR_QUE 87 +#define X_MENOR_QUE 96 +#define X_DOLAR 105 +#define X_POR_CIENTO 114 +#define X_DOS_PUNTOS 123 +#define X_AND 132 +#define X_BARRA 141 +#define X_ABRE_PARENTESIS 150 +#define X_CIERRA_PARENTESIS 159 +#define X_ASTERISCO 168 +#define X_MAS 177 +#define X_N1 186 +#define X_N2 195 +#define X_N3 204 +#define X_N4 213 +#define X_N5 222 +#define X_N6 231 +#define X_N7 240 +#define X_N8 249 +#define X_N9 258 +#define X_N0 267 +#define ESPACIO 250 +#define ALTO_HABLA_HARE 25 +#define ANCHO_HABLA_HARE 23 +#define VON_BRAUN 1 +#define AZUL_OSCURO 2 +#define VERDE_CLARO 3 +#define VERDE_OSCURO 4 +#define AMARILLO 5 +#define NARANJA 6 +#define ROJO 7 +#define MARRON 8 +#define MORADO 9 +#define BLANCO 10 +#define ROSA 11 +#define PASO_HARE_X 8 +#define PASO_HARE_Y 3 +#define ALTO_PERSONAJE 70 +#define ANCHO_PERSONAJE 43 +#define PIES_HARE 12 + +#define ANCHO_LETRAS_OPC 6 +#define ALTO_LETRAS_OPC 5 +#define Y_ABC_OPC_1 6 +#define Y_SIGNOS_OPC_1 15 +#define Y_ABC_OPC_2 31 +#define Y_SIGNOS_OPC_2 40 +#define Y_ABC_OPC_3 56 +#define Y_SIGNOS_OPC_3 65 +#define X_A_OPC 10 +#define X_B_OPC 17 +#define X_C_OPC 24 +#define X_D_OPC 31 +#define X_E_OPC 38 +#define X_F_OPC 45 +#define X_G_OPC 52 +#define X_H_OPC 59 +#define X_I_OPC 66 +#define X_J_OPC 73 +#define X_K_OPC 80 +#define X_L_OPC 87 +#define X_M_OPC 94 +#define X_N_OPC 101 +#define X_GN_OPC 108 +#define X_O_OPC 115 +#define X_P_OPC 122 +#define X_Q_OPC 129 +#define X_R_OPC 136 +#define X_S_OPC 143 +#define X_T_OPC 150 +#define X_U_OPC 157 +#define X_V_OPC 164 +#define X_W_OPC 171 +#define X_X_OPC 178 +#define X_Y_OPC 185 +#define X_Z_OPC 192 +#define ESPACIO_OPC 199 +#define X_PUNTO_OPC 10 +#define X_COMA_OPC 17 +#define X_GUION_OPC 24 +#define X_CIERRA_INTERROGACION_OPC 31 +#define X_ABRE_INTERROGACION_OPC 38 +#define X_COMILLAS_OPC 45 +#define X_CIERRA_EXCLAMACION_OPC 52 +#define X_ABRE_EXCLAMACION_OPC 59 +#define X_PUNTO_Y_COMA_OPC 66 +#define X_MAYOR_QUE_OPC 73 +#define X_MENOR_QUE_OPC 80 +#define X_DOLAR_OPC 87 +#define X_POR_CIENTO_OPC 94 +#define X_DOS_PUNTOS_OPC 101 +#define X_AND_OPC 108 +#define X_BARRA_OPC 115 +#define X_ABRE_PARENTESIS_OPC 122 +#define X_CIERRA_PARENTESIS_OPC 129 +#define X_ASTERISCO_OPC 136 +#define X_MAS_OPC 143 +#define X_N1_OPC 150 +#define X_N2_OPC 157 +#define X_N3_OPC 164 +#define X_N4_OPC 171 +#define X_N5_OPC 178 +#define X_N6_OPC 185 +#define X_N7_OPC 192 +#define X_N8_OPC 199 +#define X_N9_OPC 206 +#define X_N0_OPC 213 +#define NO_PUERTA 99 + +#define INIT_FRAME 0 +#define CMP_RLE 1 +#define CMP_OFF 2 +#define END_ANIM 3 +#define SET_PALET 4 +#define MOUSE_KEY 5 +#define EMPTY_FRAME 6 + +#define COMPLETA 256 +#define MEDIA 128 + +class DrasculaEngine : public ::Engine { + int _gameId; + Common::KeyState _keyPressed; + +protected: + + int init(); + int go(); +// void shutdown(); + + bool initGame(); + +public: + DrasculaEngine(OSystem *syst); + virtual ~DrasculaEngine(); + int getGameId() { + return _gameId; + } + + Common::RandomSource *_rnd; + const DrasculaGameDescription *_gameDescription; + uint32 getGameID() const; + uint32 getFeatures() const; + uint16 getVersion() const; + Common::Platform getPlatform() const; + void update_events(); + + Audio::SoundHandle _soundHandle; + + void asigna_memoria(); + void libera_memoria(); + void carga_info(); + void salir_al_dos(int r); + + void lee_dibujos(const char *); + void descomprime_dibujo(byte *dir_escritura, int plt); + + typedef char DacPalette256[256][3]; + + void asigna_rgb(byte *dir_lectura, int plt); + void funde_rgb(int plt); + void paleta_hare(); + void ActualizaPaleta(); + void setvgapalette256(byte *PalBuf); + void DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho, + int Alto, byte *Origen, byte *Destino); + void DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho, + int Alto, byte *Origen, byte *Destino); + void DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino); + void VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer); + + DacPalette256 palJuego; + DacPalette256 palHare; + DacPalette256 palHareClaro; + DacPalette256 palHareOscuro; + + byte *VGA; + + byte *dir_dibujo1; + byte *dir_hare_fondo; + byte *dir_dibujo3; + byte *dir_dibujo2; + byte *dir_mesa; + byte *dir_hare_dch; + byte *dir_zona_pantalla; + byte *dir_hare_frente; + byte *dir_texto; + byte *dir_pendulo; + + byte cPal[768]; + byte *Buffer_pcx; + long LenFile; + + Common::File *ald, *sku; + + int hay_sb; + int nivel_osc, musica_antes, musica_room; + char num_room[20], pantalla_disco[20]; + char datos_actuales[20]; + int objs_room; + char fondo_y_menu[20]; + + char nombre_obj[30][20]; + char nombre_icono[14][20]; + + int num_obj[40], visible[40], espuerta[40]; + int sitiobj_x[40], sitiobj_y[40], sentidobj[40]; + int objetos_que_tengo[50]; + char alapantallakeva[40][20]; + int x_alakeva[40], y_alakeva[40], sentido_alkeva[40], alapuertakeva[40]; + int x1[40], y1[40], x2[40], y2[40]; + int lleva_objeto , objeto_que_lleva; + int con_voces; + int menu_bar, menu_scr, hay_nombre; + char texto_nombre[20]; + int frame_ciego; + int frame_ronquido; + int frame_murcielago; + int c_mirar; + int c_poder; + + int flags[NUM_BANDERAS]; + + int frame_y; + int hare_x, hare_y, hare_se_mueve, direccion_hare, sentido_hare, num_frame, hare_se_ve; + int sitio_x, sitio_y, comprueba_flags; + int rompo, rompo2; + int paso_x, paso_y; + int alto_hare, ancho_hare, alto_pies; + int alto_habla, ancho_habla; + int suelo_x1, suelo_y1, suelo_x2, suelo_y2; + int cerca, lejos; + int sentido_final, anda_a_objeto; + int obj_saliendo; + float diff_vez, conta_vez; + int hay_respuesta; + int conta_ciego_vez; + int cambio_de_color; + int rompo_y_salgo; + int vb_x, sentido_vb, vb_se_mueve, frame_vb; + float nuevo_alto, nuevo_ancho; + int diferencia_x, diferencia_y; + int factor_red[202]; + int frame_piano; + int frame_borracho; + int frame_velas; + int color_solo; + int parpadeo; + int x_igor, y_igor, sentido_igor; + int x_dr, y_dr, sentido_dr; + int x_bj, y_bj, sentido_bj; + int cont_sv; + int term_int; + int num_ejec; + int cual_ejec, hay_que_load; + char nom_partida[13]; + int _color; + int corta_musica; + char select[23]; + int hay_seleccion; + int x_raton; + int y_raton; + int y_raton_ant; + int boton_izq; + int boton_dch; + + bool escoba(); + void Negro(); + void habla_vb(const char *, const char *); + void habla_vbpuerta(const char *dicho, const char *filename); + void habla_ciego(const char *, const char *, const char *); + void habla_hacker(const char *, const char *); + void agarra_objeto(int); + void anda_parriba(); + void anda_pabajo(); + void pon_vb(); + void lleva_vb(int punto_x); + void hipo_sin_nadie(int contador); + void abre_puerta(int nflag, int n_puerta); + void mapa(); + void buffer_teclado() { } + void animacion_1_1(); + bool animacion_2_1(); + void animacion_1_2(); + void animacion_2_2(); + void animacion_3_1(); + void animacion_4_1(); + void animacion_3_2(); + void animacion_4_2(); + void animacion_7(); + void animacion_8(); + void animacion_9(); + void animacion_10(); + void animacion_11(); + void animacion_12(); + void animacion_13(); + void animacion_14(); + void animacion_15(); + void animacion_16(); + void animacion_17(); + void animacion_18(); + void animacion_19(); + void animacion_20(); + void animacion_21(); + void animacion_22(); + void animacion_23(); + void animacion_23_anexo(); + void animacion_23_anexo2(); + void animacion_24(); + void animacion_25(); + void animacion_26(); + void animacion_27(); + void animacion_28(); + void animacion_29(); + void animacion_30(); + void animacion_31(); + void animacion_32(); + void animacion_33(); + void animacion_34(); + void animacion_35(); + void animacion_36(); + + void refresca_1_antes(); + void refresca_2(); + void refresca_3(); + void refresca_3_antes(); + void refresca_4(); + void refresca_5(); + void refresca_5_antes(); + void refresca_6_antes(); + void refresca_7_antes(); + void refresca_9_antes(); + void refresca_12_antes(); + void refresca_14_antes(); + void refresca_15(); + void refresca_16_antes(); + void refresca_17_antes(); + void refresca_17(); + void refresca_18_antes(); + void refresca_18(); + void hare_oscuro(); + + + void sin_verbo(); + void para_cargar(char[]); + void carga_escoba_1(const char *); + void carga_escoba_2(const char *); + void borra_pantalla(); + void lleva_al_hare(int, int); + void mueve_cursor(); + void comprueba_objetos(); + void espera_soltar(); + void MirarRaton(); + void elige_en_barra(); + bool comprueba1(); + void comprueba2(); + Common::KeyCode getscan(); + void elige_verbo(int); + void mesa(); + void saves(); + void print_abc(const char *, int, int); + void delay(int ms); + void confirma_go(); + void confirma_salir(); + void salva_pantallas(); + void elige_objeto(int objeto); + void suma_objeto(int); + int resta_objeto(int osj); + void fliplay(const char *filefli, int vel); + void FundeDelNegro(int VelocidadDeFundido); + char LimitaVGA(char valor); + void color_abc(int cl); + void centra_texto(const char *,int,int); + void comienza_sound(const char *); + void anima(const char *animacion, int FPS); + void fin_sound_corte(); + void FundeAlNegro(int VelocidadDeFundido); + void pausa(int); + void habla_dr_grande(const char *dicho, const char *filename); + void pon_igor(); + void pon_bj(); + void pon_dr(); + void habla_igor_dch(const char *dicho, const char *filename); + void habla_dr_dch(const char *dicho, const char *filename); + void habla_dr_izq(const char *dicho, const char *filename); + void habla_solo(const char *, const char *); + void habla_igor_frente(const char *, const char *); + void habla_tabernero(const char *dicho, const char *filename); + void hipo(int); + void fin_sound(); + void habla_bj(const char *, const char *); + void hablar(const char *, const char *); + void playmusic(int p); + void stopmusic(); + int music_status(); + void refresca_pantalla(); + void carga_partida(const char *); + void canal_p(const char *); + void puertas_cerradas(int); + void animafin_sound_corte(); + void color_hare(); + void funde_hare(int oscuridad); + void paleta_hare_claro(); + void paleta_hare_oscuro(); + void hare_claro(); + void actualiza_datos(); + void empieza_andar(); + void actualiza_refresco(); + void actualiza_refresco_antes(); + void pon_hare(); + void menu_sin_volcar(); + void barra_menu(); + void saca_objeto(); + bool sal_de_la_habitacion(int); + void coge_objeto(); + void banderas(int); + void cursor_mesa(); + void introduce_nombre(); + void para_grabar(char[]); + int LookForFree(); + void OpenSSN(const char *Name, int Pause); + void WaitFrameSSN(); + void MixVideo(byte *OldScreen, byte *NewScreen); + void Des_RLE(byte *BufferRLE, byte *MiVideoRLE); + void Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght); + void set_dacSSN(byte *dacSSN); + byte *TryInMem(Common::File *Sesion); + void EndSSN(); + int PlayFrameSSN(); + + byte *AuxBuffOrg; + byte *AuxBuffLast; + byte *AuxBuffDes; + int Leng; + + byte *pointer; + int UsingMem; + Common::File *_Sesion; + byte CHUNK; + byte CMP, dacSSN[768]; + byte *MiVideoSSN; + byte *mSesion; + int FrameSSN; + int GlobalSpeed; + int LastFrame; + + byte *carga_pcx(byte *NamePcc); + void set_dac(byte *dac); + void WaitForNext(int FPS); + float vez(); + void reduce_hare_chico(int, int, int, int, int, int, int, byte *, byte *); + char codifica(char); + void cuadrante_1(); + void cuadrante_2(); + void cuadrante_3(); + void cuadrante_4(); + void refresca_62(); + void refresca_62_antes(); + void refresca_63(); + void graba_partida(char[]); + void aumenta_num_frame(); + int sobre_que_objeto(); + void comprueba_banderas_menu(); + void pantalla_0(); + void pantalla_62(int); + void pantalla_63(int); + void conversa(const char *); + void print_abc_opc(const char *, int, int, int); + void responde(int); + void habla_borracho(const char *dicho, const char *filename); + void habla_pianista(const char *dicho, const char *filename); + + void MusicFadeout(); + void ctvd_end(); + void ctvd_stop(); + void ctvd_terminate(); + void ctvd_speaker(int flag); + void ctvd_output(Common::File *file_handle); + void ctvd_init(int b); + + + + +private: + +public: + +}; + +} // End of namespace Drascula + +#endif /* DRASCULA_H */ diff --git a/engines/drascula/module.mk b/engines/drascula/module.mk new file mode 100644 index 0000000000..51fb965915 --- /dev/null +++ b/engines/drascula/module.mk @@ -0,0 +1,14 @@ +MODULE := engines/drascula + +MODULE_OBJS = \ + detection.o \ + drascula.o + + +# This module can be built as a plugin +ifdef BUILD_PLUGINS +PLUGIN := 1 +endif + +# Include common rules +include $(srcdir)/rules.mk diff --git a/engines/drascula/texts.h b/engines/drascula/texts.h new file mode 100644 index 0000000000..4c457f5ac3 --- /dev/null +++ b/engines/drascula/texts.h @@ -0,0 +1,753 @@ +#define TEXT1 "Its the second biggest door I've seen in my life." +#define TEXT2 "Not really." +#define TEXT3 "The church is all boarded up, it must have been abandoned several years ago." +#define TEXT4 "I haven't opened it." +#define TEXT5 "What should I do, should I pull it off?" +#define TEXT6 "Hi there door, I'm going to make you a door-frame." +#define TEXT7 "It's too much for me." +#define TEXT8 "There's a window stopping the game from working properly." +#define TEXT9 "I can't." +#define TEXT10 "Yes, that's done." +#define TEXT11 "Why?" +#define TEXT12 "Hi window, are you doing anything tonight?" +#define TEXT13 "Not without permission from the Town Hall." +#define TEXT14 "If only this window wasn't boarded up..." +#define TEXT15 "Yoo-Hoo window!" +#define TEXT16 "Hi there." +#define TEXT17 "Like Microchof's." +#define TEXT18 "I can't reach." +#define TEXT19 "It's alright where it is." +#define TEXT21 "Its a coffin in the shape of a cross." +#define TEXT22 "No thanks." +#define TEXT23 "Hi dead man. No, don't get up for my sake." +#define TEXT24 "Yes, just like in poltergeist" +#define TEXT27 "I'll be back in fifteen minutes" +#define TEXT28 "Forbidden to put up posters." +#define TEXT29 "It's uncle Evaristo's tomb." +#define TEXT30 "Its locked." +#define TEXT31 "I've got one." +#define TEXT32 "Yoo Hoo, uncle Everisto!" +#define TEXT33 "There's no reply." +#define TEXT34 "It's not well parked." +#define TEXT35 "It's a door." +#define TEXT36 "A drawer in the table." +#define TEXT37 "A suspicious wardrobe." +#define TEXT38 "Hi wardrobe, how are you?" +#define TEXT41 "It's an ancient candelabrum." +#define TEXT42 "It must have been here ever since Yule Brinner had hair on his head." +#define TEXT43 "No, its a relic." +#define TEXT44 "Its a nice altarpiece." +#define TEXT46 "ha, ha, ha." +#define TEXT48 "No." +#define TEXT50 "Ha, He, Hi, Ho, Hu, great!" +#define TEXT54 "I can't see anything in particular." +#define TEXT55 "It's Fern n, the plant." +#define TEXT56 "It's one of the fences spikes" +#define TEXT57 "Hey! There's a packet of matches under here." +#define TEXT58 "Look! a packet of Kleenex, and one's still unused." +#define TEXT59 "There isn't anything else in the bucket." +#define TEXT60 "It's a blind man who can't see." +#define TEXT65 "That's a great deal of money." +#define TEXTD56 "Hi blind man. How it's going?" +#define TEXTD57 "How do you know I'm a foreigner?" +#define TEXTD58 "You look blind. You're wearing dark glasses like Stevie Wonder." +#define TEXTD59 "Look, I'm sorry, I didn't know you could see." +#define TEXTD60 "But haven't you just told me you weren't blind." +#define TEXTD61 "But if you can't see." +#define TEXTD62 "Ooookay. Sorry. In that case, Hi there sightless person." +#define TEXTD63 "I'm John Hacker. You must be one of those characters who will help me out in exchange for an object. Aren't you? Eh? Aren't you?" +#define TEXTD64 "Uuuum, excuse me for asking blin... Sightless person! But what sort of job is that, to give sickles in exchange for money while you play the accordion?" +#define TEXTD65 "Ah yes, I suppose that's true. Goodbye sightless person ...blind man (under his breath)." +#define TEXTD66 "Here is the large amount of money you asked me for." +#define TEXTD67 "You better have had." +#define TEXTD68 "Hi there foreigner." +#define TEXTD69 "And how do you know I'm blind?" +#define TEXTD70 "And I'm not kidding you but your's are like Woody Allen's." +#define TEXTD71 "No, I can't see." +#define TEXTD72 "And I'm not." +#define TEXTD73 "Oh of course. Just cos I can't see, you accuse me of being blind." +#define TEXTD74 "Hi there foreigner! What are you doing in Transylvania?" +#define TEXTD75 "That's right, foreigner. In exchange for a large sum of money I'll give you a sickle for when you might need it." +#define TEXTD76 " !!!!!!!!!!!!!!!!!!!!!!!!" +#define TEXTD77 "Because you told me before, didn't you?" +#define TEXTD78 "Thanks foreigner. Here's the sickle in exchange. You'll find it really useful later on, honestly." +#define TEXT100 "THERE IS NOTHING SPECIAL ABOUT IT" +#define TEXT101 "IT'S NOT UNUSUAL" +#define TEXT102 "HEY, WHAT'S UP MAN?" +#define TEXT103 "HI" +#define TEXT104 "NOTHING NEW?" +#define TEXT105 "HOW IS THE FAMILY?" +#define TEXT106 "THAT IS JUST LIKE YOU!" +#define TEXT107 "BUT HOW DO I GET THAT?" +#define TEXT108 "MY RELIGION DOES NOT ALLOW ME" +#define TEXT109 "IT'D BE BETTER NOT" +#define TEXT110 "YEAH, SURE MAN!" +#define TEXT111 "NO WAY" +#define TEXT112 "IMPOSSIBLE " +#define TEXT113 "THIS WILL NOT OPEN " +#define TEXT114 "I CAN'T DO IT BY MYSELF" +#define TEXT115 "I COULD DO IT IF I WANTED TO, BUT I JUST FEEL A LITTLE LAZY " +#define TEXT116 "I DO NOT SEE THE REASON " +#define TEXT117 "IT'S A QUITE NICE BRAIN " +#define TEXT118 "AND SO BRAIN, WHAT ARE YOU UP TONIGHT? " +#define TEXT119 "NO, IT MUST BE KEPT SOMEWHERE AWAY FROM THE MUTANT ACTION OF THE ATMOSPHERE" +#define TEXT120 "HE IS VERY STIFF, JUST LIKE MY BOSS " +#define TEXT121 "A VERY SHARP STICK" +#define TEXT122 "YOU FAITHFUL SHARP-PAINTED STICK, NOBLE TRANSILVAAANIAN OAK TREE" +#define TEXT123 "DAMN, I HAVE TO CUT MY NAILS! " +#define TEXT124 "B.J. IS IN THERE... SHE IS A REALLY HOT CHICK! " +#define TEXT125 "IT IS FIRMLY LOCKED " +#define TEXT126 "\"SAVE AWAY LOCKS LTD.\"" +#define TEXT127 "IT IS THE TYPICAL SKELETON YOU FIND IN THE DUNGEONS OF ALL THE GAMES" +#define TEXT128 "IT IS COMMONLY USED TO COMMUNICATE ELECTRICITY TO THE MACHINES CONNECTED TO IT " +#define TEXT129 "IT IS ABSOLUTELY HAND MADE BECAUSE THE JAPANESE MAKE THEM POCKET SIZE " +#define TEXT130 "I HAVE ONLY SEEN IN MY LIFE ANOTHER THING AS UGLY AS THIS ONE " +#define TEXT131 "FORGET IT. I AM NOT GOING TO TELL HIM ANYTHING IN CASE HE GETS MAD " +#define TEXT132 "IT SEEMS QUITE RATIONAL " +#define TEXT133 "IT IS A PICTURE OF PLATO WRITING HIS LOST DIALOGUE " +#define TEXT134 "I AM NOT ONE OF THOSE WHO TALKS TO POSTERS " +#define TEXT135 "THAT'S A VERY CUTE DESK " +#define TEXT136 "IT IS A VAMPIRES HUNTER'S DIPLOMA OFFICIALLY APPROVED BY OXFORD UNIVERSITY " +#define TEXT137 "IT'S A DARK NIGHT WITH FULL MOON " +#define TEXT138 "IT SEEMS LIKE THESE SCREWS ARE NOT MUCH TWISTED " +#define TEXT139 "DON'T LOOK NOW, BUT I THINK THAT A HIDDEN CAMERA IS FOCUSING ON ME " +#define TEXT140 "THAT'S A VERY MODERN STICK DETECTOR " +#define TEXT141 "NO. THE LABORATORY IS ON THE SECOND FLOOR " +#define TEXT142 "A NICE BEDSIDE TABLE " +#define TEXT143 "IT'S A LOT OF MONEY THAT CAN'T BE MISSING IN ANY VALUABLE ADVENTURE " +#define TEXT144 "IF I WERE A RICH MAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU " +#define TEXT145 "THOSE ARE STRANGE LEAVES. THEY MUST HAVE BROUGHT THEM FROM SOUTH AMERICA OR AROUND THERE " +#define TEXT146 "I DON'T THINK THEY WOULD ANSWER ME " +#define TEXT147 "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY GET ALL THE BEAUTY WITHIN IT" +#define TEXT148 "I ONLY PRAY BEFORE I GO TO BED " +#define TEXT149 "HEY, THIS PIKE SEEMS A LITTLE BIT LOOSE! " +#define TEXT150 "I HOPE YOU WON'T COMPLAIN ABOUT GETTING NO CLUES FROM ME " +#define TEXT151 "IT'S A QUITE CONVENTIONAL PIKE " +#define TEXT152 "THEY ARE CUTE, THOUGH THEY ARE COVERED WITH A LITTLE BIT OF SHIT " +#define TEXT153 "NO, THEY WON'T HEAR ME. HA,HA,HA THIS IS GREAT! " +#define TEXT154 "\"SLEEPING BEAUTY\" FROM CHAIKOSKY, OR CHOIFRUSKY, OR WHATEVER IT IS" +#define TEXT155 "VERY TEMPTING " +#define TEXT156 "NO, I'M NOT ONE OF THOSE WHO PUT USED BUBBLE GUMS IN THEIR MOUTH " +#define TEXT157 "THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER MAY BE " +#define TEXT158 "TOBACCO MANUFACTURERS WARN ABOUT HEALTH BEING SERIOUSLY DAMAGED BY SANITARY AUTHORITIES" +#define TEXT159 "AN ABSOLUTELY NORMAL CANDLE, INCLUDING WAX AND EVERYTHING " +#define TEXT160 "THESE TWO SHINY COINS DO REALLY GLITTER! " +#define TEXT161 "THIS SHINY COIN DOES REALLY GLITTER! " +#define TEXT162 "WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE'S BITES" +#define TEXT163 "NO, IT'S IS NOT THE RIGHT MOMENT YET " +#define TEXT164 "THERE IS A ONE THOUSAND BILL AND A COUPLE COINS " +#define TEXT165 "IT SAYS \"PLEASE, DO NOT THROW FOOD TO THE PIANIST\"" +#define TEXT166 "OMELET, 200. FRIED FISH, 150, MAYONNAISE POTATOES, 225" +#define TEXT167 "BEST BURGERS ON THIS SIDE OF THE DANUBE, ONLY FOR 325!" +#define TEXT168 "THAT'S A NICE SKULL WITH A VERY PENETRATING LOOK, HA, HA, HA, HA, THAT WAS GOOD!" +#define TEXT169 "HI SKULL, YOU REMIND ME OF UNCLE HAMLET " +#define TEXT170 "I HAVE THE HABIT OF NOT TOUCHING THINGS THAT HAVE BEEN ALIVE " +#define TEXT171 "IT'S A BIN " +#define TEXT172 "IT'S A BET FOR TONIGHT'S GAME " +#define TEXT173 "I WONDER WHAT THERE IS BEHIND THAT " +#define TEXT174 "HEY, THAT CURTAIN IS NOT MOVING!" +#define TEXT175 "MAN, THIS CASTLE IS REALLY GLOOMY " +#define TEXT176 "I CAN'T, HE IS TOO FAR AWAY TO HEAR ME " +#define TEXT177 "IT'S THE TYPICAL TRANSILVANIAN FOREST, WITH TREES " +#define TEXT178 "MAN YOU REALLY SAY STUPID THINGS, AND THIS IS TOO DARK! " +#define TEXT179 "GARCIA, CANDY STORE. SWEETS AND BUBBLE GUM" +#define TEXT180 "A VERY NICE DOOR " +#define TEXT181 "IT'S CLOSED " +#define TEXT182 "A COMPLETELY LOCKED BARREL " +#define TEXT184 "AREN'T THESE BUGS REALLY CUTE? " +#define TEXT185 "BSSST, PUSSYCAT... LITTLE CAT" +#define TEXT186 "THERE IS NO ANSWER " +#define TEXT187 "THE MOON IS A SATELLITE THAT TURNS AROUND THE EARTH WITH A REVOLUTION PERIOD OF 28 DAYS" +#define TEXT188 "HI, LOONY MOON " +#define TEXT189 "IT'S TOTALLY BLOCKED UP WITH PLANKS" +#define TEXT190 "IT'S IMPOSSIBLE. NOT EVEN THAT TOUGH GUY FROM TV COULD OPEN THIS " +#define TEXT191 "HEY! THE SHADOW OF THAT CYPRESS LOOKS PROLONGED TO ME! " +#define TEXT192 "YOU, BARTENDER...!! " +#define TEXT193 "I WOULD LIKE TO HAVE A ROOM PLEASE " +#define TEXT194 "DO YOU KNOW WHERE I CAN FIND THE SO CALLED DRASCULA? " +#define TEXT195 "YES, SO WHAT? " +#define TEXT196 "SO? " +#define TEXT197 "IS...THAT RIGHT? " +#define TEXT198 "GOOD QUESTION. NOW, LET ME TELL YOU MY STORY. LOOK... " +#define TEXT199 "IT'S JUST FIVE MINUTES " +#define TEXT200 "I'M JOHN HACKER AND I REPRESENT A BRITISH PROPERTY COMPANY " +#define TEXT201 "AS FAR AS I KNOW, COUNT DRASCULA WANTS TO BUY SOME PIECES OF LAND IN GIBRALTAR AND MY COMPANY SENT ME HERE TO NEGOTIATE THE SELLING " +#define TEXT202 "I THINK I'M GOING BACK TO MY MUM'S TOMORROW FIRST THING IN THE MORNING " +#define TEXT203 "BEAUTIFUL NIGHT, HUH? " +#define TEXT204 "NO, NOTHING " +#define TEXT205 "YOU...PIANIST...!!!! " +#define TEXT206 "BEAUTIFUL NIGHT " +#define TEXT207 "AND IT'S NOT EVEN COLD OR ANYTHING " +#define TEXT208 "ALL RIGHT, I'LL JUST LET YOU GO ON PLAYING " +#define TEXT209 "WELL THEN " +#define TEXT210 "HI BOSS, HOW ARE YOU? " +#define TEXT211 "AND HOW IS THE FAMILY? " +#define TEXT212 "THIS IS QUITE GROOVY, HUH? " +#define TEXT213 "I'D BETTER NOT SAY ANYTHING " +#define TEXT214 "THERE IS NO PLACE LIKE HOME. THERE IS NO...WHAT?, BUT YOU ARE NOT AUNT EMMA. AS A MATTER OF FACT, I DON'T HAVE ANY AUNT EMMA! " +#define TEXT215 "YES, SO DOES MINE. YOU CAN CALL ME ANYTHING YOU WANT, BUT IF YOU CALL ME JHONNY, I'LL COME TO YOU LIKE A DOG " +#define TEXT216 "AREN'T I JUST A FUNNY GUY, HUH?. BY THE WAY, WHERE AM I? " +#define TEXT217 "YES " +#define TEXT218 "SHOOT...! " +#define TEXT219 "OH, SURE...OF COURSE! " +#define TEXT220 "WELL, THANKS VERY MUCH FOR YOUR HELP. I WON'T BOTHER YOU ANYMORE IF YOU PLEASE TELL ME WHERE THE DOOR IS... " +#define TEXT221 "IT'S BECAUSE THE KNOCK MUST HAVE AFFECTED MY BRAIN...I CAN'T SEE A THING... " +#define TEXT222 "WELL...THAT DOESN'T MATTER. I ALWAYS CARRY AN SPARE ONE. " +#define TEXT223 "WOW, WHAT A HOT CHICK!! I DIDN'T NOTICE!, BUT OF COURSE, I WASN'T WEARING MY GLASSES " +#define TEXT224 "HEY... " +#define TEXT225 "AND ALL THIIIISSS??? " +#define TEXT226 "DON'T WORRY B.J. HONEY, I'LL SAVE YOU FROM FALLING INTO HIS CLUTCHES... " +#define TEXT227 "YOU REALLY GOT ME MAD MAN... " +#define TEXT228 "AHHH A WEREWOLF!! DIE YOU DAMNED EVIL! " +#define TEXT229 "YES, WELL... " +#define TEXT230 "YES, WELL...I THINK I'LL JUST GO ON MY WAY. EXCUSE ME " +#define TEXT231 "WHAT? " +#define TEXT232 "TO TELL YOU THE TRUTH...ON SECOND THOUGHTS...I DON'T REALLY THINK SO. " +#define TEXT233 "AND SO TELL ME YOU ERUDITE PHILOSOPHER, IS THERE ANY RELATIONSHIP CAUSE-AND-EFFECT BETWEEN SILLY AND BILLY?" +#define TEXT234 "OK, OK, FORGET IT. I DON'T EVEN KNOW WHU I SAID ANYTHING ABOUT IT " +#define TEXT235 "WHAT ARE YOU DONIG HERE PHILOSPOZING INSTEAD OF BEING EATING SOME PEOPLE " +#define TEXT236 "HOW come? " +#define TEXT237 "HEY, COULD YOU SAY AGAIN ALL THAT ABOUT PRE-EVOLUTIONARY RELATIONSHIPS? " +#define TEXT238 "YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT NEFORE. I DIDN'D GET IT VERY WELL, YOU KNOW. " +#define TEXT239 "NO, I'D RATHER NOT SAY ANYTHING, IN CASE HE GETS ANGRY OR SOMETHING... " +#define TEXT240 "HELLO? " +#define TEXT241 "YES, WHAT'S UP? " +#define TEXT242 "WELL, NOW THAT YOU MENTION IT, I'LL TELL YOU THAT... " +#define TEXT244 "WELL, THANKS FOR CALLING. BY THE WAY, THIS IS NOT THE CASE, OF COURSE, BUT WHAT COULD HAPPEN IF A VAMPIRE GOT THE RECIPE BY ANY CHANCE? " +#define TEXT245 "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END UP SOON WITH THE GAME?. WELL, MAYBE NOT. " +#define TEXT246 "IT'S EMPTY! " +#define TEXT247 "WHY DID YOU TAKE MY ONLY LOVE, B.J. , AWAY FROM ME?. LIFE HAS NO MEANING FOR WITHOUT HER " +#define TEXT248 "HER BRAIN!!? " +#define TEXT249 "TO TELL YOU THE TRUTH, I THINK I HAD JUST ENOUGH WITH YOUR OF YOUR LITTLE MONSTER. " +#define TEXT250 "OH PLEASE, HOLLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!! " +#define TEXT251 "YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL CAME AND RESCUE ME!" +#define TEXT252 "WHAT A SHIT OF GAME IS THIS IN WHICH THE PROTAGONIST DIES! " +#define TEXT253 "HEY, WAIT A SECOND!, WHAT ABOUT MY LAST WISH? " +#define TEXT254 "HA. HA, I'M NOW IMMUNIZED AGAINST YOU DAMNED EVIL!. THIS CIGARETTE IS AN ANTI-VAMPIRE BREW THAT VON BRAUN GAVE TO ME " +#define TEXT255 "YES SURE, BUT YOU'LL NEVER GET ME TO GIVE YOU THE RECIPE " +#define TEXT256 "APART FROM CREATING TORTURE, I CAN ALSO STAND IT.. " +#define TEXT257 "OH, NO PLEASE! I'LL TALK, BUT PLEASE, DON'T DO THAT TO ME! " +#define TEXT258 "ALL RIGHT THEN. I TOLD YOU WHAT YOU WANTED TO KNOW. NOW SET B.J. AND ME FREE AND LEAVE US ALONE! " +#define TEXT259 "WHAT ARE YOU DOING HERE B.J.?. WHERE IS DRASCULA? " +#define TEXT260 "WHAT A MEAN GUY!. JUST BECAUSE HE BELONGS TO THE NOBILITY HE THINKS HE IS ENTITLED TO SLEEP WITH ANYBODY HE FEELS LIKE. " +#define TEXT261 "DOWN WITH ARISTOCRATIC DESPOTISM!! " +#define TEXT262 "POOR PEOPLE OF THE WORLD FOR EVER..!! " +#define TEXT263 "AND AS I CAN SEE HE HAS CHAINED YOU UP WITH LOCKS AND ALL THAT STUFF, HUH? " +#define TEXT264 "WELL, ALL RIGHT. DO YOU HAVE A HAIRPIN OVER THERE? " +#define TEXT265 "ALL RIGHT, OK, DON'T GET MAD. I'LL THINK ABOUT SOMETHING " +#define TEXT266 "YOU...BARTENDER!! " +#define TEXT267 "HOW IS THE GAME GOING? " +#define TEXT268 "WHO? " +#define TEXT269 "CAN'T YOU SEE DRASCULA IS HERE? " +#define TEXT270 "THEN, LET'S END UP WITH HIM, RIGHT? " +#define TEXT271 "GIVE ME A SCOTCH ON THE ROCKS " +#define TEXT272 "NOTHING, I JUST FORGOT WHAT I WAS GOING TO SAY... " +#define TEXT273 "EITHER YOU GET ME A SCOTCH ON THE ROCKS OR I'LL PLAY THE PIANO UNTIL THE GAME IS OVER " +#define TEXT274 "WHEN IS THE MATCH GOING TO BE OVER? " +#define TEXT275 "GOOD EVENING" +#define TEXT276 "AND SO IGOR, HOW ARE YOU FEELING...A LITTLE HUMPED...?. HA, HA, HA, THAT WAS FUNNY! " +#define TEXT277 "WHAT ARE YOU SUPPOSED TO BE DOING? " +#define TEXT278 "WELL, NO. " +#define TEXT279 "THEN WEAR GLASSES. " +#define TEXT280 "WHAT IS ALL THAT ABOUT THE SUPERNATURAL ORGY? " +#define TEXT281 "OK, OK, STOP IT. I THINK I CAN GET THE PICTURE. " +#define TEXT282 "COULDN'T YOU TELL ME WHERE DRASCULA IS? " +#define TEXT283 "OH...PLEASE...COME ON...! " +#define TEXT284 "WHY NOT? " +#define TEXT285 "OH...BUT DIES HE SLEEP AT NIGHT? " +#define TEXT286 "WELL, I HOPE YOU GET LUCKY " +#define TEXT287 "I HAVE TO TALK TO HIM... " +#define TEXT288 "YOOUUU...SKELETOOOONN..!!! " +#define TEXT289 "GOOD HEAVENS!, IT'S A DEAD MAN TALKING! " +#define TEXT290 "TELL HOW DID YOU GET TO END UP HERE " +#define TEXT291 "AND WHY WOULD DRASCULA WANT TO CREATE A MONSTER? " +#define TEXT292 "WHAT'S YOUR NAME, MY SKELETON FRIEND? " +#define TEXT293 "HEY, DON'T YOU WANT ANYTHING TO EAT? " +#define TEXT294 "I BET YOUR STOMACH IS PRETTY EMPTY...HA, HA,HA! " +#define TEXT295 "THE THING IS THAT I DON'T FEEL LIKE TALKING RIGHT NOW " +#define TEXT296 "I HOPE SOMEONE F...(WHISTLE) YOU...,AND YOUR F...(WHISTLE) SON OF (WHISTLE TWICE) " +#define TEXT297 "I REALLY LOVED HER. I KNOW SHE WASN'T MUCH OF A WONDER, BUT NOBODY'S PERFECT, RIGHT? " +#define TEXT298 "BESIDES. SHE REALLY HAD ONE OF THOSE GREAT BODIES THAT YOU NEVER FORGET... " +#define TEXT299 "I'LL NEVER BE THE SAME AGAIN. I WILL SHUT MYSELF AWAY IN A MONASTERY, AND WILL LET MY LIFE JUST FLOW... " +#define TEXT300 "NOTHING WILL GET ME OUT OF THIS MYSTERY BECAUSE..." +#define TEXT301 "WHOSE?. WHOSE? " +#define TEXT302 "I WANT TO BECOME A PIRATE " +#define TEXT303 "I WANT TO BECOME A PROGRAMMER " +#define TEXT304 "TELL ME SOMETHING ABOUT PELAYO " +#define TEXT305 "I'LL JUST GO ON PLAYING, AND I'LL FORGET I SAW YOU. " +#define TEXT306 "WHOSE STUPID IDEA COULD THIS BE? " +#define TEXT307 "IT'S LIKE MY GRANDMOTHER'S HANDBAG " +#define TEXT308 "JESUS, AREN'T I JUST REALLY COOL MAN...! " +#define TEXT309 "THE MORE I SEE MYSELF, THE MORE I LOVE ME " +#define TEXT310 "HOW DO I LOCK MYSELF THEN? " +#define TEXT311 "I'LL HAVE TO OPEN ME FIRST, RIGHT? " +#define TEXT312 "I'M ALL RIGHT WHERE I AM " +#define TEXT313 "I GOT ME " +#define TEXT314 "HI, MYSELF! " +#define TEXT315 "I'LL WEAR THEM WHEN THE RIGHT TIME COMES " +#define TEXT316 "I CAN'T SEE ANYTHING SPECIAL ABOUT IT " +#define TEXT317 "IT'S ALL RIGHT WHERE IT IS " +#define TEXT318 "AND WHAT FOR? " +#define TEXT319 "I CAN'T " +#define TEXT320 "HI, YOU! " +#define TEXT321 "IT'S UNCLE DESIDERIO'S PANTHEON! " +#define TEXT322 "YOOUU...UNCLE DESIDERIOOOO!! " +#define TEXT323 "NO, I DON'T WANT TO CUT MYSELF AGAIN " +#define TEXT324 "AHHH,,,EXCUS.... " +#define TEXT325 "JAMM. AHH... " +#define TEXT326 "YES...WOF, WOF " +#define TEXT327 "LOOK, THERE'S A PIECE OF BUBBLE GUM STUCK HERE. " +#define TEXT328 "THIS IS THE PORTABLILINE I GOT LAST CHRISTMAS " +#define TEXT329 "IT'S VERY HIGH! " +#define TEXT330 "COME OUT TO THE BALCONY MY JULIET!! " +#define TEXT331 "YOU ARE THE LIGHT THAT ILLUMINATES MY WAY! " +#define TEXT332 "HEY, DOOR!, WHAT'S THE MATTER? " +#define TEXT333 "YOOOUU, CIGARETTE SPENDING MACHINEEE! " +#define TEXT334 "IT'S A CIGARETTE SPENDING MACHINE " +#define TEXT335 "I HAVE ANOTHER COIN INSIDE " +#define TEXT336 "NO, I JUST DECIDED TO QUIT SMOKING AND DRINKING ALCOHOL " +#define TEXT337 "I WILL DEVOTE MYSELF TO WOMEN FROM NO ON " +#define TEXT338 "THIS IS A TRICK! NOTHING CAME OUT! " +#define TEXT339 "AT LAST! " +#define TEXT340 "JUST A TRUNK " +#define TEXT341 "HELLO TRUNK, YOUR NAME IS JUST LIKE MY COUSIN FRANK... " +#define TEXT342 "I'VE FOUND B.J.'S HANDBAG! " +#define TEXT343 "OH MY GOD! DON'T GET MY IMAGE REFLECTED! I'M A VAMPIRE! " +#define TEXT344 "OH...JESUS, IT'S JUST A DRAWING! " +#define TEXT345 "LITTLE MIRROR, TELL ME, WHO IS THE MOST BEAUTIFUL IN THE WHOLE KINGDOM? " +#define TEXT346 "HE WON'T OPEN " +#define TEXT347 "ALL RIGHT. I GOT THE EAR-PLUGS ON " +#define TEXT348 "IT'S A VAMPIRE'S HUNTER DIPLOMA, officially approved by oxford university " +#define TEXT349 "NOT YET. THERE ARE STILL SOME INGREDIENTS MISSING. IT'S NOT WORTH WAKING HIM UP " +#define TEXT350 "BUT I DON'T HAVE MONEY " +#define TEXT351 "IT'S A BRITISH LAMP " +#define TEXT352 "HELP ME OUT HERE BARTENDER!! " +#define TEXT353 "A VAMPIRE CAME IN AND TOOK MY GIRLFRIEND AWAY!! " +#define TEXT354 "BUT, AREN'T YOU GOING TO HELP ME!!?? " +#define TEXT355 "DEAD?, WHAT DO YOU MEAN DEAD? " +#define TEXT356 "AAHH.... " +#define TEXT357 "A VAMPIRE HAS KIDNAPPED THE GIRL IN ROOM 501 " +#define TEXT358 "BUT YOU HAVE TO HELP ME OUT! " +#define TEXT359 "CAN'T YOU PLAY ONE FROM BLUR? " +#define TEXT360 "HOW CAN YOU STAY HERE ALL DAY PLAYING THE SAME SONG ALL THE TIME? " +#define TEXT361 "AND THEN, HOW CAN YOU HEAR ME? " +#define TEXT362 "PLEASE, LEND ME THE ERA-PLUGS. " +#define TEXT363 "COME ON, I'LL GIVE THEM BACK TO YOU RIGHT AWAY " +#define TEXT364 "COOOMEE OONNN... " +#define TEXT365 "WELL GOODBYE, I HAVE TO KILL A VAMPIRE. " +#define TEXT367 "WHAT'S YOUR LANGUAGE, TRASILVANIAN? " +#define TEXT368 "WHO IS UNCLE DESIDERIO? " +#define TEXT369 "BUT, WHAT'S THE MATTER WITH THAT DRASCULA? " +#define TEXT370 "WHO IS THAT GUY NAMED VON BRAUN? " +#define TEXT371 "AND WHY DOESN'T HE DO IT? " +#define TEXT372 "AND WHERE CAN I FIND VON BRAUN? " +#define TEXT373 "WELL, THANKS AND GOODBYE. HOPE YOU SLEEP IT OFF JUST FINE. " +#define TEXT374 "WE'D BETTER CALL FIRST " +#define TEXT375 "ARE YOU PROFESSOR BRAUN? " +#define TEXT376 "AND COULD YOU TELL ME WHERE I CA...? " +#define TEXT377 "I DON'T BELIEVE HE IS GANIMEDES THE DWARF " +#define TEXT378 "PROFESSOR!! " +#define TEXT379 "PLEASE HELP ME!. THE LIFE OF MY GIRLFRIEND DEPENDS ON YOU!! " +#define TEXT380 "WELL, ALL RIGHT. I DON'T NEED YOUR HELP " +#define TEXT381 "ALL RIGHT. I'M LEAVING " +#define TEXT382 "DON'T DE AFRAID. WE WILL BEAT DRASCULA TOGETHER. " +#define TEXT383 "THEN WHY DON'T YOU HELP ME? " +#define TEXT384 "I GOT THEM " +#define TEXT385 "YES, I GOT THEM!! " +#define TEXT386 "ALL RIGHT " +#define TEXT387 "AHH....YES " +#define TEXT388 "I HAVE COME TO GET INTO THAT CABIN AGAIN " +#define TEXT389 "I AM READY TO FACE YOUR TEST" +#define TEXT390 "ALL RIGHT OLD MAN. I CAME FOR MY MONEY " +#define TEXT391 "NO, NOTHING. I WAS JUST LEAVING " +#define TEXT392 "SORRY..." +#define TEXT393 "DO YOU LIKE THIS BOOK?. IT HAS SOME SCORES FROM TCHAIKOWSKY " +#define TEXT394 "HOW CAN I KILL A VAMPIRE?" +#define TEXT395 "HAS ANYBODY TOLD YOU THAT SLEEPING IN A BAD POSITION IS NOT GOOD FOR YOU? " +#define TEXT396 "THAT'S WHAT MY MUM ALWAYS TELL ME " +#define TEXT397 "WHY WOULDN'T DRASCULA KILL YOU? " +#define TEXT398 "AND WHAT WAS IT? " +#define TEXT399 "GREAT! YOU HAVE AN IMMUNIZING BREW" +#define TEXT400 "SO? " +#define TEXT401 "ALL RIGHT " +#define TEXT402 "CAN YOU REPEAT WHAT I NEED FOR THAT BREW " +#define TEXT403 "WELL, I'LL RUSH OUT TO GET IT " +#define TEXT404 "HEY, WHAT HAPPENED WITH THE PIANIST? " +#define TEXT405 "I HAVE ALL THE INGREDIENTS OF THAT BREW " +#define TEXT406 "JUST A QUESTION. WHAT IS ALL THAT ABOUT THE ALUCSARD ETEREUM? " +#define TEXT407 "HELLO, HELLO... " +#define TEXT408 "AND WHERE IS THAT CAVERN? " +#define TEXT409 "WHAT HAPPENS? DIDN'T YOU HAVE TO GO TO THE COURT? " +#define TEXT410 "...BUT... IF I MEET MORE VAMPIRES? " +#define TEXT411 "IT'S A VAMPIRE THAT DOESN'T LET ME COME THROUGH " +#define TEXT412 "HE LOOKS LIKE YODA, BUT A LITTLE TALLER " +#define TEXT413 "HEY YODA, IF YOU JUST LET ME GO ON MY WAY, I'LL GIVE YOU A PENNY " +#define TEXT414 "OK, OK, YOU GET MAD ABOUT NOTHING MAN " +#define TEXT415 "HAS ANYBODY TOLD YOU THAT YOU LOOK LIKE YODA?" +#define TEXT416 "HI VAMPIRE, IT'S A BEAUTIFUL NIGHT, HUH? " +#define TEXT417 "ARE YOU A VAMPIRE OR AN OIL PAINTING? " +#define TEXT418 "I'D BETTER NOT SAY ANYTHING, IN CASE YOU GET MAD " +#define TEXT419 "IT'S LOCKED " +#define TEXT420 "THE MAGPIE WOULD STICK OUT MY EYES IF I TRIED! " +#define TEXT421 "OH MY GOD. IT'S LOCKED...THAT'S SCARY, HUH?" +#define TEXT422 "THE HINGES ARE RUSTY " +#define TEXT423 "THERE IS ONLY ONE CAN OF FLOUR IN THERE " +#define TEXT424 "THAT TOOK AWAY THE RUST " +#define TEXT425 "I HAVE FOUND A PINE STICK " +#define TEXT426 "I'LL TAKE THIS THICKER ONE " +#define TEXT427 "WELL, I THINK I CAN GET RID OF THIS STUPID DISGUISE " +#define TEXT428 "\"PASSAGE TO TOWERS CLOSED FOR REPAIRS. PLEASE USE MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\"" +#define TEXT429 "...HE IS PALE, HE HAS FANGS AND WEARS A TOUPE AND HE SURE IS DRASCULA! " +#define TEXT430 "IT'S B.J.! ARE YOU ALL RIGHT B.J.? " +#define TEXT431 "YES, I KNOW SHE IS STUPID, BUT I'M SO LONELY " +#define TEXT432 "YOU DON'T HAVE A KEY AROUND THERE, DO YOU?" +#define TEXT433 "I BET YOU DON'T HAVE A PICKLOCK AROUND! " +#define TEXT434 "GIVE ME A HAIRPIN, I'M GOING TO PLAY MCGYVER HERE! " +#define TEXT435 "DON'T GO ANYWHERE. I'LL BE RIGHT BACK " +#define TEXT436 "SHOOT! IT'S BROKEN! " +#define TEXT437 "OLEEEE! I EVEN SHAVED DUDE! " +#define TEXT438 "YES, DARLING? " +#define TEXT439 "HE'S NOT ARRIVED YET " +#define TEXT440 "THE PIANIST IS NOT HERE " +#define TEXT441 "A TRANSYLVANIAN SCOTCH ON THE ROCKS " +#define TEXT442 "I DON'T HAVE A ROOM YET " +#define TEXT443 "IT LOOKS LIKE HE GOT STUCK IN THE BATH AND DECIDED TO RUN A BAR " +#define TEXT444 "HE WAS DRUNK AS A SAILOR " +#define TEXT445 "THAT HAIR...REMINDS ME OF SOMEBODY " +#define TEXT446 "IT'S A RAW-BONED SKELETON " +#define TEXT447 "LOOK! THERE'S MIGUEL BOSE! " +#define TEXT448 "HE'S ASLEEP. IT'D BE A SHAME WAKING HIM UP." +#define TEXT449 "HE'S UGLIER THAN EMILIO DE PAZ " +#define TEXT450 "A PINE-WOODEN COFFIN " +#define TEXT451 "HE IS GOING TO CUT ME IN LITTLE SLICES. JUST LIKE A SAUSAGE " +#define TEXT452 "I DON'T LIKE PENDULAE. I'D RATHER PREFER ARTICHOKES. " +#define TEXT453 "I CAN'T MAKE IT. I'M HANDCUFFED " +#define TEXT454 "IT'S OBVIOUSLY A SECRET DOOR. " +#define TEXT455 "THEY IGNORE ME " +#define TEXT456 "COME ON..! " +#define TEXT457 "WHEN I READ THE SCRIPT IT WAS SUPPOSED TO MOVE, BUT THE BUDGET GOT CRAZY AND THEY COULDN'T AFFORD TO PAY THE GYM, SO THAT I NEVER GOT TOUGH. END OF STORY. " +#define TEXT458 "IT SEEMS A LITTLE LOOSE FROM THE WALL " +#define TEXT459 "I DON'T THINK IS GOING TO HELP ME ANYWAY. IT'S TOO WET TO LIGHT IT " +#define TEXT460 "TO WEST WING? NO WAY! NOBODY KNOWS WHAT YOU CAN FIND THERE!! " +#define TEXT461 "SHE'S GOT NICE TRANSILVANIAN REASONS " +#define TEXT463 "IT'S A SHAME THERE ISN'T A ROASTED LAMB IN THERE " +#define TEXT464 "LAST TIME I OPENED AN OVEN I BLEW UP THE HOUSE " +#define TEXT465 "THAT'S THE TRANSILVANIAN FOOTBALL BADGE. " +#define TEXT466 "WHAT FOR? TO PUT IT ON MY HEAD " +#define TEXT467 "I DON'T THINK THESE TOWERS ARE THE OPENING KIND " +#define TEXT468 "I DON'T WANT TO KNOW WHAT KIND OF FOOD IS IN THERE! " +#define TEXT469 "IT LOOKS IMPRESSIONIST TO ME... " +#define TEXT470 "THE NIGHT IS FALLING OVER ALL OF US...THAT'S SCARY, ISN'T IT? " +#define TEXT471 "IT'S STUCK! " +#define TEXT472 "IT'S THE KING. YOU DIDN'T IMAGINE THAT, DID YOU! " +#define TEXT473 "NO, I ALREADY HAVE ONE AT HOME TO FEED." +#define TEXT474 "A SHELF WITH BOOKS AND SOME OTHER THINGS. " +#define TEXT475 "BUT WHO CAN I CALL AT THIS TIME? " +#define TEXT476 "\"HOW TO MAKE THE TAX RETURN FORMS\". HOW INTERESTING!" +#define TEXT477 "I ALREADY HAVE ONE AT HOME. I THINK IT'S A WORLDWIDE BEST SELLER " +#define TEXT478 "A COMPLETELY NORMAL KEY " +#define TEXT479 "I THINK SHE IS NOT FROM AROUND HERE " +#define TEXT480 "HEY, THEY'RE FANG-LIKE FRENCH FRIES! I LOVE IT! " +#define TEXT481 "I DON'T THINK THIS IS THE RIGHT TIME TO EAT THAT CRAP KNOWING THAT MY GIRLFRIEND HAS BEEN KIDNAPPED BY THE MOST EVIL PERSON EVER ON EARTH " +#define TEXT482 "I'M HAVING A GREAT TIME KILLING VAMPIRES WITH THIS THING! " +#define TEXT483 "LET'S SEE IF ANOTHER ONE COMES SOON! " +#define TEXT484 "NO, IT HAS TO BE WITH A DIRTY AND STINKY VAMPIRE, JUST LIKE THE ONE I KILLED BEFORE " +#define TEXT485 "THIS IS THE ONE AND ONLY WIG ELVIS USED WHEN HE GOT BALD" +#define TEXT486 "IT'S FLOUR, BUT DON'T ASK ME ANY COMMERCIAL NAMES. " +#define TEXT487 "MAYBE ANOTHER TIME, OK? " +#define TEXT488 "THAT'S A GREAT AXE, IT'S A SHAME THERE IS NO VAMPIRE'S HEAD AROUND HERE, HUH? " +#define TEXT489 "NO. I'M REALLY A GOOD PERSON. " +#define TEXT490 "IT'S MARGARET'S THATCHER DEODORANT...HA, HA, HA...!! " +#define TEXT491 "THAT'S A PRETTY CUTE CLOAK " +#define TEXT493 "JUST LIKE ALL BRANCHES FROM ANY TREE IN THE WORLD, THERE IS NOTHING SPECIAL. " +#define TEXT494 "HEY, THAT'S AMAZING! A ROPE WITHIN THIS TYPE OF ADVENTURE!" +#define TEXT495 "I WONDER WHAT WE COULD USE IT FOR... " +#define TEXT496 "A ROPE TIED TO A BRANCH OR THE OTHER WAY AROUND, HOWEVER YOU WANT TO PUT IT..." +#define TEXT497 " IT LOOKS LIKE THIS MAGPIE IS EVIL-MINDED" +#define TEXT498 "FORGET IT, I'M NOT SAYING ANYTHING IN CASE HE GETS MAD " +#define TEXT499 "SHE LOOKS DEAD, BUT SHE REALLY ISN'T, HUH? " +#define TEXT500 "NO ANIMAL WAS HARMED DURING THE PRODUCTION OF THIS GAME " +#define TEXTB1 "I'M HERE, DRINKING " +#define TEXTB10 "FROM TIME TO TIME HE COMES DOWN TO THE VILLAGE AND TAKES SOMEONE WITH HIM.. " +#define TEXTB11 "A LITTLE WHILE AFTER WE JUST A FEW FOUND BODY PARTS. I THINK HE IS DEALING WITH ORGANS OR SOMETHING LIKE THAT" +#define TEXTB12 "THE ONLY PERSON IN THE VILLAGE WHO KNOWS HOW TO END UP WITH DRASCULA IS A CULTIVATED PERSON " +#define TEXTB13 "HE LIVES IN A LOG-CABIN OUT OF TOWN, EVER SINCE DRASCULA BEAT HIM UP. " +#define TEXTB14 "HE IS THE ONLY ONE WHO COULD HELP US WITH DRASCULA, AND HE DOESN'T WANT TO HEAR ABOUT US. HOW DO YOU LIKE THAT? " +#define TEXTB2 "THEY ARE ALL DEAD, THANKS. BURPP... " +#define TEXTB3 "YES, SURE... " +#define TEXTB4 "SHE FEELS ATTRACTED TO UNCLE DESIDERIO. " +#define TEXTB5 "EVEN BETTER, UNCLE DESIDERIO'S DEAD BODY. " +#define TEXTB6 "MY UNCLE. HE WENT TO CASTLE AND NEVER CAME BACK " +#define TEXTB7 "WELL, HE CAME BACK JUST A LITTLE. IF ONLY VON BRAUN HADN'T SCREWED THINGS UP MY UNCLE WOULD BE DRINKING WITH US NOW. " +#define TEXTB8 "NOTHING... " +#define TEXTB9 "WELL, YES !. THAT MEAN MAN HAS TERRIFIED US ALL. " +#define TEXTBJ1 "ARE YOU ALL RIGHT?. HEY, COME ON, WAKE UP! CAN YOU HEAR ME ? ARE YOU DEAD? " +#define TEXTBJ10 "OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEEPED ON YOUR GLASSES BY ACCIDENT " +#define TEXTBJ11 "YOU REALLY LOOK GOOD WITH THOSE GLASSES. I KNOW HE'S NOT FERNANDO LANCHA, BUT I FIND HIM ATTRACTIVE... " +#define TEXTBJ12 "YES, YES, I DO...COME ON, HOLD ME AND KISS ME TIGHT " +#define TEXTBJ13 "OH JHONNY, HONEY, THANKS GOD YOU'RE HERE...THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO SEE THE FOOTBALL GAME. " +#define TEXTBJ14 "YES, IT'S TRUE. PLEASE, SET ME FREE " +#define TEXTBJ15 "NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO LIBERATE WHILE YOU LET ME DOWN. " +#define TEXTBJ16 "JOHNNY, IS THAT YOU?. OH, GOD, GREAT! I KNEW YOU'D COME! " +#define TEXTBJ17 "YOU DON'T EVEN KNOW HOW MUCH THAT EVIL DRASCULA HAS MADE ME SUFFER " +#define TEXTBJ18 "FIRSTLY HE BROUGHT ME FLYING OVER HER AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT EVEN A MIRROR OR ANYTHING " +#define TEXTBJ19 "I'M TELLING YOU!, AND THE WORSE PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE " +#define TEXTBJ2 "NO, MY NAME IS BIlLIE JEAN, BUT YOU CAN CALL ME B. J., IT'S SHORTER " +#define TEXTBJ20 "JHONNY HONEY, WHERE ARE YOU? " +#define TEXTBJ21 "I'M READY TO LEAVE DEAR. " +#define TEXTBJ22 "WAIT, I'M GOING TO TAKE A LOOK...NO DARLING, I'M SORRY " +#define TEXTBJ23 "THERE YOU GO... " +#define TEXTBJ24 "\"DEAR JOHNNY\"" +#define TEXTBJ25 "I'LL NEVER FORGET YOU BUT I HAVE REALIZED THAT THIS JUST COULDN'T WORK OUT RIGHT. TO BE HONEST WITH YOU I'LL TELL YOU THAT THERE IS ANOTHER MAN. HE IS TALLER, STRONGER... " +#define TEXTBJ26 "AND HE HAS ALSO RESCUED ME FROM DRASCULA. HE HAS ASKED ME TO MARRY HIM, AND I HAVE ACCEPTED. " +#define TEXTBJ27 "BYE JHONNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS ITS OWN WAYS " +#define TEXTBJ28 "I HOPE THERE WON'T BE HARD FEELINGS BETWEEN US. REMEMBER THAT I STILL LOVE YOU, BUT ONLY AS A FRIEND " +#define TEXTBJ3 "HA, HA...! THAT WAS A GOOD ONE! " +#define TEXTBJ4 "WELL, JHONNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS STRONG NOISE DOWN THE CORRIDOR. " +#define TEXTBJ5 "I DIDN'T PAY ATTENTION AT FIRST, BUT AFTER ABOUT TWO HOURS OR SO I COULDN'T SLEEP AND WENT OUT FOR A WALK. " +#define TEXTBJ6 "AS I OPENED THE DOOR I WAS SHOCKED TO FIND YOU THERE, LYING ON THE FLOOR. I THOUGHT YOU WERE DEAD, I SWEAR...HA, HA, SILLY BILLY. " +#define TEXTBJ7 "I WAS GOING TO GIVE YOU THE KISS OF LIFE BUT IT WASN'T NECESSARY BECAUSE YOU STARTED TO TALK " +#define TEXTBJ8 "YOU SAID SOMETHING ABOUT A SCARECROW. I WAS VERY SCARED, YOU KNOW. IT'S A REAL SHOCK WHEN A DEAD PERSON STARTS TALKING RIGHT? " +#define TEXTBJ9 "ISN'T THAT RIGHT?, WELL, THEN I MANAGED TO BRING YOU TO MY ROOM THE BEST WAY I COULD. I PUT YOU IN BED...AND THAT'S ALL...HA, HA, HA... " +#define TEXTD1 "HEY IGOR, HOW ARE THINGS? " +#define TEXTD10 "THE TIME HAS COME ! TURN ON THE ALKALINE BATTERIES' SWITCH. " +#define TEXTD11 "DAMNED IT! WHAT WENT WRONG? " +#define TEXTD12 "ARE YOU SURE YOU CHECKED IT ALL AND THERE WAS NOTHING MISSING?. YOU'VE BEEN LATELY MESSING AROUND WITH THAT STUFF ABOUT TAXES AND I DON'T KNOW MAN... " +#define TEXTD13 "YOU STUPID THING! YOU FORGOT TO CONNECT THE INDIFIBULATOR. THE SCREWS HAVE PROBABLY MAGNETIZED AND HIS BRAIN BURNT " +#define TEXTD14 "YOU ARE DEAD, YOU ARE DEAD...WAIT TILL I GET YOU! " +#define TEXTD15 "SHUT UP! I'LL GET ANOTHER BRAIN TOMORROW AND THEN WE WILL REPEAT THE EXPERIMENT " +#define TEXTD16 "THIS TIME I'LL GET A WOMAN'S BRAIN. SHINY AND NOT USED YET...HA, HA, HA, GOODIE ONE! " +#define TEXTD17 "SO WHAT? I'M THE BAD GUY, RIGHT? SO I CAN BE AS FULL OF MACHISMO AS I WANT, ALL RIGHT?. AND IF YOU SAY SOMETHING AGAIN I'LL TURN YOUR HUMP BACK TO FRONT!" +#define TEXTD18 "HA, HA, HA. YOU FELL TOOO!! WHAT IS IT, ARE YOU ALL STUPID IN THIS COUNTRY?. DIDN'T YOU READ THE SIGN SAYING \"DRASCULA DOES NOT SLEEP HERE\"? IGOR, YOU ARE GOING TO PAY FOR DARING TO FIGHT AGAINST ME!" +#define TEXTD19 "AND SO, TELL ME , YOU STUPID HUMAN. HOW COME YOU WANT TO DESTROY ME? " +#define TEXTD2 "IT'S ALWAYS THE SAME STORY. EVERYTIME THERE'S A GOOD GAME ON THE SATELLITE! ANYWAY, WE'LL GO SEE IT IN THE BAR, AS USUAL " +#define TEXTD20 "THAT'S BEAUTIFUL!. IF IT WASN'T BECAUSE IT MAKES ME LAUGH, I WOULD CRY. " +#define TEXTD21 "OUR GIRLFRIEND'S BRAIN TO HELP ME CONQUERING THE WORLD " +#define TEXTD22 "YES, SURE! I'LL TAKE IT FROM HER AND GIVE IT TO MY FRUSKYNSTEIN. THE WORLD WILL BE MINE WITH IT, HA, HA. " +#define TEXTD23 "NO WHAT!?. YOU'RE DEAD, MAN! I'M GOING TO...YOU REALLY GOT ME ANGRY MAN...COME ON, PREPARE TO DIE! " +#define TEXTD24 "HA, HA, HA. NOT EVEN IN YOUR WILDEST DREAMS! " +#define TEXTD25 "YES, ISN'T IT? HA, HA, " +#define TEXTD26 "ALL RIGHT, ALL RIGHT. BUT DO IT QUICKLY, OK? " +#define TEXTD27 "PUT THAT CIGARETTE OUT NOW! I CAN'T STAND YOU ANYMORE! " +#define TEXTD28 "AND SO, DOES THAT BREW HAVE THE OPPOSITE EFFECT? " +#define TEXTD29 "WELL, WE'LL SEE THAT " +#define TEXTD3 "IGOR LISTEN CAREFULLY MAN, WE ARE GOING TO START WITH PHASE NUMBER ONE OF MY PLAN TO CONQUER THE WORLD. " +#define TEXTD30 "OK, LET'S SEE IT. IGOR, BRING ME THE CD \"SCRATCHING YOUR NAILS ALL OVER THE BLACKBOARD\"" +#define TEXTD31 "NO WAY. THE GIRL STAYS WITH ME. YOU RE STAYING THERE UNTIL THE PENDULUM CUTS YOU INTO THIN SLICES. HA, HA, HA. " +#define TEXTD32 "MAN I'M I JUST BAD... COME ON IGOR, LET'S MAKE THE BREW AND CONQUER THE WORLD." +#define TEXTD33 "WHAT HAPPENS NOW? " +#define TEXTD34 "YES, WHAT?...OH, DAMNED, THE GAME! " +#define TEXTD35 "I FORGOT ABOUT THAT. GET THE GIRL AND LET'S GO AND SEE HIM. WE CAN CONQUER THE WORLD LATER. " +#define TEXTD36 "THANKS MAN, I WAS THIRSTY " +#define TEXTD37 "OH, THE CRUCIFIX!!...THE CRUCIFIX...! " +#define TEXTD38 "I DIDN'T NOTICE ABOUT THAT BEAUTIFUL CRUCIFIX! " +#define TEXTD39 "LEAVE ME ALONE!, I'M WATCHING THE GAME " +#define TEXTD4 "FIRST WE'LL CAPTURE ONE OF THE STORM'S LIGHTNINGS AND WE'LL DEMAGNETIZE IT WITH OUR INDIFIBULATOR. THE ELECTRICITY WILL COME THROUGH TO MY MONSTER AND HE'LL GET ALIVE! " +#define TEXTD5 "IF EVERYTHING WORKS OUT ALL RIGHT, THIS WILL BE THE BEGINNING OF A GREAT ARMY THAT WILL CONQUER THE WORLD FOR ME. HA, HA,. " +#define TEXTD6 "THE MONSTERS WILL DESTROY ALL THE ARMY'S WEAPONS IN THE WORLD, MEANWHILE, WE'LL BE SAFE IN THE PIECES OF LAND I BOUGHT IN GIBRALTAR." +#define TEXTD7 "WE'LL SET UP A COUP. GOVERNMENTS ALL OVER THE WORLD WILL BE UNCOVERED AND THEIR COUNTRIES WILL SURRENDER TO ME! " +#define TEXTD8 "I'LL BECOME THE FIRST BAD GUY IN HISTORY TO MAKE IT ! HA, HA ! " +#define TEXTD9 "I'M NOT TALKING TO YOU, IDIOT! I'M JUST GIVING YOU THE PLOT. ALL RIGHT, EVERYTHING READY?" +#define TEXTE1 "YOU...HEY YOU! " +#define TEXTE10 "YEAH, IT'S YOU " +#define TEXTE11 "WHY DO ALL ADVENTURE GAMES END UP WITH A SUNRISE OR A SUNSET? " +#define TEXTE12 "DO ALL THESE NAMES BELONG TO THE CREATORS OF THE GAME?" +#define TEXTE13 "AREN'T THEY ASHAMED TO BE SEEN BY EVERYBODY? " +#define TEXTE14 "JESUS, THAT EMILIO DE PAZ IS EVERYWHERE!! " +#define TEXTE15 "REALLY? " +#define TEXTE16 "YES " +#define TEXTE17 "WELL, DON'T MAKE A FUSS ABOUT IT. " +#define TEXTE18 "HEY WEREWOLF, BY THE WAY... " +#define TEXTE19 "DIDN'T YOU FALL OFF A WINDOW AND GOT BADLY HURT " +#define TEXTE2 "DON'T GIVE ME THAT CRAP ABOUT A DEAD BODY OK? " +#define TEXTE20 "IF AT LEAST IT WASN'T ALWAYS THE SAME ONES... " +#define TEXTE21 "HE'S BEEN OUT FOUR TIMES ALREADY. " +#define TEXTE22 "I'D LIKE TO BE A MODEL " +#define TEXTE23 "ALL RIGHT, AND WHAT ARE YOU GOING TO DO? " +#define TEXTE3 "I'M ALIVE. IT'S JUST THAT I'M STARVING. " +#define TEXTE4 "WELL, YOU SEE. I WAS THE DRUNKARD OF THE VILLAGE, JUST KEEPING UP WITH THE FAMILY TRADITION, YOU KNOW?, ONE NIGHT DRASCULA KIDNAPPED ME TO TAKE MY ORGANS AWAY. " +#define TEXTE5 "SINCE ALCOHOL STILL KEEPS ME QUITE YOUNG, I'M HERE LIKE A SCRAP YARD. EVERYTIMR HE NEEDS SOMETHING FOR THE MONSTER HE IS CREATING, HE JUST COMES AND TAKES IT FROM ME." +#define TEXTE6 "IT HURT AT FIRST, BUT I DON'T CARE ANYMORE " +#define TEXTE7 "I DON'T KNOW. I GUESS IT'S HIS GRADUATE PROJECT. " +#define TEXTE8 "I'M DESIDERIO, AND I CAN HELP YOU IN ANYTHING YOU NEED. " +#define TEXTE9 "THE TRUTH IS THAT I DON'T REALLY FEEL LIKE IT, BUT THANKS VERY MUCH ANYWAY SIR. " +#define TEXTI1 "MASTER, I THINK THIS IS NOT WORKING " +#define TEXTI10 "YES, MY MASTER " +#define TEXTI11 "MASTER " +#define TEXTI12 "DO YOU KNOW WHAT TIME IS IT ? " +#define TEXTI13 "WHAT?, OH, THAT SCARED ME !. YOU ARE THE \"NIGHT-CLEANING GUY\", RIGHT?" +#define TEXTI14 "I'M IGOR, THE VALET. YOU CAN START WITH THE BALL ROOM. THERE'S BEEN A SUPER NATURAL ORGY YESTERDAY AND IT LOOKS LIKE SHIT. " +#define TEXTI15 "IF YOU NEED ANYTHING, JUST BUY IT. " +#define TEXTI16 "IT'S THE TAX RETURN APPLICATION FORM, CAN'T YOU SEE IT? " +#define TEXTI17 "NEITHER DO I. FIRST OF ALL THE NUMBERS ARE VERY SMALL AND ALSO I CAN'T SEE MUCH AT THIS DISTANCE.. " +#define TEXTI18 "NO WAY!. THEY MAKE ME LOOK UGLY. " +#define TEXTI19 "OH, WELL. IT'S JUST LIKE A CRAZY PARTY THAT THE MASTER ORGANIZES WITH HIS FRIENDS EACH TIME SOME IDIOT COMES ALONG TRYING TO KILL HIM." +#define TEXTI2 "I AM POSITIVE, MASTER " +#define TEXTI20 "THEY TAKE HIS EYES OUT. THEN, POUR SOME LEMON JUICE SO THAT IT ITCHES TO DEATH, AND THEN... " +#define TEXTI21 "NO" +#define TEXTI22 "WHAT DO YOU MEAN WHY NOT? DO YOU KNOW WHAT TIME IT IS? " +#define TEXTI23 "YES, IT'S WINTER " +#define TEXTI24 "SEE YOU LATER " +#define TEXTI25 "DON'T EVEN THINK ABOUT IT! " +#define TEXTI26 "WELL, THAT'S ENOUGH FOR TODAY. I'M GOING TO HAVE SUPPER " +#define TEXTI27 "MAN, I ALWAYS FORGET TO LOCK IT, RIGHT? " +#define TEXTI28 "THE HELL WITH IT! " +#define TEXTI29 "WHAT?. OH, YOU SCARED ME MASTER, I THOUGHT YOU WERE ASLEEP. " +#define TEXTI3 "I'M SORRY MASTER " +#define TEXTI30 "OH, BY THE WAY, I TOOK THE LIVING-ROOM KEYS SO THAT YOU CAN WATCH THE EARLY MORNING CARTOONS WITHOUT WAKING ME UP. " +#define TEXTI31 "YOU'VE GOT ANOTHER COLD MASTER? DAMN IT!. I TOLD YOU TO GET SOME HEATING IN HERE... " +#define TEXTI32 "ALL RIGHT, JUST TAKE YOUR ASPIRIN AND GO TO BED TO SWEAT FOR A WHILE. GOOD NIGHT " +#define TEXTI4 "ARE YOU GOING TO BRING HERE ANOTHER CRAZY SCIENTIST? I'LL TELL YOU THAT THE LABORATORY IS ALREADY PACKED UP, AND BESIDES, THEY'RE ALL OUT OF DATE. " +#define TEXTI5 "HUSH MASTER, THE FEMINIST COULD HEAR YOU" +#define TEXTI6 "DAMNED IT! " +#define TEXTI7 "I DIDN'T EXPECT YOU SO SOON, MASTER." +#define TEXTI8 "QUITE BAD MASTER. THERE MUST BE SOME PROBLEMS WITH THE SATELLITE AND I JUST CAN'T RECEIVE ANYTHING. BESIDES THERE ARE SOME INTERFERENCES BECAUSE OF THE STORM." +#define TEXTI9 "WHAT DO I KNOW, MASTER? " +#define TEXTL1 "WAIT A MINUTE. ARE YOU GOING TO LET OURSELVES BE GUIDED BY OUR MOST PRIMITIVE INSTINCTS JUST BECAUSE WE BELONG TO DIFFERENT RACES AND THE SOCIAL SITUATION IS TELLING US TO DO SO? " +#define TEXTL10 "PUKE! HUNTING AS A WAY TO SURVIVE IS AN INCOMPATIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN" +#define TEXTL11 "IT JUST HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO BETHINK AND GET TO THE ABOVE MENTIONED THOUGHT. " +#define TEXTL12 "IT TOOK ME A LONG TIME TO QUIT OLD HABITS BUT AT LEAST MY IRASCIBLE SOUL BIT UP THE CONCUPISCIBLE ONE, AND EVER SINCE, I'VE NEVER EATEN MEAT AGAIN " +#define TEXTL13 "NOT EVEN THE PLEASURE OF SUCKING UP THE BONE, FEELING THE TASTE OF THE SKIN AND THAT SWEET TASTE OF MARROW...THAT JUST TAKES YOU TO HEAVENLY PLACES. " +#define TEXTL14 "IT DOESN'T REALLY GET TO ME AT ALL. " +#define TEXTL15 "WHAT? " +#define TEXTL16 "I DON'T KNOW WHAT YOU'RE TALKING ABOUT, YOU EPHEMERAL CREATURE " +#define TEXTL17 "I'M NOT INTERESTED " +#define TEXTL18 "I DON'T KNOW ABOUT THE OTHER GAMES, BUT WE COULD USE THIS BEAUTIFUL SCREEN." +#define TEXTL2 "AREN'T WE TIED BY SENSE WHICH IS THE MOST POWERFUL WEAPON AS WELL AS THE MOST PRECIOUS GIFT? " +#define TEXTL20 "I'D CARE... " +#define TEXTL21 "NO. IT'S JUST THE SON, THE FATHER, THE GRANDFATHER AND A FRIEND, WHO ARE CALLED LIKE THAT." +#define TEXTL22 "BUT, IT IS GOING TO LOOK LIKE THE GAME WAS MADE BY FIVE PEOPLE. " +#define TEXTL23 "THESE ARE PROMISING GUYS " +#define TEXTL24 "THAT'S A GOOD ONE! A GOOD ONE!" +#define TEXTL25 "PLEASE, CALL ME CONSTANTINO " +#define TEXTL26 "IT WASN'T ME MAN. IT WAS \"EL COYOTE\", MY TWIN" +#define TEXTL27 "JESUS, THESE ARE REALLY LONG CREDIT TITLES " +#define TEXTL28 "I STOPPED COUNTING A LONG TIME AGO " +#define TEXTL29 "WHAT WILL BECOME OF YOU NOW, DESIDERIO? " +#define TEXTL3 "OH, IF WE ALL LET OUR THOUGHTS GUIDE OUR WAY IN LIFE WITHOUT LEAVING SOME ROOM FOR FEELINGS WHICH ARE PRECISELY WHAT LET'S OUR PRE-EVOLUTIVE INSTINCTS COME OUT! " +#define TEXTL30 "BUT, YOU SHOULD LOSE SOME WEIGHT " +#define TEXTL31 "I'LL JUST RETIRE TO THE TIBET AND THINK ABOUT THE MEANING OF LIFE " +#define TEXTL4 "ANSWER ME, EPHEMERAL CREATURE. WOULDN'T WE ALL BE HAPPIER WITH THOSE EMOTIONAL BOUNDINGS? " +#define TEXTL5 "YOU ARE NOT GETTING THROUGH " +#define TEXTL6 "THIS IS A VERY CLEAR EXAMPLE, YOU SEE?: YOU WANT TO GET THROUGH AND GO AHEAD WITH YOUR ADVENTURE, AND I WON'T LET YOU DO THAT" +#define TEXTL7 "WILL THAT BE A CONTROVERSIAL POINT BETWEEN US THAT HAVE JUST MET? " +#define TEXTL8 "WELL THEN " +#define TEXTL9 "WELL, THAT DEPENDS ON WHAT WE TAKE A RELATIONSHIP FOR. SOME AUTHORS DEFEND... " +#define TEXTP1 "HI " +#define TEXTP10 "I'M A CONSERVATOIRE PIANIST AND THE BARTENDER WON'T BUY MORE SCORES FOR ME " +#define TEXTP11 "OH GOD, I REALLY LOVE CLASSIC MUSIC! " +#define TEXTP12 "IT'S BECAUSE I'M WEARING EAR-PLUGS" +#define TEXTP13 "IT'S BECAUSE I CAN LIP-READ " +#define TEXTP14 "NOOO " +#define TEXTP15 "NO! I'M NOT TAKING THIS ANY LONGER! " +#define TEXTP16 "NO WAYYYYY! " +#define TEXTP17 "WHAT?, OF COURSE I'M INTERESTED " +#define TEXTP18 "THANKS GOD! I CAN PLAY A DIFFERENT SONG NOW! " +#define TEXTP19 "I GUESS YOU CAN KEEP MY EAR-PLUGS " +#define TEXTP2 "YES SIR. IT'S BEAUTIFUL " +#define TEXTP3 "NO, NO. HE WON'T DO IT " +#define TEXTP4 "ALL RIGHT THEN " +#define TEXTP5 "REALLY? " +#define TEXTP6 "AND? " +#define TEXTP7 "I'M SORRY. THE PIANIST UNION TRADE DOESN'T ALLOW ME TO SAVE GIRLS FROM VAMPIRES' CLUTCHES " +#define TEXTP8 "IF YOU HAD BEEN KIDNAPPED BY THE WEREWOLF..." +#define TEXTP9 "I CAN ONLY PLAY THIS SONG " +#define TEXTT1 "WHAT HAPPENS, WHAT'S THE MATTER? " +#define TEXTT10 "THEY'RE WINNING " +#define TEXTT11 "LEAVE ALONE, ALL RIGHT? " +#define TEXTT12 "OF COURSE. I'M NOT BLIND " +#define TEXTT13 "THE TRADITION IN THIS VILLAGE IS TO FORGET ALL HARD FEELINGS WHENEVER THERE IS A GAME, SO AS TO CHEER UP THE LOCAL TEAM " +#define TEXTT14 "AND PLEASE, SHUT UP FOR GOD'S SAKE. I CAN'T HEAR ANYTHING! " +#define TEXTT15 "COME ON, LEAVE ME ALONE AND DON'T BOTHER ME ANYMORE " +#define TEXTT16 "IT HAS JUST STARTED! AND SHUT UP! " +#define TEXTT17 "OK, OK, I THOUGHT SOMETHING WAS GOING ON. " +#define TEXTT18 "IT DOESN'T MATTER, ANYWAY. SHE'LL PROBABLY BE DEAD BY NOW. " +#define TEXTT19 "HE JUST STARTED PLAYING CLASSIC MUSIC, AND I COULDN'T STAND IT " +#define TEXTT2 "OK. ROOM 512. UPSTAIRS. THE KEY IS ON THE DOOR " +#define TEXTT20 "SINCE I'M PAYING HIM FOR PLAYING WHATEVER I WISH, I JUST FIRED HIM. " +#define TEXTT21 "AND THEN, HE GOT FRESH WITH ME. JESUS!, HE LOOKED SO NICE AND INNOCENT...WHAT A HYPOCRITE! " +#define TEXTT22 "BY THE WAY, BE CAREFUL BECAUSE I JUST WAXED THE FLOOR. " +#define TEXTT23 "SHUT UP! WE'RE WATCHING THE GAME! " +#define TEXTT24 "OH, COME ON! TAKE IT! " +#define TEXTT3 "COUNT DRASCULA!!? " +#define TEXTT4 "NO, NOTHING. THAT GUY HAS A BAD REPUTATION OVER HERE. " +#define TEXTT5 "WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK UP THEIR BLOOD. " +#define TEXTT6 "HOWEVER, SOME OTHERS SAY THAT HE IS JUST AN ORGAN-DEALER AND THAT IS THE REASON WHY THERE ARE BODY PARTS ALL OVER THE PLACE." +#define TEXTT7 "BUT OF COURSE, THOSE ARE JUST RUMORS. HE'S PROBABLY BOTH THINGS. BY THE WAY, WHY DO YOU WANT TO MEET HIM? " +#define TEXTT8 "NO, FORGET IT. I'M REALLY BUSY... " +#define TEXTT9 "WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TELL ME TO. " +#define TEXTVB1 "WHO THE HELL IS CALLING AT THIS TIME ? " +#define TEXTVB10 "YOU DON'T HAVE THEM " +#define TEXTVB11 "I'M SURE YOU WOULDN'T BET ALL YOUR MONEY ON IT, HUH? " +#define TEXTVB12 "WELL, ALL RIGHT, COME ON IN " +#define TEXTVB13 "IF YOU REALLY MEAN TO FACE DRASCULA, YOU'VE GOT TO BE ABLE TO TAKE ALL TYPES OF CREAKING AND VAMPIRE-LIKE NOISES " +#define TEXTVB14 "IS THAT CLEAR? " +#define TEXTVB15 "OK, WAIT A MINUTE " +#define TEXTVB16 "STAND IN THE CENTER OF THE ROOM, PLEASE " +#define TEXTVB17 "WHERE DID I PUT THAT RECORD CALLED \"NAILS SCRATCHING THE BLACKBOARD\"?" +#define TEXTVB18 "ALL RIGHT. LET'S GET TO IT. " +#define TEXTVB19 "YOU ARE USELESS. YOU SEE...?, JUST LIKE THE REST!! " +#define TEXTVB2 "OH, ..OH, NO, NO....I'M...GANIMEDES THE DWARF. PROFESSOR VON BRAUN DOESN'T LIVE HERE ANYMORE. " +#define TEXTVB20 "JUST GIVE ME NOW THE MONEY YOU LOST AND GET OUT OF HERE " +#define TEXTVB21 "AND DON'T COME BACK UNTIL YOU ARE ABSOLUTELY READY " +#define TEXTVB22 "WHAT DO YOU WANT NOW? " +#define TEXTVB23 "I HAVE TO ADMIT IT. YOU REALLY GOT WHAT IT TAKES TO FIGHT AGAINST THE VAMPIRES. " +#define TEXTVB24 "HEY, TAKE YOUR MONEY. I ADMIT IT WHEN I MAKE A MISTAKE... " +#define TEXTVB25 "LEAVE ME ALONE NOW, I WANT TO GET SOME SLEEP. " +#define TEXTVB26 "WHENEVER YOU ARE READY TO FIGHT AGAINST THE VAMPIRES, JUST COME BACK AND I'LL HELP YOU OUT. " +#define TEXTVB27 "OH, THAT'S EASY. JUST USING THE LIGHT OF ONE CRUCIFIX IS ENOUGH TO DESTROY HIM. " +#define TEXTVB28 "YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTICS POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE " +#define TEXTVB29 "YOU'D BE LOST IF IT WASN'T FOR THE... " +#define TEXTVB3 "NO, I DON'T KNOW WHERE IT IS !! " +#define TEXTVB30 "...BREW! " +#define TEXTVB31 "YEAH, YOU'RE RIGHT! I MIGHT HAVE SOME PROBLEMS WITH MY BACK IN THE FUTURE IF I KEEP ON SLEEPING THIS WAY " +#define TEXTVB32 "WELL, OK, I UNDERSTAND HE WAS A BETTER OPPONENT THAN ME, BUT YOU HAVE TO ADMIT THAT THE DISCOVERY I MADE ABOUT ANTI-VAMPIRE TECHNIQUES WAS WHAT ACTUALLY PROTECTED ME. " +#define TEXTVB33 "I'VE FOUND THIS IMMUNIZING BREW THAT KEEPS YOU SAFE FROM ANY VAMPIRES' BITE OR AGAINST HIS FRISISNOTICS POWERS." +#define TEXTVB34 "NO, NO, EXCUSE ME. I HAD IT ONCE BUT IT'S VERY DANGEROUS TO HAVE A BREW OF THAT TYPE. CAN YOU IMAGINE WHAT COULD HAPPEN IF A VAMPIRE GOT IT? " +#define TEXTVB35 "HE'D BE IMMUNIZED AGAINST GARLIC, THE CRUCIFIX, THE SUNSHINE LIGHT...I JUST HAD TO GET RID OF WHAT WAS LEFT FROM IT. TO DO IT I USED THIS SCIENTIFIC METHOD OF THROWING IT IN THE LAVATORY" +#define TEXTVB36 "DON'T WORRY, I REMEMBER EXACTLY HOW TO MAKE THAT BREW. " +#define TEXTVB37 "I NEED GARLIC, BUT I ALREADY HAVE THEM. HOWEVER YOU'LL HAVE TO GET ME SOME WAX, BUBBLE GUM AND CIGARETTE PAPER OR PERHAPS A NAPKING OR SOMETHING ALIKE " +#define TEXTVB38 "OH...AND OF COURSE THE MOST IMPORTANT INGREDIENT. LEAVES FROM A VERY STRANGE PLANT CALLED FERNAN. " +#define TEXTVB39 "IT'S A CLIMBING PLANT WHICH LEAVES HAVE MAGIC POWERS IF THEY'RE CUT WITH A GOLDEN SICKLE. " +#define TEXTVB4 "GET OUT!! " +#define TEXTVB40 "SO THAT AS SOON AS YOU HAVE THESE FIVE THINGS, JUST COME HERE AND I'LL MAKE THE BREW. " +#define TEXTVB41 "YOU'LL BE READY THEN TO FIGHT AGAINST DRASCULA " +#define TEXTVB42 "REMEMBER: WAX, NICOTINE, A PIECE OF BUBBLE GUM, A PAPER AND SOME FERNAN'S LEAVES CUT WITH A GOLDEN SICKLE." +#define TEXTVB43 "I TOLD YOU! IT WAS JUST BECAUSE OF THE BREW! " +#define TEXTVB44 "OH, ALL RIGHT. I'M GOING TO MAKE MYSELF A...THE BREW. JUST A MOMENT, OK? " +#define TEXTVB45 "IT'S A PROTECTING SPELL AGAINST VAMPIRES. " +#define TEXTVB46 "I PUT IT THERE IN ORDER TO PRETEND THAT THE SKETCHER DIDN'T FORGET TO DRAW THE WINDOW YOU CAN SEE FROM OUTSIDE. " +#define TEXTVB47 "ALL RIGHT, THE FIRST THING YOU MUST KNOW IS THE WAY TO DRASCULA'S CASTLE. " +#define TEXTVB48 "THERE IS A CAVERN THAT GETS YOU STRAIGHT FROM THE CASTLE. IGOR, THE CRAZY ELVIS' FUN, TAKES IT TO GET TO THE VILLAGE EACH MORNING. " +#define TEXTVB49 "BE CAREFUL THOUGH, THERE IS A VAMPIRE ALWAYS WATCHING OVER IT. YOU'LL HAVE TO GET RID OF HIM. " +#define TEXTVB5 "IT'S TOO LATE NOW, YOU IDIOT!! IT ALWAYS IS " +#define TEXTVB50 "THERE IS AN OLD WELL RIGHT BY THE CEMETERY CHURCH " +#define TEXTVB51 "IT WAS USED A LONG TIME AGO FOR WITCHCRAFT TRIALS " +#define TEXTVB52 "THEY THREW THE WITCHES IN THE WELL. IF THEY DROWNED THEY WERE REAL WITCHES. IF THEY DIDN'T, THEY WEREN'T. " +#define TEXTVB53 "WE THREW ONE ONCE AND SHE DIDN'T DROWN, I GUESS SHE WASN'T A WITCH " +#define TEXTVB54 "ANYWAY. THERE IS YOUR BREW. HOWEVER, I ONLY GOT TO MAKE ENOUGH JUST FOR ONE PERSON " +#define TEXTVB55 "YOU'D BETTER SMOKE IT RIGHT BEFORE YOU FIGHT AGAINST DRASCULA " +#define TEXTVB56 "COME ON, RUN! " +#define TEXTVB57 "OH, JUST EXCUSES...! " +#define TEXTVB58 "ARE YOU JOHN HACKER? I'M DOCTOR VON BRAUN " +#define TEXTVB59 "LISTEN TO ME, THIS IS VERY IMPORTANT. IT'S ABOUT THE BREW" +#define TEXTVB6 "I COULDN'T AGREE MORE. " +#define TEXTVB60 "SHUT UP AND LET ME TALK. I JUST FOUND THIS BOOK ABOUT ANTI-VAMPIRE BREWS WARNING AGAINST MIXING THE JOINT WITH ANY ALCOHOLIC DRINK BEFORE YOU" +#define TEXTVB61 "ALCOHOL REACTS WHEN MIXED WITH BREW, SO THAT IT CANCELS OUT ITS EFFECTS JUST IN A FEW SECONDS. " +#define TEXTVB62 "I'M SORRY, BUT I HAVE TO HANG UP RIGHT NOW. THE POLICE IS LOOKING FOR ME, THEY THINK I'M A PUSHER. STUPID, ISN'T IT?. ANYWAY, BYE AND GOOD LUCK SAVING THE WORLD! " +#define TEXTVB7 "ME, SCARED? " +#define TEXTVB8 "LISTEN HERE, DUDE. YOU'RE RIGHT NOW TALKING TO THE ONLY PERSON WHO KNOWS THE SECRET TO FIGHT AGAINST THE VAMPIRE." +#define TEXTVB9 "YOU NEED TO HAVE SPECIAL SKILLS TO FIGHT AGAINST A VAMPIRE. NOT EVERYBODY CAN DO IT " +#define SYS0 "PRESS SUPR AGAIN TO restart" +#define SYS1 "press ESC again to exit" +#define SYS2 "VOiCES only" +#define SYS3 "VOices and TEXT" + +#define HIS1 "A long time ago, it seems that Drascula killed Von Braun's wife, and then, as he intended to face the count, Von Braun started to investigate all he found vampires." +#define HIS2 "When he thought he was ready, he came up to the castle and had a very violent encounter with Drascula." +#define HIS3 "Nobody knows exactly what happened there. Although Von Braun lost, Drascula could not kill him." +#define HIS4 "Von Braun felt humiliated by his defect, run away from the castle and has never dared to face Drascula ever again." + + + + |