diff options
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/drascula.cpp | 687 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 93 | ||||
-rw-r--r-- | engines/drascula/rooms.cpp | 405 | ||||
-rw-r--r-- | engines/drascula/staticdata.h | 59 |
4 files changed, 542 insertions, 702 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 4986b784b3..3e5d0b3d18 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -1535,118 +1535,35 @@ bool DrasculaEngine::saves() { return true; } -struct charInfo { - -}; - void DrasculaEngine::print_abc(const char *said, int x_pantalla, int y_pantalla) { int pos_texto[8]; - int y_de_letra = 0, x_de_letra = 0, h, length; + int letterY = 0, letterX = 0, h, length; length = strlen(said); - for (h = 0; h < length; h++) { - y_de_letra = (_lang == kSpanish) ? Y_ABC_ESP : Y_ABC; int c = toupper(said[h]); - if (c == '\245') - x_de_letra = X_GN; - else if (c == '\244') - x_de_letra = X_GN; - else if (c >= 'A' && c <= 'N') - x_de_letra = X_A + (c - 'A') * 9; - else if (c >= 'O' && c <= 'Z') - x_de_letra = X_O + (c - 'O') * 9; - else if (c == 0xa7 || c == ' ') - x_de_letra = SPACE; - else { - y_de_letra = (_lang == kSpanish) ? Y_SIGNOS_ESP : Y_SIGNOS; - if (c == '.') - x_de_letra = X_DOT; - else if (c == ',') - x_de_letra = X_COMA; - else if (c == '-') - x_de_letra = X_HYPHEN; - else if (c == '?') - x_de_letra = X_CIERRA_INTERROGACION; - else if (c == '\250') - x_de_letra = X_ABRE_INTERROGACION; -// else if (c == '\'') // FIXME -// x_de_letra = SPACE; // space for now - else if (c == '"') - x_de_letra = X_COMILLAS; - else if (c == '!') - x_de_letra = X_CIERRA_EXCLAMACION; - else if (c == '\255') - x_de_letra = X_ABRE_EXCLAMACION; - else if (c == ';') - x_de_letra = X_pointY_COMA; - else if (c == '>') - x_de_letra = X_GREATER_THAN; - else if (c == '<') - x_de_letra = X_LESSER_THAN; - else if (c == '$') - x_de_letra = X_DOLAR; - else if (c == '%') - x_de_letra = X_PERCENT; - 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_BRACKET_OPEN; - else if (c == ')') - x_de_letra = X_BRACKET_CLOSE; - else if (c == '*') - x_de_letra = X_ASTERISCO; - else if (c == '+') - x_de_letra = X_PLUS; - else if (c >= '1' && c <= '9') - x_de_letra = X_N1 + (c - '1') * 9; - // "0" is mapped after "9" in the game's font - // (it's mapped before "1" normally) - else if (c == '0') - x_de_letra = X_N0; - else y_de_letra=Y_ACENTOS; - - if (c == '\240') x_de_letra=X_A; - else if (c =='\202') x_de_letra = X_A + 1 * 9; // B - else if (c =='\241') x_de_letra = X_A + 2 * 9; // C - else if (c =='\242') x_de_letra = X_A + 3 * 9; // D - else if (c =='\243') x_de_letra = X_A + 4 * 9; // E - else if (c =='\205') x_de_letra = X_A + 5 * 9; // F - else if (c =='\212') x_de_letra = X_A + 6 * 9; // G - else if (c =='\215') x_de_letra = X_A + 7 * 9; // H - else if (c =='\225') x_de_letra = X_A + 8 * 9; // I - else if (c =='\227') x_de_letra = X_A + 9 * 9; // J - else if (c =='\203') x_de_letra = X_A + 10 * 9; // K - else if (c =='\210') x_de_letra = X_A + 11 * 9; // L - else if (c =='\214') x_de_letra = X_A + 12 * 9; // M - else if (c =='\223') x_de_letra = X_A + 13 * 9; // N - else if (c =='\226') x_de_letra = X_GN; - else if (c =='\047') x_de_letra = X_O; - else if (c =='\200') x_de_letra = X_O + 1 * 9; // P - else if (c =='\207') x_de_letra = X_O + 1 * 9; // P - else if (c =='\265') x_de_letra = X_A; - else if (c =='\220') x_de_letra = X_A + 1 * 9; // B - else if (c =='\326') x_de_letra = X_A + 2 * 9; // C - else if (c =='\340') x_de_letra = X_A + 3 * 9; // D - else if (c =='\351') x_de_letra = X_A + 4 * 9; // E - else if (c =='\267') x_de_letra = X_A + 5 * 9; // F - else if (c =='\324') x_de_letra = X_A + 6 * 9; // G - else if (c =='\336') x_de_letra = X_A + 7 * 9; // H - else if (c =='\343') x_de_letra = X_A + 8 * 9; // I - else if (c =='\353') x_de_letra = X_A + 9 * 9; // J - else if (c =='\266') x_de_letra = X_A + 10 * 9; // K - else if (c =='\322') x_de_letra = X_A + 11 * 9; // L - else if (c =='\327') x_de_letra = X_A + 12 * 9; // M - else if (c =='\342') x_de_letra = X_A + 13 * 9; // N - else if (c =='\352') x_de_letra = X_GN; - } - pos_texto[0] = x_de_letra; - pos_texto[1] = y_de_letra; + for (int i = 0; i < CHARMAP_SIZE; i++) { + if (c == charMap[i].inChar) { + letterX = charMap[i].mappedChar; + + switch (charMap[i].charType) { + case 0: // letters + letterY = (_lang == kSpanish) ? 149 : 158; + break; + case 1: // signs + letterY = (_lang == kSpanish) ? 160 : 169; + break; + case 2: // accented + letterY = 180; + break; + } // switch + break; + } // if + } // for + + pos_texto[0] = letterX; + pos_texto[1] = letterY; pos_texto[2] = x_pantalla; pos_texto[3] = y_pantalla; pos_texto[4] = CHAR_WIDTH; @@ -1659,6 +1576,53 @@ void DrasculaEngine::print_abc(const char *said, int x_pantalla, int y_pantalla) x_pantalla = 0; y_pantalla = y_pantalla + CHAR_HEIGHT + 2; } + } // for +} + +void DrasculaEngine::print_abc_opc(const char *said, int x_pantalla, int y_pantalla, int game) { + int pos_texto[6]; + int y_de_signos, letterY, letterX = 0, h, length; + length = strlen(said); + + for (h = 0; h < length; h++) { + if (game == 1) { + letterY = 6; + y_de_signos = 15; + } else if (game == 3) { + letterY = 56; + y_de_signos = 65; + } else { + letterY = 31; + y_de_signos = 40; + } + + int c = toupper(said[h]); + + for (int i = 0; i < CHARMAP_SIZE; i++) { + if (c == charMap[i].inChar) { + // Convert the mapped char of the normal font to the + // mapped char of the dialogue font + + int multiplier = (charMap[i].mappedChar - 6) / 9; + + letterX = multiplier * 7 + 10; + + if (charMap[i].charType > 0) + letterY = y_de_signos; + break; + } // if + } // for + + pos_texto[0] = letterX; + pos_texto[1] = letterY; + pos_texto[2] = x_pantalla; + pos_texto[3] = y_pantalla; + pos_texto[4] = CHAR_WIDTH_OPC; + pos_texto[5] = CHAR_HEIGHT_OPC; + + copyRectClip(pos_texto, backSurface, screenSurface); + + x_pantalla = x_pantalla + CHAR_WIDTH_OPC; } } @@ -2708,411 +2672,6 @@ bool DrasculaEngine::pickupObject() { return false; } -bool DrasculaEngine::checkFlag(int fl) { - characterMoved = 0; - updateRoom(); - updateScreen(0, 0, 0, 0, 320, 200, screenSurface); - - hasAnswer = 1; - - if (menuScreen == 1) { - if (num_ejec == 1) { - if (pickedObject == kVerbLook && fl == 28) - talk(328); - } else if (num_ejec == 2) { - if ((pickedObject == kVerbLook && fl == 22 && flags[23] == 0) - || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) { - talk(164); - flags[23] = 1; - withoutVerb(); - addObject(7); - addObject(18); - } else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1) - talk(307); - else if (pickedObject == kVerbLook && fl == 28) - talk(328); - else if (pickedObject == kVerbLook && fl == 7) - talk(143); - else if (pickedObject == kVerbTalk && fl == 7) - talk(144); - else if (pickedObject == kVerbLook && fl == 8) - talk(145); - else if (pickedObject == kVerbTalk && fl == 8) - talk(146); - else if (pickedObject == kVerbLook && fl == 9) - talk(147); - else if (pickedObject == kVerbTalk && fl == 9) - talk(148); - else if (pickedObject == kVerbLook && fl == 10) - talk(151); - else if (pickedObject == kVerbLook && fl == 11) - talk(152); - else if (pickedObject == kVerbTalk && fl == 11) - talk(153); - else if (pickedObject == kVerbLook && fl == 12) - talk(154); - else if (pickedObject == kVerbLook && fl == 13) - talk(155); - else if (pickedObject == kVerbLook && fl == 14) - talk(157); - else if (pickedObject == kVerbLook && fl == 15) - talk(58); - else if (pickedObject == kVerbLook && fl == 16) - talk(158); - else if (pickedObject == kVerbLook && fl == 17) - talk(159); - else if (pickedObject == kVerbLook && fl == 18) - talk(160); - else if (pickedObject == kVerbLook && fl == 19) - talk(161); - else if (pickedObject == kVerbLook && fl == 20) - talk(162); - else if (pickedObject == kVerbLook && fl == 23) - talk(152); - else - hasAnswer = 0; - } else if (num_ejec == 3) { - if (pickedObject == kVerbLook && fl == 22) - talk(307); - else if (pickedObject == kVerbLook && fl == 28) - talk(328); - else if (pickedObject == kVerbLook && fl == 7) - talk(143); - else if (pickedObject == kVerbTalk && fl == 7) - talk(144); - else if (pickedObject == kVerbLook && fl == 8) - talk(145); - else if (pickedObject == kVerbTalk && fl == 8) - talk(146); - else if (pickedObject == kVerbLook && fl == 9) - talk(147); - else if (pickedObject == kVerbTalk && fl == 9) - talk(148); - else if (pickedObject == kVerbLook && fl == 10) - talk(151); - else if (pickedObject == kVerbLook && fl == 11) - talk(152); - else if (pickedObject == kVerbTalk && fl == 11) - talk(153); - else if (pickedObject == kVerbLook && fl == 12) - talk(154); - else if (pickedObject == kVerbLook && fl == 13) - talk(155); - else if (pickedObject == kVerbLook && fl == 14) - talk(157); - else if (pickedObject == kVerbLook && fl == 15) - talk(58); - else if (pickedObject == kVerbLook && fl == 16) - talk(158); - else if (pickedObject == kVerbLook && fl == 17) - talk(159); - else if (pickedObject == kVerbLook && fl == 18) - talk(160); - else if (pickedObject == kVerbLook && fl == 19) - talk(161); - else if (pickedObject == kVerbLook && fl == 20) - talk(162); - else if (pickedObject == kVerbLook && fl == 23) - talk(152); - else - hasAnswer = 0; - } else if (num_ejec == 4) { - if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) { - withoutVerb(); - chooseObject(21); - removeObject(18); - removeObject(19); - } else if ((pickedObject == 14 && fl == 19) || (pickedObject == 19 && fl == 14)) - talk(484); - else if (pickedObject == kVerbLook && fl == 28) - talk(328); - else if (pickedObject == kVerbLook && fl == 7) - talk(478); - else if (pickedObject == kVerbLook && fl == 8) - talk(480); - else if (pickedObject == kVerbLook && fl == 9) { - talk(482); - talk(483); - } else if (pickedObject == kVerbLook && fl == 10) - talk(485); - else if (pickedObject == kVerbLook && fl == 11) - talk(488); - else if (pickedObject == kVerbLook && fl == 12) - talk(486); - else if (pickedObject == kVerbLook && fl == 13) - talk(490); - else if (pickedObject == kVerbLook && fl == 14) - talk(122); - else if (pickedObject == kVerbLook && fl == 15) - talk(117); - else if (pickedObject == kVerbTalk && fl == 15) - talk(118); - else if (pickedObject == kVerbOpen && fl == 15) - talk(119); - else if (pickedObject == kVerbLook && fl == 16) - talk(491); - else if (pickedObject == kVerbLook && fl == 17) - talk(478); - else if (pickedObject == kVerbLook && fl == 18) - talk(493); - else if (pickedObject == kVerbLook && fl == 19) { - talk(494); - talk(495); - } else if (pickedObject == kVerbLook && fl == 20) - talk(162); - else if (pickedObject == kVerbLook && fl == 21) - talk(496); - else if (pickedObject == kVerbLook && fl == 22) - talk(161); - else - hasAnswer = 0; - } else if (num_ejec == 5) { - if (pickedObject == kVerbLook && fl == 28) - talk(328); - else if (pickedObject == kVerbLook && fl == 7) - talk(478); - else if (pickedObject == kVerbLook && fl == 8) - talk(120); - else if (pickedObject == kVerbLook && fl == 9) { - talk(482); - talk(483); - } else if (pickedObject == kVerbLook && fl == 11) - talk(488); - else if (pickedObject == kVerbLook && fl == 13) - talk(490); - else if (pickedObject == kVerbLook && fl == 14) - talk(121); - else if (pickedObject == kVerbLook && fl == 15) - talk(117); - else if (pickedObject == kVerbTalk && fl == 15) - talk(118); - else if (pickedObject == kVerbOpen && fl == 15) - talk(119); - else if (pickedObject == kVerbLook && fl == 17) - talk(478); - else if (pickedObject == kVerbLook && fl == 20) - talk(162); - else - hasAnswer = 0; - } else if (num_ejec == 6) { - if (pickedObject == kVerbLook && fl == 28) - talk(328); - else if (pickedObject == kVerbLook && fl == 9) { - talk(482); - talk(483); - } else if (pickedObject == kVerbLook && fl == 20) - talk(123); - else if (pickedObject == kVerbLook && fl == 21) - talk(441); - else - hasAnswer = 0; - } - } else { - if (num_ejec == 1) { - if (pickedObject == kVerbLook && fl == 50) - talk(308); - else if (pickedObject == kVerbOpen && fl == 50) - talk(310); - else if (pickedObject == kVerbClose && fl == 50) - talk(311); - else if (pickedObject == kVerbMove && fl == 50) - talk(312); - else if (pickedObject == kVerbPick && fl == 50) - talk(313); - else if (pickedObject == kVerbTalk && fl == 50) - talk(314); - else if (roomNumber == 62) - room_62(fl); - else if (roomNumber == 63) - room_63(fl); - else - hasAnswer = 0; - } else if (num_ejec == 2) { - if (pickedObject == kVerbLook && fl == 50) - talk(308); - else if (pickedObject == kVerbOpen && fl == 50) - talk(310); - else if (pickedObject == kVerbClose && fl == 50) - talk(311); - else if (pickedObject == kVerbMove && fl == 50) - talk(312); - else if (pickedObject == kVerbPick && fl == 50) - talk(313); - else if (pickedObject == kVerbTalk && fl == 50) - talk(314); - // Note: the original check was strcmp(num_room, "18.alg") - else if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18) - talk(315); - else if (pickedObject == 13 && fl == 50) - talk(156); - else if (pickedObject == 20 && fl == 50) - talk(163); - else if (roomNumber == 1) - room_1(fl); - else if (roomNumber == 3) - room_3(fl); - else if (roomNumber == 4) - room_4(fl); - else if (roomNumber == 5) - room_5(fl); - else if (roomNumber == 6) - room_6(fl); - else if (roomNumber == 7) - room_7(fl); - else if (roomNumber == 8) - room_8(fl); - else if (roomNumber == 9) - room_9(fl); - else if (roomNumber == 12) - room_12(fl); - else if (roomNumber == 14) - room_14(fl); - else if (roomNumber == 15) - room_15(fl); - else if (roomNumber == 16) - room_16(fl); - else if (roomNumber == 17) - room_17(fl); - else if (roomNumber == 18) - room_18(fl); - else if (roomNumber == 19) - room_19(fl); - else - hasAnswer = 0; - } else if (num_ejec == 3) { - if (pickedObject == kVerbLook && fl == 50) - talk(309); - else if (pickedObject == kVerbOpen && fl == 50) - talk(310); - else if (pickedObject == kVerbClose && fl == 50) - talk(311); - else if (pickedObject == kVerbMove && fl == 50) - talk(312); - else if (pickedObject == kVerbPick && fl == 50) - talk(313); - else if (pickedObject == kVerbTalk && fl == 50) - talk(314); - else if (roomNumber == 13) { - if (room_13(fl)) - return true; - } else - hasAnswer = 0; - } else if (num_ejec == 4) { - if (roomNumber == 28) - talk(178); - else if (pickedObject == kVerbLook && fl == 50) - talk(309); - else if (pickedObject == kVerbOpen && fl == 50) - talk(310); - else if (pickedObject == kVerbClose && fl == 50) - talk(311); - else if (pickedObject == kVerbMove && fl == 50) - talk(312); - else if (pickedObject == kVerbPick && fl == 50) - talk(313); - else if (pickedObject == kVerbTalk && fl == 50) - talk(314); - else if (pickedObject == 8 && fl == 50 && flags[18] == 0) - talk(481); - else if (pickedObject == 9 && fl == 50) - talk(484); - else if (pickedObject == 12 && fl == 50 && flags[18] == 0) - talk(487); - else if (pickedObject == 20 && fl == 50) - talk(487); - else if (roomNumber == 21) { - if (room_21(fl)) - return true; - } else if (roomNumber == 22) - room_22(fl); - else if (roomNumber == 23) - room_23(fl); - else if (roomNumber == 24) - room_24(fl); - else if (roomNumber == 26) - room_26(fl); - else if (roomNumber == 27) - room_27(fl); - else if (roomNumber == 29) - room_29(fl); - else if (roomNumber == 30) - room_30(fl); - else if (roomNumber == 31) - room_31(fl); - else if (roomNumber == 34) - room_34(fl); - else if (roomNumber == 35) - room_35(fl); - else if (roomNumber == 44) - room_44(fl); - else - hasAnswer = 0; - } else if (num_ejec == 5) { - if (pickedObject == kVerbLook && fl == 50) - talk("Cuanto mas me miro, mas me gusto", "54.als"); - else if (pickedObject == kVerbOpen && fl == 50) - talk("y luego como me cierro", "19.als"); - else if (pickedObject == kVerbClose && fl == 50) - talk("Tendre que abrirme primero no", "19.als"); - else if (pickedObject == kVerbMove && fl == 50) - talk("Estoy bien donde estoy", "19.als"); - else if (pickedObject == kVerbPick && fl == 50) - talk("Ya me tengo", "11.als"); - else if (pickedObject == kVerbTalk && fl == 50) - talk("hola yo", "16.als"); - else if (pickedObject == 20 && fl == 50) - talk(487); - else if (roomNumber == 49) - room_49(fl); - else if (roomNumber == 53) - room_53(fl); - else if (roomNumber == 54) - room_54(fl); - else if (roomNumber == 55) - room_55(fl); - else if (roomNumber == 56) { - if (room_56(fl)) - return true; - } else - hasAnswer = 0; - } else if (num_ejec == 6) { - if (pickedObject == kVerbLook && fl == 50 && flags[0] == 1) - talk(308); - else if (pickedObject == kVerbLook && fl == 50 && flags[0] == 0) - talk(310 ); - else if (pickedObject == kVerbOpen && fl == 50) - talk(310 ); - else if (pickedObject == kVerbClose && fl == 50) - talk(311 ); - else if (pickedObject == kVerbMove && fl == 50) - talk(312 ); - else if (pickedObject == kVerbPick && fl == 50) - talk(313 ); - else if (pickedObject == kVerbTalk && fl == 50) - talk(314 ); - else if (roomNumber == 102) - room_pendulum(fl); - else if (roomNumber == 58) - room_58(fl); - else if (roomNumber == 59) - room_59(fl); - else if (roomNumber == 60) { - if (room_60(fl)) - return true; - } else if (roomNumber == 61) - room_61(fl); - else - hasAnswer = 0; - } - } - if (hasAnswer == 0 && hasName == 1) - room_0(); - else if (hasAnswer == 0 && menuScreen == 1) - room_0(); - - return false; -} - void DrasculaEngine::setCursorTable() { int cursorPos[8]; @@ -3816,114 +3375,6 @@ bucle_opc: withoutVerb(); } -void DrasculaEngine::print_abc_opc(const char *said, int x_pantalla, int y_pantalla, int game) { - int pos_texto[6]; - int y_de_signos, y_de_letra, x_de_letra = 0, h, length; - length = strlen(said); - - for (h = 0; h < length; h++) { - if (game == 1) { - y_de_letra = Y_ABC_OPC_1; - y_de_signos = Y_SIGNOS_OPC_1; - } else if (game == 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; - } - - int c = toupper(said[h]); - - if (c == '\265') x_de_letra = X_A_OPC; - else if (c == '\267') x_de_letra = X_A_OPC; - else if (c == '\266') x_de_letra = X_A_OPC; - else if (c == '\200') x_de_letra = X_A_OPC + 2 * 7; // C - else if (c == '\207') x_de_letra = X_A_OPC + 2 * 7; // C - else if (c == '\220') x_de_letra = X_A_OPC + 4 * 7; // E - else if (c == '\324') x_de_letra = X_A_OPC + 4 * 7; // E - else if (c == '\322') x_de_letra = X_A_OPC + 4 * 7; // E - else if (c == '\326') x_de_letra = X_A_OPC + 8 * 7; // I - else if (c == '\336') x_de_letra = X_A_OPC + 8 * 7; // I - else if (c == '\327') x_de_letra = X_A_OPC + 8 * 7; // I - else if (c == '\047') x_de_letra = X_GN_OPC; - else if (c == '\340') x_de_letra = X_O_OPC; - else if (c == '\342') x_de_letra = X_O_OPC; - else if (c == '\343') x_de_letra = X_O_OPC; - else if (c == '\353') x_de_letra = X_O_OPC + 6 * 7; // U - else if (c == '\352') x_de_letra = X_O_OPC + 6 * 7; // U - else if (c == '\351') x_de_letra = X_O_OPC + 6 * 7; // U - else if (c >= 'A' && c <= 'N') - x_de_letra = X_A_OPC + (c - 'A') * 7; - else if (c >= 'O' && c <= 'Z') - x_de_letra = X_O_OPC + (c - 'O') * 7; - else if (c == ' ') - x_de_letra = SPACE_OPC; - else { - y_de_letra = y_de_signos; - if (c == '.') - x_de_letra = X_DOT_OPC; - else if (c == ',') - x_de_letra = X_COMA_OPC; - else if (c == '-') - x_de_letra = X_HYPHEN_OPC; - else if (c == '?') - x_de_letra = X_CIERRA_INTERROGACION_OPC; - else if (c == 0xa8) - x_de_letra = X_ABRE_INTERROGACION_OPC; -// else if (c == '\'') // FIXME -// x_de_letra = SPACE; // space for now - else if (c == '"') - x_de_letra = X_COMILLAS_OPC; - else if (c == '!') - x_de_letra = X_CIERRA_INTERROGACION_OPC; - else if (c == 0xad) - x_de_letra = X_ABRE_EXCLAMACION_OPC; - else if (c == ';') - x_de_letra = X_pointY_COMA_OPC; - else if (c == '>') - x_de_letra = X_GREATER_THAN_OPC; - else if (c == '<') - x_de_letra = X_LESSER_THAN_OPC; - else if (c == '$') - x_de_letra = X_DOLAR_OPC; - else if (c == '%') - x_de_letra = X_PERCENT_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_BRACKET_OPEN_OPC; - else if (c == ')') - x_de_letra = X_BRACKET_CLOSE_OPC; - else if (c == '*') - x_de_letra = X_ASTERISCO_OPC; - else if (c == '+') - x_de_letra = X_PLUS_OPC; - else if (c >= '1' && c <= '9') - x_de_letra = X_N1_OPC + (c - '1') * 7; - // "0" is mapped after "9" in the game's font - // (it's mapped before "1" normally) - 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] = CHAR_WIDTH_OPC; - pos_texto[5] = CHAR_HEIGHT_OPC; - - copyRectClip(pos_texto, backSurface, screenSurface); - - x_pantalla = x_pantalla + CHAR_WIDTH_OPC; - } -} - void DrasculaEngine::response(int function) { if (num_ejec == 1) { if (function == 10) diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index ed65a00266..3614099167 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -106,6 +106,13 @@ struct ItemLocation { int y; }; +struct CharInfo { + int inChar; + int mappedChar; + int charType; // 0 - letters, 1 - signs, 2 - accented +}; + +#define CHARMAP_SIZE 93 #define NUM_SAVES 10 #define NUM_FLAGS 50 #define DIF_MASK 55 @@ -117,47 +124,6 @@ struct ItemLocation { #define CHAR_WIDTH 8 #define CHAR_HEIGHT 6 -#define Y_ABC 158 -#define Y_ABC_ESP 149 -#define Y_SIGNOS 169 -#define Y_SIGNOS_ESP 160 -#define Y_ACENTOS 180 - -// Normal font, each letter has a space of 9 from the next -// Spanish has a special character, defined as "X_GN" -// after N, so these are split from A-N and O-Z -#define X_A 6 -// (...) -#define X_N 123 -#define X_GN 132 -#define X_O 141 -// (...) -#define X_Z 240 -#define X_DOT 6 -#define X_COMA 15 -#define X_HYPHEN 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_pointY_COMA 78 -#define X_GREATER_THAN 87 -#define X_LESSER_THAN 96 -#define X_DOLAR 105 -#define X_PERCENT 114 -#define X_DOS_PUNTOS 123 -#define X_AND 132 -#define X_BARRA 141 -#define X_BRACKET_OPEN 150 -#define X_BRACKET_CLOSE 159 -#define X_ASTERISCO 168 -#define X_PLUS 177 -// Normal font, each number has a space of 9 from the next -#define X_N1 186 -// (...) -#define X_N0 267 -#define SPACE 250 #define ALTO_TALK_HARE 25 #define ANCHO_TALK_HARE 23 #define PASO_HARE_X 8 @@ -168,47 +134,6 @@ struct ItemLocation { #define CHAR_WIDTH_OPC 6 #define CHAR_HEIGHT_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 -// Dialog font, each letter has a space of 7 from the next -// Spanish has a special character, defined as "X_GN_OPC" -// after N, so these are split from A-N and O-Z -#define X_A_OPC 10 -// (...) -#define X_N_OPC 101 -#define X_GN_OPC 108 -#define X_O_OPC 115 -// (...) -#define X_Z_OPC 192 -#define SPACE_OPC 199 -#define X_DOT_OPC 10 -#define X_COMA_OPC 17 -#define X_HYPHEN_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_pointY_COMA_OPC 66 -#define X_GREATER_THAN_OPC 73 -#define X_LESSER_THAN_OPC 80 -#define X_DOLAR_OPC 87 -#define X_PERCENT_OPC 94 -#define X_DOS_PUNTOS_OPC 101 -#define X_AND_OPC 108 -#define X_BARRA_OPC 115 -#define X_BRACKET_OPEN_OPC 122 -#define X_BRACKET_CLOSE_OPC 129 -#define X_ASTERISCO_OPC 136 -#define X_PLUS_OPC 143 -// Dialog font, each number has a space of 7 from the next -#define X_N1_OPC 150 -// (...) -#define X_N0_OPC 213 #define NO_DOOR 99 #define COMPLETE_PAL 256 @@ -755,12 +680,14 @@ extern const char *_textverbs[][6]; extern const char *_textmisc[][2]; extern const char *_textd1[][11]; -extern ItemLocation itemLocations[]; +extern const ItemLocation itemLocations[]; extern int frame_x[20]; extern const int x_pol[44], y_pol[44]; extern const int x_barra[]; extern const int x1d_menu[], y1d_menu[]; +extern const CharInfo charMap[]; + } // End of namespace Drascula #endif /* DRASCULA_H */ diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index d8a9964222..44f1d76615 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1800,4 +1800,409 @@ void DrasculaEngine::update_pendulum() { } } +bool DrasculaEngine::checkFlag(int fl) { + characterMoved = 0; + updateRoom(); + updateScreen(0, 0, 0, 0, 320, 200, screenSurface); + + hasAnswer = 1; + + if (menuScreen == 1) { + if (num_ejec == 1) { + if (pickedObject == kVerbLook && fl == 28) + talk(328); + } else if (num_ejec == 2) { + if ((pickedObject == kVerbLook && fl == 22 && flags[23] == 0) + || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) { + talk(164); + flags[23] = 1; + withoutVerb(); + addObject(7); + addObject(18); + } else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1) + talk(307); + else if (pickedObject == kVerbLook && fl == 28) + talk(328); + else if (pickedObject == kVerbLook && fl == 7) + talk(143); + else if (pickedObject == kVerbTalk && fl == 7) + talk(144); + else if (pickedObject == kVerbLook && fl == 8) + talk(145); + else if (pickedObject == kVerbTalk && fl == 8) + talk(146); + else if (pickedObject == kVerbLook && fl == 9) + talk(147); + else if (pickedObject == kVerbTalk && fl == 9) + talk(148); + else if (pickedObject == kVerbLook && fl == 10) + talk(151); + else if (pickedObject == kVerbLook && fl == 11) + talk(152); + else if (pickedObject == kVerbTalk && fl == 11) + talk(153); + else if (pickedObject == kVerbLook && fl == 12) + talk(154); + else if (pickedObject == kVerbLook && fl == 13) + talk(155); + else if (pickedObject == kVerbLook && fl == 14) + talk(157); + else if (pickedObject == kVerbLook && fl == 15) + talk(58); + else if (pickedObject == kVerbLook && fl == 16) + talk(158); + else if (pickedObject == kVerbLook && fl == 17) + talk(159); + else if (pickedObject == kVerbLook && fl == 18) + talk(160); + else if (pickedObject == kVerbLook && fl == 19) + talk(161); + else if (pickedObject == kVerbLook && fl == 20) + talk(162); + else if (pickedObject == kVerbLook && fl == 23) + talk(152); + else + hasAnswer = 0; + } else if (num_ejec == 3) { + if (pickedObject == kVerbLook && fl == 22) + talk(307); + else if (pickedObject == kVerbLook && fl == 28) + talk(328); + else if (pickedObject == kVerbLook && fl == 7) + talk(143); + else if (pickedObject == kVerbTalk && fl == 7) + talk(144); + else if (pickedObject == kVerbLook && fl == 8) + talk(145); + else if (pickedObject == kVerbTalk && fl == 8) + talk(146); + else if (pickedObject == kVerbLook && fl == 9) + talk(147); + else if (pickedObject == kVerbTalk && fl == 9) + talk(148); + else if (pickedObject == kVerbLook && fl == 10) + talk(151); + else if (pickedObject == kVerbLook && fl == 11) + talk(152); + else if (pickedObject == kVerbTalk && fl == 11) + talk(153); + else if (pickedObject == kVerbLook && fl == 12) + talk(154); + else if (pickedObject == kVerbLook && fl == 13) + talk(155); + else if (pickedObject == kVerbLook && fl == 14) + talk(157); + else if (pickedObject == kVerbLook && fl == 15) + talk(58); + else if (pickedObject == kVerbLook && fl == 16) + talk(158); + else if (pickedObject == kVerbLook && fl == 17) + talk(159); + else if (pickedObject == kVerbLook && fl == 18) + talk(160); + else if (pickedObject == kVerbLook && fl == 19) + talk(161); + else if (pickedObject == kVerbLook && fl == 20) + talk(162); + else if (pickedObject == kVerbLook && fl == 23) + talk(152); + else + hasAnswer = 0; + } else if (num_ejec == 4) { + if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) { + withoutVerb(); + chooseObject(21); + removeObject(18); + removeObject(19); + } else if ((pickedObject == 14 && fl == 19) || (pickedObject == 19 && fl == 14)) + talk(484); + else if (pickedObject == kVerbLook && fl == 28) + talk(328); + else if (pickedObject == kVerbLook && fl == 7) + talk(478); + else if (pickedObject == kVerbLook && fl == 8) + talk(480); + else if (pickedObject == kVerbLook && fl == 9) { + talk(482); + talk(483); + } else if (pickedObject == kVerbLook && fl == 10) + talk(485); + else if (pickedObject == kVerbLook && fl == 11) + talk(488); + else if (pickedObject == kVerbLook && fl == 12) + talk(486); + else if (pickedObject == kVerbLook && fl == 13) + talk(490); + else if (pickedObject == kVerbLook && fl == 14) + talk(122); + else if (pickedObject == kVerbLook && fl == 15) + talk(117); + else if (pickedObject == kVerbTalk && fl == 15) + talk(118); + else if (pickedObject == kVerbOpen && fl == 15) + talk(119); + else if (pickedObject == kVerbLook && fl == 16) + talk(491); + else if (pickedObject == kVerbLook && fl == 17) + talk(478); + else if (pickedObject == kVerbLook && fl == 18) + talk(493); + else if (pickedObject == kVerbLook && fl == 19) { + talk(494); + talk(495); + } else if (pickedObject == kVerbLook && fl == 20) + talk(162); + else if (pickedObject == kVerbLook && fl == 21) + talk(496); + else if (pickedObject == kVerbLook && fl == 22) + talk(161); + else + hasAnswer = 0; + } else if (num_ejec == 5) { + if (pickedObject == kVerbLook && fl == 28) + talk(328); + else if (pickedObject == kVerbLook && fl == 7) + talk(478); + else if (pickedObject == kVerbLook && fl == 8) + talk(120); + else if (pickedObject == kVerbLook && fl == 9) { + talk(482); + talk(483); + } else if (pickedObject == kVerbLook && fl == 11) + talk(488); + else if (pickedObject == kVerbLook && fl == 13) + talk(490); + else if (pickedObject == kVerbLook && fl == 14) + talk(121); + else if (pickedObject == kVerbLook && fl == 15) + talk(117); + else if (pickedObject == kVerbTalk && fl == 15) + talk(118); + else if (pickedObject == kVerbOpen && fl == 15) + talk(119); + else if (pickedObject == kVerbLook && fl == 17) + talk(478); + else if (pickedObject == kVerbLook && fl == 20) + talk(162); + else + hasAnswer = 0; + } else if (num_ejec == 6) { + if (pickedObject == kVerbLook && fl == 28) + talk(328); + else if (pickedObject == kVerbLook && fl == 9) { + talk(482); + talk(483); + } else if (pickedObject == kVerbLook && fl == 20) + talk(123); + else if (pickedObject == kVerbLook && fl == 21) + talk(441); + else + hasAnswer = 0; + } + } else { + if (num_ejec == 1) { + if (pickedObject == kVerbLook && fl == 50) + talk(308); + else if (pickedObject == kVerbOpen && fl == 50) + talk(310); + else if (pickedObject == kVerbClose && fl == 50) + talk(311); + else if (pickedObject == kVerbMove && fl == 50) + talk(312); + else if (pickedObject == kVerbPick && fl == 50) + talk(313); + else if (pickedObject == kVerbTalk && fl == 50) + talk(314); + else if (roomNumber == 62) + room_62(fl); + else if (roomNumber == 63) + room_63(fl); + else + hasAnswer = 0; + } else if (num_ejec == 2) { + if (pickedObject == kVerbLook && fl == 50) + talk(308); + else if (pickedObject == kVerbOpen && fl == 50) + talk(310); + else if (pickedObject == kVerbClose && fl == 50) + talk(311); + else if (pickedObject == kVerbMove && fl == 50) + talk(312); + else if (pickedObject == kVerbPick && fl == 50) + talk(313); + else if (pickedObject == kVerbTalk && fl == 50) + talk(314); + // Note: the original check was strcmp(num_room, "18.alg") + else if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18) + talk(315); + else if (pickedObject == 13 && fl == 50) + talk(156); + else if (pickedObject == 20 && fl == 50) + talk(163); + else if (roomNumber == 1) + room_1(fl); + else if (roomNumber == 3) + room_3(fl); + else if (roomNumber == 4) + room_4(fl); + else if (roomNumber == 5) + room_5(fl); + else if (roomNumber == 6) + room_6(fl); + else if (roomNumber == 7) + room_7(fl); + else if (roomNumber == 8) + room_8(fl); + else if (roomNumber == 9) + room_9(fl); + else if (roomNumber == 12) + room_12(fl); + else if (roomNumber == 14) + room_14(fl); + else if (roomNumber == 15) + room_15(fl); + else if (roomNumber == 16) + room_16(fl); + else if (roomNumber == 17) + room_17(fl); + else if (roomNumber == 18) + room_18(fl); + else if (roomNumber == 19) + room_19(fl); + else + hasAnswer = 0; + } else if (num_ejec == 3) { + if (pickedObject == kVerbLook && fl == 50) + talk(309); + else if (pickedObject == kVerbOpen && fl == 50) + talk(310); + else if (pickedObject == kVerbClose && fl == 50) + talk(311); + else if (pickedObject == kVerbMove && fl == 50) + talk(312); + else if (pickedObject == kVerbPick && fl == 50) + talk(313); + else if (pickedObject == kVerbTalk && fl == 50) + talk(314); + else if (roomNumber == 13) { + if (room_13(fl)) + return true; + } else + hasAnswer = 0; + } else if (num_ejec == 4) { + if (roomNumber == 28) + talk(178); + else if (pickedObject == kVerbLook && fl == 50) + talk(309); + else if (pickedObject == kVerbOpen && fl == 50) + talk(310); + else if (pickedObject == kVerbClose && fl == 50) + talk(311); + else if (pickedObject == kVerbMove && fl == 50) + talk(312); + else if (pickedObject == kVerbPick && fl == 50) + talk(313); + else if (pickedObject == kVerbTalk && fl == 50) + talk(314); + else if (pickedObject == 8 && fl == 50 && flags[18] == 0) + talk(481); + else if (pickedObject == 9 && fl == 50) + talk(484); + else if (pickedObject == 12 && fl == 50 && flags[18] == 0) + talk(487); + else if (pickedObject == 20 && fl == 50) + talk(487); + else if (roomNumber == 21) { + if (room_21(fl)) + return true; + } else if (roomNumber == 22) + room_22(fl); + else if (roomNumber == 23) + room_23(fl); + else if (roomNumber == 24) + room_24(fl); + else if (roomNumber == 26) + room_26(fl); + else if (roomNumber == 27) + room_27(fl); + else if (roomNumber == 29) + room_29(fl); + else if (roomNumber == 30) + room_30(fl); + else if (roomNumber == 31) + room_31(fl); + else if (roomNumber == 34) + room_34(fl); + else if (roomNumber == 35) + room_35(fl); + else if (roomNumber == 44) + room_44(fl); + else + hasAnswer = 0; + } else if (num_ejec == 5) { + if (pickedObject == kVerbLook && fl == 50) + talk("Cuanto mas me miro, mas me gusto", "54.als"); + else if (pickedObject == kVerbOpen && fl == 50) + talk("y luego como me cierro", "19.als"); + else if (pickedObject == kVerbClose && fl == 50) + talk("Tendre que abrirme primero no", "19.als"); + else if (pickedObject == kVerbMove && fl == 50) + talk("Estoy bien donde estoy", "19.als"); + else if (pickedObject == kVerbPick && fl == 50) + talk("Ya me tengo", "11.als"); + else if (pickedObject == kVerbTalk && fl == 50) + talk("hola yo", "16.als"); + else if (pickedObject == 20 && fl == 50) + talk(487); + else if (roomNumber == 49) + room_49(fl); + else if (roomNumber == 53) + room_53(fl); + else if (roomNumber == 54) + room_54(fl); + else if (roomNumber == 55) + room_55(fl); + else if (roomNumber == 56) { + if (room_56(fl)) + return true; + } else + hasAnswer = 0; + } else if (num_ejec == 6) { + if (pickedObject == kVerbLook && fl == 50 && flags[0] == 1) + talk(308); + else if (pickedObject == kVerbLook && fl == 50 && flags[0] == 0) + talk(310 ); + else if (pickedObject == kVerbOpen && fl == 50) + talk(310 ); + else if (pickedObject == kVerbClose && fl == 50) + talk(311 ); + else if (pickedObject == kVerbMove && fl == 50) + talk(312 ); + else if (pickedObject == kVerbPick && fl == 50) + talk(313 ); + else if (pickedObject == kVerbTalk && fl == 50) + talk(314 ); + else if (roomNumber == 102) + room_pendulum(fl); + else if (roomNumber == 58) + room_58(fl); + else if (roomNumber == 59) + room_59(fl); + else if (roomNumber == 60) { + if (room_60(fl)) + return true; + } else if (roomNumber == 61) + room_61(fl); + else + hasAnswer = 0; + } + } + if (hasAnswer == 0 && hasName == 1) + room_0(); + else if (hasAnswer == 0 && menuScreen == 1) + room_0(); + + return false; +} + } // End of namespace Drascula diff --git a/engines/drascula/staticdata.h b/engines/drascula/staticdata.h index 937f3460b7..eddccd3b98 100644 --- a/engines/drascula/staticdata.h +++ b/engines/drascula/staticdata.h @@ -30,7 +30,64 @@ namespace Drascula { -ItemLocation itemLocations[] = { +const CharInfo charMap[CHARMAP_SIZE] = { + // Letters + // --------------------------------------- + { 'A', 6, 0 }, { 'B', 15, 0 }, + { 'C', 24, 0 }, { 'D', 33, 0 }, + { 'E', 42, 0 }, { 'F', 51, 0 }, + { 'G', 60, 0 }, { 'H', 69, 0 }, + { 'I', 78, 0 }, { 'J', 87, 0 }, + { 'K', 96, 0 }, { 'L', 105, 0 }, + { 'M', 114, 0 }, { 'N', 123, 0 }, + { '\244', 132, 0 }, { '\245', 132, 0 }, // special Spanish char + { 'O', 141, 0 }, { 'P', 150, 0 }, + { 'Q', 159, 0 }, { 'R', 168, 0 }, + { 'S', 177, 0 }, { 'T', 186, 0 }, + { 'U', 195, 0 }, { 'V', 204, 0 }, + { 'W', 213, 0 }, { 'X', 222, 0 }, + { 'Y', 231, 0 }, { 'Z', 240, 0 }, + // --------------------------------------- + { 0xa7, 250, 0 }, { ' ', 250, 0 }, + // Signs + // --------------------------------------- + { '.', 6, 1 }, { ',', 15, 1 }, + { '-', 24, 1 }, { '?', 33, 1 }, + { '\250', 42, 1 }, { '"', 51, 1 }, + { '!', 60, 1 }, { '\255', 69, 1 }, + { ';', 78, 1 }, { '>', 87, 1 }, + { '<', 96, 1 }, { '$', 105, 1 }, + { '%', 114, 1 }, { ':', 123, 1 }, + { '&', 132, 1 }, { '/', 141, 1 }, + { '(', 150, 1 }, { ')', 159, 1 }, + { '*', 168, 1 }, { '+', 177, 1 }, + { '1', 186, 1 }, { '2', 195, 1 }, + { '3', 204, 1 }, { '4', 213, 1 }, + { '5', 222, 1 }, { '6', 231, 1 }, + { '7', 240, 1 }, { '8', 249, 1 }, + { '9', 258, 1 }, { '0', 267, 1 }, + // Accented + // --------------------------------------- + { '\240', 6, 2 }, { '\202', 15, 2 }, // A, B + { '\241', 24, 2 }, { '\242', 33, 2 }, // C, D + { '\243', 42, 2 }, { '\205', 51, 2 }, // E, F + { '\212', 60, 2 }, { '\215', 69, 2 }, // G, H + { '\225', 78, 2 }, { '\227', 87, 2 }, // I, J + { '\203', 96, 2 }, { '\210', 105, 2 }, // K, L + { '\214', 114, 2 }, { '\223', 123, 2 }, // M, N + { '\226', 132, 2 }, { '\047', 141, 2 }, // special Spanish char, O + { '\200', 150, 2 }, { '\207', 150, 2 }, // P, P + { '\265', 6, 2 }, { '\220', 15, 2 }, // A, B + { '\326', 24, 2 }, { '\340', 33, 2 }, // C, D + { '\351', 42, 2 }, { '\267', 51, 2 }, // E, F + { '\324', 60, 2 }, { '\336', 69, 2 }, // G, H + { '\343', 78, 2 }, { '\353', 87, 2 }, // I, J + { '\266', 96, 2 }, { '\322', 105, 2 }, // K, L + { '\327', 114, 2 }, { '\342', 123, 2 }, // M, N + { '\352', 132, 0 } // special Spanish char +}; + +const ItemLocation itemLocations[] = { { 0, 0 }, // empty { 5, 10 }, { 50, 10 }, { 95, 10 }, // 1-3 { 140, 10 }, { 185, 10 }, { 230, 10 }, // 4-6 |