Skip to content

Commit

Permalink
KYRA: (EOB) - add debugger function (list_monsters)
Browse files Browse the repository at this point in the history
  • Loading branch information
athrxx committed Apr 21, 2013
1 parent 4a17b91 commit e37a542
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 17 additions & 2 deletions engines/kyra/debugger.cpp
Expand Up @@ -482,8 +482,9 @@ Debugger_EoB::Debugger_EoB(EoBCoreEngine *vm) : Debugger(vm), _vm(vm) {
}

void Debugger_EoB::initialize() {
DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
DCmd_Register("save_original", WRAP_METHOD(Debugger_EoB, cmd_saveOriginal));
DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
DCmd_Register("save_original", WRAP_METHOD(Debugger_EoB, cmd_saveOriginal));
DCmd_Register("list_monsters", WRAP_METHOD(Debugger_EoB, cmd_listMonsters));
}

bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
Expand Down Expand Up @@ -558,6 +559,20 @@ bool Debugger_EoB::cmd_saveOriginal(int argc, const char **argv) {
return true;
}

bool Debugger_EoB::cmd_listMonsters(int, const char **) {
DebugPrintf("\nCurrent level: %d\n----------------------\n\n", _vm->_currentLevel);
DebugPrintf("Id Type Unit Block Position Direction Sub Level Mode Dst.block HP Flags\n--------------------------------------------------------------------------------------------------------------\n");

for (int i = 0; i < 30; i++) {
EoBMonsterInPlay *m = &_vm->_monsters[i];
DebugPrintf("%.02d %.02d %.02d 0x%.04x %d %d %d %.02d 0x%.04x %.03d/%.03d 0x%.02x\n", i, m->type, m->unit, m->block, m->pos, m->dir, m->sub, m->mode, m->dest, m->hitPointsCur, m->hitPointsMax, m->flags);
}

DebugPrintf("\n");

return true;
}

#endif // ENABLE_EOB

} // End of namespace Kyra
1 change: 1 addition & 0 deletions engines/kyra/debugger.h
Expand Up @@ -121,6 +121,7 @@ class Debugger_EoB : public Debugger {

bool cmd_importSaveFile(int argc, const char **argv);
bool cmd_saveOriginal(int argc, const char **argv);
bool cmd_listMonsters(int argc, const char **argv);
};
#endif // ENABLE_EOB

Expand Down

0 comments on commit e37a542

Please sign in to comment.