diff options
author | Bastien Bouclet | 2016-11-01 19:19:26 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
commit | 14bbf8aab4ed187ec1e6da9e61a1acf6601d0332 (patch) | |
tree | 05d0ca49831dc96351a95da6347559e5f5909bac /engines/mohawk/riven_stacks/pspit.cpp | |
parent | e2c5609e81d3a54e0d3c63427288f3c261b86ade (diff) | |
download | scummvm-rg350-14bbf8aab4ed187ec1e6da9e61a1acf6601d0332.tar.gz scummvm-rg350-14bbf8aab4ed187ec1e6da9e61a1acf6601d0332.tar.bz2 scummvm-rg350-14bbf8aab4ed187ec1e6da9e61a1acf6601d0332.zip |
MOHAWK: Move the external commands to their respective stacks
Diffstat (limited to 'engines/mohawk/riven_stacks/pspit.cpp')
-rw-r--r-- | engines/mohawk/riven_stacks/pspit.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/engines/mohawk/riven_stacks/pspit.cpp b/engines/mohawk/riven_stacks/pspit.cpp index c6b1b97ec7..ae10bd0211 100644 --- a/engines/mohawk/riven_stacks/pspit.cpp +++ b/engines/mohawk/riven_stacks/pspit.cpp @@ -22,7 +22,8 @@ #include "mohawk/riven_stacks/pspit.h" -#include "engines/mohawk/riven.h" +#include "mohawk/riven.h" +#include "mohawk/riven_sound.h" namespace Mohawk { namespace RivenStacks { @@ -30,6 +31,57 @@ namespace RivenStacks { PSpit::PSpit(MohawkEngine_Riven *vm) : DomeSpit(vm, kStackPspit) { + REGISTER_COMMAND(PSpit, xpisland990_elevcombo); + REGISTER_COMMAND(PSpit, xpscpbtn); + REGISTER_COMMAND(PSpit, xpisland290_domecheck); + REGISTER_COMMAND(PSpit, xpisland25_opencard); + REGISTER_COMMAND(PSpit, xpisland25_resetsliders); + REGISTER_COMMAND(PSpit, xpisland25_slidermd); + REGISTER_COMMAND(PSpit, xpisland25_slidermw); +} + +void PSpit::xpisland990_elevcombo(uint16 argc, uint16 *argv) { + // Play button sound based on argv[0] + _vm->_sound->playSound(argv[0] + 5); + + // It is impossible to get here if Gehn is not trapped. However, + // the original also disallows brute forcing the ending if you have + // not yet trapped Gehn. + if (_vm->_vars["agehn"] != 4) + return; + + uint32 &correctDigits = _vm->_vars["pelevcombo"]; + + // pelevcombo keeps count of how many buttons we have pressed in the correct order. + // When pelevcombo is 5, clicking the handle will show the video freeing Catherine. + if (correctDigits < 5 && argv[0] == getComboDigit(_vm->_vars["pcorrectorder"], correctDigits)) + correctDigits++; + else + correctDigits = 0; +} + +void PSpit::xpscpbtn(uint16 argc, uint16 *argv) { + runDomeButtonMovie(); +} + +void PSpit::xpisland290_domecheck(uint16 argc, uint16 *argv) { + runDomeCheck(); +} + +void PSpit::xpisland25_opencard(uint16 argc, uint16 *argv) { + checkDomeSliders(); +} + +void PSpit::xpisland25_resetsliders(uint16 argc, uint16 *argv) { + resetDomeSliders(10, 14); +} + +void PSpit::xpisland25_slidermd(uint16 argc, uint16 *argv) { + dragDomeSlider(10, 14); +} + +void PSpit::xpisland25_slidermw(uint16 argc, uint16 *argv) { + checkSliderCursorChange(14); } } // End of namespace RivenStacks |