]> granicus.if.org Git - nethack/log
nethack
4 years agomenustyle:full's 'A' choice
PatR [Fri, 2 Apr 2021 19:26:41 +0000 (12:26 -0700)]
menustyle:full's 'A' choice

Change how menu choice 'A' (auto-select everything) works.  It will
now auto-select all things that match any other choices (object
class(es) or BUCX state(s) or possibly unpaid status).  So it still
skips the second menu of specific objects.  And it still picks all
objects when it is the only choice or if player uses '.' to select
it along with all the rest of the first menu's possibilities.

This change won't help anyone who picks 'A' without really meaning
to.  (Maybe add a paranoid_confirm setting to for full-menu-A?)

Affects container apply/#loot and Drop-multiple.  The invent.c part
is just formatting.

4 years agorevised Trollsbane fixes37.0 entry
PatR [Fri, 2 Apr 2021 18:26:59 +0000 (11:26 -0700)]
revised Trollsbane fixes37.0 entry

4 years agogithub issue #475 revisited - Trollsbane
PatR [Fri, 2 Apr 2021 17:38:57 +0000 (10:38 -0700)]
github issue #475 revisited - Trollsbane

Change Trollsbane versus troll corpse revival:  instead of revival
failing if Trollsbane is wielded at time of revival attempt, mark
the corpse no-revive if killed by Trollsbane (whether by the hero
or a monster).

If a no-revive corpse is within view when time to revive occurs,
give "the troll corpse twitches feebly" even when the hero isn't
responsible.  That used to only apply if the hero zapped the
corpse with undead turning, which would have become inoperative
because now being zapped by undead turning clears the no-revive
flag and revives as normal.  In other words, undead turning magic
overrides killed-by-Trollsbane or non-ice troll having been in an
ice box.

4 years agogithub issue #481 - highlighting for #overview
PatR [Thu, 1 Apr 2021 21:10:30 +0000 (14:10 -0700)]
github issue #481 - highlighting for #overview

Report states that the dungeon overview menu doesn't honor the
'menu_headings' option.  However, dungeon overview is not a menu.

Despite that, switch its hardcoded use of bold and inverse to use
the option value instead.  It doesn't really need two different
highlights and this allows user to control which video attribute
gets used.  If someone wants different highlighting for overview
than for menus, they're out of luck.

Fixes #481

4 years agoMissed adjustment for the increased prefix length of the perm_invent window
Patric Mueller [Thu, 1 Apr 2021 20:58:46 +0000 (22:58 +0200)]
Missed adjustment for the increased prefix length of the perm_invent window

4 years agofix github issue #483 - map display while engulfed
PatR [Thu, 1 Apr 2021 20:43:21 +0000 (13:43 -0700)]
fix github issue #483 - map display while engulfed

Report raises two issues:
1) if you perform magic mapping while engulfed (or underwater) the
map got updated and player could view it with cursor+autodescribe,
but when done viewing it did not switch back to the limited engulfed
(or underwater) display.
2) when picking a teleport destination while engulfed/underwater you
have to pick the spot while seeing only the limited view of the map
that is shown while engulfed/underwater.

This fixes #1.  I'm inclined to classify #2 as traditional behavior
and am not going to try to figure out a fix for it.

Fixes #483

4 years agofix pull request #478 - homemade tin nutrition
PatR [Thu, 1 Apr 2021 20:09:00 +0000 (13:09 -0700)]
fix pull request #478 - homemade tin nutrition

Homemade tin would yield a flat 50 points of nutrition even when
made from a corpse that provides less than 50 points.  Take the
minimum of the two amounts instead of always 50.

Fixes #478

4 years agoIndent items in perm_invent window
Patric Mueller [Thu, 1 Apr 2021 19:42:02 +0000 (21:42 +0200)]
Indent items in perm_invent window

Add a space in front of items in the perm_invent window as in the inventory
window.

4 years agoFix menu headings using default text color
Patric Mueller [Thu, 1 Apr 2021 19:33:12 +0000 (21:33 +0200)]
Fix menu headings using default text color

Rendering menu headings used the NetHack internal NO_COLOR macro which mapped
to dark gray instead of the default text color.

Fixes #480

4 years agofix pull request #479 - statues of stoning-immunes
PatR [Thu, 1 Apr 2021 19:12:05 +0000 (12:12 -0700)]
fix pull request #479 - statues of stoning-immunes

Statues on Medusa's level are supposed to be from petrified creatures
rather than somebody's artwork, so creatures that can't be turned to
stone aren't eligible.  However, creatures who change form when hit
with stoning damage (foo golems to stone golem) were being allowed.
Also, statues in cockatrice nest rooms are supposed to be from former
characters and take their names from the high scores file.  But when
'record' is empty, the statue would be of a random creature instead
of being changed into a player character, so both not the latter and
possibly something that can't be petrified.

I've taken the Medusa part as-is but did the cockatrice nest part
differently.  It rejected statues of non-stonable creatures in case
the named character attempt failed.  I've changed things so that when
a named player character can't be created, it will use an unnamed one
instead of random creature.  The issue of maybe ending up with a non-
stonable form goes away because all player characters are vulnerable.

Fixes #479

4 years agocancelled zombification
PatR [Wed, 31 Mar 2021 00:33:31 +0000 (17:33 -0700)]
cancelled zombification

Don't let cancelled zombies or cancelled liches create new zombies.

4 years agotwo new tribute passages (commented out)
PatR [Wed, 31 Mar 2021 00:29:40 +0000 (17:29 -0700)]
two new tribute passages (commented out)

Add a pair of commented out new passages for Moving Pictures.

4 years ago"fix" github issue #475 - Trollsbane
PatR [Mon, 29 Mar 2021 18:48:24 +0000 (11:48 -0700)]
"fix" github issue #475 - Trollsbane

