Commit Graph

237 Commits

Author SHA1 Message Date
Pasi Kallinen
56e51b9b6b Add wizmode command to recreate current level 2016-10-11 17:26:32 +03:00
Pasi Kallinen
856252702f Don't clobber up and down ext cmd binds 2016-10-09 18:10:28 +03:00
PatR
e81c58aa1d keybinding lint and formatting 2016-10-07 13:14:54 -07:00
Pasi Kallinen
2c9aac4f13 Use symbolic name STONE for levl typ 0 2016-10-07 15:43:27 +03:00
Pasi Kallinen
efd7526194 Accessibility: Pick travel/cursor targets from a menu
Adds two new configurable keys to the cursor targeting: 'A' (getpos.menu)
and 'a' (getpos.menu.cansee). First one shows a menu of all interesting
glyphs on the map, second one shows only those in sight.

Travel command also now obeys the "request menu" -prefix, showing
the menu with interesting targets in sight, and then traveling there.

Idea via the NetHack accessibility research by Alexei Pepers.
2016-10-06 13:10:13 +03:00
Pasi Kallinen
53cd30c54c Show menu control keys in help menu 2016-10-06 08:53:38 +03:00
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
Pasi Kallinen
6c093348af Separate function to check for prefix command keys 2016-09-24 17:18:07 +03: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
PatR
98a90e353b more #H4407 - #loot vs cockatrice corpse
Previous fix was 'me' to eat from inventory without checking current
location for edible items.  The report describing the need for that
also mentioned that you could #loot while blind and without gloves
and not touch any objects except for the container you pick to loot.
This adds a corpse touch check, plus `m#loot' to skip floor containers
and go directly to using #loot for adjacent saddled creature.  That,
as well as the open command, will reveal adjacent container in some
circumstances but I'm going to pretend that that doesn't matter.

doloot() has turned into spaghetti.  We should probably add #unsaddle
or something of the sort and return #loot to container-access only.
2016-06-25 00:10:01 -07:00
PatR
eb1add8500 fix #H4407 - avoiding floor-food while blind
Accept the 'm' prefix for eat, offer, and apply.

Allows 'me' to eat from inventory without checking for floor food.
Primarily for use after blind character used 'm<dir>' to move
somewhere without touching a suspected cockatrice corpse there.

'm#offer' and 'ma<let>' accomplish similar floor-object-skipping
when offering a sacrifice or applying a tinning-kit.  (All three
commands share floorfood() to pick the item to use.)

Report suggested replacing pick-from-floor followed by pick-from-
invent with use of slash'em-style pick-from-invent with explicit
pick-from-floor choice in list of inventory letters "[abc or ,]"
(slash'em used period for 'here'; I've always liked comma better
since the action is to pick an item rather than a location).  I
implemented that for nethack a long time ago, but it was mixed in
with other stuff that wasn't ready for prime time and vanished
when I lost access to the VMS system I used to use).

Using 'm' prefix to skip part of a multi-part operation is a lot
simpler to implement but doesn't include an in-game reminder that
it is available.

Revised Guidebook.mn is tested, Guidebook.tex is not.
2016-06-24 16:21:53 -07:00
PatR
1af081edc5 fix #H4388 - wishing conduct inconsistency
Make wishing for an artifact and not getting it because it already
exists break never-wished-for-artifact conduct.  The wish was made
even if the result wasn't what the player wanted.
2016-06-16 22:01:27 -07:00
PatR
1eb4d3432e "fix" bz 431 - phrasing of alignment description
The character attributes (^X) description of alignment includes
information about whether the alignment is different from what it
started out as, and is used in a verbose sentence which names the
entire three-deity pantheon.  Someone thought
  You were chaotic, temporarily on a mission for Foo
  who was opposed by Bar (lawful) and Quux (neutral).
was in need to better phrasing.  It looks straightforward to me
(the temporary aspect indicates that a helm of opposite alignment
was causing 'chaotic').  I was going to mark it "won't fix" until
I noticed that you could also get
  You were lawful, now on a mission for Bar
(when permanent, one-time alignment change was causing 'lawful').

The first one is changed for the present tense:
  You are chaotic, currently on a mission for Foo
and stays the same for end-of-game disclosure past tense.  I
considered using "formerly"--as best past tense of "currently"--
but it could be confused as a reference to the original alignment
rather than the alignment in place when the game ended.

The second is unchanged for present tense:
  You are lawful, now on a mission for Bar
For past tense, it's changed to:
  You were lawful, belatedly on a mission for Bar
Past tense of "now" should be "then", but if used it that message
it would sound absurdly stilted.  "Belatedly" is meant to suggest
that if you intended to be on a mission for Bar, you should have
started out as lawful.  (It's beside the point that some roles or
races couldn't start out at as lawful.)

Both of these changes leave something to be desired, but I'm
going to mark the bz entry closed.
2016-06-09 17:08:37 -07:00
Pasi Kallinen
e276540230 Remove extraneous curses gfx define 2016-06-06 21:16:01 +03:00
PatR
e3c15574ac lint cleanup 2016-06-05 14:52:01 -07:00
Pasi Kallinen
4d594f77c2 Split direction key showing into separate function 2016-06-03 21:08:43 +03:00
PatR
358552a587 comment formatting bit 2016-06-02 18:01:28 -07:00
PatR
cb14aa332d number_pad:-1 qwertz keyboard
Reported almost exactly one year ago by a beta tester proofreading
the Guidebook, the number_pad setting to support the German keyboard
which swaps the Y and Z keys is for a keyboard that is used in other
places too.  The report mentioned France and Belgium; Wikipedia's
"keyboard layout" entry mentions "Germany, Austria, Switzerland and
other parts of Central Europe".  This changes references to "German
keyboard" (there were only a couple) into "QWERTZ keyboard".
2016-05-27 18:39:17 -07:00
PatR
49da8b87d8 '^O' command documentation and '^' command help
While looking for things in core which might conceivably trigger the
Windows ctype assertion failure (haven't found any yet), I noticed
that help_dir() was still treating ^O as a wizard mode-only command.
Also, documentation about that command was never brought up to date.

I wish this change to ^O hadn't been done.  #overview already has
a meta/alt M-O shortcut and overloading wizard mode commands makes
documentation more complicated since wizard mode stuff traditionally
has been left unmentioned.
2016-05-26 18:35:27 -07:00
PatR
dccc818801 autodescribe for #terrain
Requested during beta-testing however long ago:  want a way to
look at specific map locations while #terrain is showing them
without monsters and/or objects and/or traps being displayed in
the way.  The post-3.6.0 autodescribe feature for getpos() made
this pretty easy to achieve, although the lookat() aspect felt
more like trail-and-error than careful design.

Instead of putting up a --More-- prompt, ask the player to pick
a location with the cursor.  Moving the cursor gives the terse
description for every location traversed.  Actually picking a
spot just ends #terrain and goes back to normal play.
2016-05-12 18:57:10 -07:00
PatR
759544dd33 long worm #stats
When #stats shows memory use for monsters, include long worm tails.
2016-05-01 00:34:36 -07:00
Pasi Kallinen
638aa6969c Unify piousness strings 2016-04-23 12:00:02 +03:00
PatR
953ee96f7e extend wizard-mode '#stats' command
Extend #stats beyond just monsters and objects.  Have it display
memory usage for traps, engravings, light sources, timers, pending
shop wall/floor repair, regions, bones tracking, named object types,
and dungeon overview.

No doubt there are other memory consumers that I've overlooked.
2016-04-16 15:37:35 -07:00
PatR
cb66774430 couple of formatting tweaks 2016-04-04 14:05:31 -07:00
nhmall
78857961d2 some of Ray Chason's MSDOS and other fixes 2016-03-05 14:44:50 -05:00
nhmall
32a4859e5b show deafness indicator on status line
May as well show a deafness indicator.
2016-01-12 23:43:28 -05:00
Pasi Kallinen
99ee354637 Fix get_count: ^H should go left instead of backspacing a count 2016-01-12 08:20:13 +02:00
Pasi Kallinen
1e1557ed46 Add extended command #kick
I've seen some complaints about not being able to kick with ^d
so add kick as an extended command.

Also add the missing #exploremode command to the Guidebook.
2016-01-09 13:39:47 +02:00
PatR
c8cd550a5a get_count() cleanup
Fix several warnings.  Accept ASCII RUBOUT (aka DELETE) in addition
to backspace.  [Should use erase_char (and add support for kill_char)
but that means pushing get_count() into the interface code.]  Guard
against user causing the count to wrap if someone ever adds a call to
get_count() which doesn't specifying a maximum value.
2016-01-06 15:37:46 -08:00
Pasi Kallinen
4c016853d4 Unify getting a count into single function 2016-01-06 13:54:09 +02:00
Pasi Kallinen
1bc05714b5 Fix bz66: Count number cannot be backspaced
... or at least partially fix it - ^H does now backspace.
I can't be bothered to dive into the (n)curses raw-mode stuff.
2016-01-06 11:50:10 +02:00
PatR
5834ace823 fix 'doterrain menu bug'
From a report sent directly to devteam:  the #terrain command had the
same bug as the '`' command (which was one of the very first ones
reported):  impossible("add_menu called before start_menu").  Only X11
notices.
2015-12-29 15:09:50 -08:00
PatR
67826ff67b inappropriately sensing humans and elves
Discovered while testing the from-what enhancements to enlightenment.
Polymorphing into a vampire confers the ability to sense humans and
elves without having telepathy or being triggered by blindness.  That
would be taken away if you polymorphed into something else, but was
being left in effect if polymorph just timed out and hero returned to
normal form.

