aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-25 17:59:38 +0000
committerJohannes Schickel2008-04-25 17:59:38 +0000
commit7fb4a87c2415f3ba5bc92d572788adc34a15f577 (patch)
tree865f0aca40555533a26facdcb60591493b9cea75 /engines/kyra
parentc10f59d358c1ad8221b2151faa7cf4f5c43b5628 (diff)
downloadscummvm-rg350-7fb4a87c2415f3ba5bc92d572788adc34a15f577.tar.gz
scummvm-rg350-7fb4a87c2415f3ba5bc92d572788adc34a15f577.tar.bz2
scummvm-rg350-7fb4a87c2415f3ba5bc92d572788adc34a15f577.zip
Implemented opcodes:
- 20: o3_setCharacterAnimFrameFromFacing - 61: o3_disguiseMalcolm svn-id: r31727
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_v3.h3
-rw-r--r--engines/kyra/script_v3.cpp20
-rw-r--r--engines/kyra/text_v3.cpp40
3 files changed, 61 insertions, 2 deletions
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index a0844ca7e2..fd20585d85 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -565,6 +565,7 @@ private:
int8 _conversationState[30][30];
bool _chatAltFlag;
void setDlgIndex(uint16 index);
+ void updateDlgIndex();
Common::SeekableReadStream *_cnvFile;
Common::SeekableReadStream *_dlgBuffer;
@@ -683,6 +684,7 @@ private:
int o3_moveCharacter(ScriptState *script);
int o3_setCharacterFacing(ScriptState *script);
int o3_showSceneFileMessage(ScriptState *script);
+ int o3_setCharacterAnimFrameFromFacing(ScriptState *script);
int o3_showBadConscience(ScriptState *script);
int o3_hideBadConscience(ScriptState *script);
int o3_addItemToCurScene(ScriptState *script);
@@ -707,6 +709,7 @@ private:
int o3_updateScore(ScriptState *script);
int o3_setSceneFilename(ScriptState *script);
int o3_removeItemsFromScene(ScriptState *script);
+ int o3_disguiseMalcolm(ScriptState *script);
int o3_drawSceneShape(ScriptState *script);
int o3_drawSceneShapeOnPage(ScriptState *script);
int o3_checkInRect(ScriptState *script);
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
index 12ba3c7da5..74a8187278 100644
--- a/engines/kyra/script_v3.cpp
+++ b/engines/kyra/script_v3.cpp
@@ -164,6 +164,15 @@ int KyraEngine_v3::o3_showSceneFileMessage(ScriptState *script) {
return 0;
}
+int KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(%p) ()", (const void *)script);
+ updateCharPal(0);
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+ return 0;
+}
+
int KyraEngine_v3::o3_showBadConscience(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showBadConscience(%p) ()", (const void *)script);
showBadConscience();
@@ -392,6 +401,13 @@ int KyraEngine_v3::o3_removeItemsFromScene(ScriptState *script) {
return retValue;
}
+int KyraEngine_v3::o3_disguiseMalcolm(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_disguiseMalcolm(%p) (%d)", (const void *)script, stackPos(0));
+ loadMalcolmShapes(stackPos(0));
+ updateDlgIndex();
+ return 0;
+}
+
int KyraEngine_v3::o3_drawSceneShape(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_drawSceneShape(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
@@ -1195,7 +1211,7 @@ void KyraEngine_v3::setupOpcodeTable() {
Opcode(o3_dummy);
Opcode(o3_dummy);
// 0x14
- OpcodeUnImpl();
+ Opcode(o3_setCharacterAnimFrameFromFacing);
Opcode(o3_showBadConscience);
Opcode(o3_dummy);
Opcode(o3_hideBadConscience);
@@ -1246,7 +1262,7 @@ void KyraEngine_v3::setupOpcodeTable() {
OpcodeUnImpl();
// 0x3c
Opcode(o3_removeItemsFromScene);
- OpcodeUnImpl();
+ Opcode(o3_disguiseMalcolm);
Opcode(o3_drawSceneShape);
Opcode(o3_drawSceneShapeOnPage);
// 0x40
diff --git a/engines/kyra/text_v3.cpp b/engines/kyra/text_v3.cpp
index 3b8c69177f..640095ff1c 100644
--- a/engines/kyra/text_v3.cpp
+++ b/engines/kyra/text_v3.cpp
@@ -508,6 +508,46 @@ void KyraEngine_v3::setDlgIndex(uint16 index) {
}
}
+void KyraEngine_v3::updateDlgIndex() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::updateDlgIndex()");
+ uint16 dlgIndex = _mainCharacter.dlgIndex;
+
+ if (_curChapter == 1) {
+ static const uint8 dlgIndexMoodNice[] = { 0x0C, 0x0E, 0x10, 0x0F, 0x11 };
+ static const uint8 dlgIndexMoodNormal[] = { 0x00, 0x02, 0x04, 0x03, 0x05 };
+ static const uint8 dlgIndexMoodEvil[] = { 0x06, 0x08, 0x0A, 0x09, 0x0B };
+
+ if (_malcolmsMood == 0)
+ dlgIndex = dlgIndexMoodNice[_malcolmShapes];
+ else if (_malcolmsMood == 1)
+ dlgIndex = dlgIndexMoodNormal[_malcolmShapes];
+ else if (_malcolmsMood == 2)
+ dlgIndex = dlgIndexMoodEvil[_malcolmShapes];
+ } else if (_curChapter == 2) {
+ if (dlgIndex >= 8)
+ dlgIndex -= 4;
+ if (dlgIndex >= 4)
+ dlgIndex -= 4;
+
+ if (_malcolmsMood == 0)
+ dlgIndex += 8;
+ else if (_malcolmsMood == 2)
+ dlgIndex += 4;
+ } else if (_curChapter == 4) {
+ if (dlgIndex >= 10)
+ dlgIndex -= 5;
+ if (dlgIndex >= 5)
+ dlgIndex -= 5;
+
+ if (_malcolmsMood == 0)
+ dlgIndex += 10;
+ else if (_malcolmsMood == 2)
+ dlgIndex += 5;
+ }
+
+ _mainCharacter.dlgIndex = dlgIndex;
+}
+
void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum) {
debugC(9, kDebugLevelMain, "KyraEngine_v3::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum);
bool running = true;