Commit Graph

6176 Commits

Author SHA1 Message Date
Pasi Kallinen
680c8a542c Add key rebinding
This is a modified version of Jason Dorje Short's key rebinding
patch, and allows also binding special keys, such as the ones
used in getloc and getpos.

One of the ways to play NetHack on nethack.alt.org is via a HTML
terminal in browser. Unfortunately this means several ctrl-key
combinations cannot be entered, because the browser intercepts
those. Similar thing applies to some international keyboard layouts
on Windows. With this patch, the user can just rebind the command
to a key that works best for them.

I've tested this on Linux TTY, X11, and Windows TTY and GUI.
2016-10-05 20:04:56 +03:00
PatR
d0783facdc tribute: The Shepherd's Crown 2016-10-04 17:08:16 -07:00
Pasi Kallinen
f07c5570ca Add configurable symbol entry for strange object 2016-10-03 09:36:28 +03:00
Pasi Kallinen
a562cc88a7 Fix Blank symset 2016-10-02 00:03:37 +03:00
Pasi Kallinen
60b4e5528e Show some timed properties in #timeout
Also simplify the levitation_dialogue a bit
2016-09-29 18:48:56 +03:00
Pasi Kallinen
eac1d825f2 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.
2016-09-25 18:38:58 +03:00
Pasi Kallinen
ea94100e9d Give feedback just before timed levitation runs out 2016-09-24 20:59:59 +03:00
Pasi Kallinen
b30a4d86c4 Add missing dark room symbol to the Guidebook 2016-09-24 19:51:43 +03:00
Pasi Kallinen
539401ca88 Add missing glyphs to Blank symset 2016-09-24 19:04:38 +03:00
Pasi Kallinen
6c093348af Separate function to check for prefix command keys 2016-09-24 17:18:07 +03:00
Pasi Kallinen
a6d2a48b25 Move getpos return values to header 2016-09-24 17:07:42 +03:00
Pasi Kallinen
ce315311f5 Show keys in travel help wrapped in single quotes 2016-09-21 19:25:25 +03:00
Pasi Kallinen
18f6ab00e8 Make it easier to add entries to the help-menu 2016-09-21 18:46:54 +03:00
Pasi Kallinen
e14120b282 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.
2016-09-20 21:03:51 +03:00
Pasi Kallinen
28e36b3136 Add full compass coordinate mode for screen readers 2016-09-20 18:36:06 +03:00
Pasi Kallinen
723edd9af9 fixes entry 2016-09-19 15:47:12 +03:00
Pasi Kallinen
996dd7192d 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.
2016-09-19 15:44:07 +03:00
Pasi Kallinen
1cec86763e Fixes entries 2016-09-16 22:05:32 +03:00
Pasi Kallinen
b5a027c3fe 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
2016-09-16 21:28:23 +03:00
Pasi Kallinen
cd2703dc35 Differentiate the symset and roguesymset menu prompts 2016-09-16 15:50:42 +03:00
Pasi Kallinen
e177af1e8b Update X11 style, define button rounding 2016-09-15 18:45:18 +03:00
Pasi Kallinen
f0d6a9e02d Better default style for X11
This tries to mimic the terminal, and adds some defines making it easier
to configure.
2016-09-15 18:23:19 +03:00
PatR
b9a6f07c14 fix #H4521 - distant squeak
Vary the message about hearing a squeak when it is close.
2016-09-12 00:24:14 -07:00
Pasi Kallinen
9732d90bd4 Fix wrong parameter order 2016-09-06 17:35:59 +03:00
PatR
ff817b55e1 fix bz623 - 'D' when not carrying anything
With menustyle set to "full" or "partial", using 'D' when not
carrying anything gave no feedback.  (Modes "traditional" and
"combination" give "you have nothing to drop" via ggetobj().)

Also, there's no need to reset in-progress armor removal, lock
picking, or trap setting if you don't actually drop anything.
The inventory they're set to operate on or with stays intact.
2016-09-02 02:38:10 -07:00
Pasi Kallinen
05ca204ae4 Expand blind/accessibility section in the Guidebook 2016-09-02 09:24:22 +03:00
PatR
4ef3fe22d9 corpse eating feedback
Eating a corpse and being told that it "tastes okay" (relatively
recent change so that omnivores don't find the taste of everything
to be "terrible") doesn't warrant an exclamation point.
2016-09-01 18:26:09 -07:00
Pasi Kallinen
f82205c232 For travel target location, report if no known travel path
Yet another accessibility feature.  When asked for a location
to travel, and autodescribe is on, the location description
has "(no travel path)" appended, if there is no known path
to that location.
2016-08-31 22:08:15 +03:00
Pasi Kallinen
2710106661 Accessibility messages when run or travel is interrupted
These were inspired by the blind accessibility changes by
Alexei Pepers.
2016-08-29 20:47:40 +03:00
Pasi Kallinen
95447b1cf5 Also pass raw printed texts to the msghandler 2016-08-27 21:07:33 +03:00
Pasi Kallinen
db83116130 Wait for the message handler process to finish 2016-08-27 20:13:17 +03:00
PatR
6fc21bfaa0 fix #H4492 - ing_suffix("throw") gave "throwwing"
The bug report assumed "you mime throwwing something" feedback
from 't-' was a typo, but 'throwwing' gets generated from 'throw'.
Change ing_suffix() not to double final 'w'.  Presumeably 'w' and 'y'
are exceptions because they're sometimes used as vowels.

