From 60fdd3d5f2918c2b48e8f3143020d0f770f47dea Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 29 Mar 2018 21:35:25 -0400 Subject: XEEN: Added intangible debugger command --- engines/xeen/debugger.cpp | 11 ++++++++--- engines/xeen/debugger.h | 6 ++++++ engines/xeen/interface.cpp | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp index fed030780c..978baf1715 100644 --- a/engines/xeen/debugger.cpp +++ b/engines/xeen/debugger.cpp @@ -45,7 +45,7 @@ static int strToInt(const char *s) { /*------------------------------------------------------------------------*/ Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm), - _invincible(false) { + _spellId(-1), _invincible(false), _intangible(false) { registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell)); registerCmd("spells", WRAP_METHOD(Debugger, cmdSpells)); @@ -55,8 +55,7 @@ Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm), registerCmd("map", WRAP_METHOD(Debugger, cmdMap)); registerCmd("pos", WRAP_METHOD(Debugger, cmdPos)); registerCmd("invincible", WRAP_METHOD(Debugger, cmdInvincible)); - - _spellId = -1; + registerCmd("intangible", WRAP_METHOD(Debugger, cmdIntangible)); } void Debugger::update() { @@ -201,4 +200,10 @@ bool Debugger::cmdInvincible(int argc, const char **argv) { return true; } +bool Debugger::cmdIntangible(int argc, const char **argv) { + _intangible = (argc < 2) || strcmp(argv[1], "off"); + debugPrintf("Intangibility is %s\n", _intangible ? "on" : "off"); + return true; +} + } // End of namespace Xeen diff --git a/engines/xeen/debugger.h b/engines/xeen/debugger.h index b7e1f1c325..c459dc1bfa 100644 --- a/engines/xeen/debugger.h +++ b/engines/xeen/debugger.h @@ -74,8 +74,14 @@ private: * Flags whether to make the party invincible */ bool cmdInvincible(int argc, const char **argv); + + /** + * Flags whether to make the party invincible + */ + bool cmdIntangible(int argc, const char **argv); public: bool _invincible; + bool _intangible; public: Debugger(XeenEngine *vm); diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 9d195f7881..de343feb15 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -895,6 +895,7 @@ void Interface::startFalling(bool flag) { } bool Interface::checkMoveDirection(int key) { + Debugger &debugger = *g_vm->_debugger; Map &map = *_vm->_map; Party &party = *_vm->_party; Sound &sound = *_vm->_sound; @@ -920,6 +921,9 @@ bool Interface::checkMoveDirection(int key) { int startSurfaceId = map._currentSurfaceId; int surfaceId; + if (debugger._intangible) + return true; + if (map._isOutdoors) { party._mazeDirection = dir; -- cgit v1.2.3