From f0d6a9e02d5d7a3948727e5c57d9c0ad19ffcfc4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 15 Sep 2016 18:23:15 +0300 Subject: [PATCH 01/19] Better default style for X11 This tries to mimic the terminal, and adds some defines making it easier to configure. --- win/X11/NetHack.ad | 271 ++++++++++++++++++++++++++++----------------- 1 file changed, 167 insertions(+), 104 deletions(-) diff --git a/win/X11/NetHack.ad b/win/X11/NetHack.ad index 0ad47b36b..baea90345 100644 --- a/win/X11/NetHack.ad +++ b/win/X11/NetHack.ad @@ -1,17 +1,27 @@ ! $NHDT-Date: 1457079198 2016/03/04 08:13:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $ +#define NETHACK_FONT -*-fixed-medium-*-*-*-15-*-*-*-*-*-*-* +#define NETHACK_CLR_FG grey +#define NETHACK_CLR_BG black +#define NETHACK_CLR_QUIT red +#define NETHACK_CLR_RANDOM green +#define NETHACK_CLR_HELP green +#define NETHACK_BTN_SHAPE roundedRectangle +#define NETHACK_CMD_BORDER 0 + ! The display_file, tombstone, and menu windows are all formatted assuming ! a fixed width font. Text windows may or may not be formatted as above. ! The rip window applies if the GRAPHIC_TOMBSTONE option is turned on, and ! requires a 12 pixel font for correct appearance. ! -NetHack*font: variable -NetHack*display_file*font: fixed -NetHack*tombstone*font: fixed -NetHack*text*rip*font: -*-times-medium-r-*-*-12-*-*-*-*-*-*-* -NetHack*menu*font: fixed -NetHack*text*font: fixed -NetHack*map*font: nh10 +NetHack*font: NETHACK_FONT +NetHack*display_file*font: NETHACK_FONT +NetHack*map*font: NETHACK_FONT +NetHack*text*font: NETHACK_FONT +NetHack*menu*font: NETHACK_FONT +NetHack*tombstone*font: NETHACK_FONT +NetHack*text*rip*font: -*-times-medium-r-*-*-12-*-*-*-*-*-*-* +NetHack*text*borderWidth: 0 ! tile_file names a file containing full-color tiles for the map. ! If you use a 100dpi (or greater) monitor you may wish to double the @@ -35,7 +45,7 @@ NetHack.tile_file: x11tiles ! The image file !NetHack.tombstone: rip.xpm ! Text starts at (tombtext_x, tombtext_y) and subsequent lines -! are displaced by (tombtext_dx, tombtext_dy) pixels. If you +! are displaced by (tombtext_dx, tombtext_dy) pixels. !NetHack.tombtext_x: 155 !NetHack.tombtext_y: 78 !NetHack.tombtext_dx: 0 @@ -73,7 +83,7 @@ NetHack*slow: True ! as part of the map when no prompt is active, then invert foreground and ! background to stand out when a prompt is issued and waiting for a response. ! If 'slow' is False, 'highlight_prompt' will have no effect. -NetHack*highlight_prompt: True +NetHack*highlight_prompt: False ! The number of lines the message window will show without scrolling. !NetHack*message_lines: 12 @@ -92,103 +102,105 @@ NetHack*highlight_prompt: True !NetHack*map*rows: 21 !NetHack*map*columns: 80 -! Parts of the fancy status display. -! -NetHack*status_condition1.borderWidth: 0 -NetHack*status_condition2.borderWidth: 0 -NetHack*status_condition3.borderWidth: 0 -NetHack*status_leftover.borderWidth: 0 -NetHack*status_info*borderWidth: 0 +NetHack*background: NETHACK_CLR_BG +NetHack*foreground: NETHACK_CLR_FG -! Sample color screen entries. -! -NetHack*nethack.background: wheat -NetHack*map*yellow: gold -NetHack*map*brown: tan -NetHack*map*gray: grey85 -NetHack*map*foreground: wheat -NetHack*map*background: grey40 +NetHack*yn_prompt*borderWidth: 0 -NetHack*fancy_status.skipAdjust: True -NetHack*fancy_status.background: wheat -NetHack*status_info*foreground: Sienna -NetHack*status_info*background: wheat -NetHack*status_info.background: wheat -NetHack*status_attributes*foreground: black -NetHack*status_attributes*background: white -NetHack*status_condition1*foreground: red -NetHack*status_condition1*background: wheat -NetHack*status_condition2*foreground: black -NetHack*status_condition2*background: wheat -NetHack*status_condition3*foreground: black -NetHack*status_condition3*background: wheat -NetHack*Scrollbar*foreground: Sienna -NetHack*Scrollbar*background: wheat -NetHack*status_info*showGrip: False -NetHack*status_attributes*showGrip: False -NetHack*status_condition1*showGrip: False -NetHack*status_condition2*showGrip: False -NetHack*status_condition3*showGrip: False +NetHack*Scrollbar*foreground: gray40 +NetHack*Scrollbar*background: gray10 -NetHack*player_selection*random.borderColor: blue -NetHack*player_selection*random.borderWidth: 2 -NetHack*player_selection*random.foreground: blue -NetHack*player_selection*random.accelerators: #override\n\ - Return: set() notify() unset() -NetHack*player_selection*quit.borderColor: blue -NetHack*player_selection*quit.foreground: blue -NetHack*player_selection*Command.borderColor: red -NetHack*player_selection*Command.foreground: red -NetHack*player_selection*quit.accelerators: #override\n\ - Escape: set() notify() unset() +NetHack*fancy_status*background: NETHACK_CLR_BG +NetHack*fancy_status*foreground: NETHACK_CLR_FG +NetHack*fancy_status.skipAdjust: True -NetHack*race_selection*random.borderColor: blue -NetHack*race_selection*random.borderWidth: 2 -NetHack*race_selection*random.foreground: blue -NetHack*race_selection*random.accelerators: #override\n\ - Return: set() notify() unset() -NetHack*race_selection*quit.borderColor: blue -NetHack*race_selection*quit.foreground: blue -NetHack*race_selection*Command.borderColor: red -NetHack*race_selection*Command.foreground: red -NetHack*race_selection*quit.accelerators: #override\n\ - Escape: set() notify() unset() +NetHack*showGrip: False -NetHack*gender_selection*random.borderColor: blue -NetHack*gender_selection*random.borderWidth: 2 -NetHack*gender_selection*random.foreground: blue -NetHack*gender_selection*random.accelerators: #override\n\ - Return: set() notify() unset() -NetHack*gender_selection*quit.borderColor: blue -NetHack*gender_selection*quit.foreground: blue -NetHack*gender_selection*Command.borderColor: red -NetHack*gender_selection*Command.foreground: red -NetHack*gender_selection*quit.accelerators: #override\n\ - Escape: set() notify() unset() +! text input prompt window +NetHack*response*textSink*background: red +NetHack*response*foreground: NETHACK_CLR_FG +NetHack*response*background: NETHACK_CLR_BG +NetHack*response*borderColor: NETHACK_CLR_FG +NetHack*response*borderWidth: 1 -NetHack*alignment_selection*random.borderColor: blue -NetHack*alignment_selection*random.borderWidth: 2 -NetHack*alignment_selection*random.foreground: blue -NetHack*alignment_selection*random.accelerators: #override\n\ - Return: set() notify() unset() -NetHack*alignment_selection*quit.borderColor: blue -NetHack*alignment_selection*quit.foreground: blue -NetHack*alignment_selection*Command.borderColor: red -NetHack*alignment_selection*Command.foreground: red -NetHack*alignment_selection*quit.accelerators: #override\n\ - Escape: set() notify() unset() +! role selection window +NetHack*player_selection*random.foreground: NETHACK_CLR_RANDOM +NetHack*player_selection*random.background: black +NetHack*player_selection*random.borderColor: NETHACK_CLR_RANDOM +NetHack*player_selection*random.borderWidth: 1 +NetHack*player_selection*random.shapeStyle: NETHACK_BTN_SHAPE +NetHack*player_selection*random.cornerRoundPercent: 1% +NetHack*player_selection*quit.foreground: NETHACK_CLR_QUIT +NetHack*player_selection*quit.borderColor: NETHACK_CLR_QUIT +NetHack*player_selection*quit.borderWidth: 1 +NetHack*player_selection*quit.shapeStyle: NETHACK_BTN_SHAPE +NetHack*player_selection*quit.cornerRoundPercent: 1% +NetHack*player_selection*Command.foreground: NETHACK_CLR_FG +NetHack*player_selection*Command.borderColor: NETHACK_CLR_FG +NetHack*player_selection*Command.borderWidth: NETHACK_CMD_BORDER -NetHack*extended_commands*dismiss.borderColor: blue -NetHack*extended_commands*dismiss.foreground: blue -NetHack*extended_commands*help.borderColor: blue -NetHack*extended_commands*help.foreground: blue -NetHack*extended_commands*Command.borderColor: red -NetHack*extended_commands*Command.foreground: red -NetHack*extended_commands*help.accelerators: #override\n\ - :?: set() notify() unset() -NetHack*extended_commands*dismiss.accelerators: #override\n\ - Escape: set() notify() unset() -! +! race selection window +NetHack*race_selection*random.foreground: NETHACK_CLR_RANDOM +NetHack*race_selection*random.background: black +NetHack*race_selection*random.borderColor: NETHACK_CLR_RANDOM +NetHack*race_selection*random.borderWidth: 1 +NetHack*race_selection*random.shapeStyle: NETHACK_BTN_SHAPE +NetHack*race_selection*random.cornerRoundPercent: 1% +NetHack*race_selection*quit.foreground: NETHACK_CLR_QUIT +NetHack*race_selection*quit.borderColor: NETHACK_CLR_QUIT +NetHack*race_selection*quit.borderWidth: 1 +NetHack*race_selection*quit.shapeStyle: NETHACK_BTN_SHAPE +NetHack*race_selection*quit.cornerRoundPercent: 1% +NetHack*race_selection*Command.foreground: NETHACK_CLR_FG +NetHack*race_selection*Command.borderColor: NETHACK_CLR_FG +NetHack*race_selection*Command.borderWidth: NETHACK_CMD_BORDER + +! gender selection window +NetHack*gender_selection*random.foreground: NETHACK_CLR_RANDOM +NetHack*gender_selection*random.background: black +NetHack*gender_selection*random.borderColor: NETHACK_CLR_RANDOM +NetHack*gender_selection*random.borderWidth: 1 +NetHack*gender_selection*random.shapeStyle: NETHACK_BTN_SHAPE +NetHack*gender_selection*random.cornerRoundPercent: 1% +NetHack*gender_selection*quit.foreground: NETHACK_CLR_QUIT +NetHack*gender_selection*quit.borderColor: NETHACK_CLR_QUIT +NetHack*gender_selection*quit.borderWidth: 1 +NetHack*gender_selection*quit.shapeStyle: NETHACK_BTN_SHAPE +NetHack*gender_selection*quit.cornerRoundPercent: 1% +NetHack*gender_selection*Command.foreground: NETHACK_CLR_FG +NetHack*gender_selection*Command.borderColor: NETHACK_CLR_FG +NetHack*gender_selection*Command.borderWidth: NETHACK_CMD_BORDER + +! alignment selection window +NetHack*alignment_selection*random.foreground: NETHACK_CLR_RANDOM +NetHack*alignment_selection*random.background: black +NetHack*alignment_selection*random.borderColor: NETHACK_CLR_RANDOM +NetHack*alignment_selection*random.borderWidth: 1 +NetHack*alignment_selection*random.shapeStyle: NETHACK_BTN_SHAPE +NetHack*alignment_selection*random.cornerRoundPercent: 1% +NetHack*alignment_selection*quit.foreground: NETHACK_CLR_QUIT +NetHack*alignment_selection*quit.borderColor: NETHACK_CLR_QUIT +NetHack*alignment_selection*quit.borderWidth: 1 +NetHack*alignment_selection*quit.shapeStyle: NETHACK_BTN_SHAPE +NetHack*alignment_selection*quit.cornerRoundPercent: 1% +NetHack*alignment_selection*Command.foreground: NETHACK_CLR_FG +NetHack*alignment_selection*Command.borderColor: NETHACK_CLR_FG +NetHack*alignment_selection*Command.borderWidth: NETHACK_CMD_BORDER + +! extended commands window +NetHack*extended_commands*dismiss.foreground: NETHACK_CLR_QUIT +NetHack*extended_commands*dismiss.borderColor: NETHACK_CLR_QUIT +NetHack*extended_commands*dismiss.borderWidth: 1 +NetHack*extended_commands*dismiss.shapeStyle: NETHACK_BTN_SHAPE +NetHack*extended_commands*dismiss.cornerRoundPercent: 1% +NetHack*extended_commands*help.foreground: NETHACK_CLR_HELP +NetHack*extended_commands*help.borderColor: NETHACK_CLR_HELP +NetHack*extended_commands*help.borderWidth: 1 +NetHack*extended_commands*help.shapeStyle: NETHACK_BTN_SHAPE +NetHack*extended_commands*help.cornerRoundPercent: 1% +NetHack*extended_commands*Command.foreground: NETHACK_CLR_FG +NetHack*extended_commands*Command.borderColor: NETHACK_CLR_FG +NetHack*extended_commands*Command.borderWidth: NETHACK_CMD_BORDER ! The extended command menu may be too big to fit on the screen so need ! a vertical scroll bar. When truncated, its height will be as tall as ! possible unless height_delta is non-zero, in which case there will be @@ -197,13 +209,64 @@ NetHack*extended_commands*dismiss.accelerators: #override\n\ ! obscuring the bottom of the menu. NetHack*extcmd_height_delta: 75 -! +! menu buttons +NetHack*OK.foreground: green +NetHack*OK.borderColor: green +NetHack*OK.shapeStyle: NETHACK_BTN_SHAPE +NetHack*OK.cornerRoundPercent: 1% + +NetHack*okay.foreground: green +NetHack*okay.borderColor: green +NetHack*okay.shapeStyle: NETHACK_BTN_SHAPE +NetHack*okay.cornerRoundPercent: 1% + +NetHack*cancel.foreground: red +NetHack*cancel.borderColor: red +NetHack*cancel.shapeStyle: NETHACK_BTN_SHAPE +NetHack*cancel.cornerRoundPercent: 1% + +NetHack*all.foreground: green +NetHack*all.borderColor: green +NetHack*all.shapeStyle: NETHACK_BTN_SHAPE +NetHack*all.cornerRoundPercent: 1% + +NetHack*none.foreground: green +NetHack*none.borderColor: green +NetHack*none.shapeStyle: NETHACK_BTN_SHAPE +NetHack*none.cornerRoundPercent: 1% + +NetHack*invert.foreground: green +NetHack*invert.borderColor: green +NetHack*invert.shapeStyle: NETHACK_BTN_SHAPE +NetHack*invert.cornerRoundPercent: 1% + +NetHack*search.foreground: green +NetHack*search.borderColor: green +NetHack*search.shapeStyle: NETHACK_BTN_SHAPE +NetHack*search.cornerRoundPercent: 1% + +! map colors +! The foreground color is used as "no color". +NetHack*map*foreground: NETHACK_CLR_FG +NetHack*map*background: NETHACK_CLR_BG + +NetHack*map*black: grey15 +NetHack*map*red: red3 +NetHack*map*green: green3 +NetHack*map*brown: DarkOrange3 +NetHack*map*blue: blue3 +NetHack*map*magenta: magenta3 +NetHack*map*cyan: cyan3 +NetHack*map*gray: gray50 +NetHack*map*orange: yellow +NetHack*map*bright_green: green +NetHack*map*yellow: yellow +NetHack*map*bright_blue: blue +NetHack*map*bright_magenta: magenta +NetHack*map*bright_cyan: cyan +NetHack*map*white: white ! ! The following are the default 15 colors that the nethack map uses. -! If they don't look good on your screen, change them. -! -! The foreground color is used as "no color". -! !NetHack*map*black: black !NetHack*map*red: red !NetHack*map*green: pale green From e177af1e8bcb834a03b408efa02ec5bbe1b95d74 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 15 Sep 2016 18:45:18 +0300 Subject: [PATCH 02/19] Update X11 style, define button rounding --- win/X11/NetHack.ad | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/win/X11/NetHack.ad b/win/X11/NetHack.ad index baea90345..3e1eed6e7 100644 --- a/win/X11/NetHack.ad +++ b/win/X11/NetHack.ad @@ -7,6 +7,7 @@ #define NETHACK_CLR_RANDOM green #define NETHACK_CLR_HELP green #define NETHACK_BTN_SHAPE roundedRectangle +#define NETHACK_BTN_ROUND 20 #define NETHACK_CMD_BORDER 0 ! The display_file, tombstone, and menu windows are all formatted assuming @@ -129,12 +130,12 @@ NetHack*player_selection*random.background: black NetHack*player_selection*random.borderColor: NETHACK_CLR_RANDOM NetHack*player_selection*random.borderWidth: 1 NetHack*player_selection*random.shapeStyle: NETHACK_BTN_SHAPE -NetHack*player_selection*random.cornerRoundPercent: 1% +NetHack*player_selection*random.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*player_selection*quit.foreground: NETHACK_CLR_QUIT NetHack*player_selection*quit.borderColor: NETHACK_CLR_QUIT NetHack*player_selection*quit.borderWidth: 1 NetHack*player_selection*quit.shapeStyle: NETHACK_BTN_SHAPE -NetHack*player_selection*quit.cornerRoundPercent: 1% +NetHack*player_selection*quit.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*player_selection*Command.foreground: NETHACK_CLR_FG NetHack*player_selection*Command.borderColor: NETHACK_CLR_FG NetHack*player_selection*Command.borderWidth: NETHACK_CMD_BORDER @@ -145,12 +146,12 @@ NetHack*race_selection*random.background: black NetHack*race_selection*random.borderColor: NETHACK_CLR_RANDOM NetHack*race_selection*random.borderWidth: 1 NetHack*race_selection*random.shapeStyle: NETHACK_BTN_SHAPE -NetHack*race_selection*random.cornerRoundPercent: 1% +NetHack*race_selection*random.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*race_selection*quit.foreground: NETHACK_CLR_QUIT NetHack*race_selection*quit.borderColor: NETHACK_CLR_QUIT NetHack*race_selection*quit.borderWidth: 1 NetHack*race_selection*quit.shapeStyle: NETHACK_BTN_SHAPE -NetHack*race_selection*quit.cornerRoundPercent: 1% +NetHack*race_selection*quit.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*race_selection*Command.foreground: NETHACK_CLR_FG NetHack*race_selection*Command.borderColor: NETHACK_CLR_FG NetHack*race_selection*Command.borderWidth: NETHACK_CMD_BORDER @@ -161,12 +162,12 @@ NetHack*gender_selection*random.background: black NetHack*gender_selection*random.borderColor: NETHACK_CLR_RANDOM NetHack*gender_selection*random.borderWidth: 1 NetHack*gender_selection*random.shapeStyle: NETHACK_BTN_SHAPE -NetHack*gender_selection*random.cornerRoundPercent: 1% +NetHack*gender_selection*random.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*gender_selection*quit.foreground: NETHACK_CLR_QUIT NetHack*gender_selection*quit.borderColor: NETHACK_CLR_QUIT NetHack*gender_selection*quit.borderWidth: 1 NetHack*gender_selection*quit.shapeStyle: NETHACK_BTN_SHAPE -NetHack*gender_selection*quit.cornerRoundPercent: 1% +NetHack*gender_selection*quit.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*gender_selection*Command.foreground: NETHACK_CLR_FG NetHack*gender_selection*Command.borderColor: NETHACK_CLR_FG NetHack*gender_selection*Command.borderWidth: NETHACK_CMD_BORDER @@ -177,12 +178,12 @@ NetHack*alignment_selection*random.background: black NetHack*alignment_selection*random.borderColor: NETHACK_CLR_RANDOM NetHack*alignment_selection*random.borderWidth: 1 NetHack*alignment_selection*random.shapeStyle: NETHACK_BTN_SHAPE -NetHack*alignment_selection*random.cornerRoundPercent: 1% +NetHack*alignment_selection*random.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*alignment_selection*quit.foreground: NETHACK_CLR_QUIT NetHack*alignment_selection*quit.borderColor: NETHACK_CLR_QUIT NetHack*alignment_selection*quit.borderWidth: 1 NetHack*alignment_selection*quit.shapeStyle: NETHACK_BTN_SHAPE -NetHack*alignment_selection*quit.cornerRoundPercent: 1% +NetHack*alignment_selection*quit.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*alignment_selection*Command.foreground: NETHACK_CLR_FG NetHack*alignment_selection*Command.borderColor: NETHACK_CLR_FG NetHack*alignment_selection*Command.borderWidth: NETHACK_CMD_BORDER @@ -192,12 +193,12 @@ NetHack*extended_commands*dismiss.foreground: NETHACK_CLR_QUIT NetHack*extended_commands*dismiss.borderColor: NETHACK_CLR_QUIT NetHack*extended_commands*dismiss.borderWidth: 1 NetHack*extended_commands*dismiss.shapeStyle: NETHACK_BTN_SHAPE -NetHack*extended_commands*dismiss.cornerRoundPercent: 1% +NetHack*extended_commands*dismiss.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*extended_commands*help.foreground: NETHACK_CLR_HELP NetHack*extended_commands*help.borderColor: NETHACK_CLR_HELP NetHack*extended_commands*help.borderWidth: 1 NetHack*extended_commands*help.shapeStyle: NETHACK_BTN_SHAPE -NetHack*extended_commands*help.cornerRoundPercent: 1% +NetHack*extended_commands*help.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*extended_commands*Command.foreground: NETHACK_CLR_FG NetHack*extended_commands*Command.borderColor: NETHACK_CLR_FG NetHack*extended_commands*Command.borderWidth: NETHACK_CMD_BORDER @@ -213,37 +214,37 @@ NetHack*extcmd_height_delta: 75 NetHack*OK.foreground: green NetHack*OK.borderColor: green NetHack*OK.shapeStyle: NETHACK_BTN_SHAPE -NetHack*OK.cornerRoundPercent: 1% +NetHack*OK.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*okay.foreground: green NetHack*okay.borderColor: green NetHack*okay.shapeStyle: NETHACK_BTN_SHAPE -NetHack*okay.cornerRoundPercent: 1% +NetHack*okay.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*cancel.foreground: red NetHack*cancel.borderColor: red NetHack*cancel.shapeStyle: NETHACK_BTN_SHAPE -NetHack*cancel.cornerRoundPercent: 1% +NetHack*cancel.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*all.foreground: green NetHack*all.borderColor: green NetHack*all.shapeStyle: NETHACK_BTN_SHAPE -NetHack*all.cornerRoundPercent: 1% +NetHack*all.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*none.foreground: green NetHack*none.borderColor: green NetHack*none.shapeStyle: NETHACK_BTN_SHAPE -NetHack*none.cornerRoundPercent: 1% +NetHack*none.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*invert.foreground: green NetHack*invert.borderColor: green NetHack*invert.shapeStyle: NETHACK_BTN_SHAPE -NetHack*invert.cornerRoundPercent: 1% +NetHack*invert.cornerRoundPercent: NETHACK_BTN_ROUND NetHack*search.foreground: green NetHack*search.borderColor: green NetHack*search.shapeStyle: NETHACK_BTN_SHAPE -NetHack*search.cornerRoundPercent: 1% +NetHack*search.cornerRoundPercent: NETHACK_BTN_ROUND ! map colors ! The foreground color is used as "no color". From cd2703dc358f056c9ac4c73444afba4753977428 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 16 Sep 2016 15:50:42 +0300 Subject: [PATCH 03/19] Differentiate the symset and roguesymset menu prompts --- src/options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 4edc94fe0..225c4aa85 100644 --- a/src/options.c +++ b/src/options.c @@ -4561,7 +4561,8 @@ boolean setinitial, setfromfile; } sl = sl->next; } - end_menu(tmpwin, "Select symbol set:"); + Sprintf(buf, "Select %ssymbol set:", rogueflag ? "rogue level " : ""); + end_menu(tmpwin, buf); if (select_menu(tmpwin, PICK_ONE, &symset_pick) > 0) { chosen = symset_pick->item.a_int - 2; free((genericptr_t) symset_pick); From b5a027c3fedbfef1c8abad4ffe3dd249ae0d79bb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 16 Sep 2016 21:28:19 +0300 Subject: [PATCH 04/19] Show mon vs mon attack messages only when target is visible The visibility check in mattackm doesn't guarantee both the attacker and defender can be seen by hero. Before giving messages, check more strictly whether we could see the message happening - either really seeing the monster or sensing the monster by some other means, depending on the message. This should remove most of the "It" messages. Also unhide mimics who get gazed by umber hulks. We could keep the mimic hidden and make the messages reflect the hulk gazing at the thing the mimic is mimicing, but this is much easier. This fixes bz631 / H4500 --- src/eat.c | 8 ++--- src/mhitm.c | 91 +++++++++++++++++++++++++++++------------------------ 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/eat.c b/src/eat.c index f827d71c0..1191a8292 100644 --- a/src/eat.c +++ b/src/eat.c @@ -498,7 +498,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ } else if (mdef == &youmonst) { Your("brain is eaten!"); } else { /* monster against monster */ - if (visflag) + if (visflag && canspotmon(mdef)) pline("%s brain is eaten!", s_suffix(Monnam(mdef))); } @@ -512,7 +512,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ } else { /* no need to check for poly_when_stoned or Stone_resistance; mind flayers don't have those capabilities */ - if (visflag) + if (visflag && canseemon(magr)) pline("%s turns to stone!", Monnam(magr)); monstone(magr); if (magr->mhp > 0) { @@ -597,7 +597,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ * monster mind flayer is eating another monster's brain */ if (mindless(pd)) { - if (visflag) + if (visflag && canspotmon(mdef)) pline("%s doesn't notice.", Monnam(mdef)); return MM_MISS; } else if (is_rider(pd)) { @@ -609,7 +609,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ } else { *dmg_p += xtra_dmg; give_nutrit = TRUE; - if (*dmg_p >= mdef->mhp && visflag) + if (*dmg_p >= mdef->mhp && visflag && canspotmon(mdef)) pline("%s last thought fades away...", s_suffix(Monnam(mdef))); } diff --git a/src/mhitm.c b/src/mhitm.c index eb401fa4e..2b67b47b0 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -412,7 +412,7 @@ register struct monst *magr, *mdef; && mdef->mhp > 1 && !mdef->mcan) { if (clone_mon(mdef, 0, 0)) { - if (vis) { + if (vis && canspotmon(mdef)) { char buf[BUFSZ]; Strcpy(buf, Monnam(mdef)); @@ -589,13 +589,17 @@ struct attack *mattk; char buf[BUFSZ]; if (vis) { + if (mdef->data->mlet == S_MIMIC + && mdef->m_ap_type != M_AP_NOTHING) + seemimic(mdef); Sprintf(buf, "%s gazes at", Monnam(magr)); - pline("%s %s...", buf, mon_nam(mdef)); + pline("%s %s...", buf, + canspotmon(mdef) ? mon_nam(mdef) : "something"); } if (magr->mcan || !magr->mcansee || !mdef->mcansee || (magr->minvis && !perceives(mdef->data)) || mdef->msleeping) { - if (vis) + if (vis && canspotmon(mdef)) pline("but nothing happens."); return MM_MISS; } @@ -691,8 +695,10 @@ register struct attack *mattk; if (vis) { /* 'it' -- previous form is no longer available and using that would be excessively verbose */ - pline("%s expels it.", Monnam(magr)); - pline("It turns into %s.", a_monnam(mdef)); + pline("%s expels %s.", Monnam(magr), + canspotmon(mdef) ? "it" : something); + if (canspotmon(mdef)) + pline("It turns into %s.", a_monnam(mdef)); } return MM_HIT; /* bypass mdamagem() */ } @@ -808,7 +814,7 @@ register struct attack *mattk; mon_to_stone(magr); return MM_HIT; /* no damage during the polymorph */ } - if (vis) + if (vis && canspotmon(magr)) pline("%s turns to stone!", Monnam(magr)); monstone(magr); if (magr->mhp > 0) @@ -827,7 +833,7 @@ register struct attack *mattk; case AD_DGST: /* eating a Rider or its corpse is fatal */ if (is_rider(pd)) { - if (vis) + if (vis && canseemon(magr)) pline("%s %s!", Monnam(magr), (pd == &mons[PM_FAMINE]) ? "belches feebly, shrivels up and dies" @@ -923,10 +929,10 @@ register struct attack *mattk; tmp = 0; break; } - if (vis) + if (vis && canseemon(mdef)) pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk)); if (pd == &mons[PM_STRAW_GOLEM] || pd == &mons[PM_PAPER_GOLEM]) { - if (vis) + if (vis && canseemon(mdef)) pline("%s burns completely!", Monnam(mdef)); mondied(mdef); if (mdef->mhp > 0) @@ -938,7 +944,7 @@ register struct attack *mattk; tmp += destroy_mitem(mdef, SCROLL_CLASS, AD_FIRE); tmp += destroy_mitem(mdef, SPBOOK_CLASS, AD_FIRE); if (resists_fire(mdef)) { - if (vis) + if (vis && canseemon(mdef)) pline_The("fire doesn't seem to burn %s!", mon_nam(mdef)); shieldeff(mdef->mx, mdef->my); golemeffects(mdef, AD_FIRE, tmp); @@ -952,10 +958,10 @@ register struct attack *mattk; tmp = 0; break; } - if (vis) + if (vis && canseemon(mdef)) pline("%s is covered in frost!", Monnam(mdef)); if (resists_cold(mdef)) { - if (vis) + if (vis && canseemon(mdef)) pline_The("frost doesn't seem to chill %s!", mon_nam(mdef)); shieldeff(mdef->mx, mdef->my); golemeffects(mdef, AD_COLD, tmp); @@ -968,11 +974,11 @@ register struct attack *mattk; tmp = 0; break; } - if (vis) + if (vis && canseemon(mdef)) pline("%s gets zapped!", Monnam(mdef)); tmp += destroy_mitem(mdef, WAND_CLASS, AD_ELEC); if (resists_elec(mdef)) { - if (vis) + if (vis && canseemon(mdef)) pline_The("zap doesn't shock %s!", mon_nam(mdef)); shieldeff(mdef->mx, mdef->my); golemeffects(mdef, AD_ELEC, tmp); @@ -987,11 +993,11 @@ register struct attack *mattk; break; } if (resists_acid(mdef)) { - if (vis) + if (vis && canseemon(mdef)) pline("%s is covered in %s, but it seems harmless.", Monnam(mdef), hliquid("acid")); tmp = 0; - } else if (vis) { + } else if (vis && canseemon(mdef)) { pline("%s is covered in %s!", Monnam(mdef), hliquid("acid")); pline("It burns %s!", mon_nam(mdef)); } @@ -1004,7 +1010,7 @@ register struct attack *mattk; if (magr->mcan) break; if (pd == &mons[PM_IRON_GOLEM]) { - if (vis) + if (vis && canseemon(mdef)) pline("%s falls to pieces!", Monnam(mdef)); mondied(mdef); if (mdef->mhp > 0) @@ -1028,7 +1034,7 @@ register struct attack *mattk; if (magr->mcan) break; if (pd == &mons[PM_WOOD_GOLEM] || pd == &mons[PM_LEATHER_GOLEM]) { - if (vis) + if (vis && canseemon(mdef)) pline("%s falls to pieces!", Monnam(mdef)); mondied(mdef); if (mdef->mhp > 0) @@ -1054,7 +1060,7 @@ register struct attack *mattk; break; } if (!resists_ston(mdef)) { - if (vis) + if (vis && canseemon(mdef)) pline("%s turns to stone!", Monnam(mdef)); monstone(mdef); post_stone: @@ -1069,20 +1075,21 @@ register struct attack *mattk; case AD_TLPT: if (!cancelled && tmp < mdef->mhp && !tele_restrict(mdef)) { char mdef_Monnam[BUFSZ]; + boolean wasseen = canspotmon(mdef); /* save the name before monster teleports, otherwise we'll get "it" in the suddenly disappears message */ - if (vis) + if (vis && wasseen) Strcpy(mdef_Monnam, Monnam(mdef)); mdef->mstrategy &= ~STRAT_WAITFORU; (void) rloc(mdef, TRUE); - if (vis && !canspotmon(mdef) && mdef != u.usteed) + if (vis && wasseen && !canspotmon(mdef) && mdef != u.usteed) pline("%s suddenly disappears!", mdef_Monnam); } break; case AD_SLEE: if (!cancelled && !mdef->msleeping && sleep_monst(mdef, rnd(10), -1)) { - if (vis) { + if (vis && canspotmon(mdef)) { Strcpy(buf, Monnam(mdef)); pline("%s is put to sleep by %s.", buf, mon_nam(magr)); } @@ -1092,7 +1099,7 @@ register struct attack *mattk; break; case AD_PLYS: if (!cancelled && mdef->mcanmove) { - if (vis) { + if (vis && canspotmon(mdef)) { Strcpy(buf, Monnam(mdef)); pline("%s is frozen by %s.", buf, mon_nam(magr)); } @@ -1105,7 +1112,7 @@ register struct attack *mattk; mon_adjust_speed(mdef, -1, (struct obj *) 0); mdef->mstrategy &= ~STRAT_WAITFORU; - if (mdef->mspeed != oldspeed && vis) + if (mdef->mspeed != oldspeed && vis && canspotmon(mdef)) pline("%s slows down.", Monnam(mdef)); } break; @@ -1115,7 +1122,7 @@ register struct attack *mattk; * we still should check for it). */ if (!magr->mcan && !mdef->mconf && !magr->mspec_used) { - if (vis) + if (vis && canseemon(mdef)) pline("%s looks confused.", Monnam(mdef)); mdef->mconf = 1; mdef->mstrategy &= ~STRAT_WAITFORU; @@ -1125,7 +1132,7 @@ register struct attack *mattk; if (can_blnd(magr, mdef, mattk->aatyp, (struct obj *) 0)) { register unsigned rnd_tmp; - if (vis && mdef->mcansee) + if (vis && mdef->mcansee && canspotmon(mdef)) pline("%s is blinded.", Monnam(mdef)); rnd_tmp = d((int) mattk->damn, (int) mattk->damd); if ((rnd_tmp += mdef->mblinded) > 127) @@ -1138,7 +1145,7 @@ register struct attack *mattk; break; case AD_HALU: if (!magr->mcan && haseyes(pd) && mdef->mcansee) { - if (vis) + if (vis && canseemon(mdef)) pline("%s looks %sconfused.", Monnam(mdef), mdef->mconf ? "more " : ""); mdef->mconf = 1; @@ -1155,7 +1162,7 @@ register struct attack *mattk; if (is_were(pd) && pd->mlet != S_HUMAN) were_change(mdef); if (pd == &mons[PM_CLAY_GOLEM]) { - if (vis) { + if (vis && canseemon(mdef)) { pline("Some writing vanishes from %s head!", s_suffix(mon_nam(mdef))); pline("%s is destroyed!", Monnam(mdef)); @@ -1171,7 +1178,7 @@ register struct attack *mattk; if (!Deaf) { if (!vis) You_hear("laughter."); - else + else if (canseemon(magr)) pline("%s chuckles.", Monnam(magr)); } } @@ -1192,20 +1199,21 @@ register struct attack *mattk; add_to_minv(magr, gold); } mdef->mstrategy &= ~STRAT_WAITFORU; - if (vis) { + if (vis && canseemon(mdef)) { Strcpy(buf, Monnam(magr)); pline("%s steals some gold from %s.", buf, mon_nam(mdef)); } if (!tele_restrict(magr)) { + boolean couldspot = canspotmon(magr); (void) rloc(magr, TRUE); - if (vis && !canspotmon(magr)) + if (vis && couldspot && !canspotmon(magr)) pline("%s suddenly disappears!", buf); } break; case AD_DRLI: if (!cancelled && !rn2(3) && !resists_drli(mdef)) { tmp = d(2, 6); - if (vis) + if (vis && canspotmon(mdef)) pline("%s suddenly seems weaker!", Monnam(mdef)); mdef->mhpmax -= tmp; if (mdef->m_lev == 0) @@ -1249,7 +1257,7 @@ register struct attack *mattk; if (vis) Strcpy(onambuf, doname(otmp)); (void) add_to_minv(magr, otmp); - if (vis) { + if (vis && canseemon(mdef)) { Strcpy(buf, Monnam(magr)); pline("%s steals %s from %s!", buf, onambuf, mdefnambuf); } @@ -1260,8 +1268,9 @@ register struct attack *mattk; return (MM_DEF_DIED | (grow_up(magr, mdef) ? 0 : MM_AGR_DIED)); if (pa->mlet == S_NYMPH && !tele_restrict(magr)) { + boolean couldspot = canspotmon(magr); (void) rloc(magr, TRUE); - if (vis && !canspotmon(magr)) + if (vis && couldspot && !canspotmon(magr)) pline("%s suddenly disappears!", buf); } } @@ -1269,25 +1278,25 @@ register struct attack *mattk; break; case AD_DREN: if (!cancelled && !rn2(4)) - xdrainenergym(mdef, vis && mattk->aatyp != AT_ENGL); + xdrainenergym(mdef, vis && canspotmon(mdef) && mattk->aatyp != AT_ENGL); tmp = 0; break; case AD_DRST: case AD_DRDX: case AD_DRCO: if (!cancelled && !rn2(8)) { - if (vis) + if (vis && canspotmon(magr)) pline("%s %s was poisoned!", s_suffix(Monnam(magr)), mpoisons_subj(magr, mattk)); if (resists_poison(mdef)) { - if (vis) + if (vis && canspotmon(mdef) && canspotmon(magr)) pline_The("poison doesn't seem to affect %s.", mon_nam(mdef)); } else { if (rn2(10)) tmp += rn1(10, 6); else { - if (vis) + if (vis && canspotmon(mdef)) pline_The("poison was deadly..."); tmp = mdef->mhp; } @@ -1296,14 +1305,14 @@ register struct attack *mattk; break; case AD_DRIN: if (notonhead || !has_head(pd)) { - if (vis) + if (vis && canspotmon(mdef)) pline("%s doesn't seem harmed.", Monnam(mdef)); /* Not clear what to do for green slimes */ tmp = 0; break; } if ((mdef->misc_worn_check & W_ARMH) && rn2(8)) { - if (vis) { + if (vis && canspotmon(magr) && canseemon(mdef)) { Strcpy(buf, s_suffix(Monnam(mdef))); pline("%s helmet blocks %s attack to %s head.", buf, s_suffix(mon_nam(magr)), mhis(mdef)); @@ -1317,7 +1326,7 @@ register struct attack *mattk; break; /* physical damage only */ if (!rn2(4) && !slimeproof(pd)) { if (!munslime(mdef, FALSE) && mdef->mhp > 0) { - if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, vis)) + if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, vis && canseemon(mdef))) pd = mdef->data; mdef->mstrategy &= ~STRAT_WAITFORU; res = MM_HIT; From 1cec86763e38c45aba410b927ab51adbe289128d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 16 Sep 2016 22:05:32 +0300 Subject: [PATCH 05/19] Fixes entries --- doc/fixes36.1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 71425d6e8..7ae3f0b03 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -339,6 +339,10 @@ change ing_suffix() to not double final 'w' when adding 'ing' ('t=' yielded using 'D' to drop when not carrying anything finished (after doing nothing) without giving any feedback for menustyles "full" and "partial" "you hear a distant squeak" might actually be nearby +differentiate symset and roguesymset option menu prompts +don't show monster vs. monster attack message, if the message refers to + a monster that cannot be sensed by the hero +umber hulk gazing at hidden mimic forces mimic to unhide Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository @@ -488,6 +492,7 @@ prevent diagonal jumping through open doorways different liquids when hallucinating when moving a cursor for travel target, show if there is no known travel path to that location, if "autodescribe" is on +show the reason why travel was interrupted if mention_walls is on Platform- and/or Interface-Specific New Features @@ -505,6 +510,7 @@ X11: NetHack*extcmd_height_delta resource can be used to adjust initial size X11: status display split into three columns to accomodate Stone/Deaf/Lev/&c; NetHack*status_condition.foreground, .background, and .showGrip resources replaced by status_condition[1-3].* +X11: more terminal-like default resources NetHack Community Patches (or Variation) Included From 996dd7192d05f87bac35f3ed5f022076532fbd4a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 19 Sep 2016 15:44:04 +0300 Subject: [PATCH 06/19] Horses have a tiny chance of being generated with a saddle Saddles are rare. Make them less so by giving domestic saddleable creatures 1% chance of being generated with a saddle. --- src/makemon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/makemon.c b/src/makemon.c index b38f64fa4..a058cb16c 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1302,6 +1302,13 @@ int mmflags; m_initweap(mtmp); /* equip with weapons / armor */ m_initinv(mtmp); /* add on a few special items incl. more armor */ m_dowear(mtmp, TRUE); + + if (!rn2(100) && is_domestic(ptr) + && can_saddle(mtmp) && !which_armor(mtmp, W_SADDLE)) { + struct obj *otmp = mksobj(SADDLE, TRUE, FALSE); + put_saddle_on_mon(otmp, mtmp); + } + } else { /* no initial inventory is allowed */ if (mtmp->minvent) From 723edd9af9dd435554f81b2dcbd8c87911c7d04e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 19 Sep 2016 15:47:12 +0300 Subject: [PATCH 07/19] fixes entry --- doc/fixes36.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 7ae3f0b03..d168cbe0a 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -493,6 +493,7 @@ different liquids when hallucinating when moving a cursor for travel target, show if there is no known travel path to that location, if "autodescribe" is on show the reason why travel was interrupted if mention_walls is on +random horses have a tiny chance of being generated saddled Platform- and/or Interface-Specific New Features From 28e36b31363f0a0ab1b68a902838cf12e133b587 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 20 Sep 2016 18:36:03 +0300 Subject: [PATCH 08/19] Add full compass coordinate mode for screen readers --- doc/Guidebook.mn | 1 + doc/Guidebook.tex | 1 + include/flag.h | 1 + src/do_name.c | 19 +++++++++++++------ src/options.c | 8 +++++++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index eef8ccc6a..7e9340869 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2698,6 +2698,7 @@ The possible settings are: .sd .si .CC c "compass ('east' or '3s' or '2n,4w');" +.CC f "full compass ('east' or '3south' or '2north,4west');" .CC m "map (map column x=0 is not used);" .CC s "screen [row,column] (row is offset to match tty usage);" .CC n "none (no coordinates shown) [default]." diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 98218165e..272e9e758 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3230,6 +3230,7 @@ The possible settings are: %.sd %.si {\tt c} --- \verb#compass ('east' or '3s' or '2n,4w')#;\\ +{\tt f} --- \verb#full compass ('east' or '3south' or '2north,4west')#;\\ {\tt m} --- \verb#map (map column x=0 is not used)#;\\ {\tt s} --- \verb#screen [row,column] (row is offset to match tty usage)#;\\ {\tt n} --- \verb#none (no coordinates shown) [default]#. diff --git a/include/flag.h b/include/flag.h index 1f79f07dd..47139d355 100644 --- a/include/flag.h +++ b/include/flag.h @@ -173,6 +173,7 @@ struct sysflag { #define GPCOORDS_NONE 'n' #define GPCOORDS_MAP 'm' #define GPCOORDS_COMPASS 'c' +#define GPCOORDS_COMFULL 'f' #define GPCOORDS_SCREEN 's' struct instance_flags { diff --git a/src/do_name.c b/src/do_name.c index 594cab44d..11d9127c2 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -232,11 +232,11 @@ int gloc; } char * -dxdy_to_dist_descr(dx, dy) +dxdy_to_dist_descr(dx, dy, fulldir) int dx, dy; +boolean fulldir; { - /* [12] suffices, but guard against long translation for direction-name */ - static char buf[20]; + static char buf[30]; int dst; if (!dx && !dy) { @@ -245,18 +245,23 @@ int dx, dy; /* explicit direction; 'one step' is implicit */ Sprintf(buf, "%s", directionname(dst)); } else { + const char *dirnames[4][2] = { + { "n", "north" }, + { "s", "south" }, + { "w", "west" }, + { "e", "east" } }; buf[0] = '\0'; /* 9999: protect buf[] against overflow caused by invalid values */ if (dy) { if (abs(dy) > 9999) dy = sgn(dy) * 9999; - Sprintf(eos(buf), "%d%c%s", abs(dy), (dy > 0) ? 's' : 'n', + Sprintf(eos(buf), "%d%s%s", abs(dy), dirnames[(dy > 0)][fulldir], dx ? "," : ""); } if (dx) { if (abs(dx) > 9999) dx = sgn(dx) * 9999; - Sprintf(eos(buf), "%d%c", abs(dx), (dx > 0) ? 'e' : 'w'); + Sprintf(eos(buf), "%d%s", abs(dx), dirnames[2 + (dx > 0)][fulldir]); } } return buf; @@ -275,11 +280,13 @@ char *outbuf, cmode; switch (cmode) { default: break; + case GPCOORDS_COMFULL: case GPCOORDS_COMPASS: /* "east", "3s", "2n,4w" */ dx = x - u.ux; dy = y - u.uy; - Sprintf(outbuf, "(%s)", dxdy_to_dist_descr(dx, dy)); + Sprintf(outbuf, "(%s)", + dxdy_to_dist_descr(dx, dy, cmode == GPCOORDS_COMFULL)); break; case GPCOORDS_MAP: /* x,y */ /* upper left corner of map is <1,0>; diff --git a/src/options.c b/src/options.c index 225c4aa85..6a0a0d10c 100644 --- a/src/options.c +++ b/src/options.c @@ -2362,7 +2362,8 @@ boolean tinitial, tfrom_file; return; } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { static char gpcoords[] = { GPCOORDS_NONE, GPCOORDS_COMPASS, - GPCOORDS_MAP, GPCOORDS_SCREEN, '\0' }; + GPCOORDS_COMFULL, GPCOORDS_MAP, + GPCOORDS_SCREEN, '\0' }; char c = lowc(*op); if (c && index(gpcoords, c)) @@ -4104,6 +4105,10 @@ boolean setinitial, setfromfile; add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_COMPASS, 0, ATR_NONE, "compass ('east' or '3s' or '2n,4w')", (gp == GPCOORDS_COMPASS) ? MENU_SELECTED : MENU_UNSELECTED); + any.a_char = GPCOORDS_COMFULL; + add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_COMFULL, + 0, ATR_NONE, "full compass ('east' or '3south' or '2north,4west')", + (gp == GPCOORDS_COMFULL) ? MENU_SELECTED : MENU_UNSELECTED); any.a_char = GPCOORDS_MAP; add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_MAP, 0, ATR_NONE, "map ", @@ -4917,6 +4922,7 @@ char *buf; Sprintf(buf, "%s", (iflags.getpos_coords == GPCOORDS_MAP) ? "map" : (iflags.getpos_coords == GPCOORDS_COMPASS) ? "compass" + : (iflags.getpos_coords == GPCOORDS_COMFULL) ? "full compass" : (iflags.getpos_coords == GPCOORDS_SCREEN) ? "screen" : "none"); } else if (!strcmp(optname, "scores")) { From e14120b282a1f233be29d9fbcdf0225e78d974e0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 20 Sep 2016 21:03:47 +0300 Subject: [PATCH 09/19] Add completely blank symbol set The blank symbol set can be used with screen reader software to prevent it from reading the map symbols. Prevent a segfault when looking at the map and many symbols share the same character. Don't list too many symbols when looking at those, if many share the same character. --- dat/symbols | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/pager.c | 6 ++ 2 files changed, 176 insertions(+) diff --git a/dat/symbols b/dat/symbols index 58699a8c5..fd0549bc7 100644 --- a/dat/symbols +++ b/dat/symbols @@ -386,6 +386,176 @@ start: NHAccess S_explode9: \047 finish +# All symbols are spaces +start: Blank + Description: Completely blank symbols + S_air: \032 + S_altar: \032 + S_amulet: \032 + S_angel: \032 + S_ant: \032 + S_anti_magic_trap: \032 + S_armor: \032 + S_armour: \032 + S_arrow_trap: \032 + S_ball: \032 + S_bars: \032 + S_bat: \032 + S_bear_trap: \032 + S_blcorn: \032 + S_blob: \032 + S_book: \032 + S_boomleft: \032 + S_boomright: \032 + S_boulder: \032 + S_brcorn: \032 + S_centaur: \032 + S_chain: \032 + S_cloud: \032 + S_cockatrice: \032 + S_coin: \032 + S_corr: \032 + S_crwall: \032 + S_dart_trap: \032 + S_demon: \032 + S_digbeam: \032 + S_dnladder: \032 + S_dnstair: \032 + S_dog: \032 + S_dragon: \032 + S_eel: \032 + S_elemental: \032 + S_explode1: \032 + S_explode2: \032 + S_explode3: \032 + S_explode4: \032 + S_explode5: \032 + S_explode6: \032 + S_explode7: \032 + S_explode8: \032 + S_explode9: \032 + S_eye: \032 + S_falling_rock_trap: \032 + S_feline: \032 + S_fire_trap: \032 + S_flashbeam: \032 + S_food: \032 + S_fountain: \032 + S_fungus: \032 + S_gem: \032 + S_ghost: \032 + S_giant: \032 + S_gnome: \032 + S_golem: \032 + S_grave: \032 + S_gremlin: \032 + S_hbeam: \032 + S_hcdbridge: \032 + S_hcdoor: \032 + S_hodoor: \032 + S_hole: \032 + S_human: \032 + S_humanoid: \032 + S_hwall: \032 + S_imp: \032 + S_jabberwock: \032 + S_jelly: \032 + S_kobold: \032 + S_kop: \032 + S_land_mine: \032 + S_lava: \032 + S_leprechaun: \032 + S_level_teleporter: \032 + S_lich: \032 + S_light: \032 + S_litcorr: \032 + S_lizard: \032 + S_lslant: \032 + S_magic_portal: \032 + S_magic_trap: \032 + S_mimic: \032 + S_mimic_def: \032 + S_mummy: \032 + S_naga: \032 + S_nymph: \032 + S_ogre: \032 + S_orc: \032 + S_piercer: \032 + S_pit: \032 + S_poisoncloud: \032 + S_polymorph_trap: \032 + S_pool: \032 + S_potion: \032 + S_pudding: \032 + S_quadruped: \032 + S_quantmech: \032 + S_ring: \032 + S_rock: \032 + S_rodent: \032 + S_rolling_boulder_trap: \032 + S_rslant: \032 + S_rust_trap: \032 + S_rustmonst: \032 + S_scroll: \032 + S_sink: \032 + S_sleeping_gas_trap: \032 + S_snake: \032 + S_spider: \032 + S_spiked_pit: \032 + S_squeaky_board: \032 + S_ss1: \032 + S_ss2: \032 + S_ss3: \032 + S_ss4: \032 + S_statue_trap: \032 + S_stone: \032 + S_sw_bc: \032 + S_sw_bl: \032 + S_sw_br: \032 + S_sw_ml: \032 + S_sw_mr: \032 + S_sw_tc: \032 + S_sw_tl: \032 + S_sw_tr: \032 + S_tdwall: \032 + S_teleportation_trap: \032 + S_throne: \032 + S_tlcorn: \032 + S_tlwall: \032 + S_tool: \032 + S_trap_door: \032 + S_trapper: \032 + S_trcorn: \032 + S_tree: \032 + S_troll: \032 + S_trwall: \032 + S_tuwall: \032 + S_umber: \032 + S_unicorn: \032 + S_upladder: \032 + S_upstair: \032 + S_vampire: \032 + S_vbeam: \032 + S_vcdbridge: \032 + S_vcdoor: \032 + S_vibrating_square: \032 + S_vodoor: \032 + S_vortex: \032 + S_vwall: \032 + S_wand: \032 + S_water: \032 + S_weapon: \032 + S_web: \032 + S_worm: \032 + S_worm_tail: \032 + S_wraith: \032 + S_xan: \032 + S_xorn: \032 + S_yeti: \032 + S_zombie: \032 + S_zruty: \032 +finish + start: plain Description: Same as Default symbols, except '+' for corner walls S_tlcorn: '+' diff --git a/src/pager.c b/src/pager.c index de932073d..16c5e07f6 100644 --- a/src/pager.c +++ b/src/pager.c @@ -53,6 +53,8 @@ const char *new_str; return 0; space_left = BUFSZ - strlen(buf) - 1; + if (space_left < 1) + return 0; (void) strncat(buf, " or ", space_left); (void) strncat(buf, new_str, space_left - 4); return 1; @@ -918,6 +920,10 @@ const char **firstmatch; * If we are looking at the screen, follow multiple possibilities or * an ambiguous explanation by something more detailed. */ + + if (found > 4) + Sprintf(out_str, "%s", "That can be many things"); + didlook: if (looked) { if (found > 1 || need_to_look) { From 18f6ab00e88a28f69ef720b3f5e61b3237e3914e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 21 Sep 2016 18:43:01 +0300 Subject: [PATCH 10/19] Make it easier to add entries to the help-menu --- src/pager.c | 228 +++++++++++++++++++++++++++------------------------- 1 file changed, 119 insertions(+), 109 deletions(-) diff --git a/src/pager.c b/src/pager.c index 16c5e07f6..7322e6094 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,8 +18,17 @@ STATIC_DCL void FDECL(checkfile, (char *, struct permonst *, BOOLEAN_P, BOOLEAN_P)); STATIC_DCL void FDECL(look_all, (BOOLEAN_P,BOOLEAN_P)); STATIC_DCL void NDECL(whatdoes_help); -STATIC_DCL boolean FDECL(help_menu, (int *)); STATIC_DCL void NDECL(docontact); +STATIC_DCL void NDECL(dispfile_help); +STATIC_DCL void NDECL(dispfile_shelp); +STATIC_DCL void NDECL(dispfile_optionfile); +STATIC_DCL void NDECL(dispfile_license); +STATIC_DCL void NDECL(dispfile_debughelp); +STATIC_DCL void NDECL(hmenu_doextversion); +STATIC_DCL void NDECL(hmenu_dohistory); +STATIC_DCL void NDECL(hmenu_dowhatis); +STATIC_DCL void NDECL(hmenu_dowhatdoes); +STATIC_DCL void NDECL(hmenu_doextlist); #ifdef PORT_HELP extern void NDECL(port_help); #endif @@ -1642,123 +1651,124 @@ docontact() destroy_nhwindow(cwin); } -/* data for help_menu() */ -static const char *help_menu_items[] = { - /* 0*/ "About NetHack (version information).", - /* 1*/ "Long description of the game and commands.", - /* 2*/ "List of game commands.", - /* 3*/ "Concise history of NetHack.", - /* 4*/ "Info on a character in the game display.", - /* 5*/ "Info on what a given key does.", - /* 6*/ "List of game options.", - /* 7*/ "Longer explanation of game options.", - /* 8*/ "List of extended commands.", - /* 9*/ "The NetHack license.", - /* 10*/ "Support information.", -#ifdef PORT_HELP - "%s-specific help and commands.", -#define PORT_HELP_ID 100 -#define WIZHLP_SLOT 12 -#else -#define WIZHLP_SLOT 11 -#endif - "List of wizard-mode commands.", "", (char *) 0 -}; - -STATIC_OVL boolean -help_menu(sel) -int *sel; +void +dispfile_help() { - winid tmpwin = create_nhwindow(NHW_MENU); -#ifdef PORT_HELP - char helpbuf[QBUFSZ]; -#endif - int i, n; - menu_item *selected; - anything any; - - any = zeroany; /* zero all bits */ - start_menu(tmpwin); - if (!wizard) - help_menu_items[WIZHLP_SLOT] = "", - help_menu_items[WIZHLP_SLOT + 1] = (char *) 0; - for (i = 0; help_menu_items[i]; i++) -#ifdef PORT_HELP - /* port-specific line has a %s in it for the PORT_ID */ - if (help_menu_items[i][0] == '%') { - Sprintf(helpbuf, help_menu_items[i], PORT_ID); - any.a_int = PORT_HELP_ID + 1; - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, helpbuf, - MENU_UNSELECTED); - } else -#endif - { - any.a_int = (*help_menu_items[i]) ? i + 1 : 0; - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, - help_menu_items[i], MENU_UNSELECTED); - } - end_menu(tmpwin, "Select one item:"); - n = select_menu(tmpwin, PICK_ONE, &selected); - destroy_nhwindow(tmpwin); - if (n > 0) { - *sel = selected[0].item.a_int - 1; - free((genericptr_t) selected); - return TRUE; - } - return FALSE; + display_file(HELP, TRUE); } +void +dispfile_shelp() +{ + display_file(SHELP, TRUE); +} + +void +dispfile_optionfile() +{ + display_file(OPTIONFILE, TRUE); +} + +void +dispfile_license() +{ + display_file(LICENSE, TRUE); +} + +void +dispfile_debughelp() +{ + display_file(DEBUGHELP, TRUE); +} + +void +hmenu_doextversion() +{ + (void) doextversion(); +} + +void +hmenu_dohistory() +{ + (void) dohistory(); +} + +void +hmenu_dowhatis() +{ + (void) dowhatis(); +} + +void +hmenu_dowhatdoes() +{ + (void) dowhatdoes(); +} + +void +hmenu_doextlist() +{ + (void) doextlist(); +} + +/* data for dohelp() */ +static struct { + void (*f)(); + const char *text; +} help_menu_items[] = { + { hmenu_doextversion, "About NetHack (version information)." }, + { dispfile_help, "Long description of the game and commands." }, + { dispfile_shelp, "List of game commands." }, + { hmenu_dohistory, "Concise history of NetHack." }, + { hmenu_dowhatis, "Info on a character in the game display." }, + { hmenu_dowhatdoes, "Info on what a given key does." }, + { option_help, "List of game options." }, + { dispfile_optionfile, "Longer explanation of game options." }, + { hmenu_doextlist, "List of extended commands." }, + { dispfile_license, "The NetHack license." }, + { docontact, "Support information." }, +#ifdef PORT_HELP + { port_help, "%s-specific help and commands." }, +#endif + { dispfile_debughelp, "List of wizard-mode commands." }, + { NULL, (char *) 0 } +}; + /* the '?' command */ int dohelp() { - int sel = 0; + winid tmpwin = create_nhwindow(NHW_MENU); + char helpbuf[QBUFSZ]; + int i, n; + menu_item *selected; + anything any; + int sel; + char *bufptr; - if (help_menu(&sel)) { - switch (sel) { - case 0: - (void) doextversion(); - break; - case 1: - display_file(HELP, TRUE); - break; - case 2: - display_file(SHELP, TRUE); - break; - case 3: - (void) dohistory(); - break; - case 4: - (void) dowhatis(); - break; - case 5: - (void) dowhatdoes(); - break; - case 6: - option_help(); - break; - case 7: - display_file(OPTIONFILE, TRUE); - break; - case 8: - (void) doextlist(); - break; - case 9: - display_file(LICENSE, TRUE); - break; - case 10: - (void) docontact(); - break; -#ifdef PORT_HELP - case PORT_HELP_ID: - port_help(); - break; -#endif - default: - /* handle slot 11 or 12 */ - display_file(DEBUGHELP, TRUE); - break; + any = zeroany; /* zero all bits */ + start_menu(tmpwin); + + for (i = 0; help_menu_items[i].text; i++) { + if (!wizard && help_menu_items[i].f == dispfile_debughelp) + continue; + if (help_menu_items[i].text[0] == '%') { + Sprintf(helpbuf, help_menu_items[i].text, PORT_ID); + bufptr = helpbuf; + } else { + bufptr = (char *)help_menu_items[i].text; } + any.a_int = i + 1; + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, + bufptr, MENU_UNSELECTED); + } + end_menu(tmpwin, "Select one item:"); + n = select_menu(tmpwin, PICK_ONE, &selected); + destroy_nhwindow(tmpwin); + if (n > 0) { + sel = selected[0].item.a_int - 1; + free((genericptr_t) selected); + (void)(*help_menu_items[sel].f)(); } return 0; } From ce315311f5bd14dac915468c15403aa8ddf5b9b4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 21 Sep 2016 19:25:25 +0300 Subject: [PATCH 11/19] Show keys in travel help wrapped in single quotes --- src/do_name.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/do_name.c b/src/do_name.c index 11d9127c2..c5ee58081 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -54,28 +54,28 @@ const char *goal; boolean doing_what_is; winid tmpwin = create_nhwindow(NHW_MENU); - Sprintf(sbuf, "Use [%c%c%c%c] to move the cursor to %s.", /* hjkl */ + Sprintf(sbuf, "Use '%c', '%c', '%c', '%c' to move the cursor to %s.", /* hjkl */ Cmd.move_W, Cmd.move_S, Cmd.move_N, Cmd.move_E, goal); putstr(tmpwin, 0, sbuf); - putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time."); - putstr(tmpwin, 0, "Or enter a background symbol (ex. <)."); - putstr(tmpwin, 0, "Use @ to move the cursor on yourself."); + putstr(tmpwin, 0, "Use 'H', 'J', 'K', 'L' to move the cursor 8 units at a time."); + putstr(tmpwin, 0, "Or enter a background symbol (ex. '<')."); + putstr(tmpwin, 0, "Use '@' to move the cursor on yourself."); if (!iflags.terrainmode || (iflags.terrainmode & TER_MON) != 0) - putstr(tmpwin, 0, "Use m or M to move the cursor to next monster."); + putstr(tmpwin, 0, "Use 'm' or 'M' to move the cursor to next monster."); if (!iflags.terrainmode || (iflags.terrainmode & TER_OBJ) != 0) - putstr(tmpwin, 0, "Use o or O to move the cursor to next object."); + putstr(tmpwin, 0, "Use 'o' or 'O' to move the cursor to next object."); if (!iflags.terrainmode || (iflags.terrainmode & TER_MAP) != 0) { /* both of these are primarily useful when choosing a travel destination for the '_' command */ putstr(tmpwin, 0, - "Use d or D to move the cursor to next door or doorway."); + "Use 'd' or 'D' to move the cursor to next door or doorway."); putstr(tmpwin, 0, - "Use x or X to move the cursor to unexplored location."); + "Use 'x' or 'X' to move the cursor to unexplored location."); } if (!iflags.terrainmode) { if (getpos_hilitefunc) - putstr(tmpwin, 0, "Use $ to display valid locations."); - putstr(tmpwin, 0, "Use # to toggle automatic description."); + putstr(tmpwin, 0, "Use '$' to display valid locations."); + putstr(tmpwin, 0, "Use '#' to toggle automatic description."); if (iflags.cmdassist) /* assisting the '/' command, I suppose... */ putstr(tmpwin, 0, (iflags.getpos_coords == GPCOORDS_NONE) @@ -84,20 +84,20 @@ const char *goal; /* disgusting hack; the alternate selection characters work for any getpos call, but only matter for dowhatis (and doquickwhatis) */ doing_what_is = (goal == what_is_an_unknown_object); - Sprintf(sbuf, "Type a .%s when you are at the right place.", - doing_what_is ? " or , or ; or :" : ""); + Sprintf(sbuf, "Type a '.'%s when you are at the right place.", + doing_what_is ? " or ',' or ';' or ':'" : ""); putstr(tmpwin, 0, sbuf); if (doing_what_is) { putstr(tmpwin, 0, - " : describe current spot, show 'more info', move to another spot."); + " ':' describe current spot, show 'more info', move to another spot."); Sprintf(sbuf, - " . describe current spot,%s move to another spot;", + " '.' describe current spot,%s move to another spot;", flags.help ? " prompt if 'more info'," : ""); putstr(tmpwin, 0, sbuf); putstr(tmpwin, 0, - " , describe current spot, move to another spot;"); + " ',' describe current spot, move to another spot;"); putstr(tmpwin, 0, - " ; describe current spot, stop looking at things;"); + " ';' describe current spot, stop looking at things;"); } } if (!force) @@ -353,7 +353,7 @@ const char *goal; if (!goal) goal = "desired location"; if (flags.verbose) { - pline("(For instructions type a ?)"); + pline("(For instructions type a '?')"); msg_given = TRUE; } cx = ccp->x; @@ -568,7 +568,7 @@ const char *goal; if (!force) Strcpy(note, "aborted"); else - Sprintf(note, "use %c%c%c%c or .", /* hjkl */ + Sprintf(note, "use '%c', '%c', '%c', '%c' or '.'", /* hjkl */ Cmd.move_W, Cmd.move_S, Cmd.move_N, Cmd.move_E); pline("Unknown direction: '%s' (%s).", visctrl((char) c), From a6d2a48b252d6cf6f6be459f37ca494ecb1b7d78 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Sep 2016 17:07:42 +0300 Subject: [PATCH 12/19] Move getpos return values to header --- include/hack.h | 8 ++++++++ src/pager.c | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/hack.h b/include/hack.h index eeb5ce3e6..45da184a9 100644 --- a/include/hack.h +++ b/include/hack.h @@ -102,6 +102,14 @@ #define CXN_ARTICLE 8 /* include a/an/the prefix */ #define CXN_NOCORPSE 16 /* suppress " corpse" suffix */ +/* getpos() return values */ +enum getpos_retval { + LOOK_TRADITIONAL = 0, /* '.' -- ask about "more info?" */ + LOOK_QUICK, /* ',' -- skip "more info?" */ + LOOK_ONCE, /* ';' -- skip and stop looping */ + LOOK_VERBOSE /* ':' -- show more info w/o asking */ +}; + /* * This is the way the game ends. If these are rearranged, the arrays * in end.c and topten.c will need to be changed. Some parts of the diff --git a/src/pager.c b/src/pager.c index 7322e6094..184027ba0 100644 --- a/src/pager.c +++ b/src/pager.c @@ -958,12 +958,6 @@ const char **firstmatch; return found; } -/* getpos() return values */ -#define LOOK_TRADITIONAL 0 /* '.' -- ask about "more info?" */ -#define LOOK_QUICK 1 /* ',' -- skip "more info?" */ -#define LOOK_ONCE 2 /* ';' -- skip and stop looping */ -#define LOOK_VERBOSE 3 /* ':' -- show more info w/o asking */ - /* also used by getpos hack in do_name.c */ const char what_is_an_unknown_object[] = "an unknown object"; From 6c093348afb74529a32cbd52c7dba684d37a9245 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Sep 2016 17:18:07 +0300 Subject: [PATCH 13/19] Separate function to check for prefix command keys --- src/cmd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 441a6938a..31e2a4bd1 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -3747,6 +3747,16 @@ char c; return (boolean) (c == C('r') || (Cmd.num_pad && c == C('l'))); } +boolean +prefix_cmd(c) +char c; +{ + return (boolean) (c == 'g' || c == 'G' + || c == 'm' || c == 'M' + || c == 'F' + || (Cmd.num_pad && (c == '5' || c == '-'))); +} + /* * uses getdir() but unlike getdir() it specifically * produces coordinates using the direction from getdir() @@ -4193,8 +4203,7 @@ parse() in_line[0] = foo; in_line[1] = '\0'; - if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' || foo == 'F' - || (Cmd.num_pad && (foo == '5' || foo == '-'))) { + if (prefix_cmd(foo)) { foo = readchar(); savech((char) foo); in_line[1] = foo; From 539401ca8845a1246c5dec2c10bcc61d85370909 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Sep 2016 19:04:38 +0300 Subject: [PATCH 14/19] Add missing glyphs to Blank symset --- dat/symbols | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dat/symbols b/dat/symbols index fd0549bc7..bda939af3 100644 --- a/dat/symbols +++ b/dat/symbols @@ -416,6 +416,7 @@ start: Blank S_coin: \032 S_corr: \032 S_crwall: \032 + S_darkroom: \032 S_dart_trap: \032 S_demon: \032 S_digbeam: \032 @@ -477,6 +478,7 @@ start: Blank S_mimic_def: \032 S_mummy: \032 S_naga: \032 + S_ndoor: \032 S_nymph: \032 S_ogre: \032 S_orc: \032 @@ -493,6 +495,7 @@ start: Blank S_rock: \032 S_rodent: \032 S_rolling_boulder_trap: \032 + S_room: \032 S_rslant: \032 S_rust_trap: \032 S_rustmonst: \032 @@ -540,6 +543,7 @@ start: Blank S_vcdoor: \032 S_vibrating_square: \032 S_vodoor: \032 + S_vcdoor: \032 S_vortex: \032 S_vwall: \032 S_wand: \032 From b30a4d86c46a27479d047477c2b33450be0278b2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Sep 2016 19:51:43 +0300 Subject: [PATCH 15/19] Add missing dark room symbol to the Guidebook --- doc/Guidebook.mn | 1 + doc/Guidebook.tex | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 7e9340869..dacbd1db5 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -3187,6 +3187,7 @@ c S_cockatrice (cockatrice) $ S_coin (pile of coins) # S_corr (corridor) - S_crwall (wall) +# S_darkroom (dark room) ^ S_dart_trap (dart trap) & S_demon (major demon) * S_digbeam (dig beam) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 272e9e758..2f6cf96f6 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3828,6 +3828,7 @@ Default & Symbol Name & Description\\ \verb@$@ & S\verb+_+coin & (pile of coins)\\ \verb@#@ & S\verb+_+corr & (corridor)\\ \verb@-@ & S\verb+_+crwall & (wall)\\ +\verb@-@ & S\verb+_+darkroom & (dark room)\\ \verb@^@ & S\verb+_+dart\verb+_+trap & (dart trap)\\ \verb@&@ & S\verb+_+demon & (major demon)\\ \verb@*@ & S\verb+_+digbeam & (dig beam)\\ From ea94100e9d0f56385d55f388cd93f854fd3d4c3c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Sep 2016 20:59:19 +0300 Subject: [PATCH 16/19] Give feedback just before timed levitation runs out --- doc/fixes36.1 | 1 + src/timeout.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index d168cbe0a..2344253f7 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -494,6 +494,7 @@ when moving a cursor for travel target, show if there is no known travel path to that location, if "autodescribe" is on show the reason why travel was interrupted if mention_walls is on random horses have a tiny chance of being generated saddled +give feedback just before timed levitation runs out Platform- and/or Interface-Specific New Features diff --git a/src/timeout.c b/src/timeout.c index 902b9befd..47553e2c8 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -8,6 +8,7 @@ STATIC_DCL void NDECL(stoned_dialogue); STATIC_DCL void NDECL(vomiting_dialogue); STATIC_DCL void NDECL(choke_dialogue); +STATIC_DCL void NDECL(levitation_dialogue); STATIC_DCL void NDECL(slime_dialogue); STATIC_DCL void NDECL(slip_or_trip); STATIC_DCL void FDECL(see_lamp_flicker, (struct obj *, const char *)); @@ -153,6 +154,38 @@ choke_dialogue() exercise(A_STR, FALSE); } +static NEARDATA const char *const levi_texts[] = { + "You float slightly lower.", + "You wobble unsteadily %s the %s.", + NULL +}; + +STATIC_OVL void +levitation_dialogue() +{ + long i = (HLevitation & TIMEOUT) / 2L; + + if (ELevitation) + return; + + if (!ACCESSIBLE(levl[u.ux][u.uy].typ) + && !is_pool_or_lava(u.ux,u.uy)) + return; + + if (((HLevitation & TIMEOUT) % 2L) && i >= 0L && i < SIZE(levi_texts)) { + const char *s = levi_texts[SIZE(levi_texts) - i - 1L]; + if (s) { + if (index(s, '%')) { + boolean danger = is_pool_or_lava(u.ux, u.uy) + && !Is_waterlevel(&u.uz); + pline(s, danger ? "over" : "in", + danger ? surface(u.ux, u.uy) : "air"); + } else + pline1(s); + } + } +} + static NEARDATA const char *const slime_texts[] = { "You are turning a little %s.", /* 5 */ "Your limbs are getting oozy.", /* 4 */ @@ -238,6 +271,8 @@ nh_timeout() vomiting_dialogue(); if (Strangled) choke_dialogue(); + if (Levitation) + levitation_dialogue(); if (u.mtimedone && !--u.mtimedone) { if (Unchanging) u.mtimedone = rnd(100 * youmonst.data->mlevel + 1); From eac1d825f2200d01f413e48af37ff80f3c22834e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 25 Sep 2016 18:37:24 +0300 Subject: [PATCH 17/19] Fix a bug binding menu command to a default object class character Due to a wrong looping variable, it was possible to bind a menu accelerator key to a default object class. --- src/options.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/options.c b/src/options.c index 6a0a0d10c..ebe189e6e 100644 --- a/src/options.c +++ b/src/options.c @@ -1768,6 +1768,23 @@ char **opp; return FALSE; } +/* Check if character c is illegal as a menu command key */ +boolean +illegal_menu_cmd_key(c) +char c; +{ + if (c == 0 || c == '\r' || c == '\n' || c == '\033' + || c == ' ' || digit(c) || (letter(c) && c != '@')) + return TRUE; + else { /* reject default object class symbols */ + int j; + for (j = 1; j < MAXOCLASSES; j++) + if (c == def_oc_syms[j].sym) + return TRUE; + } + return FALSE; +} + void parseoptions(opts, tinitial, tfrom_file) register char *opts; @@ -3226,22 +3243,11 @@ boolean tinitial, tfrom_file; } else if ((op = string_for_opt(opts, FALSE)) != 0) { int j; char c, op_buf[BUFSZ]; - boolean isbad = FALSE; escapes(op, op_buf); c = *op_buf; - if (c == 0 || c == '\r' || c == '\n' || c == '\033' - || c == ' ' || digit(c) || (letter(c) && c != '@')) - isbad = TRUE; - else /* reject default object class symbols */ - for (j = 1; j < MAXOCLASSES; j++) - if (c == def_oc_syms[i].sym) { - isbad = TRUE; - break; - } - - if (isbad) + if (illegal_menu_cmd_key(c)) badoption(opts); else add_menu_cmd_alias(c, default_menu_cmd_info[i].cmd); From 60b4e5528ef953859ab69c3ef66df201108c5f95 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 29 Sep 2016 18:48:52 +0300 Subject: [PATCH 18/19] Show some timed properties in #timeout Also simplify the levitation_dialogue a bit --- doc/fixes36.1 | 1 + src/timeout.c | 63 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 2344253f7..1ab4b2566 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -343,6 +343,7 @@ differentiate symset and roguesymset option menu prompts don't show monster vs. monster attack message, if the message refers to a monster that cannot be sensed by the hero umber hulk gazing at hidden mimic forces mimic to unhide +show some timed hero properties in wizard-mode #timeout Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/timeout.c b/src/timeout.c index 47553e2c8..430784e5a 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -123,14 +123,18 @@ vomiting_dialogue() } static NEARDATA const char *const choke_texts[] = { - "You find it hard to breathe.", "You're gasping for air.", - "You can no longer breathe.", "You're turning %s.", "You suffocate." + "You find it hard to breathe.", + "You're gasping for air.", + "You can no longer breathe.", + "You're turning %s.", + "You suffocate." }; static NEARDATA const char *const choke_texts2[] = { "Your %s is becoming constricted.", "Your blood is having trouble reaching your brain.", - "The pressure on your %s increases.", "Your consciousness is fading.", + "The pressure on your %s increases.", + "Your consciousness is fading.", "You suffocate." }; @@ -156,14 +160,14 @@ choke_dialogue() static NEARDATA const char *const levi_texts[] = { "You float slightly lower.", - "You wobble unsteadily %s the %s.", - NULL + "You wobble unsteadily %s the %s." }; STATIC_OVL void levitation_dialogue() { - long i = (HLevitation & TIMEOUT) / 2L; + /* -1 because the last message comes via float_down() */ + long i = (((HLevitation & TIMEOUT) - 1L) / 2L); if (ELevitation) return; @@ -172,17 +176,15 @@ levitation_dialogue() && !is_pool_or_lava(u.ux,u.uy)) return; - if (((HLevitation & TIMEOUT) % 2L) && i >= 0L && i < SIZE(levi_texts)) { - const char *s = levi_texts[SIZE(levi_texts) - i - 1L]; - if (s) { - if (index(s, '%')) { - boolean danger = is_pool_or_lava(u.ux, u.uy) - && !Is_waterlevel(&u.uz); - pline(s, danger ? "over" : "in", - danger ? surface(u.ux, u.uy) : "air"); - } else - pline1(s); - } + if (((HLevitation & TIMEOUT) % 2L) && i > 0L && i <= SIZE(levi_texts)) { + const char *s = levi_texts[SIZE(levi_texts) - i]; + if (index(s, '%')) { + boolean danger = is_pool_or_lava(u.ux, u.uy) + && !Is_waterlevel(&u.uz); + pline(s, danger ? "over" : "in", + danger ? surface(u.ux, u.uy) : "air"); + } else + pline1(s); } } @@ -1488,6 +1490,26 @@ timer_element *base; } } +static boolean print_prop_header = TRUE; +void +print_prop(win, text, prop) +winid win; +const char *text; +long prop; +{ + char buf[BUFSZ]; + if (prop & TIMEOUT) { + if (print_prop_header) { + putstr(win, 0, ""); + putstr(win, 0, "Properties:"); + putstr(win, 0, ""); + print_prop_header = FALSE; + } + Sprintf(buf, " %10s: %ld", text, (prop & TIMEOUT)); + putstr(win, 0, buf); + } +} + int wiz_timeout_queue() { @@ -1505,6 +1527,13 @@ wiz_timeout_queue() putstr(win, 0, ""); print_queue(win, timer_base); + print_prop_header = TRUE; + print_prop(win, "Levitation", HLevitation); + print_prop(win, "Stoned", Stoned); + print_prop(win, "Vomiting", Vomiting); + print_prop(win, "Strangled", Strangled); + print_prop(win, "Slimed", Slimed); + display_nhwindow(win, FALSE); destroy_nhwindow(win); From a562cc88a7d46a547489e275f34b31e212fcddd7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 2 Oct 2016 00:03:33 +0300 Subject: [PATCH 19/19] Fix Blank symset --- dat/symbols | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/symbols b/dat/symbols index bda939af3..de4b5dc5b 100644 --- a/dat/symbols +++ b/dat/symbols @@ -459,6 +459,7 @@ start: Blank S_humanoid: \032 S_hwall: \032 S_imp: \032 + S_invisible: \032 S_jabberwock: \032 S_jelly: \032 S_kobold: \032 @@ -543,7 +544,6 @@ start: Blank S_vcdoor: \032 S_vibrating_square: \032 S_vodoor: \032 - S_vcdoor: \032 S_vortex: \032 S_vwall: \032 S_wand: \032