2008-05-02 12:00:58 +00:00
|
|
|
/* 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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-06-05 13:23:57 +00:00
|
|
|
#include "common/array.h"
|
|
|
|
|
2008-05-02 12:00:58 +00:00
|
|
|
#include "drascula/drascula.h"
|
|
|
|
|
|
|
|
namespace Drascula {
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
typedef bool (DrasculaEngine::*RoomParser)(int args);
|
2008-06-05 13:23:57 +00:00
|
|
|
|
|
|
|
struct DrasculaRoomParser {
|
|
|
|
DrasculaRoomParser(const char* d, RoomParser p) : desc(d), proc(p) {}
|
|
|
|
const char* desc;
|
|
|
|
RoomParser proc;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef void (DrasculaEngine::*Updater)();
|
|
|
|
|
|
|
|
struct DrasculaUpdater {
|
|
|
|
DrasculaUpdater(const char* d, Updater p) : desc(d), proc(p) {}
|
|
|
|
const char* desc;
|
|
|
|
Updater proc;
|
|
|
|
};
|
|
|
|
|
|
|
|
Common::Array<DrasculaRoomParser*> _roomParsers;
|
|
|
|
Common::Array<DrasculaUpdater*> _roomPreupdaters;
|
|
|
|
Common::Array<DrasculaUpdater*> _roomUpdaters;
|
|
|
|
|
|
|
|
#define ROOM(x) _roomParsers.push_back(new DrasculaRoomParser(#x, &DrasculaEngine::x))
|
|
|
|
#define PREUPDATEROOM(x) _roomPreupdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
|
|
|
|
#define UPDATEROOM(x) _roomUpdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
|
|
|
|
|
|
|
|
void DrasculaEngine::setupRoomsTable() {
|
2008-06-06 07:42:00 +00:00
|
|
|
ROOM(room_0); // default
|
2008-06-05 13:23:57 +00:00
|
|
|
ROOM(room_1);
|
|
|
|
ROOM(room_3);
|
|
|
|
ROOM(room_4);
|
|
|
|
ROOM(room_5);
|
|
|
|
ROOM(room_6);
|
|
|
|
ROOM(room_7);
|
|
|
|
ROOM(room_8);
|
|
|
|
ROOM(room_9);
|
|
|
|
ROOM(room_12);
|
2008-06-06 07:42:00 +00:00
|
|
|
ROOM(room_13); // returns bool
|
2008-06-05 13:23:57 +00:00
|
|
|
ROOM(room_14);
|
|
|
|
ROOM(room_15);
|
|
|
|
ROOM(room_16);
|
|
|
|
ROOM(room_17);
|
|
|
|
ROOM(room_18);
|
2008-06-06 07:42:00 +00:00
|
|
|
ROOM(room_21); // returns bool
|
2008-06-05 13:23:57 +00:00
|
|
|
ROOM(room_22);
|
|
|
|
ROOM(room_23);
|
|
|
|
ROOM(room_24);
|
|
|
|
ROOM(room_26);
|
|
|
|
ROOM(room_27);
|
|
|
|
ROOM(room_29);
|
|
|
|
ROOM(room_30);
|
|
|
|
ROOM(room_31);
|
|
|
|
ROOM(room_34);
|
|
|
|
ROOM(room_35);
|
|
|
|
ROOM(room_49);
|
|
|
|
ROOM(room_53);
|
|
|
|
ROOM(room_54);
|
|
|
|
ROOM(room_55);
|
2008-06-06 07:42:00 +00:00
|
|
|
ROOM(room_56); // returns bool
|
2008-06-05 13:23:57 +00:00
|
|
|
ROOM(room_58);
|
|
|
|
ROOM(room_59);
|
2008-06-06 07:42:00 +00:00
|
|
|
ROOM(room_60); // returns bool
|
2008-06-05 13:23:57 +00:00
|
|
|
ROOM(room_62);
|
2008-06-05 19:04:58 +00:00
|
|
|
ROOM(room_102);
|
2008-06-05 13:23:57 +00:00
|
|
|
|
|
|
|
PREUPDATEROOM(update_1_pre);
|
|
|
|
PREUPDATEROOM(update_6_pre);
|
|
|
|
PREUPDATEROOM(update_9_pre);
|
|
|
|
PREUPDATEROOM(update_14_pre);
|
|
|
|
PREUPDATEROOM(update_16_pre);
|
|
|
|
PREUPDATEROOM(update_18_pre);
|
|
|
|
PREUPDATEROOM(update_23_pre);
|
|
|
|
PREUPDATEROOM(update_26_pre);
|
|
|
|
PREUPDATEROOM(update_35_pre);
|
|
|
|
PREUPDATEROOM(update_58_pre);
|
|
|
|
PREUPDATEROOM(update_59_pre);
|
|
|
|
PREUPDATEROOM(update_60_pre);
|
|
|
|
PREUPDATEROOM(update_62_pre);
|
|
|
|
|
|
|
|
UPDATEROOM(update_2);
|
|
|
|
UPDATEROOM(update_3);
|
|
|
|
UPDATEROOM(update_4);
|
|
|
|
UPDATEROOM(update_13);
|
|
|
|
UPDATEROOM(update_26);
|
|
|
|
UPDATEROOM(update_58);
|
|
|
|
UPDATEROOM(update_60);
|
|
|
|
UPDATEROOM(update_62);
|
2008-06-05 19:04:58 +00:00
|
|
|
UPDATEROOM(update_102);
|
2008-06-05 13:23:57 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::roomParse(int rN, int fl) {
|
2008-06-05 20:35:45 +00:00
|
|
|
bool seen = false;
|
|
|
|
|
2008-06-10 21:06:39 +00:00
|
|
|
for (int i = 0; i < _roomActionsSize; i++) {
|
2008-06-09 10:11:42 +00:00
|
|
|
if (_roomActions[i].room == rN) {
|
2008-06-05 20:35:45 +00:00
|
|
|
seen = true;
|
2008-06-09 10:11:42 +00:00
|
|
|
if (_roomActions[i].chapter == currentChapter ||
|
|
|
|
_roomActions[i].chapter == -1) {
|
|
|
|
if (_roomActions[i].action == pickedObject ||
|
|
|
|
_roomActions[i].action == kVerbDefault) {
|
|
|
|
if (_roomActions[i].objectID == fl ||
|
|
|
|
_roomActions[i].objectID == -1) {
|
|
|
|
talk(_roomActions[i].speechID);
|
2008-06-05 19:29:30 +00:00
|
|
|
hasAnswer = 1;
|
|
|
|
return true;
|
|
|
|
}
|
2008-05-26 17:50:26 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-05 20:35:45 +00:00
|
|
|
} else if (seen) // Stop searching down the list
|
|
|
|
break;
|
2008-05-26 17:50:26 +00:00
|
|
|
}
|
|
|
|
|
2008-06-04 14:42:27 +00:00
|
|
|
return false;
|
2008-05-26 17:50:26 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_0(int fl) {
|
2008-06-04 10:48:18 +00:00
|
|
|
static const int lookExcuses[3] = {100, 101, 54};
|
|
|
|
static const int actionExcuses[6] = {11, 109, 111, 110, 115, 116};
|
2008-05-30 20:42:31 +00:00
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
fl = -1; // avoid warning
|
2008-06-05 21:12:02 +00:00
|
|
|
|
2008-05-26 17:50:26 +00:00
|
|
|
// non-default actions
|
2008-05-31 10:01:13 +00:00
|
|
|
if (currentChapter == 2 || currentChapter == 4 ||
|
2008-05-31 09:16:26 +00:00
|
|
|
currentChapter == 5 || currentChapter == 6) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbLook) {
|
2008-06-04 10:48:18 +00:00
|
|
|
talk(lookExcuses[curExcuseLook]);
|
|
|
|
curExcuseLook++;
|
|
|
|
if (curExcuseLook == 3)
|
|
|
|
curExcuseLook = 0;
|
2008-05-26 17:50:26 +00:00
|
|
|
} else {
|
2008-06-04 10:48:18 +00:00
|
|
|
talk(actionExcuses[curExcuseAction]);
|
|
|
|
curExcuseAction++;
|
|
|
|
if (curExcuseAction == 6)
|
|
|
|
curExcuseAction = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_1(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 118) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(1);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(10);
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(2);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbLook && fl == 120 && flags[8] == 0)
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(14);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_3(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl == 129) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(23);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(6);
|
2008-06-04 09:02:23 +00:00
|
|
|
talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbTalk && fl == 133) {
|
2008-06-04 09:02:23 +00:00
|
|
|
talk_sync(_text[_lang][322], "322.als", "13333334125433333333");
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(25);
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(33);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbLook && fl == 165) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(149);
|
|
|
|
talk(150);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 165) {
|
2008-06-10 18:54:32 +00:00
|
|
|
copyBackground(0, 0, 0,0, 320, 200, bgSurface, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(4);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(10);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[3] = 1;
|
|
|
|
visible[8] = 0;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 14 && fl == 166 && flags[37] == 0) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_7_2();
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(8);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 14 && fl == 166 && flags[37] == 1)
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(323);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 211) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(185);
|
|
|
|
talk(186);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_4(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbMove && fl == 189 && flags[34] == 0) {
|
2008-05-26 17:50:26 +00:00
|
|
|
talk(327);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(13);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[34] = 1;
|
|
|
|
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
|
|
|
|
flags[38] = 1;
|
2008-05-27 07:45:13 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_5(int fl) {
|
2008-05-31 10:01:13 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 136 && flags[8] == 0)
|
2008-05-27 11:49:36 +00:00
|
|
|
talk(14);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 10 && fl == 136) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_2();
|
2008-06-05 15:03:48 +00:00
|
|
|
removeObject(kItemSpike);
|
2008-05-27 11:49:36 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_6(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbLook && fl==144) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(41);
|
|
|
|
talk(42);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbOpen && fl == 138)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(0, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 138)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(0, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 143 && flags[2] == 0) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-27 11:49:36 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-27 11:49:36 +00:00
|
|
|
pause(10);
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(3);
|
2008-05-27 11:49:36 +00:00
|
|
|
flags[2] = 1;
|
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbClose && fl == 143 && flags[2] == 1) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[2] = 0;
|
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(5);
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(4);
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbOpen && fl == 139 && flags[1] == 0) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(19);
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(3);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[1] = 1;
|
|
|
|
visible[4] = 1;
|
|
|
|
visible[2] = 0;
|
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 140) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(19);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(9);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[4] = 0;
|
|
|
|
flags[10] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbOpen && fl == 140)
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 1;
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_7(int fl) {
|
2008-06-04 14:42:27 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 190) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(17);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[35] = 1;
|
|
|
|
visible[3] = 0;
|
|
|
|
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
|
|
|
|
flags[38] = 1;
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_8(int fl) {
|
2008-06-04 16:39:56 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 147) {
|
|
|
|
if (flags[7] == 0) {
|
|
|
|
talk(58);
|
|
|
|
pickObject(15);
|
|
|
|
flags[7] = 1;
|
|
|
|
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
|
|
|
|
flags[38] = 1;
|
|
|
|
} else {
|
|
|
|
talk(59);
|
|
|
|
}
|
2008-06-04 14:42:27 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_9(int fl) {
|
2008-06-04 14:42:27 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_4_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_33_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 7 && fl == 51) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_6_2();
|
2008-06-05 15:03:48 +00:00
|
|
|
removeObject(kItemMoney);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(14);}
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_12(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 156)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(16, 4);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 156)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(16, 4);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::room_13(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 51) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(411);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(412);
|
2008-05-11 11:20:40 +00:00
|
|
|
strcpy(objName[1], "yoda");
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbTalk && fl == 51)
|
2008-06-05 13:23:57 +00:00
|
|
|
converse(7);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 19 && fl == 51)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_1_3();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 9 && fl == 51) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_2_3();
|
|
|
|
return true;
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
2008-05-02 12:00:58 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_14(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_12_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 1)
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(109);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 12 && fl == 54)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_26_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 52 && flags[5] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_11_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 52 && flags[5] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_36_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 53)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_13_2();
|
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_15(int fl) {
|
2008-06-03 18:17:56 +00:00
|
|
|
if (pickedObject == 19 && fl == 188 && flags[27] == 0)
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(335);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 19 && fl == 188 && flags[27] == 1) {
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(336);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(337);
|
2008-06-04 09:02:23 +00:00
|
|
|
talk_sync(_text[_lang][46], "46.als", "4442444244244");
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 18 && fl == 188 && flags[26] == 0) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(133, 135, curX + 6, curY, 39, 63, drawSurface3, screenSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(8);
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(338);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[27] = 0;
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(19);
|
2008-06-05 15:03:48 +00:00
|
|
|
removeObject(kItemTwoCoins);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbMove && fl == 188 && flags[27] == 0) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_34_2();
|
2008-05-26 18:52:25 +00:00
|
|
|
talk(339);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(16);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[26] = 1;
|
|
|
|
flags[27] = 1;
|
|
|
|
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
|
|
|
|
flags[38] = 1;
|
2008-06-03 18:17:56 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_16(int fl) {
|
2008-06-03 18:17:56 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 163)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(17, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 163)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(17, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 183) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(341);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(10);
|
2008-06-04 09:02:23 +00:00
|
|
|
talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(3);
|
2008-08-26 08:35:02 +00:00
|
|
|
talk_trunk(83);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbOpen && fl == 183) {
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(19, NO_DOOR);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[20] == 0) {
|
|
|
|
flags[20] = 1;
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(342);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(22);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbClose && fl == 183)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(19, NO_DOOR);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbLook && fl == 187) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(343);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(344);
|
2008-06-03 18:17:56 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_17(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 177)
|
2008-05-30 09:28:52 +00:00
|
|
|
talk(35);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 177 && flags[18] == 0)
|
2008-05-30 09:28:52 +00:00
|
|
|
talk(6);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 177 && flags[18] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_18_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 177 && flags[18] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(346);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 177 && flags[14] == 0 && flags[18] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_22_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 177 && flags[14] == 1)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(15, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 177 && flags[14] == 1)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(15, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 11 && fl == 50 && flags[22] == 0) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(347);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[29] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(23);
|
2008-06-05 15:03:48 +00:00
|
|
|
removeObject(kItemEarplugs);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_18(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_24_2();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(109);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbPick && fl == 182) {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(4);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(12);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[2] = 0;
|
|
|
|
flags[28] = 1;
|
2008-05-30 14:25:03 +00:00
|
|
|
} else if (fl == 55 && flags[38] == 0 && flags[33] == 0) {
|
|
|
|
if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 ||
|
|
|
|
pickedObject == 16 || pickedObject == 17)
|
|
|
|
talk(349);
|
|
|
|
} else if (fl == 55 && flags[38] == 1 && flags[33] == 1) {
|
|
|
|
if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 ||
|
|
|
|
pickedObject == 16 || pickedObject == 17)
|
|
|
|
animation_24_2();
|
|
|
|
}
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 11 && fl == 50 && flags[22] == 0) {
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh_pre();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(1, 1, curX - 1, curY + 3, 42, 67, drawSurface2, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRefresh();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(6);
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(347);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[29] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(23);
|
2008-06-05 15:03:48 +00:00
|
|
|
removeObject(kItemEarplugs);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::room_21(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 101 && flags[28] == 0)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(419);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 101 && flags[28] == 1)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(0, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 101)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(0, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if(pickedObject == kVerbPick && fl == 141) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(19);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[2] = 0;
|
|
|
|
flags[10] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if(pickedObject == 7 && fl == 101) {
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[28] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(0, 1);
|
|
|
|
withoutVerb();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 21 && fl == 179) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_9_4();
|
|
|
|
return true;
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_22(int fl) {
|
2008-06-04 14:42:27 +00:00
|
|
|
if (pickedObject == 11 && fl == 140) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(18);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[1] = 0;
|
|
|
|
flags[24] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 22 && fl == 52) {
|
2008-05-30 07:24:32 +00:00
|
|
|
animate("up.bin",14);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[26]=1;
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(1);
|
2008-05-29 22:34:03 +00:00
|
|
|
hiccup(14);
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-11 11:20:40 +00:00
|
|
|
withoutVerb();
|
2008-05-29 22:34:03 +00:00
|
|
|
removeObject(22);
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(499);
|
|
|
|
talk(500);
|
2008-06-04 14:42:27 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 0)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(420);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 1) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(7);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[3] = 0;
|
|
|
|
flags[27] = 1;
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_23(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 103) {
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(0, 0);
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if(pickedObject == kVerbClose && fl == 103) {
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(0, 0);
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if(pickedObject == kVerbOpen && fl == 104)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(1, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if(pickedObject == kVerbClose && fl == 104)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(1, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if(pickedObject == kVerbPick && fl == 142) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(8);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[2] = 0;
|
|
|
|
flags[11] = 1;
|
|
|
|
if (flags[22] == 1 && flags[14] == 1)
|
|
|
|
flags[18] = 1;
|
|
|
|
if (flags[18] == 1)
|
|
|
|
animation_6_4();
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_24(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 105)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(1, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 105)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(1, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 106)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(2, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 106)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(2, 1);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_26(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 0)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(2, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(421);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 107)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(2, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 10 && fl == 50 && flags[18] == 1 && flags[12] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 8 && fl == 50 && flags[18] == 1 && flags[12] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 12 && fl == 50 && flags[18] == 1 && flags[12] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 1) {
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(260, 180);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(10);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[1] = 0;
|
|
|
|
flags[12] = 1;
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(2, 0);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 2;
|
2008-06-02 20:32:36 +00:00
|
|
|
talk_igor(27, kIgorDoor);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[30] = 1;
|
2008-06-02 20:32:36 +00:00
|
|
|
talk_igor(28, kIgorDoor);
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(153, 180);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 0) {
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(260, 180);
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(80, 78, 199, 94, 38, 27, drawSurface3, screenSurface);
|
|
|
|
updateScreen(199, 94, 199, 94, 38, 27, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(3);
|
2008-06-02 20:32:36 +00:00
|
|
|
talk_igor(25, kIgorWig);
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(153, 180);
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbTalk && fl == 51)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_1_4();
|
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_27(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 110)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(6, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 110)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(6, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 116 && flags[23] == 0)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(419);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 116 && flags[23] == 1)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(5, 3);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 17 && fl == 116) {
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[23] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(5,3);
|
|
|
|
withoutVerb();
|
2008-06-06 19:29:59 +00:00
|
|
|
} else if (fl == 150)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(460);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_29(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 114)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(4, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 114)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(4, 1);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_30(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 115)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(4, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 115)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(4, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 0)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(422);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 1 && flags[22] == 1)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(16, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 1 && flags[22] == 0) {
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(16, 1);
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(423);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[22] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(12);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[11] == 1 && flags[14] == 1)
|
|
|
|
flags[18] = 1;
|
|
|
|
if (flags[18] == 1)
|
|
|
|
animation_6_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbClose && fl == 144)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(16, 1);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 13 && fl == 144) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(424);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[19] = 1;
|
2008-06-04 14:42:27 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_31(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 145) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(11);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[1] = 0;
|
|
|
|
flags[13] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbOpen && fl == 117)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(5, 0);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbClose && fl == 117)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(5, 0);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_34(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbMove && fl == 146)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_8_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 1)
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(8, 2);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 0) {
|
2008-05-11 11:20:40 +00:00
|
|
|
openDoor(8, 2);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(425);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(14);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[25] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbClose && fl == 120)
|
2008-05-27 07:17:15 +00:00
|
|
|
closeDoor(8, 2);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer=0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_35(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 148) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(16);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[2] = 0;
|
|
|
|
flags[14] = 1;
|
|
|
|
if (flags[11] == 1 && flags[22] == 1)
|
|
|
|
flags[18] = 1;
|
|
|
|
if (flags[18] == 1)
|
|
|
|
animation_6_4();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 147) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(426);
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(15);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[1] = 0;
|
|
|
|
flags[15] = 1;
|
|
|
|
flags[17] = 1;
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbPick && fl == 149) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(13);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[3] = 0;
|
|
|
|
flags[17] = 0;
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_49(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl ==51)
|
2008-06-05 13:23:57 +00:00
|
|
|
converse(9);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if ((pickedObject == 8 && fl == 51) || (pickedObject == 8 && fl == 203))
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_5_5();
|
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_53(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 120) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(16);
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[3] = 0;
|
2008-06-04 14:42:27 +00:00
|
|
|
} else if (pickedObject == kVerbMove && fl == 123)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_11_5();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 12 && fl == 52)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_10_5();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 15 && fl == 52)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_9_5();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 16 && fl == 121) {
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[2] = 1;
|
2008-05-11 11:20:40 +00:00
|
|
|
withoutVerb();
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-08-25 15:58:45 +00:00
|
|
|
pickedObject = kVerbMove;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 16) {
|
2008-08-25 15:58:45 +00:00
|
|
|
// Wall plug in chapter 5
|
2008-05-02 12:00:58 +00:00
|
|
|
visible[3] = 1;
|
2008-08-25 15:58:45 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_54(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if ((pickedObject == kVerbTalk && fl == 118) || (pickedObject == kVerbLook && fl == 118 && flags[0] == 0))
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_1_5();
|
2008-06-06 19:29:59 +00:00
|
|
|
else if (pickedObject == kVerbLook && fl == 118 && flags[0] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(124);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 0) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(288);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[12] = 1;
|
|
|
|
pause(10);
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_mus(1);
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(289);
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_mus(2);
|
|
|
|
talk_mus(3);
|
2008-06-05 13:23:57 +00:00
|
|
|
converse(10);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[12] = 0;
|
|
|
|
flags[14] = 1;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(109);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbPick && fl == 9999 && flags[13] == 0) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(8);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[13] = 1;
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_mus(10);
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-06-04 14:42:27 +00:00
|
|
|
} else if (pickedObject == 10 && fl == 119) {
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(4);
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(436);
|
2008-05-11 11:20:40 +00:00
|
|
|
withoutVerb();
|
2008-05-29 22:34:03 +00:00
|
|
|
removeObject(10);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_55(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 122) {
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(12);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[8] = 1;
|
2008-05-31 09:16:26 +00:00
|
|
|
updateVisible();
|
2008-06-04 14:42:27 +00:00
|
|
|
} else if (fl == 206) {
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(11);
|
2008-05-30 07:24:32 +00:00
|
|
|
animate("det.bin", 17);
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(curX - 3, curY + curHeight + 6);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::room_56(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbOpen && fl == 124) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_14_5();
|
|
|
|
return true;
|
2008-06-04 14:42:27 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_58(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbMove && fl == 103)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_7_6();
|
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_59(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if ((pickedObject == kVerbTalk && fl == 51) || (pickedObject == kVerbLook && fl == 51)) {
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[9] = 1;
|
2008-05-27 16:13:41 +00:00
|
|
|
talk(259);
|
2008-05-29 22:34:03 +00:00
|
|
|
talk_bj_bed(13);
|
2008-05-27 16:13:41 +00:00
|
|
|
talk(263);
|
2008-05-29 22:34:03 +00:00
|
|
|
talk_bj_bed(14);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(40);
|
2008-05-27 16:13:41 +00:00
|
|
|
talk(264);
|
2008-05-29 22:34:03 +00:00
|
|
|
talk_bj_bed(15);
|
2008-05-27 16:13:41 +00:00
|
|
|
talk(265);
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[9] = 0;
|
|
|
|
if (flags[11] == 0) {
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(12);
|
2008-05-02 12:00:58 +00:00
|
|
|
delay(40);
|
2008-06-01 20:58:05 +00:00
|
|
|
finishSound();
|
2008-05-02 12:00:58 +00:00
|
|
|
delay(10);
|
2008-06-03 08:54:49 +00:00
|
|
|
gotoObject(174, 168);
|
|
|
|
trackProtagonist = 2;
|
2008-05-02 12:00:58 +00:00
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(40);
|
2008-05-30 11:04:40 +00:00
|
|
|
playSound(12);
|
2008-05-02 12:00:58 +00:00
|
|
|
pause(19);
|
2008-06-01 20:58:05 +00:00
|
|
|
stopSound();
|
2008-05-02 12:00:58 +00:00
|
|
|
hare_se_ve = 0;
|
|
|
|
updateRoom();
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(101, 34, curX - 4, curY - 1, 37, 70, drawSurface3, screenSurface);
|
2008-06-10 18:54:32 +00:00
|
|
|
copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface);
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-02 12:00:58 +00:00
|
|
|
hare_se_ve = 1;
|
|
|
|
clearRoom();
|
2008-06-10 18:54:32 +00:00
|
|
|
loadPic("tlef0.alg", bgSurface, COMPLETE_PAL);
|
2008-06-04 10:27:10 +00:00
|
|
|
loadPic("tlef1.alg", drawSurface3);
|
|
|
|
loadPic("tlef2.alg", frontSurface);
|
|
|
|
loadPic("tlef3.alg", backSurface);
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_htel(240);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-05-30 07:16:17 +00:00
|
|
|
color_abc(kColorBrown);
|
2008-05-02 15:09:20 +00:00
|
|
|
talk_solo(_textvb[_lang][58], "VB58.als");
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_htel(241);
|
2008-05-30 07:16:17 +00:00
|
|
|
color_abc(kColorBrown);
|
2008-05-02 15:09:20 +00:00
|
|
|
talk_solo(_textvb[_lang][59], "VB59.als");
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_htel(242);
|
2008-05-30 07:16:17 +00:00
|
|
|
color_abc(kColorBrown);
|
2008-05-02 15:09:20 +00:00
|
|
|
talk_solo(_textvb[_lang][60], "VB60.als");
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_htel(196);
|
2008-05-30 07:16:17 +00:00
|
|
|
color_abc(kColorBrown);
|
2008-05-02 15:09:20 +00:00
|
|
|
talk_solo(_textvb[_lang][61],"VB61.als");
|
2008-05-30 14:25:03 +00:00
|
|
|
talk_htel(244);
|
2008-05-30 07:16:17 +00:00
|
|
|
color_abc(kColorBrown);
|
2008-05-02 15:09:20 +00:00
|
|
|
talk_solo(_textvb[_lang][62], "VB62.als");
|
2008-05-02 12:00:58 +00:00
|
|
|
clearRoom();
|
2008-06-04 10:27:10 +00:00
|
|
|
loadPic("aux59.alg", drawSurface3);
|
|
|
|
loadPic(96, frontSurface, COMPLETE_PAL);
|
|
|
|
loadPic(99, backSurface);
|
2008-06-10 18:54:32 +00:00
|
|
|
loadPic(59, bgSurface, HALF_PAL);
|
2008-06-03 08:54:49 +00:00
|
|
|
trackProtagonist = 3;
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(245);
|
2008-05-11 11:20:40 +00:00
|
|
|
withoutVerb();
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[11] = 1;
|
|
|
|
}
|
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::room_60(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbMove && fl == 112)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_10_6();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 52) {
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(266);
|
2008-06-01 22:38:29 +00:00
|
|
|
talk_bartender(1, 1);
|
2008-06-05 13:23:57 +00:00
|
|
|
converse(12);
|
2008-05-11 11:20:40 +00:00
|
|
|
withoutVerb();
|
2008-05-27 12:02:26 +00:00
|
|
|
pickedObject = 0;
|
2008-06-04 14:42:27 +00:00
|
|
|
} else if (pickedObject == 21 && fl == 56)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_18_6();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 9 && fl == 56 && flags[6] == 1) {
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_9_6();
|
|
|
|
return true;
|
2008-05-27 12:02:26 +00:00
|
|
|
} else if (pickedObject == 9 && fl == 56 && flags[6] == 0) {
|
2008-05-30 07:24:32 +00:00
|
|
|
animate("cnf.bin", 14);
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(455);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_62(int fl) {
|
2008-05-27 12:02:26 +00:00
|
|
|
if (pickedObject == kVerbTalk && fl == 53)
|
2008-06-05 13:23:57 +00:00
|
|
|
converse(13);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_3_1();
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 1)
|
2008-05-30 08:48:01 +00:00
|
|
|
talk(109);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == kVerbTalk && fl == 54)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_4_1();
|
2008-06-04 14:42:27 +00:00
|
|
|
else
|
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
bool DrasculaEngine::room_102(int fl) {
|
2008-06-04 14:42:27 +00:00
|
|
|
if (pickedObject == kVerbPick && fl == 101)
|
2008-05-11 11:20:40 +00:00
|
|
|
pickObject(20);
|
2008-05-27 12:02:26 +00:00
|
|
|
else if (pickedObject == 20 && fl == 100)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_6_6();
|
2008-06-10 22:14:47 +00:00
|
|
|
else if (pickedObject == kVerbPick || pickedObject == kVerbOpen)
|
|
|
|
talk(453);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-29 22:34:03 +00:00
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
|
|
|
|
return true;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::updateRefresh() {
|
2008-06-06 09:53:33 +00:00
|
|
|
// Check generic updaters
|
2008-06-10 21:06:39 +00:00
|
|
|
for (int i = 0; i < _roomUpdatesSize; i++) {
|
2008-06-09 10:11:42 +00:00
|
|
|
if (_roomUpdates[i].roomNum == roomNumber) {
|
|
|
|
if (_roomUpdates[i].flag < 0 ||
|
|
|
|
flags[_roomUpdates[i].flag] == _roomUpdates[i].flagValue) {
|
|
|
|
if (_roomUpdates[i].type == 0) {
|
|
|
|
copyBackground(_roomUpdates[i].sourceX, _roomUpdates[i].sourceY,
|
|
|
|
_roomUpdates[i].destX, _roomUpdates[i].destY,
|
|
|
|
_roomUpdates[i].width, _roomUpdates[i].height,
|
2008-06-06 09:53:33 +00:00
|
|
|
drawSurface3, screenSurface);
|
|
|
|
} else {
|
2008-06-09 10:11:42 +00:00
|
|
|
copyRect(_roomUpdates[i].sourceX, _roomUpdates[i].sourceY,
|
|
|
|
_roomUpdates[i].destX, _roomUpdates[i].destY,
|
|
|
|
_roomUpdates[i].width, _roomUpdates[i].height,
|
2008-06-06 09:53:33 +00:00
|
|
|
drawSurface3, screenSurface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-05 13:23:57 +00:00
|
|
|
// Call room-specific updater
|
|
|
|
char rm[20];
|
|
|
|
sprintf(rm, "update_%d", roomNumber);
|
|
|
|
for (uint i = 0; i < _roomUpdaters.size(); i++) {
|
|
|
|
if (!strcmp(rm, _roomUpdaters[i]->desc)) {
|
|
|
|
debug(4, "Calling room updater %d", roomNumber);
|
|
|
|
(this->*(_roomUpdaters[i]->proc))();
|
|
|
|
break;
|
|
|
|
}
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
2008-06-05 13:23:57 +00:00
|
|
|
|
|
|
|
if (roomNumber == 10)
|
|
|
|
showMap();
|
|
|
|
else if (roomNumber == 45)
|
|
|
|
showMap();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::updateRefresh_pre() {
|
2008-06-06 09:53:33 +00:00
|
|
|
// Check generic preupdaters
|
2008-06-10 21:06:39 +00:00
|
|
|
for (int i = 0; i < _roomPreUpdatesSize; i++) {
|
2008-06-09 10:11:42 +00:00
|
|
|
if (_roomPreUpdates[i].roomNum == roomNumber) {
|
|
|
|
if (_roomPreUpdates[i].flag < 0 ||
|
|
|
|
flags[_roomPreUpdates[i].flag] == _roomPreUpdates[i].flagValue) {
|
|
|
|
if (_roomPreUpdates[i].type == 0) {
|
|
|
|
copyBackground(_roomPreUpdates[i].sourceX, _roomPreUpdates[i].sourceY,
|
|
|
|
_roomPreUpdates[i].destX, _roomPreUpdates[i].destY,
|
|
|
|
_roomPreUpdates[i].width, _roomPreUpdates[i].height,
|
2008-06-06 09:53:33 +00:00
|
|
|
drawSurface3, screenSurface);
|
|
|
|
} else {
|
2008-06-09 10:11:42 +00:00
|
|
|
copyRect(_roomPreUpdates[i].sourceX, _roomPreUpdates[i].sourceY,
|
|
|
|
_roomPreUpdates[i].destX, _roomPreUpdates[i].destY,
|
|
|
|
_roomPreUpdates[i].width, _roomPreUpdates[i].height,
|
2008-06-06 09:53:33 +00:00
|
|
|
drawSurface3, screenSurface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-05 13:23:57 +00:00
|
|
|
// Call room-specific preupdater
|
|
|
|
char rm[20];
|
|
|
|
sprintf(rm, "update_%d_pre", roomNumber);
|
|
|
|
for (uint i = 0; i < _roomPreupdaters.size(); i++) {
|
|
|
|
if (!strcmp(rm, _roomPreupdaters[i]->desc)) {
|
|
|
|
debug(4, "Calling room preupdater %d", roomNumber);
|
|
|
|
(this->*(_roomPreupdaters[i]->proc))();
|
|
|
|
break;
|
|
|
|
}
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
2008-06-05 13:23:57 +00:00
|
|
|
|
|
|
|
if (currentChapter == 1 && roomNumber == 16)
|
|
|
|
placeBJ();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_1_pre() {
|
2008-06-04 07:58:34 +00:00
|
|
|
if (curX > 98 && curX < 153) {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 1;
|
2008-06-04 07:58:34 +00:00
|
|
|
setDarkPalette();
|
|
|
|
} else {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
setBrightPalette();
|
|
|
|
}
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[8] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(2, 158, 208, 67, 27, 40, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
void DrasculaEngine::update_2() {
|
2008-06-04 07:58:34 +00:00
|
|
|
int batPos[6];
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-06-04 07:58:34 +00:00
|
|
|
int batX[] = {0, 38, 76, 114, 152, 190, 228, 266,
|
2008-05-02 12:00:58 +00:00
|
|
|
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};
|
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
int batY[] = {179, 179, 179, 179, 179, 179, 179, 179,
|
2008-05-02 12:00:58 +00:00
|
|
|
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};
|
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
if (actorFrames[kFrameBat] == 41)
|
|
|
|
actorFrames[kFrameBat] = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
batPos[0] = batX[actorFrames[kFrameBat]];
|
|
|
|
batPos[1] = batY[actorFrames[kFrameBat]];
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
if (actorFrames[kFrameBat] < 22) {
|
2008-06-04 07:58:34 +00:00
|
|
|
batPos[4] = 37;
|
|
|
|
batPos[5] = 21;
|
2008-06-06 14:50:19 +00:00
|
|
|
} else if (actorFrames[kFrameBat] > 27) {
|
2008-06-04 07:58:34 +00:00
|
|
|
batPos[4] = 57;
|
|
|
|
batPos[5] = 36;
|
2008-05-02 12:00:58 +00:00
|
|
|
} else {
|
2008-06-04 07:58:34 +00:00
|
|
|
batPos[4] = 47;
|
|
|
|
batPos[5] = 22;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
batPos[2] = 239;
|
|
|
|
batPos[3] = 19;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
copyRectClip(batPos, drawSurface3, screenSurface);
|
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference >= 6) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameBat]++;
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(29, 37, 58, 114, 57, 39, drawSurface3, screenSurface);
|
2008-05-29 22:34:03 +00:00
|
|
|
showMap();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_3() {
|
2008-06-02 23:09:19 +00:00
|
|
|
if (curY + curHeight < 118)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(129, 110, 194, 36, 126, 88, drawSurface3, screenSurface);
|
|
|
|
copyRect(47, 57, 277, 143, 43, 50, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_4() {
|
2008-06-04 07:58:34 +00:00
|
|
|
if (curX > 190) {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 1;
|
2008-06-04 07:58:34 +00:00
|
|
|
setDarkPalette();
|
|
|
|
} else {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
setBrightPalette();
|
|
|
|
}
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_6_pre() {
|
2008-06-02 23:09:19 +00:00
|
|
|
if ((curX > 149 && curY + curHeight > 160 && curX < 220 && curY + curHeight < 188) ||
|
2008-06-04 07:58:34 +00:00
|
|
|
(curX > 75 && curY + curHeight > 183 && curX < 145)) {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
setBrightPalette();
|
|
|
|
} else {
|
2008-05-29 22:34:03 +00:00
|
|
|
changeColor = 1;
|
2008-06-04 07:58:34 +00:00
|
|
|
setDarkPalette();
|
|
|
|
}
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_9_pre() {
|
2008-06-04 07:58:34 +00:00
|
|
|
int blindX[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
|
|
|
|
int blindY[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
copyRect(blindX[actorFrames[kFrameBlind]], blindY[actorFrames[kFrameBlind]],
|
|
|
|
122, 57, 41, 72, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[9] == 0) {
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference >= 11) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameBlind]++;
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
2008-06-06 14:50:19 +00:00
|
|
|
if (actorFrames[kFrameBlind] == 9)
|
|
|
|
actorFrames[kFrameBlind] = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameBlind] = 3;
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_13() {
|
2008-06-02 23:09:19 +00:00
|
|
|
if (curX > 55 && flags[3] == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
animation_6_3();
|
2008-06-06 09:53:33 +00:00
|
|
|
// These cannot be placed in an array, as they're between screen updates
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[1] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(185, 110, 121, 65, 67, 88, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[2] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(185, 21, 121, 63, 67, 88, drawSurface3, screenSurface);
|
|
|
|
copyRect(3, 127, 99, 102, 181, 71, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_14_pre() {
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
|
|
|
|
copyBackground(_candleX[actorFrames[kFrameCandles]], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-05-29 22:34:03 +00:00
|
|
|
if (blinking == 5)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
|
2008-06-02 23:09:19 +00:00
|
|
|
if (curX > 101 && curX < 155)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[11] == 0)
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(_pianistX[actorFrames[kFramePianist]], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
else if (flags[5] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[12] == 1)
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference > 6) {
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[12] == 1) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameDrunk]++;
|
|
|
|
if (actorFrames[kFrameDrunk] == 8) {
|
|
|
|
actorFrames[kFrameDrunk] = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[12] = 0;
|
|
|
|
}
|
|
|
|
} else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
|
|
|
|
flags[12] = 1;
|
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameCandles]++;
|
|
|
|
if (actorFrames[kFrameCandles] == 3)
|
|
|
|
actorFrames[kFrameCandles] = 0;
|
|
|
|
actorFrames[kFramePianist]++;
|
|
|
|
if (actorFrames[kFramePianist] == 9)
|
|
|
|
actorFrames[kFramePianist] = 0;
|
2008-05-29 22:34:03 +00:00
|
|
|
blinking = _rnd->getRandomNumber(10);
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_16_pre() {
|
2008-06-05 13:23:57 +00:00
|
|
|
if (currentChapter != 2) {
|
|
|
|
debug(4, "update_16_pre: Special case, current chapter is not 2, not performing update");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[17] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(1, 103, 24, 72, 33, 95, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[19] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(37, 151, 224, 115, 56, 47, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_18_pre() {
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-29 22:34:03 +00:00
|
|
|
int snore_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95};
|
|
|
|
int snore_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18};
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[21] == 0) {
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(1, 69, 120, 58, 56, 61, drawSurface3, screenSurface);
|
2008-06-06 14:50:19 +00:00
|
|
|
copyBackground(snore_x[actorFrames[kFrameSnore]],
|
|
|
|
snore_y[actorFrames[kFrameSnore]],
|
|
|
|
124, 59, 40, 37, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
} else
|
2008-06-06 14:50:19 +00:00
|
|
|
moveVonBraun();
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference > 9) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameSnore]++;
|
|
|
|
if (actorFrames[kFrameSnore] == 16)
|
|
|
|
actorFrames[kFrameSnore] = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_23_pre() {
|
|
|
|
if (flags[11] == 1 && flags[0] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(87, 171, 237, 110, 20, 28, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 09:53:33 +00:00
|
|
|
// It might be possible to put these in an array, though I'm a bit unsure
|
|
|
|
// of the draw order
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[0] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(29, 126, 239, 94, 57, 73, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[1] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(1, 135, 7, 94, 27, 64, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_26_pre() {
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-05-29 22:34:03 +00:00
|
|
|
if (blinking == 5 && flags[18] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(52, 172, 226, 106, 3, 4, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference >= 10) {
|
2008-05-29 22:34:03 +00:00
|
|
|
blinking = _rnd->getRandomNumber(10);
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (flags[20] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_26() {
|
|
|
|
if (flags[29] == 1)
|
2008-06-02 23:09:19 +00:00
|
|
|
copyRect(93, 1, curX, curY, 45, 78, backSurface, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(233, 107, 17, 102, 66, 92, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_35_pre() {
|
|
|
|
if (flags[17] == 0 && flags[15] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(111, 150, 118, 52, 40, 23, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_58_pre() {
|
|
|
|
if (flags[1] == 0 && flags[0] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(278, 171, 173, 116, 25, 28, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[2] == 0) {
|
2008-05-29 22:34:03 +00:00
|
|
|
placeIgor();
|
|
|
|
placeDrascula();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
2008-06-06 09:53:33 +00:00
|
|
|
// Not possible to put these in an array, as there are other surfaces
|
|
|
|
// copied above
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[3] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(1, 29, 204, 0, 18, 125, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[8] == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(20, 60, 30, 64, 46, 95, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_58() {
|
|
|
|
if (hare_se_ve == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(67, 139, 140, 147, 12, 16, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_59_pre() {
|
|
|
|
if (flags[9] == 1) {
|
2008-06-10 18:54:32 +00:00
|
|
|
copyBackground(65, 103, 65, 103, 49, 38, bgSurface, screenSurface);
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(1, 105, 65, 103, 49, 38, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_60_pre() {
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[5] == 0)
|
2008-05-29 22:34:03 +00:00
|
|
|
placeDrascula();
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flag_tv == 1)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(114, 158, 8, 30, 8, 23, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-29 22:34:03 +00:00
|
|
|
blinking = _rnd->getRandomNumber(7);
|
|
|
|
if (blinking == 5 && flag_tv == 0)
|
2008-05-02 12:00:58 +00:00
|
|
|
flag_tv = 1;
|
2008-05-29 22:34:03 +00:00
|
|
|
else if (blinking == 5 && flag_tv == 1)
|
2008-05-02 12:00:58 +00:00
|
|
|
flag_tv = 0;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference > 6) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameCandles]++;
|
|
|
|
if (actorFrames[kFrameCandles] == 3)
|
|
|
|
actorFrames[kFrameCandles] = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_60() {
|
2008-06-06 14:50:19 +00:00
|
|
|
if (curY - 10 < drasculaY && flags[5] == 0)
|
2008-05-29 22:34:03 +00:00
|
|
|
placeDrascula();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_62_pre() {
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
|
|
|
|
copyBackground(_candleX[actorFrames[kFrameCandles]], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-05-29 22:34:03 +00:00
|
|
|
if (blinking == 5)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-02 23:09:19 +00:00
|
|
|
if (curX > 101 && curX < 155)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[11] == 0)
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(_pianistX[actorFrames[kFramePianist]], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
else if (flags[5] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-30 07:09:36 +00:00
|
|
|
copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[12] == 1)
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference > 6) {
|
2008-05-02 12:00:58 +00:00
|
|
|
if (flags[12] == 1) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameDrunk]++;
|
|
|
|
if (actorFrames[kFrameDrunk] == 8) {
|
|
|
|
actorFrames[kFrameDrunk] = 0;
|
2008-05-02 12:00:58 +00:00
|
|
|
flags[12] = 0;
|
|
|
|
}
|
|
|
|
} else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
|
|
|
|
flags[12] = 1;
|
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFrameCandles]++;
|
|
|
|
if (actorFrames[kFrameCandles] == 3)
|
|
|
|
actorFrames[kFrameCandles] = 0;
|
|
|
|
actorFrames[kFramePianist]++;
|
|
|
|
if (actorFrames[kFramePianist] == 9)
|
|
|
|
actorFrames[kFramePianist] = 0;
|
2008-05-29 22:34:03 +00:00
|
|
|
blinking = _rnd->getRandomNumber(10);
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::update_62() {
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(1, 1, 0, 0, 62, 142, drawSurface2, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-02 23:09:19 +00:00
|
|
|
if (curY + curHeight < 89) {
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(205, 1, 180, 9, 82, 80, drawSurface3, screenSurface);
|
2008-06-09 10:11:42 +00:00
|
|
|
copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-05 19:04:58 +00:00
|
|
|
void DrasculaEngine::update_102() {
|
2008-05-29 22:34:03 +00:00
|
|
|
int pendulum_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
|
2008-05-30 08:14:01 +00:00
|
|
|
int difference;
|
2008-06-08 11:26:48 +00:00
|
|
|
byte *pendulumSurface = drawSurface3;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
if (actorFrames[kFramePendulum] <= 4)
|
2008-05-30 07:09:36 +00:00
|
|
|
pendulumSurface = drawSurface3;
|
2008-06-06 14:50:19 +00:00
|
|
|
else if (actorFrames[kFramePendulum] <= 11)
|
2008-05-30 07:09:36 +00:00
|
|
|
pendulumSurface = extraSurface;
|
2008-05-02 12:00:58 +00:00
|
|
|
else
|
2008-05-30 07:09:36 +00:00
|
|
|
pendulumSurface = frontSurface;
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-06 14:50:19 +00:00
|
|
|
copyBackground(pendulum_x[actorFrames[kFramePendulum]], 19, 152, 0, 55, 125, pendulumSurface, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[1] == 2)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(18, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
|
|
|
if (flags[1] == 0)
|
2008-05-30 07:09:36 +00:00
|
|
|
copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
|
2008-05-02 12:00:58 +00:00
|
|
|
|
2008-06-04 07:58:34 +00:00
|
|
|
difference = getTime() - savedTime;
|
2008-05-30 08:14:01 +00:00
|
|
|
if (difference > 8) {
|
2008-06-06 14:50:19 +00:00
|
|
|
actorFrames[kFramePendulum]++;
|
|
|
|
if (actorFrames[kFramePendulum] == 17)
|
|
|
|
actorFrames[kFramePendulum] = 0;
|
2008-06-04 07:58:34 +00:00
|
|
|
savedTime = getTime();
|
2008-05-02 12:00:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-05 13:23:57 +00:00
|
|
|
bool DrasculaEngine::checkAction(int fl) {
|
2008-05-30 23:43:47 +00:00
|
|
|
characterMoved = 0;
|
|
|
|
updateRoom();
|
2008-05-31 12:40:02 +00:00
|
|
|
updateScreen();
|
2008-05-30 23:43:47 +00:00
|
|
|
|
|
|
|
hasAnswer = 1;
|
|
|
|
|
2008-06-05 20:28:50 +00:00
|
|
|
if (menuScreen == 1 && roomParse(200, fl)) {
|
|
|
|
;
|
|
|
|
} else if (menuScreen != 1 && roomParse(201, fl)) {
|
|
|
|
;
|
|
|
|
} else if (menuScreen == 1) {
|
2008-05-31 09:16:26 +00:00
|
|
|
if (currentChapter == 1) {
|
2008-06-05 20:28:50 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 2) {
|
2008-05-30 23:43:47 +00:00
|
|
|
if ((pickedObject == kVerbLook && fl == 22 && flags[23] == 0)
|
2008-06-05 20:28:50 +00:00
|
|
|
|| (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) {
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(164);
|
|
|
|
flags[23] = 1;
|
|
|
|
withoutVerb();
|
2008-06-05 15:03:48 +00:00
|
|
|
addObject(kItemMoney);
|
|
|
|
addObject(kItemTwoCoins);
|
2008-05-30 23:43:47 +00:00
|
|
|
} else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1)
|
|
|
|
talk(307);
|
|
|
|
else
|
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 3) {
|
2008-06-05 20:28:50 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 4) {
|
2008-05-30 23:43:47 +00:00
|
|
|
if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) {
|
|
|
|
withoutVerb();
|
|
|
|
chooseObject(21);
|
|
|
|
removeObject(18);
|
|
|
|
removeObject(19);
|
2008-06-06 19:37:36 +00:00
|
|
|
} else if (pickedObject == kVerbLook && fl == 9) {
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(482);
|
|
|
|
talk(483);
|
2008-06-05 20:28:50 +00:00
|
|
|
} else if (pickedObject == kVerbLook && fl == 19) {
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(494);
|
|
|
|
talk(495);
|
2008-06-05 20:28:50 +00:00
|
|
|
} else
|
2008-05-30 23:43:47 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 5) {
|
2008-06-05 20:28:50 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 9) {
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(482);
|
|
|
|
talk(483);
|
2008-06-05 20:28:50 +00:00
|
|
|
} else
|
2008-05-30 23:43:47 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 6) {
|
2008-06-05 20:28:50 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 9) {
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(482);
|
|
|
|
talk(483);
|
2008-06-05 20:28:50 +00:00
|
|
|
} else
|
2008-05-30 23:43:47 +00:00
|
|
|
hasAnswer = 0;
|
|
|
|
}
|
|
|
|
} else {
|
2008-05-31 09:16:26 +00:00
|
|
|
if (currentChapter == 1) {
|
2008-06-05 20:28:50 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 2) {
|
2008-05-30 23:43:47 +00:00
|
|
|
// Note: the original check was strcmp(num_room, "18.alg")
|
2008-06-05 20:28:50 +00:00
|
|
|
if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18)
|
2008-05-30 23:43:47 +00:00
|
|
|
talk(315);
|
|
|
|
else
|
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 3) {
|
2008-06-05 20:28:50 +00:00
|
|
|
if (roomNumber == 13) {
|
2008-06-06 06:35:25 +00:00
|
|
|
if (room(13, fl))
|
2008-05-30 23:43:47 +00:00
|
|
|
return true;
|
|
|
|
} else
|
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 4) {
|
2008-05-30 23:43:47 +00:00
|
|
|
if (roomNumber == 28)
|
|
|
|
talk(178);
|
|
|
|
else if (pickedObject == 8 && fl == 50 && flags[18] == 0)
|
|
|
|
talk(481);
|
|
|
|
else if (pickedObject == 12 && fl == 50 && flags[18] == 0)
|
|
|
|
talk(487);
|
|
|
|
else if (roomNumber == 21) {
|
2008-06-06 06:35:25 +00:00
|
|
|
if (room(21, fl))
|
2008-05-30 23:43:47 +00:00
|
|
|
return true;
|
2008-06-05 13:23:57 +00:00
|
|
|
} else
|
2008-05-30 23:43:47 +00:00
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 5) {
|
2008-06-06 19:37:36 +00:00
|
|
|
if (roomNumber == 56) {
|
2008-06-06 06:35:25 +00:00
|
|
|
if (room(56, fl))
|
2008-05-30 23:43:47 +00:00
|
|
|
return true;
|
|
|
|
} else
|
|
|
|
hasAnswer = 0;
|
2008-05-31 09:16:26 +00:00
|
|
|
} else if (currentChapter == 6) {
|
2008-05-30 23:43:47 +00:00
|
|
|
if (pickedObject == kVerbLook && fl == 50 && flags[0] == 1)
|
|
|
|
talk(308);
|
|
|
|
else if (pickedObject == kVerbLook && fl == 50 && flags[0] == 0)
|
2008-06-03 08:54:49 +00:00
|
|
|
talk(310);
|
2008-05-30 23:43:47 +00:00
|
|
|
else if (roomNumber == 102)
|
2008-06-06 06:35:25 +00:00
|
|
|
room(102, fl);
|
2008-05-30 23:43:47 +00:00
|
|
|
else if (roomNumber == 60) {
|
2008-06-06 06:35:25 +00:00
|
|
|
if (room(60, fl))
|
2008-05-30 23:43:47 +00:00
|
|
|
return true;
|
2008-06-05 13:23:57 +00:00
|
|
|
}
|
2008-05-30 23:43:47 +00:00
|
|
|
else
|
|
|
|
hasAnswer = 0;
|
|
|
|
}
|
|
|
|
}
|
2008-06-05 13:23:57 +00:00
|
|
|
|
|
|
|
if (hasAnswer == 0) {
|
|
|
|
hasAnswer = 1;
|
|
|
|
|
2008-06-06 06:35:25 +00:00
|
|
|
room(roomNumber, fl);
|
2008-06-05 13:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1))
|
2008-06-06 06:35:25 +00:00
|
|
|
room(0, -1);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::room(int rN, int fl) {
|
|
|
|
if (!roomParse(rN, fl)) {
|
|
|
|
// Call room-specific parser
|
|
|
|
char rm[20];
|
|
|
|
sprintf(rm, "room_%d", rN);
|
|
|
|
for (uint i = 0; i < _roomParsers.size(); i++) {
|
|
|
|
if (!strcmp(rm, _roomParsers[i]->desc)) {
|
|
|
|
debug(4, "Calling room parser %d", rN);
|
|
|
|
|
|
|
|
return (this->*(_roomParsers[i]->proc))(fl);
|
|
|
|
}
|
|
|
|
}
|
2008-06-06 09:18:49 +00:00
|
|
|
|
|
|
|
// We did not find any parser, let default one work
|
|
|
|
hasAnswer = 0;
|
2008-06-06 06:35:25 +00:00
|
|
|
}
|
2008-05-30 23:43:47 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-06-07 19:40:43 +00:00
|
|
|
void DrasculaEngine::enterRoom(int roomIndex) {
|
|
|
|
debug(2, "Entering room %d", roomIndex);
|
|
|
|
|
|
|
|
char fileName[20];
|
|
|
|
sprintf(fileName, "%d.ald", roomIndex);
|
|
|
|
int soc, l, martin = 0, objIsExit = 0;
|
|
|
|
float chiquez = 0, pequegnez = 0;
|
|
|
|
char pant1[20], pant2[20], pant3[20], pant4[20];
|
|
|
|
char buffer[256];
|
|
|
|
int palLevel = 0;
|
|
|
|
|
|
|
|
hasName = 0;
|
|
|
|
|
|
|
|
strcpy(currentData, fileName);
|
|
|
|
|
|
|
|
_arj.open(fileName);
|
|
|
|
if (!_arj.isOpen()) {
|
|
|
|
error("missing data file %s", fileName);
|
|
|
|
}
|
|
|
|
int size = _arj.size();
|
|
|
|
|
|
|
|
getIntFromLine(buffer, size, &roomNumber);
|
|
|
|
getIntFromLine(buffer, size, &roomMusic);
|
|
|
|
getStringFromLine(buffer, size, roomDisk);
|
|
|
|
getIntFromLine(buffer, size, &palLevel);
|
|
|
|
|
|
|
|
if (currentChapter == 2)
|
|
|
|
getIntFromLine(buffer, size, &martin);
|
|
|
|
|
|
|
|
if (currentChapter == 2 && martin != 0) {
|
|
|
|
curWidth = martin;
|
|
|
|
getIntFromLine(buffer, size, &curHeight);
|
|
|
|
getIntFromLine(buffer, size, &feetHeight);
|
|
|
|
getIntFromLine(buffer, size, &stepX);
|
|
|
|
getIntFromLine(buffer, size, &stepY);
|
|
|
|
|
|
|
|
getStringFromLine(buffer, size, pant1);
|
|
|
|
getStringFromLine(buffer, size, pant2);
|
|
|
|
getStringFromLine(buffer, size, pant3);
|
|
|
|
getStringFromLine(buffer, size, pant4);
|
|
|
|
|
|
|
|
strcpy(menuBackground, pant4);
|
|
|
|
}
|
|
|
|
|
|
|
|
getIntFromLine(buffer, size, &numRoomObjs);
|
|
|
|
|
|
|
|
for (l = 0; l < numRoomObjs; l++) {
|
|
|
|
getIntFromLine(buffer, size, &objectNum[l]);
|
|
|
|
getStringFromLine(buffer, size, objName[l]);
|
|
|
|
getIntFromLine(buffer, size, &x1[l]);
|
|
|
|
getIntFromLine(buffer, size, &y1[l]);
|
|
|
|
getIntFromLine(buffer, size, &x2[l]);
|
|
|
|
getIntFromLine(buffer, size, &y2[l]);
|
|
|
|
getIntFromLine(buffer, size, &roomObjX[l]);
|
|
|
|
getIntFromLine(buffer, size, &roomObjY[l]);
|
|
|
|
getIntFromLine(buffer, size, &trackObj[l]);
|
|
|
|
getIntFromLine(buffer, size, &visible[l]);
|
|
|
|
getIntFromLine(buffer, size, &isDoor[l]);
|
|
|
|
if (isDoor[l] != 0) {
|
|
|
|
getStringFromLine(buffer, size, _targetSurface[l]);
|
|
|
|
getIntFromLine(buffer, size, &_destX[l]);
|
|
|
|
getIntFromLine(buffer, size, &_destY[l]);
|
|
|
|
getIntFromLine(buffer, size, &trackCharacter_alkeva[l]);
|
|
|
|
getIntFromLine(buffer, size, &alapuertakeva[l]);
|
|
|
|
updateDoor(l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
getIntFromLine(buffer, size, &floorX1);
|
|
|
|
getIntFromLine(buffer, size, &floorY1);
|
|
|
|
getIntFromLine(buffer, size, &floorX2);
|
|
|
|
getIntFromLine(buffer, size, &floorY2);
|
|
|
|
|
|
|
|
if (currentChapter != 2) {
|
2008-06-25 08:36:07 +00:00
|
|
|
getIntFromLine(buffer, size, &upperLimit);
|
|
|
|
getIntFromLine(buffer, size, &lowerLimit);
|
2008-06-07 19:40:43 +00:00
|
|
|
}
|
|
|
|
_arj.close();
|
|
|
|
|
|
|
|
if (currentChapter == 2 && martin != 0) {
|
|
|
|
loadPic(pant2, extraSurface);
|
|
|
|
loadPic(pant1, frontSurface);
|
|
|
|
loadPic(pant4, backSurface);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 2) {
|
|
|
|
if (martin == 0) {
|
|
|
|
stepX = STEP_X;
|
|
|
|
stepY = STEP_Y;
|
|
|
|
curHeight = CHARACTER_HEIGHT;
|
|
|
|
curWidth = CHARACTER_WIDTH;
|
|
|
|
feetHeight = FEET_HEIGHT;
|
|
|
|
loadPic(97, extraSurface);
|
|
|
|
loadPic(96, frontSurface);
|
|
|
|
loadPic(99, backSurface);
|
|
|
|
|
|
|
|
strcpy(menuBackground, "99.alg");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (l = 0; l < numRoomObjs; l++) {
|
|
|
|
if (objectNum[l] == objExit)
|
|
|
|
objIsExit = l;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 2) {
|
|
|
|
if (curX == -1) {
|
|
|
|
curX = _destX[objIsExit];
|
|
|
|
curY = _destY[objIsExit] - curHeight;
|
|
|
|
}
|
|
|
|
characterMoved = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
loadPic(roomDisk, drawSurface3);
|
2008-06-10 18:54:32 +00:00
|
|
|
loadPic(roomNumber, bgSurface, HALF_PAL);
|
2008-06-07 19:40:43 +00:00
|
|
|
|
|
|
|
copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
|
|
|
|
|
|
|
|
setDefaultPalette();
|
|
|
|
if (palLevel != 0)
|
|
|
|
setPaletteBase(palLevel);
|
|
|
|
assignBrightPalette();
|
|
|
|
setDefaultPalette();
|
|
|
|
setPaletteBase(palLevel + 2);
|
|
|
|
assignDarkPalette();
|
|
|
|
|
|
|
|
setBrightPalette();
|
|
|
|
changeColor = -1;
|
|
|
|
|
|
|
|
if (currentChapter == 2)
|
|
|
|
color_abc(kColorLightGreen);
|
|
|
|
|
|
|
|
if (currentChapter != 2) {
|
|
|
|
for (l = 0; l <= floorY1; l++)
|
2008-06-25 08:36:07 +00:00
|
|
|
factor_red[l] = upperLimit;
|
2008-06-07 19:40:43 +00:00
|
|
|
for (l = floorY1; l <= 201; l++)
|
2008-06-25 08:36:07 +00:00
|
|
|
factor_red[l] = lowerLimit;
|
2008-06-07 19:40:43 +00:00
|
|
|
|
2008-06-25 08:36:07 +00:00
|
|
|
chiquez = (float)(lowerLimit - upperLimit) / (float)(floorY2 - floorY1);
|
2008-06-07 19:40:43 +00:00
|
|
|
for (l = floorY1; l <= floorY2; l++) {
|
2008-06-25 08:36:07 +00:00
|
|
|
factor_red[l] = (int)(upperLimit + pequegnez);
|
2008-06-07 19:40:43 +00:00
|
|
|
pequegnez = pequegnez + chiquez;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (roomNumber == 24) {
|
|
|
|
for (l = floorY1 - 1; l > 74; l--) {
|
2008-06-25 08:36:07 +00:00
|
|
|
factor_red[l] = (int)(upperLimit - pequegnez);
|
2008-06-07 19:40:43 +00:00
|
|
|
pequegnez = pequegnez + chiquez;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 5 && roomNumber == 54) {
|
|
|
|
for (l = floorY1 - 1; l > 84; l--) {
|
2008-06-25 08:36:07 +00:00
|
|
|
factor_red[l] = (int)(upperLimit - pequegnez);
|
2008-06-07 19:40:43 +00:00
|
|
|
pequegnez = pequegnez + chiquez;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter != 2) {
|
|
|
|
if (curX == -1) {
|
|
|
|
curX = _destX[objIsExit];
|
|
|
|
curY = _destY[objIsExit];
|
|
|
|
curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
|
|
|
|
curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
|
|
|
|
curY = curY - curHeight;
|
|
|
|
} else {
|
|
|
|
curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
|
|
|
|
curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
|
|
|
|
}
|
|
|
|
characterMoved = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 2) {
|
|
|
|
soc = 0;
|
|
|
|
for (l = 0; l < 6; l++) {
|
|
|
|
soc += curWidth;
|
2008-06-09 10:11:42 +00:00
|
|
|
_frameX[l] = soc;
|
2008-06-07 19:40:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 5)
|
|
|
|
hare_se_ve = 1;
|
|
|
|
|
|
|
|
updateVisible();
|
|
|
|
|
|
|
|
if (currentChapter == 1)
|
|
|
|
isDoor[7] = 0;
|
|
|
|
|
|
|
|
if (currentChapter == 2) {
|
|
|
|
if (roomNumber == 14 && flags[39] == 1)
|
|
|
|
roomMusic = 16;
|
|
|
|
else if (roomNumber == 15 && flags[39] == 1)
|
|
|
|
roomMusic = 16;
|
|
|
|
if (roomNumber == 14 && flags[5] == 1)
|
|
|
|
roomMusic = 0;
|
|
|
|
else if (roomNumber == 15 && flags[5] == 1)
|
|
|
|
roomMusic = 0;
|
|
|
|
|
|
|
|
if (previousMusic != roomMusic && roomMusic != 0)
|
|
|
|
playMusic(roomMusic);
|
|
|
|
if (roomMusic == 0)
|
|
|
|
stopMusic();
|
|
|
|
} else {
|
|
|
|
if (previousMusic != roomMusic && roomMusic != 0)
|
|
|
|
playMusic(roomMusic);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 2) {
|
|
|
|
if (roomNumber == 9 || roomNumber == 2 || roomNumber == 14 || roomNumber == 18)
|
|
|
|
savedTime = getTime();
|
|
|
|
}
|
|
|
|
if (currentChapter == 4) {
|
|
|
|
if (roomNumber == 26)
|
|
|
|
savedTime = getTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentChapter == 4 && roomNumber == 24 && flags[29] == 1)
|
|
|
|
animation_7_4();
|
|
|
|
|
|
|
|
if (currentChapter == 5) {
|
|
|
|
if (roomNumber == 45)
|
|
|
|
hare_se_ve = 0;
|
|
|
|
if (roomNumber == 49 && flags[7] == 0)
|
|
|
|
animation_4_5();
|
|
|
|
}
|
|
|
|
|
|
|
|
updateRoom();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::clearRoom() {
|
|
|
|
memset(VGA, 0, 64000);
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
|
|
|
_system->updateScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DrasculaEngine::exitRoom(int l) {
|
|
|
|
debug(2, "Exiting room from door %d", l);
|
|
|
|
|
|
|
|
int roomNum = 0;
|
|
|
|
|
|
|
|
if (currentChapter == 1) {
|
|
|
|
if (objectNum[l] == 105 && flags[0] == 0)
|
|
|
|
talk(442);
|
|
|
|
else {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
trackProtagonist = trackObj[l];
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
|
|
|
|
if (objectNum[l] == 105) {
|
|
|
|
animation_2_1();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX = -1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (currentChapter == 2) {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
if (objectNum[l] == 136)
|
|
|
|
animation_2_2();
|
|
|
|
if (objectNum[l] == 124)
|
|
|
|
animation_3_2();
|
|
|
|
if (objectNum[l] == 173) {
|
|
|
|
animation_35_2();
|
|
|
|
return true;
|
|
|
|
} if (objectNum[l] == 146 && flags[39] == 1) {
|
|
|
|
flags[5] = 1;
|
|
|
|
flags[11] = 1;
|
|
|
|
}
|
|
|
|
if (objectNum[l] == 176 && flags[29] == 1) {
|
|
|
|
flags[29] = 0;
|
|
|
|
removeObject(kItemEarWithEarPlug);
|
|
|
|
addObject(kItemEarplugs);
|
|
|
|
}
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX =- 1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
}
|
|
|
|
} else if (currentChapter == 3) {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0 && visible[l] == 1) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
trackProtagonist = trackObj[l];
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX =- 1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
}
|
|
|
|
} else if (currentChapter == 4) {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
trackProtagonist = trackObj[l];
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
|
|
|
|
if (objectNum[l] == 108)
|
|
|
|
gotoObject(171, 78);
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX = -1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
}
|
|
|
|
} else if (currentChapter == 5) {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0 && visible[l] == 1) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
trackProtagonist = trackObj[l];
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
hare_se_ve = 1;
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX = -1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
}
|
|
|
|
} else if (currentChapter == 6) {
|
|
|
|
updateDoor(l);
|
|
|
|
if (isDoor[l] != 0) {
|
|
|
|
gotoObject(roomObjX[l], roomObjY[l]);
|
|
|
|
trackProtagonist = trackObj[l];
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
characterMoved = 0;
|
|
|
|
trackProtagonist = trackCharacter_alkeva[l];
|
|
|
|
objExit = alapuertakeva[l];
|
|
|
|
doBreak = 1;
|
|
|
|
previousMusic = roomMusic;
|
|
|
|
clearRoom();
|
|
|
|
sscanf(_targetSurface[l], "%d", &roomNum);
|
|
|
|
curX = -1;
|
|
|
|
enterRoom(roomNum);
|
|
|
|
|
|
|
|
if (objExit == 105)
|
|
|
|
animation_19_6();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::updateRoom() {
|
2008-08-26 08:21:21 +00:00
|
|
|
copyBackground();
|
2008-06-07 19:40:43 +00:00
|
|
|
updateRefresh_pre();
|
|
|
|
if (currentChapter == 3) {
|
|
|
|
if (flags[0] == 0)
|
|
|
|
moveCharacters();
|
|
|
|
else
|
|
|
|
copyRect(113, 54, curX - 20, curY - 1, 77, 89, drawSurface3, screenSurface);
|
|
|
|
} else {
|
|
|
|
moveCharacters();
|
|
|
|
}
|
|
|
|
updateRefresh();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::updateDoor(int doorNum) {
|
|
|
|
if (currentChapter == 1 || currentChapter == 3 || currentChapter == 5 || currentChapter == 6)
|
|
|
|
return;
|
|
|
|
else if (currentChapter == 2) {
|
|
|
|
if (objectNum[doorNum] == 138)
|
|
|
|
isDoor[doorNum] = flags[0];
|
|
|
|
else if (objectNum[doorNum] == 136)
|
|
|
|
isDoor[doorNum] = flags[8];
|
|
|
|
else if (objectNum[doorNum] == 156)
|
|
|
|
isDoor[doorNum] = flags[16];
|
|
|
|
else if (objectNum[doorNum] == 163)
|
|
|
|
isDoor[doorNum] = flags[17];
|
|
|
|
else if (objectNum[doorNum] == 177)
|
|
|
|
isDoor[doorNum] = flags[15];
|
|
|
|
else if (objectNum[doorNum] == 175)
|
|
|
|
isDoor[doorNum] = flags[40];
|
|
|
|
else if (objectNum[doorNum] == 173)
|
|
|
|
isDoor[doorNum] = flags[36];
|
|
|
|
} else if (currentChapter == 4) {
|
|
|
|
if (objectNum[doorNum] == 101 && flags[0] == 0)
|
|
|
|
isDoor[doorNum] = 0;
|
|
|
|
else if (objectNum[doorNum] == 101 && flags[0] == 1 && flags[28] == 1)
|
|
|
|
isDoor[doorNum] = 1;
|
|
|
|
else if (objectNum[doorNum] == 103)
|
|
|
|
isDoor[doorNum] = flags[0];
|
|
|
|
else if (objectNum[doorNum] == 104)
|
|
|
|
isDoor[doorNum] = flags[1];
|
|
|
|
else if (objectNum[doorNum] == 105)
|
|
|
|
isDoor[doorNum] = flags[1];
|
|
|
|
else if (objectNum[doorNum] == 106)
|
|
|
|
isDoor[doorNum] = flags[2];
|
|
|
|
else if (objectNum[doorNum] == 107)
|
|
|
|
isDoor[doorNum] = flags[2];
|
|
|
|
else if (objectNum[doorNum] == 110)
|
|
|
|
isDoor[doorNum] = flags[6];
|
|
|
|
else if (objectNum[doorNum] == 114)
|
|
|
|
isDoor[doorNum] = flags[4];
|
|
|
|
else if (objectNum[doorNum] == 115)
|
|
|
|
isDoor[doorNum] = flags[4];
|
|
|
|
else if (objectNum[doorNum] == 116 && flags[5] == 0)
|
|
|
|
isDoor[doorNum] = 0;
|
|
|
|
else if (objectNum[doorNum] == 116 && flags[5] == 1 && flags[23] == 1)
|
|
|
|
isDoor[doorNum] = 1;
|
|
|
|
else if (objectNum[doorNum] == 117)
|
|
|
|
isDoor[doorNum] = flags[5];
|
|
|
|
else if (objectNum[doorNum] == 120)
|
|
|
|
isDoor[doorNum] = flags[8];
|
|
|
|
else if (objectNum[doorNum] == 122)
|
|
|
|
isDoor[doorNum] = flags[7];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::openDoor(int nflag, int doorNum) {
|
|
|
|
if (flags[nflag] == 0) {
|
|
|
|
if (currentChapter == 1 /*|| currentChapter == 4*/) {
|
|
|
|
if (nflag != 7) {
|
|
|
|
playSound(3);
|
|
|
|
flags[nflag] = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
playSound(3);
|
|
|
|
flags[nflag] = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (doorNum != NO_DOOR)
|
|
|
|
updateDoor(doorNum);
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
finishSound();
|
|
|
|
withoutVerb();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrasculaEngine::closeDoor(int nflag, int doorNum) {
|
|
|
|
if (flags[nflag] == 1) {
|
|
|
|
playSound(4);
|
|
|
|
flags[nflag] = 0;
|
|
|
|
if (doorNum != NO_DOOR)
|
|
|
|
updateDoor(doorNum);
|
|
|
|
updateRoom();
|
|
|
|
updateScreen();
|
|
|
|
finishSound();
|
|
|
|
withoutVerb();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-02 12:00:58 +00:00
|
|
|
} // End of namespace Drascula
|