SCUMM: Add a grail command to the debugger

This prints the number of the real Grail object when counting from the
left in the final room with the knight in Indy3.

May be useful since there are many Grails, choosing the wrong one kills
you and makes you restart the 3 trials again, and the hints to find it
require the original manual and taking notes during the game.
This commit is contained in:
Donovan Watteau 2022-06-13 12:36:48 +02:00 committed by Filippos Karapetis
parent 95fd7dcffc
commit c3b30b75a6
2 changed files with 25 additions and 1 deletions

View file

@ -82,7 +82,8 @@ ScummDebugger::ScummDebugger(ScummEngine *s)
if (_vm->_game.id == GID_LOOM)
registerCmd("drafts", WRAP_METHOD(ScummDebugger, Cmd_PrintDraft));
if (_vm->_game.id == GID_INDY3)
registerCmd("grail", WRAP_METHOD(ScummDebugger, Cmd_PrintGrail));
if (_vm->_game.id == GID_MONKEY && _vm->_game.platform == Common::kPlatformSegaCD)
registerCmd("passcode", WRAP_METHOD(ScummDebugger, Cmd_Passcode));
@ -1004,6 +1005,28 @@ bool ScummDebugger::Cmd_PrintDraft(int argc, const char **argv) {
return true;
}
bool ScummDebugger::Cmd_PrintGrail(int argc, const char **argv) {
if (_vm->_game.id != GID_INDY3) {
debugPrintf("Command only works with Indy3\n");
return true;
}
if (_vm->_currentRoom != 86) {
debugPrintf("Command only works in room 86\n");
return true;
}
const int grailNumber = _vm->_scummVars[253];
if (grailNumber < 1 || grailNumber > 10) {
debugPrintf("Couldn't find the Grail number\n");
return true;
}
debugPrintf("Real Grail is Grail #%d\n", grailNumber);
return true;
}
bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) {
if (argc > 1) {
_vm->_bootParam = atoi(argv[1]);

View file

@ -57,6 +57,7 @@ private:
bool Cmd_ImportRes(int argc, const char **argv);
bool Cmd_PrintDraft(int argc, const char **argv);
bool Cmd_PrintGrail(int argc, const char **argv);
bool Cmd_Passcode(int argc, const char **argv);
bool Cmd_Debug(int argc, const char **argv);