aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-23 14:20:34 +0000
committerJohannes Schickel2008-04-23 14:20:34 +0000
commitd20dc45072a7af1976dd57986cc1ff7b967ac5db (patch)
tree890650eedffd09ea29875563e26588ccfca02d69 /engines/kyra
parent6069dba988e9940b4d5285d6abc01b83967f8702 (diff)
downloadscummvm-rg350-d20dc45072a7af1976dd57986cc1ff7b967ac5db.tar.gz
scummvm-rg350-d20dc45072a7af1976dd57986cc1ff7b967ac5db.tar.bz2
scummvm-rg350-d20dc45072a7af1976dd57986cc1ff7b967ac5db.zip
Implemented opcode 118: o3_malcolmRandomChat.
svn-id: r31662
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_v3.h3
-rw-r--r--engines/kyra/script_v3.cpp8
-rw-r--r--engines/kyra/text_v3.cpp20
3 files changed, 30 insertions, 1 deletions
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index facab63a20..767e3efb43 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -522,6 +522,8 @@ private:
int o3d_updateAnim(ScriptState *script);
int o3d_delay(ScriptState *script);
+ void malcolmRandomChat();
+
// conscience
bool _badConscienceShown;
int _badConscienceAnim;
@@ -617,6 +619,7 @@ private:
int o3_defineSceneAnim(ScriptState *script);
int o3_updateSceneAnim(ScriptState *script);
int o3_runActorScript(ScriptState *script);
+ int o3_malcolmRandomChat(ScriptState *script);
int o3_setDlgIndex(ScriptState *script);
int o3_getDlgIndex(ScriptState *script);
int o3_defineScene(ScriptState *script);
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
index 19ff1c1a8f..8193553e59 100644
--- a/engines/kyra/script_v3.cpp
+++ b/engines/kyra/script_v3.cpp
@@ -544,6 +544,12 @@ int KyraEngine_v3::o3_runActorScript(ScriptState *script) {
return 0;
}
+int KyraEngine_v3::o3_malcolmRandomChat(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_malcolmRandomChat(%p) ()", (const void *)script);
+ malcolmRandomChat();
+ return 0;
+}
+
int KyraEngine_v3::o3_setDlgIndex(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setDlgIndex(%p) (%d)", (const void *)script, stackPos(0));
setDlgIndex(stackPos(0));
@@ -882,7 +888,7 @@ void KyraEngine_v3::setupOpcodeTable() {
// 0x74
Opcode(o3_runActorScript);
OpcodeUnImpl();
- OpcodeUnImpl();
+ Opcode(o3_malcolmRandomChat);
Opcode(o3_setDlgIndex);
// 0x78
Opcode(o3_getDlgIndex);
diff --git a/engines/kyra/text_v3.cpp b/engines/kyra/text_v3.cpp
index 21f3e5fbca..d42ec9efe3 100644
--- a/engines/kyra/text_v3.cpp
+++ b/engines/kyra/text_v3.cpp
@@ -648,5 +648,25 @@ void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, in
_chatObject= - 1;
}
+void KyraEngine_v3::malcolmRandomChat() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::malcolmRandomChat()");
+ updateDlgBuffer();
+
+ int index = (_mainCharacter.sceneId - _chapterLowestScene[_curChapter]) * 2;
+
+ int vocHighBase = 0, vocHighIndex = 0, index1 = 0, index2 = 0;
+ loadDlgHeader(vocHighBase, vocHighIndex, index1, index2);
+
+ if (_chatAltFlag)
+ index++;
+ _chatAltFlag = !_chatAltFlag;
+
+ _cnvFile->seek(index1*6, SEEK_CUR);
+ _cnvFile->seek(index*2, SEEK_CUR);
+ _cnvFile->seek(_cnvFile->readUint16LE(), SEEK_SET);
+
+ processDialog(vocHighIndex, vocHighBase, 0);
+}
+
} // end of namespace Kyra