Same thing occurred for sensing shriekers if you poly'd into a purple
worm and then reverted to normal (something much less likely to get
noticed and not really subject to abuse if it ever did).

Bonus fix:  the code involved was using 0 to mean that Warn_of_mon
from polymorph wasn't in effect, but 0 is also giant ant.  This makes
it use NON_PM for that instead.
2015-12-25 14:24:18 -08:00
nhmall
ec166df636 handle escape from new wizmode menu appropriately 2015-12-18 16:23:05 -05:00
nhmall
7019a7da77 fix H4101: can hear pets while deaf
This is a fix for H4101, bz192.

add non-audio (felt) outcome to yelp()

This also add #wizintrinsic command because testing this was a pain
without a simple, straightforward way to go deaf that didn't time-out
before the situation being tested recurred.
2015-12-18 12:50:25 -05:00
PatR
3ec592e3f1 fix bz60 and bz61 - meta char feedback
60: getpos() doesn't report the offending keystroke accurately when
rejecting M-something as a movement keystroke while moving the cursor;
61: typing M-N as a command keystroke produces
 |Unknown command 'M-
 |                 '.
where the '.' on the second line clobbers the top line of the map.

I can't reproduce the first one without extending the altmeta hack
[a run-time option to treat two char sequence ESC c as M-c] to getpos()
and nh_poskey(), which I've done for testing but am not including here.

