aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/debugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/debugger.cpp')
-rw-r--r--engines/xeen/debugger.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp
index 68d2c0cbd4..42f61b02b5 100644
--- a/engines/xeen/debugger.cpp
+++ b/engines/xeen/debugger.cpp
@@ -44,14 +44,17 @@ static int strToInt(const char *s) {
/*------------------------------------------------------------------------*/
-Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm) {
+Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm),
+ _invincible(false) {
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell));
+ registerCmd("spells", WRAP_METHOD(Debugger, cmdSpells));
registerCmd("dump", WRAP_METHOD(Debugger, cmdDump));
registerCmd("gold", WRAP_METHOD(Debugger, cmdGold));
registerCmd("gems", WRAP_METHOD(Debugger, cmdGems));
registerCmd("map", WRAP_METHOD(Debugger, cmdMap));
registerCmd("pos", WRAP_METHOD(Debugger, cmdPos));
+ registerCmd("invincible", WRAP_METHOD(Debugger, cmdInvincible));
_spellId = -1;
}
@@ -87,6 +90,21 @@ bool Debugger::cmdSpell(int argc, const char **argv) {
return true;
}
+bool Debugger::cmdSpells(int argc, const char **argv) {
+ Party &party = *_vm->_party;
+
+ 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);
+ c._currentSp = 9999;
+ }
+
+ party._gems += 1000;
+
+ debugPrintf("Spells given to party.\n");
+ return true;
+}
+
bool Debugger::cmdDump(int argc, const char **argv) {
File f;
@@ -178,4 +196,10 @@ bool Debugger::cmdPos(int argc, const char **argv) {
}
}
+bool Debugger::cmdInvincible(int argc, const char **argv) {
+ _invincible = (argc < 2) || strcmp(argv[1], "off");
+ debugPrintf("Invincibility is %s\n", _invincible ? "on" : "off");
+ return true;
+}
+
} // End of namespace Xeen