Player's pet killed a troll with Trollsbane and the corpse later
revived.  He assumed that killing a troll with Trollsbane is what
prevents troll corpse revival but that is inhibited by the hero
be wielding Trollsbane at the time revival is attempted.

Having killed-by-Trollsbane be the reason for blocking revival
would be much better but looks like a lot of work for something
which was supposed to be a one-line enhancement to an under-used
artifact.  This extends revival inhibition to having anyone on
the level be wielding Trollsbane rather than just the hero.
Not a proper fix but I think it's better than nothing.

Closes #475

4 years agofix github issue #477 - incorrect MC calculation
PatR [Mon, 29 Mar 2021 17:46:29 +0000 (10:46 -0700)]
fix github issue #477 - incorrect MC calculation

when wearing an amulet.  Wearing any amulet while having the
Protected attribute was conferring an amulet of guarding's +2 MC
bonus.  Mattered when Protected via worn ring(s) of protection or
wearing Mitre of Holiness or wielding Tsurugi of Muramasa for
hero, or the latter two or being a high priest[ess] for monsters.
(Being Proteced via cloak of protection already yields maximum MC,
or via amulet of guarding yields intended result.)

The fixes37.0 entry oversimplifies.

Fixes #477

4 years agopull request #465 - explding hero waking monsters
PatR [Mon, 29 Mar 2021 16:35:43 +0000 (09:35 -0700)]
pull request #465 - explding hero waking monsters

A polymorphed hero who exploded when attacking thin air would use a
radius based on experience level rather than the fixed radius that
the monster form itself used.  When exploding at a monster it didn't
wake other monsters at all.

Fixes #465

4 years ago'O' vs 'altmeta'
PatR [Mon, 29 Mar 2021 16:17:33 +0000 (09:17 -0700)]
'O' vs 'altmeta'

I accidentally toggled the 'altmeta' option On and got this
non sequitur result when trying to toggle it back Off:
|The altmeta option may not both have a value and be negated.

4 years agowight difficulty
PatR [Sun, 28 Mar 2021 00:24:13 +0000 (17:24 -0700)]
wight difficulty

When wights were given a cold attack back in January, their
difficulty rating wasn't re-evaluated.  The dummy monstr.c
produced by 'makedefs -m' puts it at 8 rather than previous 7.

4 years agoupdate doc/Guidebook.txt after several revisions
PatR [Sat, 27 Mar 2021 01:33:03 +0000 (18:33 -0700)]
update doc/Guidebook.txt after several revisions

I tried to follow the directions for the cron generated update
but the first step yielded
 fatal: Not possible to fast-forward, aborting.
so I just diff'd the cron-NetHack-3.7 branch's Guidebook.txt
and the NetHack-3.7 one, applied that diff as a patch to my
copy of NetHack-3.7, and am committing it as an ordinary change.

4 years agotribute typos: Moving Pictures pasgs 10, 14
PatR [Sat, 27 Mar 2021 01:07:13 +0000 (18:07 -0700)]
tribute typos: Moving Pictures pasgs 10, 14

Passage 10: single quote at start of paragraph should be a double.

Passage 14: second instance of "megalomaniac" was misspelled.

Add a couple of comments about some deliberately misspelled words.

4 years ago'f' for aklys
PatR [Fri, 26 Mar 2021 23:19:24 +0000 (16:19 -0700)]
'f' for aklys

Adopt a feature mentioned in the xNetHack release announcement.
If you use the fire ('f') command when wielding a throw-and-return
weapon while your quiver is empty and the 'autoquiver' option is
Off, throw the wielded weapon instead of prompting to fill the
quiver.  It will usually return and be re-wielded, so be ready to
fire again.

Implemented from scratch.

4 years agoShow extended command name in key help
Pasi Kallinen [Fri, 26 Mar 2021 15:57:50 +0000 (17:57 +0200)]
Show extended command name in key help

(In the "?f")

4 years agoGuidebook.mn SPECIAL THANKS - no need to shout
PatR [Tue, 23 Mar 2021 20:54:58 +0000 (13:54 -0700)]
Guidebook.mn SPECIAL THANKS - no need to shout

Guidebook.tex already uses mixed case for "Special Thanks"
but it put Dungeoneers into a new section--one on par with
Credits--rather than have that be a continuation of the
Special Thanks subsection.  Split the difference:  make
Dungeoneers be a second subsection of Credits in both.

4 years agomore monster/door interaction
PatR [Tue, 23 Mar 2021 15:52:36 +0000 (08:52 -0700)]
more monster/door interaction

Apply visibility fixups for monsters triggering door trap
explosions or digging through doors similar to the monster-opens-
door-handling from a couple of days.  Again, the issue is that
hero/player can see a closed door in situations where they can't
see an open one, and messages about the door being opened or
destroyed need to take that into account when seeing a closed
door go away.

Not as thoroughly tested as monster just opening closed door.

4 years agowizard mode wishing for doors
PatR [Mon, 22 Mar 2021 22:31:29 +0000 (15:31 -0700)]
wizard mode wishing for doors

