Allow 'P' and 'R' commands to accept armor and wear/take-off the chosen
item, and 'W' and 'T' commands to accept accessories and put-on/remove
the item. The which-object prompt only lists the type(s) of items that
traditionally go with each command, as does an inventory menu if the
user picks '?', but items of the alternate type(s) can be chosen, by
unshown letter or by the inventory menu given for '*'.
There shouldn't be much difference if you continue picking items that
go with the original commands, although you will somestimes get
"which object? [*]" when the only choices are for alternate command.
And you won't see the all-four-accessories-are-already-worn message
for 'P' unless you also have something worn in all seven armor slots.
The Guidebook.mn changes have been tested (that's how/why I noticed
the preface glitch) but the corresponding Guidebook.tex ones haven't.
Reported by ais; clearing object bypass bits once per turn isn't often
enough. Clear them after the hero moves (which might be more than once
in a turn) and before each monster moves (ditto) and after last monster
moves. This might not be optimal but that shouldn't matter since it's
usually a no-op.
Add macros W_WEAPON and W_ACCESSORY, similar to existing W_ARMOR, bitmask
of all the relevant worn bits. Just for code readability; there should
be no change in behavior.
Also, reformat the "ugly checks" portion of getobj(). Slightly better
readability and fewer continuation lines, but only a modest improvement.
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.
If color or dark_room options were toggled during gameplay, and then
the game is saved and restored with different options, the dark room
glyphs were wrong.
Reported by both Boudewijn and Pat.
As reported by Pat:
> After leaving a level and then returning, I'm seeing lit
> room squares as blank
> Options all have their default settings
OPTIONS=nocolor is the default; we should probably change this
sometime, because nearly everyone plays with color.
%o[hij] relied on makesingular() converting "the Eyes of the Overworld"
into "the Eye of the Overworld" to recognize when it should use
they/them/their instead of it/it/its, but makesingular() was changed to
keep "eyes" intract instead of stripping the 's'. So qtext_pronoun()
needs to check for "Eyes" itself.
Add new entries to the menu used for the '/' command: describe nearby
monsters, describe all shown monsters, describe nearby objects, and
describe all shown objects. It makes a text window listing monsters--
or objects--currently displayed on the map, showing lines of
X r,c monster-or-object description
where 'X' is symbol (monster or object class letter for tty), 'r,c' is
row and column separated by comma, and description is similar to what
using '/y' or ';' manually would provide (how-seen info is omitted
when listing monsters).
Originally intended for blind players using screen readers to describe
what is displayed, but will probably get used by other players too.
The map doesn't use a separate set of glyphs for objects which are the
tops of piles, so the information that there are additional objects
beneath the ones shown isn't available to '/' and ';'. That feels like
a bug to me....
If you've just received the "dead bat revives as a vampire" message,
suppress the rather obscure "Maybe not..." message given when an unseen
creature gets life-saved since it ends up being out of sequence. You
could get them both when the death/revival was sensed via telepathy
without being in sight.
Also, some formatting cleanup and a couple miscellaneous code tweaks.
Implement the requested feature to have an automatic annotation on the
dungeon level with the quest entry portal where you sense the leader
summoning you. It stays even after entering the portal (which results
in another automatic annotation of "portal to quest"), up until you
return to that level after having completed the quest.
Add a second one for the quest home level once the leader has given
you the go ahead to start the quest. After completing the quest that
one remains but its wording is changed.
This ought to haved incremented EDITLEVEL but I decided to risk leaving
current save files viable. That should work ok for anyone who isn't
overriding the default definition of Bitfield(), although odd behavior
could conceivably occur. New games have nothing to worry about.
Fix a couple of instances of a mis-indented block comment which happens
to be immediately preceded by an end-of-line comment. Change a couple of
| if (condition)
| something;
| else {
| other_stuff;
| }
to have braces around the 'then' part. Remove some gratuitous 'register'
declarations.
Make both pairs of iron boots weigh the same (kicking boots become
heavier). Make boots of water walking weigh the same as levitation
and elven boots (slightly lighter; 3/4 as much as speed, fumbling,
and mundane high boots).
Allow one item to be taken out of a pile, and leave framework in place
for partial splits so that all monsters will take up to their capacity,
rather than leaving the whole pile if it's too big to take all at once.
Betatesters noticed the death message could overflow the text tombstone,
because the helpless reason was also shown there.
So don't show the helpless at all in the tombstone. The helpless is
still put in the record, logfile, and as a separate while-field in xlogfile.
Reported by Stefan:
> I just did the valkyrie quest. When I arrived on quest goal, I took only
> a few steps away from the upstairs and Lord Surtur jumped me. One of the
> monsters in his lair had stepped on one of the guaranteed squeaky boards
Squeaky boards (and other noisy things) woke up monsters that were
meditating. Unfortunately this also woke up such meditating monsters
as the Wiz, or the quest nemesis.
Prevent unique monsters with waiting strategy being woken up by the noise.
Manually reformat objects.c so that it's a bit easier to work with,
prior to possibly modifying it. I wrote objects[] and obj_descr[].*
to files before and after and they were byte-for-byte identical, so
the revised objects.c hasn't introduced any changes. It was done
from scratch rather than reverting to the pre-clang-format edition.
There was nothing particularly wrong with the uniform spacing
produced by the automated reformat, but organizing things in columns
and/or controlling where the line splits occur make changes and
comparisons easier.
artilist.h and monst.c should probably be redone too, but I don't
think I going to get around to tackling them.
Previous boulder symbol fix unearthed another problem:
When no boulder symbol was defined in config file, the default
iflags.bouldersym null value was used as a symbol.
Boulder symbol could not be changed in config file with
"SYMBOLS=S_boulder:0" because the glyph code was checking
iflags.bouldersym; that is only set if boulder symbol
is changed with the deprecated "OPTIONS=boulder:0" way.
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.
I started out cleaning up a bit of lint in the recent run-time options
handling and discovered that pmatchregex wasn't finished. Finish it and
also deal with the version lint. Argument declarations for function
definitions in pmatchregex.c have been switched to K&R style. (The ones
in posixregex.c have been left in ANSI style.)
There wasn't any build rule for pmatchregex.o; now there is (for Unix).
posixregex.o is still the default.
There isn't any build rule for cppregex.o (again, for Unix); the change
to cppregex.cpp is untested.
Changes to be committed:
modified: include/context.h
modified: include/extern.h
modified: src/files.c
modified: src/invent.c
modified: src/sounds.c
modified: src/spell.c
Add a couple more tribute easter eggs.
- can lead to a remark by Death if you happen to have a pratchett book on
your person, as suggested by M. Stephenson (fat chance you will, or
think to #chat if you do, but it could be a tournament novelty or something
obscure to strive for).
- can draw some additional Death quotes from the tribute file. (There's two
in there right now. If anyone wants to add or suggest some more, please go
ahead. The Death quotes are at the end of the tribute file. One-liners
only please or the code will only pull the last line.
Three fixes, the first leading to the need to fix the second, and that
fix making dealing with the third be straightforward.
First, make the furthest level reached in any given branch be considered
interesting by #overview, even if no interesting features have been
encountered. This will result in listing Gnomish Mines and their first
level when someone goes down the stairs and immediately back up. It will
also produce a reminder of how far you've been--in each branch--after
retreating for any reason, without the need to manually add an annotation.
Second, #overview was suppressing the range of level numbers for Sokoban
because the author realized that the values were wrong. The record of
the furthest level reached was incorrect for builds-up branches, always
sticking with the deepest level even though it was the entrance. The
overview patch neglected to do the same suppression for Vlad's Tower and
the level range ("36 to 38" or similar) there was wrong. This fixes the
furthest level reached problem and also fixes #overview's level range
handling for builds-up branches.
Third and last, a long-standing issue which I don't think has ever been
formally reported: the level difficulty calculation used for monster
creation treated the upper (harder to get to) levels of builds-up branches
as if they were easier since they're closer to the surface as the gopher
burrows. So sokoban generated easier monsters on its final level than on
the ones leading up to that. Make depth for difficulty purposes account
for descent to the entrance and then ascent to the level of interest.
There was a distressing amount of trial and error involved. The dungeon
layout structures are not exactly easy to work with, and I never managed
to get builds_up() based on branch data to work correctly. Basing it on
dungeon data works as intended provided the branch has more than one
level, but it will yield incorrect result if we ever add a single-level
branch reached via stairs up rather than stairs down.