]> granicus.if.org Git - nethack/log
nethack
4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Mon, 10 May 2021 22:52:07 +0000 (18:52 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agopipelines build attempt 2
nhmall [Mon, 10 May 2021 22:51:29 +0000 (18:51 -0400)]
pipelines build attempt 2

4 years agomore tribute: Soul Music
PatR [Mon, 10 May 2021 22:16:21 +0000 (15:16 -0700)]
more tribute: Soul Music

Add page citations for first two passages and some missing italics
to the first one.  Fix spelling of "fossil" in passage 8.

Add two short, new passages bringing total to 13.

4 years agotry simple fix for pipelines gcc-8 issue
nhmall [Mon, 10 May 2021 18:25:53 +0000 (14:25 -0400)]
try simple fix for pipelines gcc-8 issue

4 years agoAllow webs to be placed without a giant spider on them
Pasi Kallinen [Mon, 10 May 2021 14:48:47 +0000 (17:48 +0300)]
Allow webs to be placed without a giant spider on them

Allow creating webs without spiders in the lua level scripts:

des.trap({ type = "web", spider_on_web = 0 });

Based on xNetHack commit by copperwater <aosdict@gmail.com>.

Also changes the Spider nest themed room to generate without
spiders when the level difficulty is 8 or less.

4 years agosuppress monster health
PatR [Sun, 9 May 2021 19:54:45 +0000 (12:54 -0700)]
suppress monster health

For the time being at least, take out "uninjured/barely wounded/
slightly wounded/wounded/heavily wounded/nearly dead" description
on monsters examined with ';' or '//' or '/m' and on final tombstone
and logfile entry if hero gets directly killed by a monster.

Maybe it will be revisited later....

4 years agoAccept "waiting" on special level des.monster() specifications
Pasi Kallinen [Sun, 9 May 2021 09:15:48 +0000 (12:15 +0300)]
Accept "waiting" on special level des.monster() specifications

Allow specifying "waiting" for monsters created via lua level scripts.
This sets the monster strategy to make it wait for the hero
to be in visual range before allowing the monster to move.

Also makes the monster inside the Mausoleum themed room use this feature,
to prevent out of depth liches bothering the player unprovoked.

For example:

des.monster({ class = "D", waiting = 1 });

4 years agoFix compile error on Windows
Pasi Kallinen [Sun, 9 May 2021 08:43:51 +0000 (11:43 +0300)]
Fix compile error on Windows

Fixes #508

4 years agocorpse eating feedback
PatR [Sun, 9 May 2021 08:13:32 +0000 (01:13 -0700)]
corpse eating feedback

Avoid the message combination
|You have a very bad case of stomach acid.
|This acid blob corpse tastes okay.

4 years agofix github issue #507 - filename buffer overflow
PatR [Sun, 9 May 2021 01:02:00 +0000 (18:02 -0700)]
fix github issue #507 - filename buffer overflow

when compressing or uncompressing a save file.  Defining
VAR_PLAYGROUND forces PREFIXES_IN_USE to be defined, and the latter
causes docompress_file() to be called with save file name containing
a full path instead of just save/xyzzy.Z relative to the playground.
Depending on the value of VAR_PLAYGROUND, that could be too long for
the buffer used to make a copy of the name with ".Z"/".gz"/".bz2"
appended.

Probably only applies to Unix/linux/OSX configurations.

Fixes #507

4 years agofix pull request #505 - undead turning
PatR [Fri, 7 May 2021 18:58:58 +0000 (11:58 -0700)]
fix pull request #505 - undead turning

zapped at corpse flagged as "no revive".  A fairly recent change
made undead turning override no-revive if it hit someone carrying
a corpse flagged that way (corpse of a troll killed by Trollsbane
or stuffed in an ice box or explicitly cancelled) but neglected to
do so for corpses zapped while on the floor.  This fixes that, for
undead turning zapped by monsters as well as by the hero.

Fixes #505

4 years agofix pull request #504 - partly eaten food
PatR [Fri, 7 May 2021 00:52:30 +0000 (17:52 -0700)]
fix pull request #504 - partly eaten food

that has no nutritional value.  Prevent applying the partly eaten
attribute to wished for food if the full nutrition isn't at least 2.
The problem case was 0 nutrition wraith corpse, yielding "partly
eaten food (1) more nutritious than untouched food (0)" when setting
the corpse's weight.  That one was possible in 3.6.x, unlike corpse
that was actually partly eaten and then revived as a zombie (which
was just fixed for triggering the same warning).

Wishing really ought to ignore "partly eaten" for anything that is
normally eaten in one bite but I'm not sure how to handle that.

Fixes #504

4 years agofix github issue #493 - hero item knowledge
PatR [Thu, 6 May 2021 19:36:32 +0000 (12:36 -0700)]
fix github issue #493 - hero item knowledge

Issue was about being asked what to call a previously seen potion
which has been picked up and thrown by an unseen monster.  Hero
shouldn't remember what the item description was.  This is a much
more general change than just fixing that.  Any item picked up by
an unseen non-tame monster will have all its *known flags cleared
since the hero can't see what that monster does to it.  Same if an
item is picked up while seen but then used when unseen.

Unseen pets are excluded from the pick up case--but not the use
case--because they pick up and drop stuff continually and players
would just slaughter them if they caused item information to be
forgotten.

Fixes #493

4 years agofix github issue #503 - bad Magic Key logic
PatR [Thu, 6 May 2021 18:42:14 +0000 (11:42 -0700)]
fix github issue #503 - bad Magic Key logic

When unlocking a trapped container, any blessed key was behaving
as if it was the rogue's Master Key of Thievery:  detecting the
trap, asking whether to untrap, and always succeeding if player
responds with yes.  The intended behavior is that the Master Key
will behave that way for a rogue if not cursed and for non-rogue
if blessed; it wasn't supposed to affect ordinary keys at all.

Fixes #503

4 years agoFix: uninitialized buffer in mhitm theft feedback
Michael Meyer [Wed, 5 May 2021 21:57:53 +0000 (17:57 -0400)]
Fix: uninitialized buffer in mhitm theft feedback

If a monster with a theft attack (nymph or leprechaun) stole something
from an invisible monster (e.g. while under the influence of conflict),
and the attacking monster was not itself invisible, the monster name
buffer used when printing the "<foo> suddenly disappears!" message would
be used while still uninitialized.  The attacking monster's name was
only copied into the buffer if the defending monster was visible, but
would be used regardless to print the pline if the attacking monster was
visible and teleported away successfully after the attack.

4 years agoFix: nymph theft vs monster
Michael Meyer [Wed, 5 May 2021 22:51:26 +0000 (18:51 -0400)]
Fix: nymph theft vs monster

Nymphs' item theft attack against other monsters was broken in 1696019,
when a break used to select a particular item in the target monster's
inventory was changed to an early return.

4 years agoEntering special room, wake up only that room
Pasi Kallinen [Wed, 5 May 2021 17:32:47 +0000 (20:32 +0300)]
Entering special room, wake up only that room

... instead of doing a level-wide wake-up.

Fixes #429

4 years agotribute update: Lords and Ladies, Men at Arms
PatR [Mon, 3 May 2021 21:18:21 +0000 (14:18 -0700)]
tribute update: Lords and Ladies, Men at Arms

For Lords and Ladies, add a new, 13th passage.

For Men at Arms, include a page citation for the first passage
and add some missing italics to that one.  Add a missing word to
the second passage.

4 years agofix pull request #498 - unseen demon "looks angry"
PatR [Mon, 3 May 2021 21:10:09 +0000 (14:10 -0700)]
fix pull request #498 - unseen demon "looks angry"

When a potentially bribable demon lord becomes angry because the
hero is wielding Excalibur or Demonbane, avoid "It looks angry"
if the demon can't be seen.  The pull request just suppressed the
message in that situation; I've added an alternate one.

Fixes #498

4 years agofix github issue #499 - perm_invent menu_headings
PatR [Mon, 3 May 2021 20:50:48 +0000 (13:50 -0700)]
fix github issue #499 - perm_invent menu_headings

Implementation of '|'/#perminv command for scrolling perm_invent
deliberately disabled menu_headings (video attribute for object
class separator lines) on the persistent inventory window under
curses.  I don't recall why (possibly because it isn't actually
a menu) but there's no compelling need to do that, so reinstate
heading attributes.