It was possible to wish for a secret door, if done at a wall or
door location, but not for a regular door.  Add that.  (Dig
followed by locking magic possibly followed by open or by kick
could cover most of the details without wish support, but there
wasn't any way to force a closed or locked door to be trapped.)

The wish request can include "trapped" (or "untrapped", the
default) and/or one of the 5 door states: "locked", "closed",
"open", "broken", or "doorless" (default is "closed").  If more
than one state is specified, the last one in the wish text
overrides others.  If trapped is specified with open or broken or
doorless, it will be ignored.

Allow "looted" when wishing for a fountain, sink, throne, or tree.
For the ones with multiple loot tracking bits, it sets them all.

Explicitly reject a wish for a wall rather than claiming nothing
of that description exists.

Formatting:  wrap various wide lines.

4 years agofix #H6928 - monster vs closed door messaging
PatR [Sun, 21 Mar 2021 09:33:20 +0000 (02:33 -0700)]
fix #H6928 - monster vs closed door messaging

Report from roughly two and half years ago was about "<monster>
opens the door" without displaying <monster>.

Monster movement first decides whether a monster can pass closed
door.  If so, the monster is placed at the door spot, a message
is given about that movement (unlock, open, smash down, &c), and
finally the map is updated.

Changing the sequence to update the map before issuing the door
message was not sufficient to fix this.  In the corridor plus
closed door plus lit room map fragment shown here, when 'O' moved
to '+', you would see it there if the hero is at '1' or '2', but
not if at '3', '4', or '5'; open door was shown instead.  But the
message described 'O' accurately rather than as "it" for all those
hero locations.
:   -----
: #O+1...
:   |2...
:   |3...
:   |4...
:   |5...
:   -----

For 3,4,5 the #vision command shows the closed door as 3 before
the O move, but blank (0) after.  In other words, the closed door
is within line of sight but once opened, the doorway spot isn't.
It makes sense that the closed door behaves like a wall but I'm
not sure whether the behavior for an open door's breach does too.

I had an awful workaround that successfully displayed the monster,
but it wouldn't show the same thing if the door was already open,
so I've changed the situation to yield "You see a door open."

4 years agoanother getobj/force_invmenu fix
PatR [Sat, 20 Mar 2021 17:52:46 +0000 (10:52 -0700)]
another getobj/force_invmenu fix

For !force_invmenu when attempting a command that needs an object,
if inventory is completely empty
 What do you want to <foo>? [*]
will report "Never mind" and stop asking if player presses return
or report "Not carrying anything" and reprompt if player types '*'.
But for force_invmenu, it would report
 Not carrying anything.  Never mind.
without any reprompting in between the two messages.  Just skip
the second message in that situation.

Perhaps the first case should avoid reprompting too but I haven't
gone that far.

4 years agogithub pull request #467 - getobj() changes
PatR [Sat, 20 Mar 2021 16:42:31 +0000 (09:42 -0700)]
github pull request #467 - getobj() changes

Incorporate the changes from pull request #467, which itself
incorporates a fix for issue #441.  Allows hands/self to be an
acceptable but hidden choice (don't think any command actually
needs this).  When 'force_invent' option is on, show all the
acceptable but usually hidden choices if no ordinary candidates
are available instead of having an empty menu.  Also, omit
force_invent's "* - (list everything)" extra menu entry if the
menu already contains everything.

Cleans up a couple of whitespace issues too.  I changed at least
one more and added a couple of comments.  I'm not sure about the
comment change that I made in hack.h; the original said "foo is
identical to foo" but the revision might not be accurate.

Fixes #467
Fixes #441

4 years agoMore Guidebook menu_* settings
PatR [Fri, 19 Mar 2021 14:14:21 +0000 (07:14 -0700)]
More Guidebook menu_* settings

Previous update added one change to Guidebook.tex which was omitted
from Guidebook.mn, so catch up.

Don't try to list the interfaces or ports which support each menu
command key.  Just have a generic "not every command is implemented
by every interface" instead.

Flesh out the one sentence menu_search description.

Update an example which shows changing menu_first_page to '{' now
that '{' has a default use for something else (menu_shift_left).
Since 'menu_first_page:^' is the opposite of 'menu_last_page:|' and
'\' shares the same key as '|' with opposite shift state, switch
the example to 'menu_first_page:\'.

4 years agoGuidebook update for #perminv
PatR [Fri, 19 Mar 2021 08:59:38 +0000 (01:59 -0700)]
Guidebook update for #perminv

Interaction with persistent inventory window was documented for
the '|' key a week ago but nothing was specified for '#perminv'.

menu_shift_left and menu_shift_right for X11 are now explicitly
for the perm_invent menu only.

4 years agomultiple gold stacks in invent
PatR [Wed, 17 Mar 2021 17:36:42 +0000 (10:36 -0700)]
multiple gold stacks in invent

The pull request that fixed a couple of instances where it was
possible to have multiple entries for gold in inventory indirectly
pointed out that the error checking was clumsy.  If you executed
the #adjust command while having two '$' items in inventory, you
were told twice that you had multiple stacks of gold in inventory.
Change how that's handled so that the warning appears at most once
for any given #adjust command.  Also avoids having #adjust's use
of getobj() re-scan entire invent for every item in invent.

Also, if player did manage to get two or more '$' entries, #adjust
would allow moving any but the last to a letter entry.  Once in a
letter, further #adjust with count specified could split the letter
gold entries into even more gold entries.  Now, if the player picks
gold as the #adjust 'from' item (which is only possible when there
are wrong letter gold entries or multiple ones or both) then #adjust
will now force 'to' slot to be '$' (without asking player to pick).

Lastly, the inventory check for multiple and/or wrong slot gold is
now performed by wizard mode sanity_check() in addition to #adjust.

4 years agosanity_check of steed
PatR [Wed, 17 Mar 2021 16:14:22 +0000 (09:14 -0700)]
sanity_check of steed

For wizard mode sanity_check, add a check for steed's saddle when
hero is riding.

4 years agomore data.base
PatR [Wed, 17 Mar 2021 15:22:32 +0000 (08:22 -0700)]
more data.base

Add some missing monster types for the recent male/female/neuter
name split.  "vampire lady" was missing but getting false hit on
"*lady, offler" entry for Discworld's Lady Luck, aka The Lady,
goddess, god.  "{dwarf,gnome,kobold} lady" got the corresponding
"{dwarf,gnome,kobold}" entry but "ogre lady" got "Lady Luck"; all
wildcard matches that are affected by their ordering in the file.

