From 0ba4567b4b44c9332bd978ef266f4af41c052779 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 2 Nov 2009 12:38:55 +0100 Subject: Make same square teleport no-scatter no-fail and no-contamination. We can have either this, making SIGHUP on teleport control prompt make you randomly teleport, or forcing a teleport on reload. --- crawl-ref/source/spells3.cc | 11 ++++++++++- crawl-ref/source/view.cc | 8 +++++++- crawl-ref/source/view.h | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 3dc8033cd2..de848e0632 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1445,7 +1445,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area) while (true) { - show_map(pos, false); + show_map(pos, false, true); redraw_screen(); #if defined(USE_UNIX_SIGNALS) && defined(SIGHUP_SAVE) && defined(USE_CURSES) @@ -1464,6 +1464,15 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area) mprf(MSGCH_DIAGNOSTICS, "Target square (%d,%d)", pos.x, pos.y ); #endif + if (pos == you.pos() || pos == coord_def(-1,-1)) + { + if (!yesno("Are you sure you want to cancel this teleport?", + true, 'n')) + continue; + you.turn_is_over = false; + return (false); + } + if (you.duration[DUR_MESMERISED]) { bool blocked_movement = false; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 8d1062dc1b..e24cfdb1cb 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -2393,7 +2393,7 @@ static void _reset_travel_colours(std::vector &features) // the player from getting "artificial" location clues by using the // map to see how close to the end they are. They'll need to explore // to get that. This function is still a mess, though. -- bwr -void show_map( coord_def &spec_place, bool travel_mode ) +void show_map( coord_def &spec_place, bool travel_mode, bool allow_esc ) { cursor_control ccon(!Options.use_fake_cursor); int i, j; @@ -2797,6 +2797,12 @@ void show_map( coord_def &spec_place, bool travel_mode ) #endif case CMD_MAP_EXIT_MAP: + if (allow_esc) + { + spec_place = coord_def(-1, -1); + map_alive = false; + break; + } default: if (travel_mode) { diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index eb065ccf8d..24efb64e9e 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -35,7 +35,7 @@ bool noisy(int loudness, const coord_def& where, const char *msg = NULL, void blood_smell( int strength, const coord_def& where); void handle_monster_shouts(monsters* monster, bool force = false); -void show_map( coord_def &spec_place, bool travel_mode ); +void show_map( coord_def &spec_place, bool travel_mode, bool allow_esc = false ); bool check_awaken(monsters* monster); int count_detected_mons(void); void clear_map(bool clear_items = true, bool clear_mons = true); -- cgit v1.2.3-54-g00ecf