aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorathrxx2013-04-22 20:29:17 +0200
committerathrxx2013-04-22 21:23:23 +0200
commitcdff19324cbd91f0b08cd565486a607fea877cf0 (patch)
tree8767baff0d95887859e083db03cba3727ca2817f /engines/kyra
parent6434258722020972198bbb063a032b29e309d132 (diff)
downloadscummvm-rg350-cdff19324cbd91f0b08cd565486a607fea877cf0.tar.gz
scummvm-rg350-cdff19324cbd91f0b08cd565486a607fea877cf0.tar.bz2
scummvm-rg350-cdff19324cbd91f0b08cd565486a607fea877cf0.zip
KYRA: (EOB) - add debugger functions
(open_door, close_door)
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/debugger.cpp33
-rw-r--r--engines/kyra/debugger.h2
2 files changed, 34 insertions, 1 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 0a9ec25b8e..702707e649 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -487,7 +487,8 @@ void Debugger_EoB::initialize() {
DCmd_Register("list_monsters", WRAP_METHOD(Debugger_EoB, cmd_listMonsters));
DCmd_Register("show_position", WRAP_METHOD(Debugger_EoB, cmd_showPosition));
DCmd_Register("set_position", WRAP_METHOD(Debugger_EoB, cmd_setPosition));
-
+ DCmd_Register("open_door", WRAP_METHOD(Debugger_EoB, cmd_openDoor));
+ DCmd_Register("close_door", WRAP_METHOD(Debugger_EoB, cmd_closeDoor));
}
bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
@@ -618,6 +619,36 @@ bool Debugger_EoB::cmd_setPosition(int argc, const char **argv) {
return true;
}
+bool Debugger_EoB::cmd_openDoor(int, const char **) {
+ DebugPrintf("Warning: Using this command may cause glitches.\n");
+ uint16 block = _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection);
+ int c = (_vm->_wllWallFlags[_vm->_levelBlockProperties[block].walls[0]] & 8) ? 0 : 1;
+ int v = _vm->_levelBlockProperties[block].walls[c];
+ int flg = (_vm->_flags.gameID == GI_EOB1) ? 1 : 0x10;
+ if (_vm->_wllWallFlags[v] & flg) {
+ DebugPrintf("Couldn't open any door. Make sure you're facing the door you wish to open and standing right in front of it.\n\n");
+ } else {
+ _vm->openDoor(block);
+ DebugPrintf("Trying to open door at block %d.\n\n", block);
+ }
+ return true;
+}
+
+bool Debugger_EoB::cmd_closeDoor(int, const char **) {
+ DebugPrintf("Warning: Using this command may cause glitches.\n");
+ uint16 block = _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection);
+ int c = (_vm->_wllWallFlags[_vm->_levelBlockProperties[block].walls[0]] & 8) ? 0 : 1;
+ int v = _vm->_levelBlockProperties[block].walls[c];
+ int flg = (_vm->_flags.gameID == GI_EOB1) ? 1 : 0x10;
+ if ((_vm->_flags.gameID == GI_EOB1 && !(_vm->_wllWallFlags[v] & 1)) || (_vm->_flags.gameID == GI_EOB2 && (_vm->_wllWallFlags[v] & 0x20))) {
+ DebugPrintf("Couldn't close any door. Make sure you're facing the door you wish to open and standing right in front of it.\n\n");
+ } else {
+ _vm->closeDoor(block);
+ DebugPrintf("Trying to close door at block %d.\n\n", block);
+ }
+ return true;
+}
+
#endif // ENABLE_EOB
} // End of namespace Kyra
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index 14326708dc..76264ec8e2 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -124,6 +124,8 @@ protected:
bool cmd_listMonsters(int argc, const char **argv);
bool cmd_showPosition(int argc, const char **argv);
bool cmd_setPosition(int argc, const char **argv);
+ bool cmd_openDoor(int argc, const char **argv);
+ bool cmd_closeDoor(int argc, const char **argv);
};
#endif // ENABLE_EOB