The pull request adopted yesterday added "battle axe" but it was
missing a hyphen so didn't match.  I've fixed that and moved it
from the generic "weapon" entry to the more specific "axe" one.

I accidentally omitted the addition of "luckstone" but since the
luck quote is about bad luck, having it match that would be too
misleading for novice players so am now intentionally omitting it.

4 years agopull request #472 - data.base enhancements
PatR [Wed, 17 Mar 2021 08:44:16 +0000 (01:44 -0700)]
pull request #472 - data.base enhancements

Improves the consistency of quote citations.  Mostly by adding
missing commas but there are a handful or more substantial
corrections.

Pull request changed one "G.K. Chesterton" to "G. K. Chesterton"
but I went the other way.  There are roughly 60 citations with
two or three initials, and about 50 omit the space, only 10-ish
included it.  I changed those to match the rest.  It's slightly
less visual clutter when reading an entry.

Also adds some new keys that previously had no entry to now match
some existing entries.

I added various comments and also inserted a few blank lines to
separate paragraphs but made no attempt to be thorough about that.

Fixes #472

4 years agofix pull request #471 - error message segfault
PatR [Wed, 17 Mar 2021 01:45:56 +0000 (18:45 -0700)]
fix pull request #471 - error message segfault

for invalid 'O' values when option error messages are issued after
theme rooms have left iflags.in_lua set.  The pull request just
turned the flag off but lua code turns back on and off after that
for other dungeon levels.  nhlua probably shouldn't be sharing the
same error routine as options processing, or at least it should
toggle the flag on and off at need instead of pretending that it
can be global.

Fixes #471

4 years agofix pull request #469 - multiple '$' invent slots
PatR [Tue, 16 Mar 2021 19:29:22 +0000 (12:29 -0700)]
fix pull request #469 - multiple '$' invent slots

Assigning a partial stack of gold to quiver (Qnn$) resulted in
an extra '$' slot in inventory, one for the unquivered part and
another for the quivered part.

Throwing a non-quivered partial stack of gold at self (tnn$.)
also resulted in an extra '$' slot after throwing at self was
rejected.

For the first case, reject the quiver-subset-of-gold attempt.
For both cases, recombine the two stacks back to original amount.

Fixes #469

4 years agofix pull request #468 - scroll of earth panic
PatR [Tue, 16 Mar 2021 18:20:16 +0000 (11:20 -0700)]
fix pull request #468 - scroll of earth panic

If a monster read a scroll of earth and got killed in the process,
there would be an "dealloc_obj: obj not free" panic when trying to
use up the scroll.  It was dropped to the ground with any other
possessions and no longer in the monster's inventory at the time
m_useup() was called.  Use up the scroll before performing its
effects.

The patch does something similar for potion of polymorph, but if
newcham() can kill the monster then there are other problems
besides trying to use up the potion.  I kept that in anyway.

Fixes #468

4 years agofix pull request #470 - two riding fixes
PatR [Tue, 16 Mar 2021 18:01:43 +0000 (11:01 -0700)]
fix pull request #470 - two riding fixes

Post-3.6 change to monster inventory handling could result in hero
remaining mounted on an unsaddled steed (if saddle was removed via
opening magic).

Hero falling out of saddle would fall to the ground and take damage
even if levitating or flying without steed's help after dismount.

Fixes #470

4 years agoX11 perm_invent positioning
PatR [Tue, 16 Mar 2021 16:13:55 +0000 (09:13 -0700)]
X11 perm_invent positioning

Change the '|'/#perminv final positioning for X11 to be the same
as for curses:  finishing with <escape> leaves the current view,
with <return> resets to unscrolled.

Actually getting ESC and RET to the right place wasn't trivial;
down the rabbit hole and out the other side.  Using yn_function()
to get the #perminv keystrokes is less than ideal.  (curses also
started that way but switched to raw character input for this.)

4 years agoX11 persistent inventory horizontal scrolling
PatR [Tue, 16 Mar 2021 16:12:18 +0000 (09:12 -0700)]
X11 persistent inventory horizontal scrolling

Enable a horizontal scrollbar for the perm_invent window so that
the '}' and '{' menu commands work for it.

4 years ago\#perminv comments
PatR [Mon, 15 Mar 2021 15:54:10 +0000 (08:54 -0700)]
\#perminv comments

Fix a couple of comment typos and an instance of ambiguous wording.

4 years agofixes37.0 entry about scrambled dipping message
PatR [Mon, 15 Mar 2021 08:26:46 +0000 (01:26 -0700)]
fixes37.0 entry about scrambled dipping message

The "you mime dip <item> intoing something" message was already
present in 3.6, not introduced by the post-3.6 "getobj refactor".

4 years agopost-3.6 bug: scrambled dip message
PatR [Mon, 15 Mar 2021 08:10:39 +0000 (01:10 -0700)]
post-3.6 bug: scrambled dip message

Reported directly to devteam:  constructing a verb by applying
"ing" to "dip <item> into" (when attempting to dip into '-')
didn't work too well.  It yielded
 |You mime dip <item> intoing something.
instead of
 |You mime dipping <item> into something.

4 years agocurses perm_invent comment
PatR [Mon, 15 Mar 2021 08:05:19 +0000 (01:05 -0700)]
curses perm_invent comment

Stripping article ("a ", "an ", "the ") off inventory items to
squeeze a little more info into truncated persistent inventory
was initially case insensitve.  That was removed because it isn't
needed but the comment still reflected it.

4 years agogenocide failure for already genocided creature
PatR [Sun, 14 Mar 2021 22:18:24 +0000 (15:18 -0700)]
genocide failure for already genocided creature

Reported seven years ago:  when class genoicde (blessed scroll)
attempts to genocide something that has already been wiped out
 |All foos are already nonexistent.
should be simplified to
 |Foos are already nonexistent.

I think the redundant "All" was just there to avoid capitalization
handling for the monster species but that's trivial to deal with.