Fixes #499

4 years agofix #K3317 - warning when eating corpse
PatR [Sun, 2 May 2021 01:36:46 +0000 (18:36 -0700)]
fix #K3317 - warning when eating corpse

The report was misleading because the warning about partly eaten
food being more nutritious than untouched food was actually given
when the partly eaten corpse was used to calculate hit points of
the new monster as the corpse was reviving as a zombie, rather
than when a bite was taken from it.  Pull request #497 had correct
analysis and a fix, although I've put the fix in a different place.

Closes #497

4 years agofix pull request #496 - ^X feedback typo
PatR [Wed, 28 Apr 2021 20:08:39 +0000 (13:08 -0700)]
fix pull request #496 - ^X feedback typo

Issue #495 and pull request #496 are both about a typo in recently
modified ^X feedback displayed when held by a monster:  "createure"
should be "creature".

Closes #496
Closes #495

4 years agoexplode() arguments
PatR [Tue, 27 Apr 2021 19:53:50 +0000 (12:53 -0700)]
explode() arguments

Argument explanation and Formatting.

4 years agofix "Killed by foo, while paralyzed by a monster"
PatR [Thu, 22 Apr 2021 23:13:41 +0000 (16:13 -0700)]
fix "Killed by foo, while paralyzed by a monster"

