From d54fa49b5f01e624f11a057b80e150b2fcad97c3 Mon Sep 17 00:00:00 2001 From: David Turner Date: Sun, 9 Jan 2011 18:12:30 +0000 Subject: [PATCH] CINE: Add console command "labyrinthCheat" to help with Operation Stealth Playtesting. This command activates a cheat for the Operation Stealth Scene 6 arcade section i.e. Chased by Guards in Labyrinths in Otto's Mansion. These puzzles are quite hard and thus discourage playtesting beyond this point, especially since it is not possible to save (This may be a bug compared to the original interpreter). Also, added extra debug output to aid script debug output. svn-id: r55189 --- engines/cine/console.cpp | 12 ++++++++++++ engines/cine/console.h | 4 ++++ engines/cine/script_fw.cpp | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp index 9a006bf25ef..dbbeb4c9b76 100644 --- a/engines/cine/console.cpp +++ b/engines/cine/console.cpp @@ -28,10 +28,22 @@ namespace Cine { +bool labyrinthCheat; + CineConsole::CineConsole(CineEngine *vm) : GUI::Debugger(), _vm(vm) { + DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat)); + + labyrinthCheat = false; } CineConsole::~CineConsole() { } +// Activate Cheat during Scene 6 Labyrinth chased by Guards in Otto's Mansion +// This puzzle is hard, especially without save/load so this will aid playtesting. +bool CineConsole::Cmd_LabyrinthCheat(int argc, const char **argv) { + labyrinthCheat = true; + return true; +} + } // End of namespace Cine diff --git a/engines/cine/console.h b/engines/cine/console.h index 2f24b3be466..92d059cb637 100644 --- a/engines/cine/console.h +++ b/engines/cine/console.h @@ -30,6 +30,8 @@ namespace Cine { +extern bool labyrinthCheat; + class CineEngine; class CineConsole : public GUI::Debugger { @@ -39,6 +41,8 @@ public: private: CineEngine *_vm; + + bool Cmd_LabyrinthCheat(int argc, const char **argv); }; } // End of namespace Cine diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index 3574a1b73a5..d403b0dc3a6 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -35,6 +35,7 @@ #include "cine/sound.h" #include "cine/various.h" #include "cine/script.h" +#include "cine/console.h" namespace Cine { @@ -1333,6 +1334,13 @@ int FWScript::o1_startGlobalScript() { assert(param < NUM_MAX_SCRIPT); debugC(5, kCineDebugScript, "Line: %d: startScript(%d)", _line, param); + + // Cheat for Scene 6 Labyrinth Arcade Game to disable John's Death (to aid playtesting) + if (g_cine->getGameType() == Cine::GType_OS && labyrinthCheat && scumm_stricmp(currentPrcName, "LABY.PRC") == 0 && param == 46) { + warning("LABY.PRC startScript(46) Disabled. CHEAT!"); + return 0; + } + addScriptToGlobalScripts(param); return 0; } @@ -1971,6 +1979,7 @@ uint16 compareVars(int16 a, int16 b) { void executeObjectScripts() { ScriptList::iterator it = g_cine->_objectScripts.begin(); for (; it != g_cine->_objectScripts.end();) { + debugC(5, kCineDebugScript, "executeObjectScripts() Executing Object Index: %d", (*it)->_index); if ((*it)->_index < 0 || (*it)->execute() < 0) { it = g_cine->_objectScripts.erase(it); } else { @@ -1982,6 +1991,7 @@ void executeObjectScripts() { void executeGlobalScripts() { ScriptList::iterator it = g_cine->_globalScripts.begin(); for (; it != g_cine->_globalScripts.end();) { + debugC(5, kCineDebugScript, "executeGlobalScripts() Executing Object Index: %d", (*it)->_index); if ((*it)->_index < 0 || (*it)->execute() < 0) { it = g_cine->_globalScripts.erase(it); } else {