diff options
author | Bastien Bouclet | 2010-12-01 20:37:36 +0000 |
---|---|---|
committer | Bastien Bouclet | 2010-12-01 20:37:36 +0000 |
commit | f3bda71376137b1cf06f58fcdabd170d76aa5c35 (patch) | |
tree | f145d3dca3a17e7358e78801dade4fc44106c9f0 /engines/mohawk/myst_stacks/selenitic.cpp | |
parent | 250d5d81f7d98f4aec05b6ffd8496ab2d002f124 (diff) | |
download | scummvm-rg350-f3bda71376137b1cf06f58fcdabd170d76aa5c35.tar.gz scummvm-rg350-f3bda71376137b1cf06f58fcdabd170d76aa5c35.tar.bz2 scummvm-rg350-f3bda71376137b1cf06f58fcdabd170d76aa5c35.zip |
MOHAWK: Implement maze runner backtrack button. Last part of Selenitic completed !
svn-id: r54720
Diffstat (limited to 'engines/mohawk/myst_stacks/selenitic.cpp')
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 74c12f243c..248a9ff585 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -302,6 +302,9 @@ void MystScriptParser_Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, uint16 if (videoToNext) { _mazeRunnerCompass->drawConditionalDataToScreen(8); + if (move == 3) + mazeRunnerBacktrack(oldPosition); + mazeRunnerPlayVideo(videoToNext, oldPosition); mazeRunnerUpdateCompass(); @@ -310,6 +313,68 @@ void MystScriptParser_Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, uint16 } } +void MystScriptParser_Selenitic::mazeRunnerBacktrack(uint16 &oldPosition) { + if (oldPosition == 289) + _mazeRunnerDirection = 3; + + uint16 targetDirection = _mazeRunnerPosition % 8; + + if (_mazeRunnerPosition == 289) { + targetDirection = 3; + } else if (_mazeRunnerPosition == 288) { + targetDirection = 0; + } else if (_mazeRunnerPosition == 252) { + targetDirection = 6; + } else if (_mazeRunnerPosition == 212) { + targetDirection = 2; + } else if (_mazeRunnerPosition == 171) { + targetDirection = 7; + } else if (_mazeRunnerPosition == 150) { + targetDirection = 4; + } else if (_mazeRunnerPosition == 116) { + targetDirection = 2; + } + + uint16 moves = 0; + if (targetDirection >= _mazeRunnerDirection) { + moves = targetDirection - _mazeRunnerDirection; + } else { + moves = targetDirection + 8 - _mazeRunnerDirection; + } + + bool goLeft = false; + if (moves > 4) + goLeft = true; + + while (targetDirection != _mazeRunnerDirection) { + _mazeRunnerCompass->drawConditionalDataToScreen(8); + if (goLeft) { + _mazeRunnerLeftButton->drawConditionalDataToScreen(2); + + uint16 video = _mazeRunnerVideos[oldPosition][1]; + oldPosition = _mazeRunnerMap[oldPosition][1]; + _mazeRunnerDirection = (_mazeRunnerDirection + 7) % 8; + + mazeRunnerPlayVideo(video, oldPosition); + + _mazeRunnerLeftButton->drawConditionalDataToScreen(1); + } else { + _mazeRunnerRightButton->drawConditionalDataToScreen(2); + + uint16 video = _mazeRunnerVideos[oldPosition][2]; + oldPosition = _mazeRunnerMap[oldPosition][2]; + _mazeRunnerDirection = (_mazeRunnerDirection + 1) % 8; + + mazeRunnerPlayVideo(video, oldPosition); + + _mazeRunnerRightButton->drawConditionalDataToScreen(1); + } + _mazeRunnerCompass->drawConditionalDataToScreen(_mazeRunnerDirection); + _vm->_system->delayMillis(150); + } + +} + void MystScriptParser_Selenitic::mazeRunnerPlayVideo(uint16 video, uint16 pos) { Common::String file; |