If the killer and the paralyzer are the same monster, truncate
that to "Killed by a foo, while paralyzed".  When not the same,
spell out the paralyzer's monster type instead of using generic
"monster".  "Killed by a fox, while paralyzed by a ghoul", or
"Killed by a ghoul, while paralyzed by a ghoul" *if* they were
two different ghouls.

4 years agotribute: Small Gods
PatR [Tue, 20 Apr 2021 21:53:42 +0000 (14:53 -0700)]
tribute: Small Gods

Add page number citations for the first two passages and add three
new passages.  That brings the total for Small Gods up to 15 which
is a bit on the high side, but they all seemed worthy.

While in there, fix a transcription mistake in Lords and Ladies #7:
"to" should be "be".

And two fixes for Jingo #11's footnote, change "genious" to "genius",
remove second "was" from "was, oddly enough, was one [...]".

Also, add a comment about the Amazing Maurice.

I've tried to bring the fixes37.0 entries about tribute fixes up to
date.  They're mostly minor and mostly neglected to include updates
for that.

4 years agoHallucinatory liquids for water damage messages
Patric Mueller [Tue, 20 Apr 2021 11:38:34 +0000 (13:38 +0200)]
Hallucinatory liquids for water damage messages

4 years agoanother scrambled message when given '-' as object
PatR [Mon, 19 Apr 2021 00:34:26 +0000 (17:34 -0700)]
another scrambled message when given '-' as object

This is similar to commit 98d381de46c47325abbdafda7894238c59f18cb8
(which mis-classified the bug as post-3.6), using #rub on a lump
of royal jelly and supplying '-' rather than an egg as the target
yielded "You mime rub the royal jellying on something."  Change
it to be "You mime rubbing the royal jelly on something."

4 years agofix pull request #488 - regressions for 'a'pply
PatR [Mon, 19 Apr 2021 00:02:11 +0000 (17:02 -0700)]
fix pull request #488 - regressions for 'a'pply

Restore some old behavior for the apply command that was changed
by the "getobj refactor" patch.  You couldn't attempt to apply
potions to determine whether they were oil, couldn't apply gray
stones once touchstone was discovered, and attempting to apply
arbitrary items gave "that is a silly thing to apply" rather
than "sorry, I don't know how to use that."