4 years agoboulder path for rolling boulder trap
PatR [Sun, 14 Mar 2021 22:12:46 +0000 (15:12 -0700)]
boulder path for rolling boulder trap

Reported six and a half years ago (by paxed), don't use a boulder
path start starts up a pit or hole.  Extended to avoid teleport
too.

4 years agoX11 #perminv typo/thinko
PatR [Sun, 14 Mar 2021 09:00:36 +0000 (01:00 -0800)]
X11 #perminv typo/thinko

Copy+paste error.  Would matter if menus had horizontal scrollbars
but since they don't, it's academic.

4 years ago\#perminv, 2 of 2: implementation
PatR [Sun, 14 Mar 2021 02:18:53 +0000 (18:18 -0800)]
\#perminv, 2 of 2: implementation

Add new '|' command, aka #perminv, which allows the player to
send menu scrolling keystrokes to the persistent inventory window.

Implemented for X11, where its usefulness is limited, and for
curses, where it is more needed and also more fully functional.
The interface can either prompt for one keystroke, act upon it,
and return to normal play, or it can loop for multiple keystrokes
until player types <return> or <escape>.  X11 does the former if
the 'slow' application resource is False so that prompting uses
popups, and the latter when 'slow' is True where prompting is in
a fixed spot and doesn't end up causing the persistent inventory
window to be stacked behind the map window.  curses always does
the loop-until-done approach.  It also accepts up and down arrow
keys to scroll one line at a time.

Also adds two new menu scrolling commands, menu_shift_right (key
'}' by default) and menu_shift_left ('{') if wincap2 flags contain
WC2_MENU_SHIFT.  Shifting allows different substrings of too-long
lines to be seen.

For X11, neither works because their handling requires a horizontal
scrollbar and for some reason that escapes me our menus don't have
one of those.  If they did, shifts could work for all menus but a
shifted window would hide the selection letters.  So shifting would
be most usefully done as:  pan right, read more of any long lines,
immediately pan back to the left.

For curses, they only apply to the persistent inventory window.
Shift right redraws it with class headers and inventory letters
shown normally but the item descriptions omit their leftmost
portion, showing more text towards the end.  Shift left reverses
that and does nothing if the beginning is already in view.  Forward
and backward scrolling while shifted leave the shift in place.

4 years ago\#perminv, 1 of 2: groundwork
PatR [Sun, 14 Mar 2021 02:17:00 +0000 (18:17 -0800)]
\#perminv, 1 of 2: groundwork

Give the window-port side of *_update_inventory() an argument.
Calls in the core still omit that; invent.c's update_inventory()
is the only place that cares.

4 years agoscrollbar handling by X11
PatR [Sat, 13 Mar 2021 02:06:43 +0000 (18:06 -0800)]
scrollbar handling by X11

Looking up scrollbars did not work as intended.  The code wanted an
ancestor widget that had both horizontal and vertical scrollbars,
but menus either have none or just vertical.  The lookup code found
some top level widget and returned bad data.

4 years agoremove several obsolete C() and M() macros
PatR [Wed, 10 Mar 2021 21:50:44 +0000 (13:50 -0800)]
remove several obsolete C() and M() macros

The ones moved from cmd.c to global.h suffice.

4 years agoduplicate options parsing for menu keys
PatR [Wed, 10 Mar 2021 21:17:19 +0000 (13:17 -0800)]
duplicate options parsing for menu keys

I'm sure that this could be improved but it is better than before....

4 years agooptions key parsing
PatR [Wed, 10 Mar 2021 20:28:09 +0000 (12:28 -0800)]
options key parsing

  OPTIONS=menu_previous_page:\mv
  BINDINGS=M-v:menu_previous_page
both worked, but
  OPTIONS=menu_previous_page:M-v
  BINDINGS=\mv:menu_previous_page
both failed.  Make all four variations work.  Tiny change made large
by the need to move some things around.

The option definition for menu_first_page had a couple of its flag
bits swapped.  I didn't try to figure out whether that had any impact.

4 years agofix a couple of options affecting perm_invent
PatR [Wed, 10 Mar 2021 19:22:22 +0000 (11:22 -0800)]
fix a couple of options affecting perm_invent

When the 'O' command is used to change either 'menu_headings' or
'sortloot', inventory display can change so persistent inventory
needs to be updated.

Oddly, the flag to indicate initial options processing remained
True after options had been processed, but that ultimately didn't
matter here.  It's fixed now anyway.

Also, sort the WC2_xxx options in a couple of places.

4 years agosignal induced panictrace under curses
PatR [Tue, 9 Mar 2021 15:45:58 +0000 (07:45 -0800)]
signal induced panictrace under curses

When panictrace feedback occurs due to catching a signal rather
than controlled panic, the backtrace is useless when running the
curses interface unless the terminal gets reset first.  Let's
just hope that the signal triggering a panictrace doesn't occur
while resetting the terminal.

4 years agofix #K3274 - applied polearm locates hidden mon
PatR [Sun, 7 Mar 2021 23:08:08 +0000 (15:08 -0800)]
fix #K3274 - applied polearm locates hidden mon

without using any time.  Targetting an apparently empty spot at
valid polearm range where a monster happens to be hiding reports
"Wait!  There's something there you can't see!" and displays the
remembered, unseen monster glyph, then aborts the attack attempt.
It would use a turn if the polearm became wielded in the attempt
but not if it was already wielded.  Make latter case take time.

4 years agowindow.doc cleanup
PatR [Sun, 7 Mar 2021 22:04:22 +0000 (14:04 -0800)]
window.doc cleanup

Remove a bunch of trailing spaces and shorten some long lines.

4 years agoblinded Archon gaze bit
PatR [Fri, 5 Mar 2021 02:07:23 +0000 (18:07 -0800)]
blinded Archon gaze bit

