aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-29 21:35:25 -0400
committerPaul Gilbert2018-03-29 21:35:25 -0400
commit60fdd3d5f2918c2b48e8f3143020d0f770f47dea (patch)
treed9424d46c60b088763ea703ce201ffbec5443f8d /engines
parent09f67c83ceeb34e4560a758e207e053aef0b7f35 (diff)
downloadscummvm-rg350-60fdd3d5f2918c2b48e8f3143020d0f770f47dea.tar.gz
scummvm-rg350-60fdd3d5f2918c2b48e8f3143020d0f770f47dea.tar.bz2
scummvm-rg350-60fdd3d5f2918c2b48e8f3143020d0f770f47dea.zip
XEEN: Added intangible debugger command
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/debugger.cpp11
-rw-r--r--engines/xeen/debugger.h6
-rw-r--r--engines/xeen/interface.cpp4
3 files changed, 18 insertions, 3 deletions
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;