ULTIMA4: Shifted abyss jump to debugger command

This commit is contained in:
Paul Gilbert 2020-04-14 21:22:56 -07:00
parent bfb9290138
commit c4d188249c
3 changed files with 23 additions and 19 deletions

View File

@ -79,6 +79,7 @@ Debugger::Debugger() : Shared::Debugger() {
registerCmd("yell", WRAP_METHOD(Debugger, cmdYell));
registerCmd("3d", WRAP_METHOD(Debugger, cmd3d));
registerCmd("abyss", WRAP_METHOD(Debugger, cmdAbyss));
registerCmd("collisions", WRAP_METHOD(Debugger, cmdCollisions));
registerCmd("companions", WRAP_METHOD(Debugger, cmdCompanions));
registerCmd("destroy", WRAP_METHOD(Debugger, cmdDestroy));
@ -1074,6 +1075,23 @@ bool Debugger::cmd3d(int argc, const char **argv) {
return isDebuggerActive();
}
bool Debugger::cmdAbyss(int argc, const char **argv) {
// first teleport to the abyss
g_context->_location->_coords.x = 0xe9;
g_context->_location->_coords.y = 0xe9;
g_game->setMap(mapMgr->get(MAP_ABYSS), 1, NULL);
// then to the final altar
g_context->_location->_coords.x = 7;
g_context->_location->_coords.y = 7;
g_context->_location->_coords.z = 7;
g_ultima->_saveGame->_orientation = DIR_NORTH;
g_context->_party->lightTorch(100, false);
cmdIgnite(0, nullptr);
return isDebuggerActive();
}
bool Debugger::cmdCollisions(int argc, const char **argv) {
_collisionOverride = !_collisionOverride;
print("Collision detection %s",

View File

@ -235,6 +235,11 @@ private:
*/
bool cmd3d(int argc, const char **argv);
/**
* Teleports to the Abyss final altar
*/
bool cmdAbyss(int argc, const char **argv);
/**
* Collision detection on/off
*/

View File

@ -600,25 +600,6 @@ bool GameController::keyPressed(int key) {
if ((g_context->_location->_context & CTX_DUNGEON) && strchr("abefjlotxy", key))
screenMessage("%cNot here!%c\n", FG_GREY, FG_WHITE);
else
switch (key) {
case 'c' + U4_ALT:
if (settings._debug && g_context->_location->_map->isWorldMap()) {
/* first teleport to the abyss */
g_context->_location->_coords.x = 0xe9;
g_context->_location->_coords.y = 0xe9;
setMap(mapMgr->get(MAP_ABYSS), 1, NULL);
/* then to the final altar */
g_context->_location->_coords.x = 7;
g_context->_location->_coords.y = 7;
g_context->_location->_coords.z = 7;
}
break;
default:
valid = false;
break;
}
if (valid && endTurn) {
if (eventHandler->getController() == g_game)