I can't reproduce the second as it's described, but M-^J produces
 |Unknown command 'M-
 |'.--More--
and this fixes that, with a general fix that applies to any meta char.

The diffs include some cleanup/groundwork for maybe extending altmeta.
2015-12-15 03:22:39 -08:00
PatR
c14336fee2 fruit enlightenment
Move the 'if (wizard) { /* give feedback for named fruit */ }' code
in ^X/enlightenment into an #if DEBUG block, and expand the if (wizard)
predicate with '&& explicitdebug("fruit")' to require that 'fruit' be in
DEBUGFILES.  So, build with DEBUG enabled and run via
 |% DEBUGFILES='fruit' nethack
to get it back....

This isn't actually a bug fix and it isn't necessary for 3.6.1, but I
got tired of seeing ^X and end-of-game disclosure of attributes end with
three lines about fruit when I'm not doing anything with named fruit.
2015-12-10 00:36:01 -08:00
Pasi Kallinen
dc09a991fe Fix some warnings from clang's static code analyzer 2015-11-18 22:54:28 +02:00
PatR
62193be46a more formatting
Mostly tab replacement, plus the last of the cast spacing.
2015-11-08 01:37:55 -08:00
PatR
a9eb5b2ca8 yet more formatting
Reformat some trailing &&, || operators followed by end-of-line comment,
missed by the earlier continuation formating.

