aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/access.cpp1
-rw-r--r--engines/access/access.h2
-rw-r--r--engines/access/amazon/amazon_logic.cpp5
-rw-r--r--engines/access/debugger.cpp13
-rw-r--r--engines/access/debugger.h1
5 files changed, 21 insertions, 1 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index a09e47c733..428c4c603a 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -88,6 +88,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_sndSubFile = 0;
_loadSaveSlot = -1;
_vidX = _vidY = 0;
+ _cheatFl = false;
}
AccessEngine::~AccessEngine() {
diff --git a/engines/access/access.h b/engines/access/access.h
index 2fe4b726a2..2fdf26318e 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -207,7 +207,7 @@ public:
int _flags[256];
bool _clearSummaryFlag;
-
+ bool _cheatFl;
// Fields mapped into the flags array
int &_useItem;
int &_startup;
diff --git a/engines/access/amazon/amazon_logic.cpp b/engines/access/amazon/amazon_logic.cpp
index c9e8886d08..c1df5353a2 100644
--- a/engines/access/amazon/amazon_logic.cpp
+++ b/engines/access/amazon/amazon_logic.cpp
@@ -1168,6 +1168,11 @@ void Guard::setGuardFrame() {
}
void Guard::doGuard() {
+ // Skip the code dealing with the guard on the boat (chapter 8)
+ // if the cheat mode is activated
+ if (_vm->_cheatFl)
+ return;
+
if (_vm->_timers[8]._flag) {
setGuardFrame();
return;
diff --git a/engines/access/debugger.cpp b/engines/access/debugger.cpp
index 6b49fb0e67..1f8100452b 100644
--- a/engines/access/debugger.cpp
+++ b/engines/access/debugger.cpp
@@ -57,6 +57,7 @@ Debugger *Debugger::init(AccessEngine *vm) {
Debugger::Debugger(AccessEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
registerCmd("scene", WRAP_METHOD(Debugger, Cmd_LoadScene));
+ registerCmd("cheat", WRAP_METHOD(Debugger, Cmd_Cheat));
switch (vm->getGameID()) {
case GType_Amazon:
@@ -120,6 +121,18 @@ bool Debugger::Cmd_LoadScene(int argc, const char **argv) {
}
}
+bool Debugger::Cmd_Cheat(int argc, const char **argv) {
+ if (argc != 1) {
+ debugPrintf("Usage: %s\n", argv[0]);
+ debugPrintf("Switches on/off the cheat mode\n");
+ return true;
+ }
+
+ _vm->_cheatFl = !_vm->_cheatFl;
+ debugPrintf("Cheat is now %s\n", _vm->_cheatFl ? "ON" : "OFF");
+ return true;
+}
+
/*------------------------------------------------------------------------*/
namespace Amazon {
diff --git a/engines/access/debugger.h b/engines/access/debugger.h
index 839d13106e..6bd23740cd 100644
--- a/engines/access/debugger.h
+++ b/engines/access/debugger.h
@@ -37,6 +37,7 @@ protected:
AccessEngine *_vm;
bool Cmd_LoadScene(int argc, const char **argv);
+ bool Cmd_Cheat(int argc, const char **argv);
Common::String *_sceneDescr;
int _sceneNumb;
public: