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
This commit is contained in:
David Turner 2011-01-09 18:12:30 +00:00
parent cd6d818ca3
commit d54fa49b5f
3 changed files with 26 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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 {