aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-02-16 17:32:17 +0000
committerMatthew Hoops2010-02-16 17:32:17 +0000
commit5e24974ad5ba3031867a92b7936b0b3bb112f9d5 (patch)
tree0e31a17d4347e9a1e4e21925bfaf82c1b0ef1419 /engines
parentb54724a778ee9a091d87dd5a5eef8810d248ed57 (diff)
downloadscummvm-rg350-5e24974ad5ba3031867a92b7936b0b3bb112f9d5.tar.gz
scummvm-rg350-5e24974ad5ba3031867a92b7936b0b3bb112f9d5.tar.bz2
scummvm-rg350-5e24974ad5ba3031867a92b7936b0b3bb112f9d5.zip
Implement xpisland990_elevcombo which allows you to free Catherine.
svn-id: r48072
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/riven_external.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index edabc10946..964fda5ba3 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -1201,10 +1201,29 @@ void RivenExternal::xgwatch(uint16 argc, uint16 *argv) {
// pspit (Prison Island) external commands
// ------------------------------------------------------------------------------------
-// Yeah, none of these are done yet :P
+static uint16 getComboDigit(uint32 correctCombo, uint32 digitsCorrect) {
+ static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 };
+ return (correctCombo % powers[digitsCorrect]) / powers[digitsCorrect + 1];
+}
void RivenExternal::xpisland990_elevcombo(uint16 argc, uint16 *argv) {
- // TODO: Elevator combo check
+ // Play button sound based on argv[0]
+ _vm->_sound->playSound(argv[0] + 5, false);
+
+ // 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->matchVarToString("agehn") != 4)
+ return;
+
+ uint32 *correctDigits = _vm->matchVarToString("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 (argv[0] == getComboDigit(*_vm->matchVarToString("pcorrectorder"), *correctDigits))
+ *correctDigits += 1;
+ else
+ *correctDigits = 0;
}
void RivenExternal::xpscpbtn(uint16 argc, uint16 *argv) {