Skip to content

Commit

Permalink
ACCESS: Add a cheat mode which currently skips the guard in chapter 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent b864b84 commit 3cf0893
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions engines/access/access.cpp
Expand Up @@ -88,6 +88,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_sndSubFile = 0;
_loadSaveSlot = -1;
_vidX = _vidY = 0;
_cheatFl = false;
}

AccessEngine::~AccessEngine() {
Expand Down
2 changes: 1 addition & 1 deletion engines/access/access.h
Expand Up @@ -207,7 +207,7 @@ class AccessEngine : public Engine {
int _flags[256];

bool _clearSummaryFlag;

bool _cheatFl;
// Fields mapped into the flags array
int &_useItem;
int &_startup;
Expand Down
5 changes: 5 additions & 0 deletions engines/access/amazon/amazon_logic.cpp
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions engines/access/debugger.cpp
Expand Up @@ -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:
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions engines/access/debugger.h
Expand Up @@ -37,6 +37,7 @@ class Debugger : public GUI::Debugger {
AccessEngine *_vm;

bool Cmd_LoadScene(int argc, const char **argv);
bool Cmd_Cheat(int argc, const char **argv);
Common::String *_sceneDescr;
int _sceneNumb;
public:
Expand Down

0 comments on commit 3cf0893

Please sign in to comment.