aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorDavid Turner2010-12-21 01:09:14 +0000
committerDavid Turner2010-12-21 01:09:14 +0000
commit3d3f7b09b2d92074fb970e3102193b3d4bcff571 (patch)
treed21dc2a4146160d496cf2031a72f4daa9a6f0a42 /engines/mohawk/myst_stacks
parent5f6dfb2b6797592c965ceaa01eabe8b8a24f5e53 (diff)
downloadscummvm-rg350-3d3f7b09b2d92074fb970e3102193b3d4bcff571.tar.gz
scummvm-rg350-3d3f7b09b2d92074fb970e3102193b3d4bcff571.tar.bz2
scummvm-rg350-3d3f7b09b2d92074fb970e3102193b3d4bcff571.zip
MOHAWK: Add Framework of getVar(), setVar() and toggleVar() to Myst Stoneship Script Parser.
svn-id: r54982
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/stoneship.cpp85
-rw-r--r--engines/mohawk/myst_stacks/stoneship.h3
2 files changed, 88 insertions, 0 deletions
diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp
index 0dcfccd66d..71db317f87 100644
--- a/engines/mohawk/myst_stacks/stoneship.cpp
+++ b/engines/mohawk/myst_stacks/stoneship.cpp
@@ -26,6 +26,7 @@
#include "mohawk/myst.h"
#include "mohawk/graphics.h"
#include "mohawk/myst_areas.h"
+#include "mohawk/myst_saveload.h"
#include "mohawk/sound.h"
#include "mohawk/video.h"
#include "mohawk/myst_stacks/stoneship.h"
@@ -90,6 +91,90 @@ void MystScriptParser_Stoneship::runPersistentScripts() {
opcode_209_run();
}
+uint16 MystScriptParser_Stoneship::getVar(uint16 var) {
+ MystVariables::Globals &globals = _vm->_saveLoad->_v->globals;
+ MystVariables::Stoneship &stoneship = _vm->_saveLoad->_v->stoneship;
+
+ switch(var) {
+//case 0: // Water Drained From Lighthouse / Right Button Of Pump
+// return 0; // Water Present / Button Dark
+// return 1; // Water Drained / Button Lit & Released
+// return 2; // Button Lit & Depressed
+//case 1: // Water Drained From Tunnels To Brothers' Rooms / Middle Button Of Pump
+// return 0; // Water Present / Button Dark
+// return 1; // Water Drained / Button Lit & Released
+// return 2; // Button Lit & Depressed
+//case 2: // Water Drained From Ship Cabin Tunnel / Left Button Of Pump
+// return 0; // Water Present / Button Dark
+// return 1; // Water Drained / Button Lit & Released
+// return 2; // Button Lit & Depressed
+//case 3: // Lighthouse Chest Floating(?)
+// return 0;
+// return 1;
+//case 4: // Lighthouse State - Close Up
+// return 0; // Flooded
+// return 1; // Drained
+// return 2; // Flooded, Chest Floating
+//case 5: // Lighthouse Trapdoor State
+// return 0; // Closed, No Lock
+// return 1; // Open
+// return 2; // Closed, Lock
+//case 7:
+// return;
+//case 11:
+// return;
+//case 12:
+// return;
+//case 13: // State Of Tunnels To Brothers' Rooms - Close Up
+// return 0; Dark, Flooded
+// return 1; Dark, Drained
+// return 2; Lit, Flooded
+// return 3; Lit, Drained
+//case 14: // State Of Tunnels To Brothers' Rooms - Far
+// return 0; // Lights Off
+// return 1; // Lights On
+// return 2; // Lights Off
+//case 16: // Ship Chamber Light State
+// return 0; // Off
+// return 1; // On
+//case 20: // Ship Chamber Table/Book State
+// return 0;
+// return 1;
+//case 28: // Telescope Angle Position
+// return;
+//case 36: // Ship Chamber Door State
+// return 0; // Closed
+// return 1; // Open, Light Off
+// return 2; // Open, Light On
+ default:
+ return MystScriptParser::getVar(var);
+ }
+}
+
+void MystScriptParser_Stoneship::toggleVar(uint16 var) {
+ MystVariables::Globals &globals = _vm->_saveLoad->_v->globals;
+ MystVariables::Stoneship &stoneship = _vm->_saveLoad->_v->stoneship;
+
+ switch(var) {
+ default:
+ MystScriptParser::toggleVar(var);
+ break;
+ }
+}
+
+bool MystScriptParser_Stoneship::setVarValue(uint16 var, uint16 value) {
+ MystVariables::Stoneship &stoneship = _vm->_saveLoad->_v->stoneship;
+ bool refresh = false;
+
+ switch (var) {
+ default:
+ refresh = MystScriptParser::setVarValue(var, value);
+ break;
+ }
+
+ return refresh;
+}
+
void MystScriptParser_Stoneship::opcode_100(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
// Used for Cards 2185 (Water Pump)
varUnusedCheck(op, var);
diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h
index c01ee01a86..a0c7151bc1 100644
--- a/engines/mohawk/myst_stacks/stoneship.h
+++ b/engines/mohawk/myst_stacks/stoneship.h
@@ -47,6 +47,9 @@ public:
private:
void setupOpcodes();
+ uint16 getVar(uint16 var);
+ void toggleVar(uint16 var);
+ bool setVarValue(uint16 var, uint16 value);
void opcode_200_run();
void opcode_200_disable();