/** * Go up one level */ void do_cmd_go_up(struct command *cmd) { /* Verify stairs */ if (!square_isupstairs(cave, player->py, player->px)) { msg("I see no up staircase here."); return; } /* Force descend */ if (OPT(birth_force_descend)) { msg("Nothing happens!"); return; } /* Take a turn */ player->upkeep->energy_use = z_info->move_energy; /* Success */ msgt(MSG_STAIRS_UP, "You enter a maze of up staircases."); /* Create a way back */ player->upkeep->create_up_stair = FALSE; player->upkeep->create_down_stair = TRUE; /* Change level */ dungeon_change_level(player->depth - 1); }
/** * Go up one level */ void do_cmd_go_up(struct command *cmd) { int ascend_to; /* Verify stairs */ if (!square_isupstairs(cave, player->py, player->px)) { msg("I see no up staircase here."); return; } /* Force descend */ if (OPT(birth_force_descend)) { msg("Nothing happens!"); return; } ascend_to = dungeon_get_next_level(player->depth, -1); if (ascend_to == player->depth) { msg("You can't go up from here!"); return; } /* Take a turn */ player->upkeep->energy_use = z_info->move_energy; /* Success */ msgt(MSG_STAIRS_UP, "You enter a maze of up staircases."); /* Create a way back */ player->upkeep->create_up_stair = false; player->upkeep->create_down_stair = true; /* Change level */ dungeon_change_level(ascend_to); }