Change 'strrchr()' to 'rindex()' like the rest of nethack.  Someday
those will need to be switched the other way around.

Add some missing bounds checking, although since ing_suffix() isn't
used for user-supplied strings, that's probably superfluous.
2016-08-23 19:37:42 -07:00
Pasi Kallinen
01fd5dcbb1 Fix Guidebook typos 2016-08-21 10:05:45 +03:00
Pasi Kallinen
20893bf95d Fix tribute typos
Ran the tribute file through a spellchecker, and double-checked with Pat as he
added most of the tributes.
2016-08-21 09:16:25 +03:00
PatR
a16000d80a fix #H4482 - "a some <foo> corpses"
farlook was changed (end of December) to use doname instead of xname
to yield more info for items which had already been seen up close,
but it gave away info about ones which hadn't.  So doname was changed
(end of April) to use "some" instead of precise quantity (when the
quantity is greater than 1) for the latter, but that doesn't work
well with corpse_xname() when the hero is blind, yielding "a some
<foo> corpses".  While testing the first fix attempt, I noticed that
pickup gave "you can only lift some of the some <foo> corpses".

This fix is far from perfect.  farlook can still say "some <item>s"
but lookhere and pickup always say "N <item>s".  Picking up a stack
while blind will show "N <item>s" in inventory display, but dropping
it while still blind will revert to "some <item>s" for farlook.
2016-08-13 11:17:32 -07:00
PatR
b848f2732d fix #H4476 - monster class via member of class
Blessed genocide of "titans" wiped out all quadrupeds because
"titan" is a prefix of "titanothere".  After class letters and
class descriptions have been rejected, Have name_to_monclass()
resort to name_to_mon() instead of doing its own less detailed
name matching.
2016-08-11 18:53:52 -07:00
PatR
a72d19b905 fix #H4475 - shop message about disenchanted item
drain_item() always assumed player was responsible, so called
costly_alteration() to adjust shop price of disenchanted item.
If it was unpaid and the effect was caused by a disenchanter
attack rather than by the hero, the feedback was nonsensical.

This also lets a disenchanter hit worn rings, amulet, or blindfold
if no armor gets targetted.  Amulets, blindfolds, and most rings
have no charge to be drained, but several types of rings do.
2016-08-10 02:04:09 -07:00
PatR
62fd796271 fix #H4472 & #H4473 - incorrect total_tiles_used
The value calculated for total_tiles_used never got adjusted for
displaying statues-as-monsters.  The most common configuration(s)
using tiles don't care, but the combination of X11 plus USE_XPM
needs an accurate value there.
2016-08-06 19:30:44 -07:00
PatR
7f8e8293f9 fix #H4468 - [no-]autopickup in shop
Autopickup for pickup_types is disabled for unpaid shop goods, but
always-pick-up autopickup_exception still picked things up, as did
pickup_thrown for thrown objects.  Now they'll only work in shops
for no_charge items (dropped by hero and shk didn't want, or hero
declined to sell).

costly_spot() was being recalculated for every item which passed
pickup_types.  This changes autopickup to check it once for a given
autopickup operation and cache the result.  [Whenever the hero moves,
a room entry check is performed.  That ought to be extended to cache
costly_spot() for <u.ux,u.uy> in iflags or u.]
2016-08-05 19:17:47 -07:00
PatR
694b32cae2 option parsing crash: 'playmode' without value
Reported directly to devteam, specifying the playmode option without
appending a value caused a segfault during options parsing.  The
argument passed to string_for_opt() ought to have been False for
"not optional" to trigger a "bad syntax" message, but even then the
playmode parsing needs to check for Null to prevent the crash.

"Bad syntax" is awfully vague.  In cases like this, we can be more
precise.  Now it will say "Missing value" instead.
2016-08-04 17:42:26 -07:00
PatR
e03c14eeae dungeon overview when escaping the dungeon
Noticed while testing something.  Final disclosure of dungeon
overview showed "Level 1: <- You were here", which looked a bit odd
when the game ended by climbing the stairs to escape the dungeon.
Change the annotation when escaping to be "<- You left from here".

'Here' will usually be level 1, but not always.
2016-08-03 18:51:55 -07:00
PatR
b49830f4c1 fix #H4462 - grammar in corpse eating message
"The the Wizard of Yendor corpse tastes terrible."

