From: Pasi Kallinen Date: Tue, 24 Mar 2015 20:01:29 +0000 (+0200) Subject: Add an option to give feedback when bumping walls X-Git-Tag: NetHack-3.6.0_RC01~558 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d787f45dcbec5b1ab3bd8bec062107c22511b625;p=nethack Add an option to give feedback when bumping walls Boolean option "mention_walls", defaults to off. Useful for blind players. --- diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0b2e5cf3b..04cb9ea5f 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2053,6 +2053,8 @@ Enable mail delivery during the game (default on). .lp "male " An obsolete synonym for ``gender:male''. Cannot be set with the `O' command. +.lp mention_walls +Give feedback when walking against a wall (default off). .lp menustyle Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5d9f4707a..d1cd02932 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -879,7 +879,7 @@ abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" improve the messaging when a monster you can't see is causing an obstruction - +add option mention_walls, which gives feedback when bumping against a wall Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/include/flag.h b/include/flag.h index aaff7431c..add59340e 100644 --- a/include/flag.h +++ b/include/flag.h @@ -189,6 +189,7 @@ struct instance_flags { boolean deferred_X; /* deferred entry into explore mode */ boolean num_pad; /* use numbers for movement commands */ boolean news; /* print news */ + boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ diff --git a/src/hack.c b/src/hack.c index 1edfb9f4e..7f15af6ee 100644 --- a/src/hack.c +++ b/src/hack.c @@ -630,8 +630,11 @@ int mode; if (Passes_walls && may_passwall(x,y)) { ; /* do nothing */ } else if (tmpr->typ == IRONBARS) { - if (!(Passes_walls || passes_bars(youmonst.data))) + if (!(Passes_walls || passes_bars(youmonst.data))) { + if (iflags.mention_walls) + You("cannot pass through the bars."); return FALSE; + } } else if (tunnels(youmonst.data) && !needspick(youmonst.data)) { /* Eat the rock. */ if (mode == DO_MOVE && still_chewing(x,y)) return FALSE; @@ -646,8 +649,10 @@ int mode; if (Is_stronghold(&u.uz) && is_db_wall(x,y)) pline_The("drawbridge is up!"); /* sokoban restriction stays even after puzzle is solved */ - if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) + else if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) pline_The("Sokoban walls resist your ability."); + else if (iflags.mention_walls) + pline("It's a wall."); } return FALSE; } diff --git a/src/options.c b/src/options.c index 147e0a701..d1f5b26de 100644 --- a/src/options.c +++ b/src/options.c @@ -139,6 +139,7 @@ static struct Bool_Opt #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif + {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/