Add an option to give feedback when bumping walls

Boolean option "mention_walls", defaults to off.
Useful for blind players.
This commit is contained in:
Pasi Kallinen
2015-03-24 22:01:29 +02:00
parent dfe967732d
commit d787f45dcb
5 changed files with 12 additions and 3 deletions

View File

@@ -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

View File

@@ -879,7 +879,7 @@ abuse wisdom in keeping with Rider eating message
message inconsistency: death message "swallowed <mon> 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
-----------------------------------------

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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*/