From yesterday (old #H3841), the alternate message given when a
monster is being hit by a blind Archon's gaze was checking the
wrong monster for blindness.

4 years agoDiscworld: Sourcery
PatR [Thu, 4 Mar 2021 00:38:49 +0000 (16:38 -0800)]
Discworld:  Sourcery

Include the page number for Sourcery's second passage.  While
in there, add another passage.

For wishing, recognize "sorcery" as an alternate spelling.

4 years agodiscoveries/#known sorting fix
PatR [Wed, 3 Mar 2021 23:03:31 +0000 (15:03 -0800)]
discoveries/#known sorting fix

If the sort order for sortdiscoveries was s ('sortloot' order)
and any artifacts or unique items were discovered, using '\'
to see all discoveries included "Discovered Items" as a spurious
class header between the real header for the last object class with
discoveries and the discoveries for that class:
 |Discoveries, sortloot order (by class with some sub-class groupings)
 |
 |Artifacts
 |  Sunsword [lawful long sword]
 |Potions
 |  water (clear)
 |Gems/Stones
 |Discovered items
 |  diamond (white)
 |  flint stone (gray)

"Discovered items" is supposed to only be shown when sorting
alphabetically across all classes and there are artifacts and/or
unique items before the regular discovered objects.

4 years agofix #H3841 - inconsistent Archon gaze behavior
PatR [Wed, 3 Mar 2021 22:40:19 +0000 (14:40 -0800)]
fix #H3841 - inconsistent Archon gaze behavior

From six years ago:  hero is "blinded by the Archon's radiance"
even if the attacking Archon has been blinded, but monsters hit
by same thing were protected from it by that blindness.  Make
monsters attacked by Archons be affected similarly to the hero.

Hypothetical case of hero-as-Archon versus monster is ignored
because hero can't polymorph into that shape.

4 years agohypothetical buffer overruns
PatR [Sun, 28 Feb 2021 01:13:17 +0000 (17:13 -0800)]
hypothetical buffer overruns

doprtool() and doprinuse() collect the inventory letters of all
applicable items into a buffer capable of holding 52 letters plus
terminator.  It is possible to have more than 52 items (ignoring
gold) so theoretically possible to have more than 52 separate lit
candles.  Guard against that.

The easiest way to get an item in the overflow slot is to carry
52 non-boulders, polymorph into a giant, and pick up a boulder.
Assigning the latter to one of the three weapon slots would not
impact doprtool() but it will impact doprinuse().  However, that
wasn't enough to cause a crash for me; evidently the overflow
clobbered something innocuous.  (52+boulder is not the only way
to get something into slot '#', just the only guaranteed one I
can think of offhand.)

This also removes a bunch of 'register' type qualifiers.

4 years agoX11 menu handling
PatR [Sat, 27 Feb 2021 01:06:40 +0000 (17:06 -0800)]
X11 menu handling

In a couple of places, call menu_popdown instead of duplicating
its contents.  I'm fairly sure that executing the is_active bit
that the duplications omitted is safe.

Several minor formatting bits are mixed in.

4 years agobit
nhmall [Fri, 26 Feb 2021 14:47:54 +0000 (09:47 -0500)]
bit

4 years agoread_simplemail() when SERVER_ADMIN_MSG is defined
nhmall [Fri, 26 Feb 2021 14:05:52 +0000 (09:05 -0500)]
read_simplemail() when SERVER_ADMIN_MSG is defined

Some warnings were mentioned

Add a prototype ahead of the function
Use a non-const copy of SERVER_ADMIN_MSG

quick-tested by:
- uncommenting the following in include/unixconf.h
  /* #define SERVER_ADMIN_MSG "adminmsg" */
- building NetHack
- creating a test message:
  echo "server_admin: system is going down at 2 pm" >~/nh/install/games/lib/nethackdir/adminmsg
- playtested and received the desired message

4 years agofixes37.0 entry about engraving
PatR [Fri, 26 Feb 2021 08:13:22 +0000 (00:13 -0800)]
fixes37.0 entry about engraving

Revert part of commit f6a30e7b05c9e45b58a8410afb9daf6b7c599180
that moved a fixes entry from the 'fixes to 3.6.x' section
into the 'post-3.6.x, exposed by git' section.  It wasn't due
to the conversion of engraving from multi-turn action into an
occupation, it was fixing a bug that had been around for 5 or 6
years.  Moot now; the conversion to occupation removed it.

4 years agopartly fix github issue #446 - monk gender
PatR [Thu, 25 Feb 2021 22:11:03 +0000 (14:11 -0800)]
partly fix github issue #446 - monk gender

The monk role can be either male or female but the monk fake
player monster was flagged as male-only.  Allow both genders.

The male and female monk tiles are identical though and this
doesn't address that.

Fixes #466

4 years agotribute bit: Sourcery passage 4
PatR [Wed, 24 Feb 2021 22:41:51 +0000 (14:41 -0800)]
tribute bit: Sourcery passage 4

Fix a mistake that led to a bad fix for a perceived mistake that
wasn't really there.

I think having a comma after "moment" would make things clearer,
but style-wise that's optional and leaving it out restores the
book's original wording.

4 years ago[lack of] autopickup inside shops
PatR [Tue, 23 Feb 2021 10:42:28 +0000 (02:42 -0800)]
[lack of] autopickup inside shops

When being inside a shop inhibits autopickup, menion that in ^X
feedback about autopickup.

4 years agofix #H3734 - "see an angry guard" when that guard
PatR [Tue, 23 Feb 2021 10:04:21 +0000 (02:04 -0800)]
fix #H3734 - "see an angry guard" when that guard

is invisible and hero can't see him/her.  Reported for 3.4.3 in
late 2014....

4 years agoX11 yn_function() again
PatR [Mon, 22 Feb 2021 09:10:14 +0000 (01:10 -0800)]
X11 yn_function() again

Widget widths should have type 'Dimension' rather than plain 'int'.

Perform a couple of things once during popup widget creation rather
than every time it gets popped up.

4 years agoX11 popup yn_function resizing
PatR [Mon, 22 Feb 2021 01:30:09 +0000 (17:30 -0800)]
X11 popup yn_function resizing

When X11_yn_function() re-uses a popup widget to issue a prompt
and get the player's response, make it resize properly.  I'm not
sure why the old hack for that apparently worked for some folks
and not for me, or why this does work for me.  At least it does.

Also, make the minimum popup width be 25 characters so that
really short prompts don't result in tiny popups.  Since the
popup appears at whatever spot the pointer happens to be sitting,
it isn't always immediately noticeable when the player is using
the keyboard rather than the pointer.

4 years ago"If you see me running, try to keep up."
PatR [Sun, 21 Feb 2021 01:24:25 +0000 (17:24 -0800)]
"If you see me running, try to keep up."

Noticed while poking about in read.c for the ^G feedback change:
a relatively recently added apron slogan turns out to be a near
duplicate of an existing T-shirt slogan.  Change the apron one a
little, although they're still nearly identical.

4 years ago^G feedback
PatR [Sun, 21 Feb 2021 01:15:58 +0000 (17:15 -0800)]
^G feedback

For ^G, if someone replies with empty input to the "Create which
monster?" prompt, give alternate feedback than "I've never heard
of such monsters." before reprompting.

4 years agoX11 getline refinement
PatR [Sun, 21 Feb 2021 00:25:12 +0000 (16:25 -0800)]
X11 getline refinement

X11_getlin() echoing its prompt and response to message window
truncates combined value to maximum allowed pline (rather than
having pline truncate it).  But it was truncating the response
as if the prompt was maximum allowed length instead of its actual
length, so possibly hiding some of the user's text unnecessarily.

4 years agoWindows nmake build - recognize VS 16.8.5
nhmall [Sat, 20 Feb 2021 16:53:17 +0000 (11:53 -0500)]
Windows nmake build - recognize VS 16.8.5

4 years agoX11 getline: log prompt and response
PatR [Fri, 19 Feb 2021 23:38:31 +0000 (15:38 -0800)]
X11 getline: log prompt and response

After player has responded to a getline prompt, echo the prompt
and the line of text response to the message window.  Uses pline()
so also gets put into core's message history for dumplog.

4 years agoX11 update
PatR [Fri, 19 Feb 2021 22:11:32 +0000 (14:11 -0800)]
X11 update

More issues.  The incorrectly rendered map after panning is one
I haven't seen before.  Normally I only have a clipped map if I
force double size tiles rather and hadn't noticed this behavior
for that case, so manually resizing--and/or the scrollbars which
get added when that occurs--may be what triggers it.

4 years agoIncrement editlevel
Pasi Kallinen [Fri, 19 Feb 2021 15:24:50 +0000 (17:24 +0200)]
Increment editlevel

Just in case, even though changing joined to boolean shouldn't cause problems.

4 years agoConvert room 'joined' and 'needjoining' into booleans
copperwater [Thu, 18 Feb 2021 23:55:10 +0000 (18:55 -0500)]
Convert room 'joined' and 'needjoining' into booleans

des.region() accepted booleans for the joined field, whereas des.room
accepted xchars. These were only being used as truth values, so this
converts the room ones into booleans for consistency. I don't think
accidentally using an int or a boolean wrongly would actually crash the
level generator, but consistency is good.

This converts an schar field in struct mkroom into a boolean; on most
systems these are probably 1-byte types and save files won't be broken,
but it might be best to treat this as a save breaker anyway.

4 years agoMake g.coder->lvl_is_joined a boolean
copperwater [Thu, 18 Feb 2021 23:19:48 +0000 (18:19 -0500)]
Make g.coder->lvl_is_joined a boolean

Its value is only used as a boolean, so there's no real need to keep it
as a confusing int.

Shouldn't be a save-breaking change; it doesn't look like g.coder is
saved.

4 years agoMerge branch 'copperwater-pr464' into NetHack-3.7
nhmall [Fri, 19 Feb 2021 12:50:34 +0000 (07:50 -0500)]
Merge branch 'copperwater-pr464' into NetHack-3.7

4 years agofixes37.0 entry for pr#464
nhmall [Fri, 19 Feb 2021 12:49:10 +0000 (07:49 -0500)]
fixes37.0 entry for pr#464

4 years agoMerge branch 'fix-engraving-impossible' of https://github.com/copperwater/NetHack...
nhmall [Fri, 19 Feb 2021 12:46:45 +0000 (07:46 -0500)]
Merge branch 'fix-engraving-impossible' of https://github.com/copperwater/NetHack into copperwater-pr464

4 years agoOutput message when changing fastmove mode while cursor targetting
Patric Mueller [Fri, 19 Feb 2021 09:36:39 +0000 (10:36 +0100)]
Output message when changing fastmove mode while cursor targetting

4 years ago'O' feedback for booleans
PatR [Fri, 19 Feb 2021 08:24:45 +0000 (00:24 -0800)]
'O' feedback for booleans

Give a message for each boolean option toggled via 'O'.  It may
help catch mistakes sooner if/when player types wrong menu letter.

Only applies to 'O', not booleans manipulated during config file
or NETHACKOPTIONS processing.

4 years ago'wizmgender' flag
PatR [Fri, 19 Feb 2021 07:54:30 +0000 (23:54 -0800)]
'wizmgender' flag

"Demote" wizmgender from an obscure wizard mode extended command
to an obscure wizard mode boolean option.  Behaves the same except
that no message is given when the value gets toggled.

4 years agoFix: engraving with non-blade dulled the weapon anyway
copperwater [Fri, 19 Feb 2021 05:25:45 +0000 (00:25 -0500)]
Fix: engraving with non-blade dulled the weapon anyway

Due to a logic bug introduced when engraving became an occupation - the
code that tests to see whether the player is writing with a weapon that
will get dulled wasn't correctly checking that they were actually
carving an engraving.

4 years agofix github issue #462 - line not displayed
PatR [Wed, 17 Feb 2021 22:27:00 +0000 (14:27 -0800)]
fix github issue #462 - line not displayed

Fix a latent bug in unreachable code.  As the comment preceding
the cited code states, hero polymorphed into an eel isn't offered
a chance to use #monster to hide, so program execution won't ever
get to the bad code.  Using formatting routine The() where message
delivery routine pline_The() is intended is certainly a bug though.

Fixes #462

4 years agoX11's yn_function() echoing its response
PatR [Tue, 16 Feb 2021 03:09:00 +0000 (19:09 -0800)]
X11's yn_function() echoing its response

X11_yn_function() issues a pline() to put the prompt and player's
response into the message window.  Change it to use visctrl() to
make sure that the response character is ledgible when something
like the '&' command allows an arbitrary answer.

This patch adds a leading space and two extra trailing spaces
to the prompt when it's being issued via popup, but that hasn't
affected the issue mentioned next....

The popup prompting when the 'slow' resource is False doesn't
always resize properly.  I saw both too wide and too narrow
[What do you want to throw? [abc] ]b
[       In what direction?        ]
and
[Really quit? [yn] (n) ]y
[Dump core? [ynq] (q) ]n   (size seemed right, but hard to tell)
[Do you want your posses]  (might have shown one more letter;
                            resize doodad in window's bottom right
                            corner on OSX oscures the rightmost
                            column--which is ordinarily a space)
The truncated one did accept responses.  If I answered 'n' then
the next question was truncated too, but for 'y' (plus ensuing
feedback) it would be sized correctly for the question after that.

To be clear:  the popup width issue was present before this change
and is still present after it.  The code already has a hack that's
intended to deal with this but it doesn't do the job for me.

4 years agoX11 persistent inventory again: initial display
PatR [Sun, 14 Feb 2021 08:57:34 +0000 (00:57 -0800)]
X11 persistent inventory again: initial display

If 'perm_invent' is preset in player's options, have X11 show the
persistent inventory window from the start instead of waiting for
an 'i' command.  moveloop() prolog needed a tweak do deal with it
cleanly.

Require WC_PERM_INVENT in order to honor the perm_invent option.
X11 and curses already set that, tty and curses don't support it,
so only Windows GUI needed to be updated for it.

4 years agoX11 perm_invent: handle 'O' toggling off perm_invent
PatR [Sun, 14 Feb 2021 03:17:20 +0000 (19:17 -0800)]
X11 perm_invent: handle 'O' toggling off perm_invent

When persistent inventory window is up, remove it if 'perm_invent'
option gets set to False.  This has a side-effect of fixing the
end-of-game prompting problem it caused.

4 years agomonster missiles vs sinks
PatR [Sat, 13 Feb 2021 23:16:15 +0000 (15:16 -0800)]
monster missiles vs sinks

Missiles shot or thrown by monsters already stop at sinks; give
a message if they haven't exhausted their range and hero sees.

4 years agoscatter() vs sinks
PatR [Sat, 13 Feb 2021 23:15:21 +0000 (15:15 -0800)]
scatter() vs sinks

Objects shot, thrown, or kicked by the hero or by monsters stop
short if they try to pass over a sink; make objects launched by
an explosion behave similarly.

4 years agoAdd couple more config tests
Pasi Kallinen [Sat, 13 Feb 2021 09:51:25 +0000 (11:51 +0200)]
Add couple more config tests

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 12 Feb 2021 23:24:07 +0000 (18:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoX11: persistent inventory issues and hack for OSX
PatR [Fri, 12 Feb 2021 23:07:51 +0000 (15:07 -0800)]
X11: persistent inventory issues and hack for OSX

This hack prevents the perm_invent window for X11 on OSX from
creeping every time it gets updated.  It is far from perfect and
at the very least ought be handled via user settable X resources
rather than hardcoded values, but it's as much effort as I'm likely
to spend.

Add a new file containing a list of issues that ought to be fixed.
The initial entries are things I noticed while experimenting with
perm_invent; there is lots of older stuff that could/should be
there too.  I'm not sure whether the first one is OSX-specific; the
others aren't.

4 years agoMake runmode option complain, add some tests for it
Pasi Kallinen [Fri, 12 Feb 2021 17:38:40 +0000 (19:38 +0200)]
Make runmode option complain, add some tests for it

4 years agomkroom.c oddity
PatR [Thu, 11 Feb 2021 23:38:26 +0000 (15:38 -0800)]
mkroom.c oddity

Replace a strange pline() with impossible().

Remove some ancient MAC special handling for getenv("SHOPTYPE").

4 years agomklev.c's mkroom qsort
PatR [Thu, 11 Feb 2021 23:18:12 +0000 (15:18 -0800)]
mklev.c's mkroom qsort

Get rid of some obsolete qsort hackery.  Use of prototypes makes
it unnecessary.  Even before that it was the only one of a dozen
instances of qsort() usage that cared about pre-ANSI implementation.

Also, reformat a couple of comments.

4 years agoDon't complain about unknown option if param is wrong
Pasi Kallinen [Thu, 11 Feb 2021 16:22:14 +0000 (18:22 +0200)]
Don't complain about unknown option if param is wrong

When a compound option was given an erroneous parameter,
for example "OPTIONS=runmode:foo",
you first got "Unknown runmode parameter 'foo", and
then "Unknown option 'runmode:foo'".

Prevent the Unknown option complaint, if we actually did
find a match.