diff options
Diffstat (limited to 'engines/xeen/debugger.cpp')
-rw-r--r-- | engines/xeen/debugger.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp index 42f61b02b5..7d8f170129 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), _superStrength(false) { registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell)); registerCmd("spells", WRAP_METHOD(Debugger, cmdSpells)); @@ -55,8 +55,8 @@ 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("strength", WRAP_METHOD(Debugger, cmdSuperStrength)); + registerCmd("intangible", WRAP_METHOD(Debugger, cmdIntangible)); } void Debugger::update() { @@ -95,7 +95,7 @@ bool Debugger::cmdSpells(int argc, const char **argv) { for (uint charIdx = 0; charIdx < party._activeParty.size(); ++charIdx) { Character &c = party._activeParty[charIdx]; - Common::fill(c._spells, c._spells + MAX_SPELLS_PER_CLASS, true); + Common::fill(c._spells, c._spells + SPELLS_PER_CLASS, true); c._currentSp = 9999; } @@ -160,20 +160,19 @@ bool Debugger::cmdGems(int argc, const char **argv) { } bool Debugger::cmdMap(int argc, const char **argv) { - FileManager &files = *g_vm->_files; Map &map = *g_vm->_map; Party &party = *g_vm->_party; if (argc < 2) { - debugPrintf("map mapId [ sideNum [ xp, yp ]]\n"); + debugPrintf("map mapId [ xp, yp ] [ sideNum ]\n"); return true; } else { int mapId = strToInt(argv[1]); - bool side = argc < 3 ? files._isDarkCc : strToInt(argv[2]) != 0; - int x = argc < 4 ? 8 : strToInt(argv[3]); - int y = argc < 5 ? 8 : strToInt(argv[4]); + int x = argc < 3 ? 8 : strToInt(argv[2]); + int y = argc < 4 ? 8 : strToInt(argv[3]); - map._loadDarkSide = side; + if (argc == 5) + map._loadCcNum = strToInt(argv[4]); map.load(mapId); party._mazePosition.x = x; party._mazePosition.y = y; @@ -202,4 +201,16 @@ bool Debugger::cmdInvincible(int argc, const char **argv) { return true; } +bool Debugger::cmdSuperStrength(int argc, const char **argv) { + _superStrength = (argc < 2) || strcmp(argv[1], "off"); + debugPrintf("Super-powered attacks are %s\n", _superStrength ? "on" : "off"); + 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 |