diff options
author | Bastien Bouclet | 2011-02-12 20:12:32 +0100 |
---|---|---|
committer | Bastien Bouclet | 2011-02-12 20:12:32 +0100 |
commit | d11b57e60935c1799b07445caf817c871391f2cf (patch) | |
tree | cbcb4a3a045d673c47abc08ef511275c5e5a0e1c /engines/mohawk/myst_stacks | |
parent | f2e5b126cf1b64e547998606cc0d24bc55085f5e (diff) | |
download | scummvm-rg350-d11b57e60935c1799b07445caf817c871391f2cf.tar.gz scummvm-rg350-d11b57e60935c1799b07445caf817c871391f2cf.tar.bz2 scummvm-rg350-d11b57e60935c1799b07445caf817c871391f2cf.zip |
MOHAWK: Implement Mechanical var getters 4 and 15
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.cpp | 25 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.h | 2 |
2 files changed, 17 insertions, 10 deletions
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index 96b9883ca4..cffcf67cf8 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -38,6 +38,8 @@ namespace Mohawk { MystScriptParser_Mechanical::MystScriptParser_Mechanical(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(vm->_gameState->_mechanical) { setupOpcodes(); + + _mystStaircaseState = false; } MystScriptParser_Mechanical::~MystScriptParser_Mechanical() { @@ -102,16 +104,15 @@ void MystScriptParser_Mechanical::runPersistentScripts() { uint16 MystScriptParser_Mechanical::getVar(uint16 var) { switch(var) { - case 0: // Sirrus's Secret Panel State + case 0: // Sirrus's Secret Panel State2 return _state.sirrusPanelState; case 1: // Achenar's Secret Panel State return _state.achenarPanelState; // case 3: // Sirrus's Secret Room Crate State // return 0; // return 1; -// case 4: // Myst Book Room Staircase State -// return 0; // Staircase Up -// return 1; // Staircase Down + case 4: // Myst Book Room Staircase State + return _mystStaircaseState; // case 5: // Fortress Position // return 0; // Island with Code Lock // return 1; // Island with Last Two Symbols of Code @@ -136,10 +137,14 @@ uint16 MystScriptParser_Mechanical::getVar(uint16 var) { // return 3; // return 4; // return 5; -// case 15: // Code Lock Execute Button State(?) -// return 0; -// return 1; -// return 2; + case 15: // Code Lock Execute Button Script + if (_mystStaircaseState) + return 0; + else if (_state.codeShape[0] == 2 && _state.codeShape[1] == 8 + && _state.codeShape[2] == 5 && _state.codeShape[3] == 1) + return 1; + else + return 2; case 16: // Code Lock Shape #1 - Left case 17: // Code Lock Shape #2 case 18: // Code Lock Shape #3 @@ -171,8 +176,8 @@ void MystScriptParser_Mechanical::toggleVar(uint16 var) { switch(var) { // case 3: // Sirrus's Secret Room Crate State // temp ^= 1; -// case 4: // Code Lock Puzzle Correct / Myst Book Room Staircase State -// temp ^= 1; + case 4: // Myst Book Room Staircase State + _mystStaircaseState ^= 1; case 10: // Fortress Staircase State _state.staircaseState ^= 1; case 16: // Code Lock Shape #1 - Left diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 6ea1bc6fd7..8af5c5ed98 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -95,6 +95,8 @@ private: DECLARE_OPCODE(opcode_300); MystGameState::Mechanical &_state; + + bool _mystStaircaseState; // 76 }; } // End of namespace Mohawk |