4 years agofix pull request #492 - select_do_line of a point
PatR [Sun, 18 Apr 2021 21:13:57 +0000 (14:13 -0700)]
fix pull request #492 - select_do_line of a point

Latent bug:  selection_do_line() for a single point produced
spurious line(s).

I haven't got a test case so am taking this one on faith....

While in there, do some nearby formatting fixups in sp_lev.c.

Fixes #492

4 years agofix github issue #490 - rolling boulder traps
PatR [Sun, 18 Apr 2021 21:02:57 +0000 (14:02 -0700)]
fix github issue #490 - rolling boulder traps

Don't include "Click!" in the feedback when a rolling boulder
trap is triggered if the hero is deaf.  Some feedback based on
being able to see a monster be hit by a rolling boulder should
also be reported if the location can be seen and an invisible
monster can be sensed there.  Change "you hear rumbling in the
distance" to "you hear rumbling nearby" when unseen activity is
close.  If the boulder itself is visible when it starts to roll,
report seeing that instead of hearing rumbling.

Fixes #490

4 years agofix github issue #486 - feedback while engulfed
PatR [Sun, 18 Apr 2021 20:29:54 +0000 (13:29 -0700)]
fix github issue #486 - feedback while engulfed

Issue is about monster shape changes being sensed via telepathy
while hero is swallowed, so player gets told about things that
aren't being shown on the map.  Similar situation while underwater;
only monsters in adjacent water spots are shown on the screen, but
messages about sensed monsters will continue to be given.  It isn't
limited to shape changing; lots of places include telepathy,
extended monster detection, and warning against specific types of
creatures as criteria to decide whether the hero 'sees' something
that isn't directly visible happen.

Change sensemon() to behave as if being swallowed or underwater
blocks telepathy, extended monster detection, and warning.  I
consider this to be experimental, but it needs much wider testing
than would take place if put into its own test branch.  It can be
tweaked or reversed if that turns out to be necessary.