"The" was supplied when formatting the sentence, "the" when formatting
the corpse object.  Same applied to several other monsters, those
flagged as unique and without personal name (Oracle, Cyclops, others).

This also changes the corpse eating message to not always specify the
taste as "terrible" when the eater is omnivorous.

It also makes corpses (and tins) of unique monsters be wishable in
wizard mode.  I had killed the Wizard at least half a dozen times
without a corpse being left, so used wishing instead.  Later retries
did finally leave one--lack of corpse turned out to just be by chance.
2016-08-03 17:59:10 -07:00
PatR
bde2aa5ea2 lev_comp shifts of negative values
Apparently the compiler for OSX 10.11 + Xcode 7.3.1 is defaulting
to C99 (or C11?) because it is enabling a gcc warning that is
included by -Wextra (newer name for obscure -W) for C99 or later.

lev_comp.y:2276:20: warning: shifting a negative signed value is undefined
 [-Wshift-negative-value]
       (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[(1) - (1)].i));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/sp_lev.h:248:33: note: expanded from macro 'SP_OBJ_PACK'
\#define SP_OBJ_PACK(o, c) (((o) << 8) + ((char) (c)))
\                            ~~~ ^

SP_MONST_PACK() and SP_OBJ_PACK() are both called with -1, and
SP_MAPCHAR_PACK() is called with either -1 or -2.  The revised
macros add 10 when encoding and subtract it when decoding so that
they can handle -1 through -10 without shifting negative values.

There were also several bitwise ANDs that the bulk reformatting
misclassified as casts of hardcoded addresses.
2016-08-03 01:17:43 -07:00
PatR
2160dee4ca lint suppression
botl.c   - unused argument in #if STATUS_HILITES code.

mkmaze.c - "clang version 7.3.0 (clang-703.0.31)", or whatever version
  of gcc it's based on, warns that ''#define register /*empty*/''
  hides a keyword.  '-Wkeyword-macro' isn't mentioned in the recent gcc
  manual I checked, but it is being enabled by specifying '-pedantic'
  (rather than -Wall or -W) to the preprocessor.  It could be turned
  off via '-Wno-keyword-macro' but this removes all mkmaze.c's register
  references instead.  (Sean wanted that, and this might be why....)
2016-07-30 19:08:25 -07:00
PatR
e5263b5ff0 fix #H4460 - tribute typos in /Thud!/
Passage 2: DELIBERATEDLY -> DELIBERATELY
Passage 6: vengence -> vengeance
2016-07-30 14:53:00 -07:00
PatR
5e0cf04b04 update sys/unix/hints/macosx10.10
On OSX, one of the XQuartz header files triggers a compiler warning
about using a gcc extension, resulting in a diagnostic for each of
the files compiled with the WANT_WIN_X11 set of CFLAGS.  Use the
same fix as hints/macosx10.8 already does.
2016-07-30 01:59:27 -07:00
PatR
6632c380f3 fix #H4457 - grammar nitpick
"Your pair of speed boots glow silver for a moment." should be
"Your pair of speed boots glows silver for a moment.".  The fix
reverses a post-3.6.0 change to is_plural().  Also, add new
pair_of() to test for object formatted as "pair of Bars".  For verb
usage, that's definitely singular, but for pronoun usage, sometimes
plural seems better (although it might actually be incorrect).

I fixed up the formatting of a block comment in obj.h, but it is
still a candidate for tab cleanup.
2016-07-30 01:19:44 -07:00
PatR
d466dc3742 lint cleanup: '!mptr->mmove == 0'
The compiler whined about that, and rightly so.  It happens to yield
the right value by accident, so there should be no change in behavior.
2016-07-29 18:09:01 -07:00
PatR
d69f0787be add '(uchar)' casts to ctype calls
This is from the pull request for the assertion failure fix.  It
did not mention how to reproduce the assertion failure, just added
casts to a bunch of isspace/isprint/tolower calls that didn't already
have such.

I removed an obsolete change for win/tty/topl.c and changed the
win/win32/mswproc.c code to avoid using an expression with side-effects
(*colorstring++) in calls to tolower() in case someone overrides that
with a macro which evaluates its argument more than once as some pre-
ANSI ones used to do.  Not tested, might have typos....

sys/wince/*.c still needs similar casts.
2016-07-19 05:40:09 -07:00
PatR
5713f92df1 fix #H4436 - polyself message sequencing bug
for digesting a swallowed critter.  The "you kill <critter>" message
was left implicit, but if hero gained a level, that made "welcome
to level N+1" look like it was issued out of sequence because it's
immediate and the "you totally digest <critter>" is delayed.  Giving
the you-kill-it message explicitly makes things be more verbose but
avoids having the new-level message seem out of order.
2016-07-13 16:16:55 -07:00