diff options
author | Johannes Schickel | 2008-03-17 23:27:33 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-17 23:27:33 +0000 |
commit | 845d65d8b73e2b7f3edf3fe50ac5b9bc3ce157e6 (patch) | |
tree | b6ae9fd0d06c2c9a57d71e0dfc6f1ccb236e93f0 /engines | |
parent | 1042c6dccf9fd34a80990335420f6ef6dd2d4d1f (diff) | |
download | scummvm-rg350-845d65d8b73e2b7f3edf3fe50ac5b9bc3ce157e6.tar.gz scummvm-rg350-845d65d8b73e2b7f3edf3fe50ac5b9bc3ce157e6.tar.bz2 scummvm-rg350-845d65d8b73e2b7f3edf3fe50ac5b9bc3ce157e6.zip |
Implemented opcode 98: o2_setDeathHandlerFlag
svn-id: r31168
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 2 | ||||
-rw-r--r-- | engines/kyra/saveload_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 8 |
4 files changed, 15 insertions, 5 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index d10e501273..4d8fdde58d 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -130,6 +130,8 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _mainCharacter.dlgIndex = 0; setNewDlgIndex(-1); + _deathHandler = -1; + _bookMaxPage = 6; _bookCurPage = 0; _bookNewPage = 0; @@ -387,7 +389,7 @@ void KyraEngine_v2::runLoop() { _quitFlag = false; while (!_quitFlag) { - //if (_unk1 >= 0) { + //if (_deathHandler >= 0) { // removeHandItem(); // waitTicks(5); // sub_270A0(); @@ -514,7 +516,7 @@ void KyraEngine_v2::handleInput(int x, int y) { } } - //if (_unk1 <= -1) + //if (_deathHandler <= -1) // skipHandling = 1; if (skipHandling) @@ -545,7 +547,7 @@ void KyraEngine_v2::handleInput(int x, int y) { } bool KyraEngine_v2::handleInputUnkSub(int x, int y) { - if (y > 143/* || _unk1 > -1 */|| queryGameFlag(0x164)) + if (y > 143 || _deathHandler > -1 || queryGameFlag(0x164)) return false; if (_handItemSet <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) { diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 884123f26a..559cd038bf 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -744,6 +744,7 @@ protected: int16 x2, y2; }; + int8 _deathHandler; Character _mainCharacter; bool _useCharPal; int _charPalEntry; @@ -1016,6 +1017,7 @@ protected: int o2_blockOutRegion(ScriptState *script); int o2_setCauldronState(ScriptState *script); int o2_getRand(ScriptState *script); + int o2_setDeathHandlerFlag(ScriptState *script); int o2_setDrawNoShapeFlag(ScriptState *script); int o2_showLetter(ScriptState *script); int o2_fillRect(ScriptState *script); diff --git a/engines/kyra/saveload_v2.cpp b/engines/kyra/saveload_v2.cpp index c20a73fc9f..5087db9591 100644 --- a/engines/kyra/saveload_v2.cpp +++ b/engines/kyra/saveload_v2.cpp @@ -139,7 +139,7 @@ void KyraEngine_v2::loadGame(const char *fileName) { bool setFlag1EE = (queryGameFlag(0x1EE) != 0); - //_unk1 = -1; + _deathHandler = -1; if (!_unkSceneScreenFlag1) { _sound->beginFadeOut(); _system->delayMillis(5 * _tickLength); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 7330434ee0..9a2e94fa73 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -739,6 +739,12 @@ int KyraEngine_v2::o2_getRand(ScriptState *script) { return _rnd.getRandomNumberRng(stackPos(0), stackPos(1)); } +int KyraEngine_v2::o2_setDeathHandlerFlag(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0)); + _deathHandler = stackPos(0); + return 0; +} + int KyraEngine_v2::o2_setDrawNoShapeFlag(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDrawNoShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); _drawNoShapeFlag = (stackPos(0) != 0); @@ -1548,7 +1554,7 @@ void KyraEngine_v2::setupOpcodeTable() { // 0x60 Opcode(o2_getRand), OpcodeUnImpl(), - OpcodeUnImpl(), + Opcode(o2_setDeathHandlerFlag), Opcode(o2_setDrawNoShapeFlag), // 0x64 OpcodeUnImpl(), |