There should be no change in behavior when not swallowed and not
underwater.  But for either of those two situations, some messages
that have been getting delivered may be different (such as using
"it" instead of sensed monster's name) or suppressed.

Fixes #486

4 years agofix pull request #489 - applying an empty lantern
PatR [Sun, 18 Apr 2021 00:36:14 +0000 (17:36 -0700)]
fix pull request #489 - applying an empty lantern

The message given when attempting to light a lantern with no power
left described it as a lamp.  Change that to lantern.  Also, "has
run out of power" duplicates the message given when it burns out;
change that part to "is out of power".

Your lamp has run out of power.  ->  Your lantern is out of power.

Fixes #489

4 years agofix pull request #491 - color of converted altar
PatR [Sun, 18 Apr 2021 00:16:44 +0000 (17:16 -0700)]
fix pull request #491 - color of converted altar

A display optimization assumed that the color of a glyph wouldn't
change unless the glyph itself changed, but there is a single glyph
for all altars and unaligned is shown with a different color than
the three aligned ones.  If there was an unaligned altar outside
of Gehennom (orcish mine town, some quests) and an invisible hero
(without see invisible) converted it, it stayed the old color until
there was some other reason to update that screen location.

Fixes #491

4 years agocontainer vulnerability to water damage
PatR [Sat, 17 Apr 2021 19:41:30 +0000 (12:41 -0700)]
container vulnerability to water damage

We used to have the contents of chests and large boxes be immune to
water damage, oilskin sacks immune unless the sack was cursed, other
containers be vulnerable.  Some reddit discussion about ice boxes in
unnethack indicates that they are treated like oilskin sacks, which
makes sense.  This adds that to nethack and also makes chests and
large boxes behave similarly.  So it's now:  nothing is immune even
when cursed (except statues); oilskin sacks, ice boxes, and other
boxes are immune to water damage unless cursed; all other containers
vulnerable even when not cursed.
|
|                  Old                  New
|immune all        statues,             statues
| the time         chests, large boxes
|
|immune when BU,   oilskin sacks        oilskin sacks,
| vulnerable if C                       ice boxes,
|                                       chests, large boxes
|
|vulnerable        ordinary sacks,      ordinary sacks,
| all the time     bags of holding,     bags of holding
|                  ice boxes
|
I suspect that the old ice box classification might have been an
accident caused by the Is_box() predicate yielding False for it.

The changes won't make much difference to actual play.  Chests and
large boxes are rarely carried and never start out cursed, ice boxes
even more so, and sacks/bags haven't been changed.  However, players
might intentionally curse a container to keep strong pets from
picking it up, or be carrying a box because they haven't found a bag
yet and then muck about with fountains or thrones and get it cursed.

4 years agotopten: UPDATE_RECORD_IN_PLACE
PatR [Sat, 17 Apr 2021 06:01:04 +0000 (23:01 -0700)]
topten: UPDATE_RECORD_IN_PLACE

'final_fpos' shouldn't have been moved to the 'g' struct.  Even if
a game went all the way through topten and was restarted as a new
game that also went all the way through topten, 'final_fpos' would
get a new value rather than being messed up by a stale old one.

4 years agoOPTIONS=scores:own
PatR [Fri, 16 Apr 2021 22:35:25 +0000 (15:35 -0700)]
OPTIONS=scores:own

From a beta tester six years ago:  specifying 'scores:own' resulted
in an option setting of 'scores:3 top/2 around/own' when player
wanted 'scores:0 top/0 around/own'.  Change it so that when fewer
than all three fields are given new values, the others are reset
rather than having their old values merge with new settings.

Also, 'scores:none' can be used to get 'scores:0 top/0 around/!own'
to skip the scores at the end without skipping notification of
whether the ending game's score made it into the top N list.
Options parsing accepts '!scores' and then ignores the negation.
Changing the optlist flags for 'scores' to allow negation resulted
in a complaint about missing value; I gave up instead of pursuing
that.  'scores:none' should suffice.

Setting 'scores:!top/own' or 'scores:!around/own' would behave as
'scores:1 top/!own' or 'scores:1 around/!own', respectively.
'scores:!top/!around/own' behaved as 'scores:1 top/1 around/own'
(note affect of two prior negations on final field compared to
single negation in the earlier two variations).  This fixes those.

4 years agoremove curse vs saddle
PatR [Wed, 14 Apr 2021 19:51:20 +0000 (12:51 -0700)]
remove curse vs saddle

Prayer reward can already uncurse a cursed saddle because hero is
stuck on it.  Allow scroll/spell of remove curse to do so too.

The original riding implementation in slash'em operated with the
saddle in hero's inventory rather than in the steed's, so it would
have handled this without any extra effort.  Presumeably that was
overlooked when incorporating riding into nethack changed it to
have saddle be part of the steed's inventory instead of hero's.

4 years ago^X feedback when held by unseen monster
PatR [Tue, 13 Apr 2021 21:50:12 +0000 (14:50 -0700)]
^X feedback when held by unseen monster

When swallowed and blind, the swallowing monster is described
accurately, but being held rather than swallowed describes the
monster as "it".  That's normal, but the status feedback section
of ^X output lists
|You are held by it.
which looks pretty weird.  Change that to be
|You are held by an unseen creature.

4 years agoopening magic vs holding monster
PatR [Tue, 13 Apr 2021 20:51:57 +0000 (13:51 -0700)]
opening magic vs holding monster

Zapping wand of opening or spell of knock at engulfer while swallowed
would make the engulfer expel the hero; this change makes zapping
other holders release their hold.  Zapping self now achieves the same
effect, as does breaking a non-empty wand of opening.  When poly'd
hero is holding a monster rather than being held, that monster will
be released.

Engulfers can't re-engulf for 1 or 2 turns after releasing the hero
in order to prevent hero from being immediately re-engulfed.  Impose
the same limitation on other holders.

4 years agolevel teleporters vs Ft.Ludios
PatR [Mon, 12 Apr 2021 20:25:52 +0000 (13:25 -0700)]
level teleporters vs Ft.Ludios

From newsgroup discussion where slash'em changes have revealed a
latent nethack bug:  prevent placing level teleporters in single-
level branches.  The Knox level doesn't have any level teleporters
(or random traps) but wizard mode wishing could create them there.
They wouldn't do anything because the only possible destination
would be the same level.  Pushing a boulder onto one used to trigger
an infinite loop (and still does in slash'em, which has other
single-level branches besides Ft.Ludios) trying to relocate it.

Boulder pushing was changed 15 years ago to prevent the infinite
loop and to avoid giving "the boulder disappears" message when a
level teleporter failed, but rolling boulder traversal lacked that
same change--it wasn't vulnerable to looping but could give an
inaccurate message claiming that the boulder disappeared when it
actually didn't.  Fixing this is a bit late; rolling boulder trap
creation was recently changed to not choose a path that rolls over
teleportation or level tele traps any more.

4 years agoQt extended command "rest"
PatR [Mon, 12 Apr 2021 00:53:57 +0000 (17:53 -0700)]
Qt extended command "rest"

When Qt's extended command selection dialog is set for all commands
or all normal mode commands, it displays the "#wait" command as
"wait (rest)".  Picking by mouse is straightforward; the extra text
on the button has no effect.  Picking by typing "#wa" will choose it;
there aren't any other choices matching that so the player never gets
as far as typing 'i'.  This change allows the player to type "#rest"
as an alternate way to choose it.  "#re" matches some other stuff
and the choice is left pending, adding 's' makes it unique but not
explicitly chosen (so still possible to back up), then adding 't'
chooses it.  The core never knows the difference.

4 years agoQt extended command selection
PatR [Sun, 11 Apr 2021 21:55:45 +0000 (14:55 -0700)]
Qt extended command selection

Simplify extended command selection under Qt by allowing the
autocomplete subset be one of the choices for its [filter].  That's
the same subset as X11 uses, where #q is unambiguous for #quit
instead of competing with #quaff and #quiver.

Unlike under X11, the player can use [filter] to switch to the full
command set and get access to a few commands which have no useable
key and aren't flagged to autocomplete.  (Mostly obscure wizard mode
commands but #exploremode is in that situation.)

In normal and explore modes, the [filter] button just toggles between
two sets of commands (all normal mode commands vs autocomplete normal
mode commands).  In wizard mode there are four choices and you might
need to click on [filter] up to three times to step through to the
target one among four sets (all commands, all normal mode commands,
autocomplete commands for both normal and wizard, full subset of just
the wizard mode commands).

4 years agotweaks to a few command flags
PatR [Sun, 11 Apr 2021 21:13:52 +0000 (14:13 -0700)]
tweaks to a few command flags

The #twoweapon command was flagged as autocomplete back when using
an extended command was the only way to execute it.  Take that off
since simple 'X' suffices.  Do the same for wizard mode commands
that can be invoked with control characters.  Probably ought to do
the same for #overview too but this change doesn't.

I started to add the autocomplete flag for #exploremode but that
would require an extra letter for #enhance so I decided not to.

There are some wizard mode commands that can't be executed under
X11 because they aren't flagged to autocomplete and its extended
command selection widget only offers autocomplete commands as
choices.  I haven't attempted to change that.

Always require paranoid confirmation for #panic rather than just
when it has been enabled for #quit.

4 years agodata.base novel titles
PatR [Thu, 8 Apr 2021 18:49:10 +0000 (11:49 -0700)]
data.base novel titles

Reduce the extra indentation of the Discworld titles from 4 spaces to 2.

4 years agoQt text windows
PatR [Thu, 8 Apr 2021 18:42:55 +0000 (11:42 -0700)]
Qt text windows

For Qt, always render text windows with fixed width font instead
of switching from proportional to fixed when the text contains
any line(s) with four consecutive spaces.  That was really meant
for menu lines without selector letters which want to be lined
up under or over ones with such, and wasn't a very good heuristic
for text windows.

Most of the text files for the '?' command happen to have such
lines so are already being shown with fixed-width font.  data.base
entries were hit or miss; most have attribution lines indented by
four or more spaces but some don't, so display was inconsistent:
some were shown with fixed-width font and some with proportional.

4 years agofix pull request #485 - genetic engineer attacks
PatR [Mon, 5 Apr 2021 03:06:45 +0000 (20:06 -0700)]
fix pull request #485 - genetic engineer attacks

Pull request fixed two genetic engineer problems:
1) lack of "you hit <foo>" message when you were poly'd into one;
2) lack of shield effect animation ('sparkle') when a genetic
   engineer hit magic resistant hero.

