[Scummvm-cvs-logs] SF.net SVN: scummvm:[48072] scummvm/trunk/engines/mohawk/riven_external.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Tue Feb 16 18:32:18 CET 2010


Revision: 48072
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48072&view=rev
Author:   mthreepwood
Date:     2010-02-16 17:32:17 +0000 (Tue, 16 Feb 2010)

Log Message:
-----------
Implement xpisland990_elevcombo which allows you to free Catherine.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/riven_external.cpp

Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp	2010-02-16 06:08:25 UTC (rev 48071)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp	2010-02-16 17:32:17 UTC (rev 48072)
@@ -1201,10 +1201,29 @@
 // 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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list