diff options
author | Matthew Hoops | 2011-01-18 14:51:03 +0000 |
---|---|---|
committer | Matthew Hoops | 2011-01-18 14:51:03 +0000 |
commit | 5da1718beb7bdc1b034e12739be783873fd133df (patch) | |
tree | 199eb45e7ca8937ac46e875fed9ae64d8220837e | |
parent | 245b7337f8720db022acdab0bb15e5b99ad313ad (diff) | |
download | scummvm-rg350-5da1718beb7bdc1b034e12739be783873fd133df.tar.gz scummvm-rg350-5da1718beb7bdc1b034e12739be783873fd133df.tar.bz2 scummvm-rg350-5da1718beb7bdc1b034e12739be783873fd133df.zip |
MOHAWK: Implement the whark response to the red light
svn-id: r55300
-rw-r--r-- | engines/mohawk/riven_external.cpp | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index 91bb0b1d4b..78b1eb25ea 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -1268,7 +1268,48 @@ void RivenExternal::xgrviewer(uint16 argc, uint16 *argv) { } void RivenExternal::xgplaywhark(uint16 argc, uint16 *argv) { - // TODO: Whark response to using the lights + // The whark response to using the lights + + // If we've gotten a visit already since we turned out the light, bail out + uint32 *wharkState = _vm->getVar("gwharktime"); + + if (*wharkState != 1) + return; + + *wharkState = 0; + + // Increase the amount of times the whark has visited + uint32 *wharkVisits = _vm->getVar("gwhark"); + *wharkVisits += 1; + + // If we're at 5 or more, the whark will no longer visit us :( + if (*wharkVisits >= 5) { + *wharkVisits = 5; + return; + } + + // Activate the correct video based on the amount of times we've been visited + switch (*wharkVisits) { + case 1: + _vm->_video->activateMLST(3, _vm->getCurCard()); + break; + case 2: + // One of two random videos + _vm->_video->activateMLST(4 + _vm->_rnd->getRandomBit(), _vm->getCurCard()); + break; + case 3: + // One of two random videos + _vm->_video->activateMLST(6 + _vm->_rnd->getRandomBit(), _vm->getCurCard()); + break; + case 4: + // Red alert! Shields online! Brace yourself for impact! + _vm->_video->activateMLST(8, _vm->getCurCard()); + break; + } + + // For whatever reason the devs felt fit, code 31 is used for all of the videos + _vm->_video->playMovieBlocking(31); + _vm->refreshCard(); } void RivenExternal::xgwharksnd(uint16 argc, uint16 *argv) { @@ -1306,7 +1347,7 @@ void RivenExternal::xglview_villageon(uint16 argc, uint16 *argv) { } void RivenExternal::xglview_villageoff(uint16 argc, uint16 *argv) { - // Turn off the left viewer when in 'village mode' + // Turn off the left viewer when in 'village mode' (why is this external?) *_vm->getVar("glview") = 0; _vm->_gfx->drawPLST(1); _vm->_gfx->updateScreen(); |