That opened a can o' worms.
3) hero lacking see invisible, poly'd into genetic engineer, and
   turning target into an invisible stalker got no feedback about
   the target vanishing.

A genetic engineer attacking a monster would polymorph it turn
after turn.
4) put back the teleport capability I removed when bringing it over
   from slash'em;
5) have genetic engineer teleport away after polymorphing someone.

The various mhitm_ad_XXXX() routines used g.vis to have caller
decide visibility, but hmonas() for poly'd hero didn't set that so
some messages--not just attack induced polymorph--were based on
visibility of earlier monster vs monster activity.
6) have hmonas() set up g.vis even though it doesn't use that.

There may have been one or two other minor fixes before I managed
to force the lid back onto the can.

Fixes #485

4 years agofix pull request #487 - one-step diagonal travel
PatR [Mon, 5 Apr 2021 00:23:46 +0000 (17:23 -0700)]
fix pull request #487 - one-step diagonal travel

When travel destination is one step away the code stops probing
for a path and reverts to normal movement, but it wasn't handling
the case where the one step was an impossible diagonal except for
hero being a grid bug.  If the situation was a diagonal that's
too narrow to squeeze through, travel would end and regular move
would fail.

I've rejected the suggested fix and done it differently, without
attempting to figure out why the change to end_running() would
have been wrong.  Clearly it was code that called end_running()
which needed to be fixed.