An
  #if 0
    something {
  #else
    something_else {
  #endif
construct in rhack(cmd.c) confused the automated reformatter, resulting
in some code from inside a function ending up in column 1.
2015-11-01 01:17:54 -08:00
Pasi Kallinen
4f616a932c Prevent out of array access
As index() can match with the string terminator, that would make
the xdir etc array references out of bounds.
2015-11-01 01:32:24 +02:00
Pasi Kallinen
530ba8e3d3 Add sanity checking for light sources 2015-10-27 18:36:07 +02:00
PatR
3986546325 formatting: src/a*.c - d*.c continuation lines
Mostly && and || at end of the first half of a continued line rather
than at the start of the second half.  The automated reformat got
confused by comments in the midst of such lines.
  foo ||
  bar
was converted to
  foo
  || bar
but
  foo ||
  /* comment */
  bar
stayed as is.

Some excluded code [#if 0] was also manually reformatted, but this is
mainly stuff that can be found via regexp '[&|?:][ \t]*$' (with a lot
of false hits for labels whose colon ends their line).
2015-10-19 17:32:21 -07:00
Pasi Kallinen
af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
Pasi Kallinen
f056bdb429 Comment typofixes, pt 2 2015-10-17 13:15:46 +03:00
Pasi Kallinen
f8b48490aa Comment typofixes 2015-10-17 12:28:52 +03:00
Pasi Kallinen
f0220c4203 Add monster data sanity checking 2015-10-11 20:36:28 +03:00
PatR
2b2ee0fbab formatting fixup (1 of 2)
Replace instances of strings split across lines which rely on C89/C90
implicit concatenation of string literals to splice them together
with single strings that are outdented relative to the code that uses
them.  It's uglier but it won't break compile for pre-ANSI compilers.

This covers many files in src/ that only have one or two such split
strings.  There are several more files which have three or more.  Those
will eventually be '(2 of 2)'.

Noticed along the way:  the fake mail message/subject
  Report bugs to devteam@nethack.org.
wasn't using its format string of "Report bugs to %s.", so would have
just shown our email address.  Doesn't anybody enable fake mail anymore?

I modified that format to enclose the address within angle brackets and
made a similar change for the 'contact' choice of the '?' command.
2015-07-12 19:35:06 -07:00
PatR
da1ae4a7da Make #tip at a location which has multiple containers honor menustyle
rather than always use a menu.  Only affects menustyle:traditional and
can be overridden at the time by using the 'm' prefix before the #tip
command.

When using the menu, add an explicit pick-from-inventory choice.  The
behavior there stays the same:  ask about inventory if no floor container
is chosen.
2015-06-16 19:23:43 -07:00
PatR
af54125c22 characteristics disclosure
Change end of game disclosure's display for strength, dexterity, &c to
always show the maximum possible value instead of only when the final
value was less than maximum.  For both end of game and ^X, change the
description from "limit" to "innate limit" if the current value exceeds
limit due to worn items (gauntlets of power, +N ring of adornment, &c).
2015-06-11 18:19:09 -07:00