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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Tue Jan 18 15:51:04 CET 2011


Revision: 55300
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55300&view=rev
Author:   mthreepwood
Date:     2011-01-18 14:51:03 +0000 (Tue, 18 Jan 2011)

Log Message:
-----------
MOHAWK: Implement the whark response to the red light

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

Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp	2011-01-18 14:26:26 UTC (rev 55299)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp	2011-01-18 14:51:03 UTC (rev 55300)
@@ -1268,7 +1268,48 @@
 }
 
 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_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();


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