The test case was
 ..x|.
 ..|@.
 .....
while carrying enough that directly moving from '@' to 'x' will
not be allowed.  '@' would move one step south west and then stop
because findtravelpath() had ended travel due to single step move.
A similar case is
   ###
  |x-#-
  |0@.|
where 'x' is a doorway with intact open door and '0' is a boulder.
Prior to this fix, player would get "a boulder blocks the way" and
not move.  After, '@' will move northeast then northwest then west
to get into orthogonal position and finally south into the doorway.

Even though it definitely fixes both mentioned test cases, I won't
be surprised if this results in regressions for other situations.

Fixes #487

4 years agodata.base for role ranks and for discworld novels
PatR [Sun, 4 Apr 2021 02:04:16 +0000 (19:04 -0700)]
data.base for role ranks and for discworld novels

Requesting a lookup of "arc ranks" or "wizard ranks" will show a
list of the rank titles and the experience levels that use them
for the specified role.  Looking up a specific rank title such
as "curator" works for many of them, but some such as "wizard"
already match existing entries and continue to do so.  There is
just a bare list of the titles with the levels they apply to, no
attempt at flavor text.

Also, add a lookup key for "novel" and "paperback book" which
have been yielding the "no match" result.  It lists all 41 of
the Discworld titles.  Again, just a bare list, no added flavor.

These all look ok on tty, curses, Qt (which watches for any line
containing four consecutive spaces while collecting the text to
be displayed and switches to fixed-width font if it is sees that),
and X11 (which specifies fixed-width font for popup text windows
in default NetHack.ad file).  It might not look good on Windows
GUI if that is using a proportional font.

4 years agoLua: Fix getmap nodoor flag
Pasi Kallinen [Sat, 3 Apr 2021 18:44:05 +0000 (21:44 +0300)]
Lua: Fix getmap nodoor flag

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....