1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
/* 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.
*
*/
#include "titanic/game/computer_screen.h"
#include "titanic/messages/messages.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CComputerScreen, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(MovementMsg)
END_MESSAGE_MAP()
CComputerScreen::CComputerScreen() : CGameObject() {
}
void CComputerScreen::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CComputerScreen::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
bool CComputerScreen::ActMsg(CActMsg *msg) {
if (msg->_action == "newCD1" || msg->_action == "newCD2") {
playMovie(27, 53, MOVIE_WAIT_FOR_FINISH);
playMovie(19, 26, MOVIE_WAIT_FOR_FINISH);
} else if (msg->_action == "newSTCD") {
playMovie(0, 18, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
return true;
}
bool CComputerScreen::MovieEndMsg(CMovieEndMsg *msg) {
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
addTimer(0, 3000, 0);
for (int idx = 0; idx < 10; ++idx)
playMovie(0, 18, 0);
return true;
}
bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) {
loadFrame(26);
// WORKAROUND: The original game leaves in a debug link that
// allows skipping of Doorbot arrival sequence. Disable it
static_cast<CLinkItem *>(getParent()->findByName("_TRACK,3,e-cu,4,E"))->_bounds.clear();
return true;
}
bool CComputerScreen::MovementMsg(CMovementMsg *msg) {
if (msg->_movement != MOVE_BACKWARDS)
return true;
msg->_posToUse = Common::Point(320, 50);
return false;
}
bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
int handle;
switch (msg->_actionVal) {
case 0:
if (g_language == Common::DE_DEU) {
loadSound("a#27.wav");
loadSound("a#26.wav");
loadSound("a#28.wav");
loadSound("a#25.wav");
loadSound("a#24.wav");
playSound("a#20.wav");
} else {
loadSound("a#32.wav");
loadSound("a#31.wav");
loadSound("a#33.wav");
loadSound("a#30.wav");
loadSound("a#29.wav");
playSound("a#25.wav");
}
addTimer(1, 2000, 0);
break;
case 1:
playMovie(23, 26, MOVIE_STOP_PREVIOUS);
playSound(TRANSLATE("a#32.wav", "a#27.wav"));
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
addTimer(2, 2000, 0);
break;
case 2: {
CChangeMusicMsg musicMsg(CString(), MUSIC_STOP);
musicMsg.execute("HomeMusicPlayer");
playSound(TRANSLATE("a#33.wav", "a#28.wav"));
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
changeView("Home.Node 4.E", "");
playClip(51, 150);
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
playClip(151, 200);
handle = playSound(TRANSLATE("a#27.wav", "a#22.wav"));
playClip(200, 306);
playSound(TRANSLATE("a#30.wav", "a#25.wav"));
stopSound(handle, 0);
playClip(306, 338);
handle = playSound(TRANSLATE("a#28.wav", "a#23.wav"));
playClip(338, 392);
playSound(TRANSLATE("a#29.wav", "a#24.wav"));
stopSound(handle);
handle = playSound(TRANSLATE("y#662.wav", "y#0.wav"));
setSoundVolume(handle, 10, 2);
playClip(392, 450);
startTalking("Doorbot", 0x3611A);
sleep(TRANSLATE(8000, 7000));
playClip(450, 492);
startTalking("Doorbot", 0x36121);
playClip(492, 522);
setSoundVolume(handle, 30, 2);
playClip(523, 540);
setSoundVolume(handle, 0, 1);
playClip(541, 551);
stopSound(handle);
break;
}
default:
break;
}
return true;
}
} // End of namespace Titanic
|