]> granicus.if.org Git - nethack/log
nethack
8 years agoeating off floor while blind
PatR [Tue, 14 Jun 2016 23:43:03 +0000 (16:43 -0700)]
eating off floor while blind

Reported directly to devteam in late December, when blind and
lacking gloves, you could safely locate cockatrice corpses on the
floor by using 'm' prefix to move without pickup followed by 'e'
and then answering no when ask whether to eat a cockatrice corpse.

8 years agofeedback for failed movement attempts
PatR [Tue, 14 Jun 2016 00:46:34 +0000 (17:46 -0700)]
feedback for failed movement attempts

When underwater and an attempt to move onto adjacent land fails
because the destination is a wall or solid rock or closed door,
report that there's an obstacle instead of just silently failing
to make the move.

If the user has 'mention_walls' option set, give feedback for
failing to move diagonally into or out of a doorway instead of
just silently not moving.

Having 'mention_walls' set could yield "you cannot pass through
the bars" when travel was testing (not moving) for a path past
iron bars, and when it happened it tended to be delivered a whole
bunch of times.

8 years agoChange deserted temple ghost messages
Pasi Kallinen [Mon, 13 Jun 2016 08:25:34 +0000 (11:25 +0300)]
Change deserted temple ghost messages

8 years agoMove generic usernames to sysconf
Pasi Kallinen [Mon, 13 Jun 2016 08:01:05 +0000 (11:01 +0300)]
Move generic usernames to sysconf

8 years agoAdd more hallu liquids
Pasi Kallinen [Mon, 13 Jun 2016 07:26:13 +0000 (10:26 +0300)]
Add more hallu liquids

8 years agofix #H4060 - sysconf is re-read if no config file
PatR [Mon, 13 Jun 2016 00:52:12 +0000 (17:52 -0700)]
fix #H4060 - sysconf is re-read if no config file

Config file handling remembers the name of the last config file
read in order for options processing to use it in messages, but
it was also reused as default config file name if user-supplied
config file name failed access() test.  So the SYSCF file became
the default user config file after it was used.  The config file
handling was a real mess.

This patch fixes it for Unix but there is a lot of scope for
typos in the changes for other platforms.  Testing is needed.

8 years agomore cmdhelp
PatR [Sat, 11 Jun 2016 22:35:35 +0000 (15:35 -0700)]
more cmdhelp

Some number_pad handling which wasn't present in the original cmdhelp
but is acted upon in cmd.c.

8 years agoChange fountains to bright blue
Pasi Kallinen [Sat, 11 Jun 2016 19:43:55 +0000 (22:43 +0300)]
Change fountains to bright blue

It's "sparkling water" after all, and makes it more obvious they're
different from water.

8 years agoMake ray bounceback depend on the wall type.
Pasi Kallinen [Sat, 11 Jun 2016 19:26:22 +0000 (22:26 +0300)]
Make ray bounceback depend on the wall type.

8 years agoReduce #turn undead helpless duration
Pasi Kallinen [Sat, 11 Jun 2016 18:33:08 +0000 (21:33 +0300)]
Reduce #turn undead helpless duration

8 years agoWhen attacking a peaceful monster, make other peaceful monsters react.
Pasi Kallinen [Sat, 11 Jun 2016 17:27:55 +0000 (20:27 +0300)]
When attacking a peaceful monster, make other peaceful monsters react.

8 years agoPrevent diagonal jump through open door
Pasi Kallinen [Sat, 11 Jun 2016 16:27:50 +0000 (19:27 +0300)]
Prevent diagonal jump through open door

8 years agodat/symbols: RogueEpyx
PatR [Sat, 11 Jun 2016 07:16:11 +0000 (00:16 -0700)]
dat/symbols: RogueEpyx

I don't know whether this fixes #H4335 but it does eliminate a
bunch of duplicate symbol entries.  And the two whose duplicates
had different values are suspicious ones: using linefeed and tab as
the character for object class symbol, which could easily confuse
the tty interface's cursor position tracking.  But those should
have been overridden by the later entries which specified the
default object class characters--I couldn't find anything in symbol
processing which would cause it to keep the first value instead of
replacing that with the second one.

The report had a link to screen shot which showed a door (I think
an open one despite the '+' shape) in the corner inside a room,
something like
 --+-----------
 |            |
 |       =
 |          ..##
 |          .+#
 ----+---------
where the '+#' in the lower right looks like it belongs two rows up
and one column over, the upper left of the three '#' is white and
the other two gray (lit corridor or empty dooryway or what?), the
'=' is actually three horizontal bars in green, and the lower '.'
has the cursor on it.  There aren't any object class symbols shown
(unless the triple-barred = is one), so linefeed and tab don't look
like likely culprits.

8 years ago"fix" bz 431 - phrasing of alignment description
PatR [Fri, 10 Jun 2016 00:08:37 +0000 (17:08 -0700)]
"fix" bz 431 - phrasing of alignment description

The character attributes (^X) description of alignment includes
information about whether the alignment is different from what it
started out as, and is used in a verbose sentence which names the
entire three-deity pantheon.  Someone thought
  You were chaotic, temporarily on a mission for Foo
  who was opposed by Bar (lawful) and Quux (neutral).
was in need to better phrasing.  It looks straightforward to me
(the temporary aspect indicates that a helm of opposite alignment
was causing 'chaotic').  I was going to mark it "won't fix" until
I noticed that you could also get
  You were lawful, now on a mission for Bar
(when permanent, one-time alignment change was causing 'lawful').

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

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

Both of these changes leave something to be desired, but I'm
going to mark the bz entry closed.

8 years agofix #H4383 - blasted twice by Excalibur
PatR [Thu, 9 Jun 2016 18:42:34 +0000 (11:42 -0700)]
fix #H4383 - blasted twice by Excalibur

...when alignment was toggled by helm of opposite alignment.  The
touch/retouch code is quite convoluted, but I think this simple
change is the right fix.

8 years agomore cmdhelp revamp
PatR [Wed, 8 Jun 2016 23:54:01 +0000 (16:54 -0700)]
more cmdhelp revamp

The if/elif/else/endif interpretor for '&' command data was too
simplistic.  It would allow multiple else clauses, elif clauses
after an else clause, and worst of all, accept a should-be-rejected
conditional block if an else or elif which evaluated true followed
an elif which evaluated false which in turn followed an earlier
true clause.  (dat/cmdhelp trigger any of those bugs.)

8 years agocmdhelp revamp
PatR [Wed, 8 Jun 2016 21:58:35 +0000 (14:58 -0700)]
cmdhelp revamp

Implement a rudimentary if/elif/else/endif interpretor and use
conditionals in dat/cmdhelp to describe what command each keystroke
currently invokes, so that there isn't a lot of "(debug mode only)"
and "(if number_pad is off)" cluttering the feedback that the user
sees.  (The conditionals add quite a bit of clutter to the raw data
but users don't see that.  number_pad produces a lot of conditional
commands:  basic letters vs digits, 'g' vs 'G' for '5', phone
keypad vs normal layout of digits, and QWERTZ keyboard swap between
y/Y/^Y/M-y/M-Y/M-^Y and z/Z/^Z/M-z/M-Z/M-^Z.)

The interpretor understands
 '&#' for comment,
 '&? option' for 'if' (also '&? !option'
                       or '&? option=value[,value2,...]'
                       or '&? !option=value[,value2,...]'),
 '&: option' for 'elif' (with argument variations same as 'if';
                         any number of instances for each 'if'),
 '&:' for 'else' (also '&: #comment';
                  0 or 1 instance for a given 'if'), and
 '&.' for 'endif' (also '&. #comment'; required for each 'if').

The option handling is a bit of a mess, with no generality for
which options to deal with and only a comma separated list of
integer values for the '=value' part.  number_pad is the only
supported option that has a value; the few others (wizard/debug,
rest_on_space, #if SHELL, #if SUSPEND) are booleans.

8 years agosome doc bits
PatR [Wed, 8 Jun 2016 12:35:53 +0000 (05:35 -0700)]
some doc bits

Add fixes36.1 for '&' command's support of altmeta option.

Short command help lacked an entry for '&' command.

Wizard mode help omitted #vanquished and some other obscure commands.

8 years agoHallucinatory liquids for water, lava, and acid
Pasi Kallinen [Tue, 7 Jun 2016 17:57:50 +0000 (20:57 +0300)]
Hallucinatory liquids for water, lava, and acid

8 years agoFix typo
Pasi Kallinen [Tue, 7 Jun 2016 05:58:52 +0000 (08:58 +0300)]
Fix typo

8 years agomore multishot
PatR [Tue, 7 Jun 2016 01:13:04 +0000 (18:13 -0700)]
more multishot

An attempt to simplify handling of missiles which stop at hero's
location (either hit or reached end of range) would have resulted
in missiles that hit the hero not being put on the map.  I had
realized this earlier but for some reason didn't get around to
dealing with it before the previous commit.

8 years agomultishot by monsters, plus reformatting
PatR [Tue, 7 Jun 2016 00:42:58 +0000 (17:42 -0700)]
multishot by monsters, plus reformatting

Some reformatting of the recently added pet ranged attack code.

The redundant--but different--multishot volley code has been replaced
so that there are only two versions (hero and monster) instead of
three (hero and monster vs hero and pet vs other monster).  The monst
version was out of date relative to post-3.4.3 changes to the hero one.
The pet version was way out of date and had some bugs:  wielding an
elven bow gave a +1 multishot increment to volley count for fast weapon
even when throwing something rather than shooting arrows, wielding any
weapon which had at least +2 enchantment gave 1/3 enchantment bonus to
volley count when throwing instead of shooting shoot ammo, and a pet
which got killed in the midst of a multishot volley--perhaps by a gas
spore explosion or some other passive counterattack--would keep on
shooting/throwing until the volley count was exhausted.

Pet use of ranged weapons is not ready for prime-time.  Pets don't
hang on to missiles or launchers+ammo, they just drop them if there is
no target immediately available.

8 years agoRemove extraneous curses gfx define
Pasi Kallinen [Mon, 6 Jun 2016 18:16:01 +0000 (21:16 +0300)]
Remove extraneous curses gfx define

8 years agolint cleanup
PatR [Sun, 5 Jun 2016 21:52:01 +0000 (14:52 -0700)]
lint cleanup

8 years agotiles fixup: zap beams
PatR [Sun, 5 Jun 2016 21:50:30 +0000 (14:50 -0700)]
tiles fixup: zap beams

Just noticed that a change of mine to src/drawing.c 2.5 weeks ago
("zap beam symbol descriptions -- they aren't walls") triggered a
set of four complaints when processing tiles.

8 years agodat/keyhelp for vms
PatR [Sun, 5 Jun 2016 13:33:42 +0000 (06:33 -0700)]
dat/keyhelp for vms

Update vms/install.com (rather than Makefile.top) to install the new
data file for the 'whatdoes' command.

Also, the 3.6.0 distribution puts version number 3.5.0 into vms
binaries (all the programs, not just nethack itself).  It's something
observable with native tools without running the program, nothing to
do with nethack's 'v' command which gets its version number from
patchlevel.h via makedefs.

8 years ago'whatdoes' command and new file: dat/keyhelp
PatR [Sun, 5 Jun 2016 08:09:52 +0000 (01:09 -0700)]
'whatdoes' command and new file: dat/keyhelp

Make the whatdoes ('&' or '?f') command support the 'altmeta' option
for meta-characters generated by two character seqeunce 'ESC char'.
Also, make it be more descriptive when reporting "no such command"
by including the numeric value it operated on when failing to match
any command.  That might provide a way for us to get some extra
information when players report problems with odd keystrokes:  we ask
them to type such at the "what command?" prompt and then tell us what
numbers come up.

It's been given a help file to deal with assorted idiosyncracies
which can come up when querying what keys do.  Unfortunately that
ended up being way more verbose than intended.

Installation of the extra data file has only been done for Unix.
Other platforms will get "can't open file" if they respond with
'&' or '?' to the "what command?" prompt.  The command will still
work though, just without the extra text.

8 years agomore /? of spaces
PatR [Sat, 4 Jun 2016 13:06:20 +0000 (06:06 -0700)]
more /? of spaces

Restore the ability to look up a single space by 'name'.

I thought mungspaces("<all spaces>") kept one space, but it doesn't.
It's a lucky accident that unnaming monsters and objects still works.
There may be other places which intend to give a special meaning to
a single space that don't still work....

8 years agoImprove the Guidebook config file section
Pasi Kallinen [Sat, 4 Jun 2016 09:43:09 +0000 (12:43 +0300)]
Improve the Guidebook config file section

8 years agoComment the limitation and reason
Pasi Kallinen [Sat, 4 Jun 2016 05:14:41 +0000 (08:14 +0300)]
Comment the limitation and reason

8 years agoFix #H4369: what-is reporting singular of null when given only spaces
Pasi Kallinen [Sat, 4 Jun 2016 05:01:55 +0000 (08:01 +0300)]
Fix #H4369: what-is reporting singular of null when given only spaces

8 years agoAllow pets to use ranged attacks
Pasi Kallinen [Fri, 3 Jun 2016 22:06:00 +0000 (01:06 +0300)]
Allow pets to use ranged attacks

This is the Pet ranged attack -patch by Darshan Shaligram,
with the spellcaster parts removed to keep it simpler.

Pets will now throw, spit and breathe at other monsters.

8 years agoSplit direction key showing into separate function
Pasi Kallinen [Fri, 3 Jun 2016 18:08:43 +0000 (21:08 +0300)]
Split direction key showing into separate function

8 years agoClear leashmon when leash is generated, even without obj init
Pasi Kallinen [Fri, 3 Jun 2016 16:33:51 +0000 (19:33 +0300)]
Clear leashmon when leash is generated, even without obj init

8 years agocomment formatting bit
PatR [Fri, 3 Jun 2016 01:01:28 +0000 (18:01 -0700)]
comment formatting bit

8 years agofarlook bullet-proofing
PatR [Fri, 3 Jun 2016 00:11:13 +0000 (17:11 -0700)]
farlook bullet-proofing

When examining a buried object (after detection has revealed it),
suppress setting of its dknown bit when hero is adjacent.  [That
couldn't actually happen, because the glyph on the map that we're
trying to examine would be replaced by one for whatever is on the
surface when sighted hero moved next to it, and an earlier clause
in the same test prevents blinded hero from getting to this point.]

8 years agoGive a hint that containers are looted instead of opened
Pasi Kallinen [Thu, 2 Jun 2016 15:11:35 +0000 (18:11 +0300)]
Give a hint that containers are looted instead of opened

8 years agoShow in inventory which monster a leash is attached to
Pasi Kallinen [Thu, 2 Jun 2016 13:35:21 +0000 (16:35 +0300)]
Show in inventory which monster a leash is attached to

8 years agodetection revamp
PatR [Thu, 2 Jun 2016 08:08:34 +0000 (01:08 -0700)]
detection revamp

Change most instances of detection to offer the player a chance to
move the cursor around on the map so that the getpos() autodescribe
feature can explain things that might go away as soon as the
current detection completes.  The few instances that don't offer
such a chance are the ones where everything which has been revealed
will still be there once the action finishes (such as regular magic
mapping and blessed/persistent monster detection).

There were quite a lot of inconsistencies in things like handling
for detection while swallowed or underwater.  I didn't keep track
of them to distinguish between 3.6.0, current dev code, or my patch
in progess.  They should be much more consistent now but without a
comprehensive fixes36.1 entry.

Blessed clairvoyance (divination spells at skilled or expert) now
shows monsters as well as terrain.  I first had it like that for
any clairvoyance, but having getpos/autodescribe kick in every 15
or 30 turns once you have the amulet--or pay the appropriate amount
to a temple preist--was nearly unplayable.  When it only follows an
explicit spell cast it is not intrusive.

8 years agoobscure polyself message
PatR [Thu, 2 Jun 2016 01:45:52 +0000 (18:45 -0700)]
obscure polyself message

Hero was poly'd into a hider monster and was swallowed by something.
Attempting to hide via '#monster' gave "You can't hide while you're
being held."  It correctly blocked hiding due to u.ustuck but the
feedback ignored the possibility of u.ustuck+u.uswallow.

8 years agoMake coyote names deterministic
Pasi Kallinen [Wed, 1 Jun 2016 15:38:21 +0000 (18:38 +0300)]
Make coyote names deterministic

8 years agoDisable object pile display when hallucinating
Pasi Kallinen [Wed, 1 Jun 2016 15:29:01 +0000 (18:29 +0300)]
Disable object pile display when hallucinating

Hallucination shows object piles under boulders

8 years agoiflags.save_uswallow
PatR [Wed, 1 Jun 2016 12:58:22 +0000 (05:58 -0700)]
iflags.save_uswallow

Some groundwork for detection enhancements.

you.h  - just formatting
flag.h - add iflags.save_uswallow so that u.uswallow manipulation ...
save.c - ... can be undone if a hangup save occurs

8 years agoFix travel occasionally walking you into pools
Pasi Kallinen [Tue, 31 May 2016 17:41:35 +0000 (20:41 +0300)]
Fix travel occasionally walking you into pools

This was a bug introduced post-3.6.0 in commit 9a2eb370e704

8 years agomore door/chest trap detection
PatR [Tue, 31 May 2016 13:37:14 +0000 (06:37 -0700)]
more door/chest trap detection

Make the '^' command catch up with far-look as far as identifying
trapped doors and trapped chests revealed by confused gold detect.
You need to be blinded when approaching the '^', otherwise as soon
as you can see a door or chest or whatever else is there the fake
bear trap will be removed from the map.

8 years agowishing fix
PatR [Tue, 31 May 2016 12:35:56 +0000 (05:35 -0700)]
wishing fix

rnd_otyp_by_namedesc() had an off by one error when choosing which
matching item to return, making it impossible to successfully wish
for the Amulet of Yendor, always yielding the plastic imitation.
  n == 2, maxprob == 2
  prob = rn2(maxprob); => 0 or 1
  i = 0; while (i < n - 1 && (prob -= ... + 1) > 0) i++;
always exited the loop on the first test of the condition because
subtracting 1 from 0 or 1 never yielded a result greater than 0.

It's still suboptimal:  "amulet of yendor" should find an exact match
and should never return "cheap plastic imitation of amulet of yendor"
from the partial match.

I think biasing the choice among multiple candidates based on their
generation probabilities only makes sense when all the candidates are
within the same class.  If scroll of light occurred in 5% of scrolls
and spellbook of light occurred in 10% of spellbooks (both percentages
pulled out of thin air), having "light" get a 2 out 3 chance to be a
spellbook doesn't seem right because scrolls are four times more
likely than spellbooks (in most of the dungeon; books aren't randomly
generated at all on the rogue level or in Gehennom).

8 years agofix #H4353 - monster gets angry after being killed
PatR [Tue, 31 May 2016 11:44:21 +0000 (04:44 -0700)]
fix #H4353 - monster gets angry after being killed

...by thrown potion.  The reported case was a shopkeeper killed by
system shock from thrown potion of polymorph, but any death (acid,
burning oil explosion, water against iron golem, holy water against
undead, demon, or werecritter) to any peaceful monster could cause
similar result.

8 years agodetecting chest and door traps
PatR [Tue, 31 May 2016 07:08:17 +0000 (00:08 -0700)]
detecting chest and door traps

When confused gold detection finds a door trap or a chest trap, it
puts a bear trap glyph/tile on the map at that location.  (They
disappear once they're within sight.)  Those should be given their
own glyphs so that they can have their own tiles, but this doesn't
do that.  What it does do is describe such fake bear traps as
"trapped door" or "trapped chest" when examined with far-look.
The '^' command--if used while blind so that '^' hasn't disappeared
yet--needs to catch up: it says "I can't see a trap there" when the
adjacent '^' is a fake bear trap.

8 years agogetpos moving to 'cmap' characters
PatR [Tue, 31 May 2016 00:56:47 +0000 (17:56 -0700)]
getpos moving to 'cmap' characters

While testing something I noticed that moving the cursor to visible '^'
by typing '^' while getpos was asking me to pick a location, it didn't
always cycle through all visible traps.  The most straightforward
culprit was after trap detection (via confused gold detection, not ^F)
had found a trap door or level teleporter in a closet that itself was
a secret corridor spot.  But it turned out to be any location that
hadn't been seen yet.  This is a substantial overhaul of the relevant
code and so far works for all the cases I've tried, but there are
bound to be cases I haven't tried yet and those may or may not work
correctly.

There's also a bunch of formatting cleanup, and some simplification of
the m/M/o/O/d/D/x/X handling.

8 years agoknox level tweaks
PatR [Mon, 30 May 2016 00:24:47 +0000 (17:24 -0700)]
knox level tweaks

The level teleport arrival regions (which also apply when invoking the
W quest artifact's temporary magic portal) on the Ft.Ludios level had
the wrong bounding coordinates.

While there, I've added a corridor between the welcome/zoo room and
the empty room at the top.  The doors are secret so monsters won't be
able to use it until they've been discovered by the player (which
happens with magic mapping as well as with searching).  I put a giant
in the formerly empty room, and made that room's original door secret
too so that the giant won't smash it down to get out, then smash down
the door between the zoo room and the main area around the fort.

8 years agoUpdate fixes file
Pasi Kallinen [Sun, 29 May 2016 19:20:52 +0000 (22:20 +0300)]
Update fixes file

8 years agoAdd fixes entry for the "autoexplore"
Pasi Kallinen [Sun, 29 May 2016 13:00:09 +0000 (16:00 +0300)]
Add fixes entry for the "autoexplore"

8 years agoGremlin wailing in agony should wake up nearby monsters
Pasi Kallinen [Sun, 29 May 2016 06:35:51 +0000 (09:35 +0300)]
Gremlin wailing in agony should wake up nearby monsters

Also allow wizmode ^G create sleeping monsters

8 years agoreset travel cache when changing levels
PatR [Sun, 29 May 2016 02:54:19 +0000 (19:54 -0700)]
reset travel cache when changing levels

When travel fails to reach its destination, it remembers the target
spot to use as default next time.  But that spot is only meaningful
on the current level.  Discard last travel destination when moving
to a different level.

Also, discard unlocking context when changing level unless the
context is for a container being brought along (after having been
picked up since you can't unlock a carried box).  Previously, a
door pointer on the new level could happen to match the last one
being unlocked on the old level.

Discard trap setting context when changing level even if the trap
object is brought along.

Somehow the code for applying a touchstone got inserted in between
two sections of code for applying a trap (ages ago; probably since
touchstone was first introduced however many versions back), so
clean that up.

8 years agotravel comment formatting
PatR [Sun, 29 May 2016 01:39:11 +0000 (18:39 -0700)]
travel comment formatting

8 years agoctype tweaks
PatR [Sun, 29 May 2016 00:18:51 +0000 (17:18 -0700)]
ctype tweaks

None of these explains the Windows assertion failure.
 end.c - post-3.6.0
 options.c - in #else block of #if win32
 winmenu.c - X11

8 years agoAdd rudimentary autoexplore to getloc
Pasi Kallinen [Sat, 28 May 2016 11:49:13 +0000 (14:49 +0300)]
Add rudimentary autoexplore to getloc

Pressing 'x' or 'X' will move the cursor to a possibly unexplored location.

8 years agoSome code reorg for the getloc nearest/farthest locs
Pasi Kallinen [Sat, 28 May 2016 11:27:07 +0000 (14:27 +0300)]
Some code reorg for the getloc nearest/farthest locs

8 years agoMinor code reorg in gather locs
Pasi Kallinen [Sat, 28 May 2016 10:52:53 +0000 (13:52 +0300)]
Minor code reorg in gather locs

8 years agoblack&white lava
PatR [Sat, 28 May 2016 07:51:54 +0000 (00:51 -0700)]
black&white lava

Add MG_BW_LAVA to mapglyph() instead of hijacking MG_DETECT.  Used
to display lava in inverse video if color is disabled and lava is
using the same display character as water (which is the default).
(The use_inverse option must be enabled for tty to honor it.  X11's
text mode doesn't care.  Win32 does care but probably shouldn't--it's
not a case like tty where the hardware might not support it.)

This implements both MG_DETECT and MG_BW_LAVA for X11, but only if
the program is built with TEXTCOLOR enabled.  Those should work even
when color is not supported, but I suspect that configuration is
unlikely to ever be used so didn't want to spend the time to figure
out how to do it.  (The relevant data is overloaded on the color
data, so not available when TEXTCOLOR is disabled.)

The win32 revision is untested.

8 years agoMerge branch 'tung-infinite-travel-fix' into NetHack-3.6.0
Pasi Kallinen [Sat, 28 May 2016 06:51:14 +0000 (09:51 +0300)]
Merge branch 'tung-infinite-travel-fix' into NetHack-3.6.0

8 years agoMerge branch 'infinite-travel-fix' of https://github.com/tung/NetHack into tung-infin...
Pasi Kallinen [Sat, 28 May 2016 06:50:20 +0000 (09:50 +0300)]
Merge branch 'infinite-travel-fix' of https://github.com/tung/NetHack into tung-infinite-travel-fix

8 years agonumber_pad:-1 qwertz keyboard
PatR [Sat, 28 May 2016 01:39:17 +0000 (18:39 -0700)]
number_pad:-1 qwertz keyboard

Reported almost exactly one year ago by a beta tester proofreading
the Guidebook, the number_pad setting to support the German keyboard
which swaps the Y and Z keys is for a keyboard that is used in other
places too.  The report mentioned France and Belgium; Wikipedia's
"keyboard layout" entry mentions "Germany, Austria, Switzerland and
other parts of Central Europe".  This changes references to "German
keyboard" (there were only a couple) into "QWERTZ keyboard".

8 years agogetpos of doors
PatR [Fri, 27 May 2016 23:10:03 +0000 (16:10 -0700)]
getpos of doors

Using 'd' to cycle through door locations is worthwhile when #terrain
is executing as well as when picking a location.

8 years agoMake getpos for doors also target drawbridges
Pasi Kallinen [Fri, 27 May 2016 15:47:56 +0000 (18:47 +0300)]
Make getpos for doors also target drawbridges

8 years ago'^O' command documentation and '^' command help
PatR [Fri, 27 May 2016 01:35:27 +0000 (18:35 -0700)]
'^O' command documentation and '^' command help

While looking for things in core which might conceivably trigger the
Windows ctype assertion failure (haven't found any yet), I noticed
that help_dir() was still treating ^O as a wizard mode-only command.
Also, documentation about that command was never brought up to date.

I wish this change to ^O hadn't been done.  #overview already has
a meta/alt M-O shortcut and overloading wizard mode commands makes
documentation more complicated since wizard mode stuff traditionally
has been left unmentioned.

8 years agoReset dooridx too
Pasi Kallinen [Thu, 26 May 2016 14:58:17 +0000 (17:58 +0300)]
Reset dooridx too

8 years agolevel_difficulty comment: Wizard's Tower
PatR [Thu, 26 May 2016 00:31:57 +0000 (17:31 -0700)]
level_difficulty comment: Wizard's Tower

Add a comment addressing something I recently mentioned in the
newsgroup.

8 years agounix mail cleanup bulletproofing
PatR [Thu, 26 May 2016 00:25:47 +0000 (17:25 -0700)]
unix mail cleanup bulletproofing

If the recently added release routine ever gets called twice for
some reason, don't free already freed memory, or worse, was freed
here and then allocated for something else which is still in use.

8 years agomore #H4347 - corpse revival
PatR [Wed, 25 May 2016 08:09:45 +0000 (01:09 -0700)]
more #H4347 - corpse revival

When a stack of N corpses is hit by wand or spell of undead turning,
1 revives and N-1 remain corpses.  If owned by a shop, a fee for
using up all N corpses was charged and if carried at the time, the
extra N-1 became owned by the player but if on the floor, they
remained owned by the shop.  Feedback was schitzophrenic as to
whether the whole stack was involved:
 One of the <foo> corpses glows irridescently.
 You owe <shk> X zormids for them.

Split the stack so that revival explicitly operates on only 1 corpse.
It's done after the revival side of things has already succeeded or
given up, so the split will never need to be undone.

8 years agofix #H4347 - revival of carried corpse in shop
PatR [Wed, 25 May 2016 01:00:57 +0000 (18:00 -0700)]
fix #H4347 - revival of carried corpse in shop

Zapping wand of undead turning at self while inside a shop and
carrying a corpse caused the shopkeeper to claim a use-up fee for
the corpse regardless of whether it was owned by the shop.

Not mentioned in the report:  casting stone-to-flesh as self while
carrying a figurine or statue behaved similarly.

8 years agoSeparate permonst valid location humidity function
Pasi Kallinen [Mon, 23 May 2016 19:19:43 +0000 (22:19 +0300)]
Separate permonst valid location humidity function

8 years agoAllow quick pick doors and doorways in getloc
Pasi Kallinen [Mon, 23 May 2016 18:00:47 +0000 (21:00 +0300)]
Allow quick pick doors and doorways in getloc

8 years agoFree mailbox at exit
Pasi Kallinen [Mon, 23 May 2016 14:18:24 +0000 (17:18 +0300)]
Free mailbox at exit

8 years agoFix valgrind complaints of uninitialized memory
Pasi Kallinen [Mon, 23 May 2016 13:21:36 +0000 (16:21 +0300)]
Fix valgrind complaints of uninitialized memory

8 years agopotential ctype.h issues
PatR [Mon, 23 May 2016 00:29:59 +0000 (17:29 -0700)]
potential ctype.h issues

A few things which might conceivably pass negative values to ctype
routines.  Some are post-3.6.0.  None of them explain the sporadic
Windows assertion failure.

Using tolower() without verifying the argument isupper() should be
completely safe when tolower() is a function but might not be when
it's a macro.  (Likewise for toupper() without islower().)  NetHack's
lowc() function is always safe, at least for ASCII.

8 years agomon->mhp manipulation
PatR [Sun, 22 May 2016 01:25:16 +0000 (18:25 -0700)]
mon->mhp manipulation

I've hunted for other instances where monster hit points were set
to zero or less without calling the routine that kills off the
monster (see recent mon_unslime() vs zhitm()) and didn't find any
for mhp subtraction.  I haven't checked for direct assignment yet.

For a while I thought I'd found several cases where a monster was
intended to be killed but got left with positive hit points, but
it turned out that lifesaved_monster(), of all places, was setting
them to zero.  I've moved that to its callers so that it isn't so
well hidden.  And changed several ''if ((mon->mhp -= dmg) <= 0)''
into separate subtraction and 'if' just so the mhp manipulation is
a bit more visible.

I think the only actual change here is the message for monster
being killed by lava, where glass golems now melt instead of burn.

8 years agoMinor tweakage of the sample config
Pasi Kallinen [Sat, 21 May 2016 21:00:06 +0000 (00:00 +0300)]
Minor tweakage of the sample config

8 years agoAdd sample config file
Pasi Kallinen [Sat, 21 May 2016 08:29:39 +0000 (11:29 +0300)]
Add sample config file

Several people seem to be confused about config file and what to
put in it.  Perhaps this'll help a bit.  The options are mostly
in alphabetical order, except where it makes sense to group
them together.

Also add fixes36.1 to the Files

8 years agoGuidebook tweaks
PatR [Sat, 21 May 2016 07:11:19 +0000 (00:11 -0700)]
Guidebook tweaks

Fix a typo in the text for encumbrance in the Status section.

Fix a typo in Guidebook.mn for non-fatal status condtions that
resulted in bold font for the entire Stun/Conf/Hallu line.

For Guidebook.ps, force
 Status
     Hunger:
onto two lines instead of being bunched up together on one line.
(For Guidebook.txt, it's already two lines.)

For both Guidebook.txt and Guidebook.ps, force some extra vertical
separation between the set of one-letter commands and the set of
extended commands, between the set of extended commands and the
set of Meta-key commands, and between the set of Meta-key commands
and the extra one-letter commands available when number_pad is on.
I don't know whether Guidebook.tex's output would look better with
something similar.

8 years agofar-look which swallowed
PatR [Sat, 21 May 2016 00:24:18 +0000 (17:24 -0700)]
far-look which swallowed

Change description of area outside of the swallow animation from
"interior of a monster" to "unreconnoitered".  For the animation
characters themselves, don't suppress the list of other screen
features which use the same character ('/' for wand and so on).
Add a data.base entry for "unreconnoitered" in case someone tries
to use it to look up an unfamiliar term.

8 years agoformatting: tab removal
PatR [Sat, 21 May 2016 00:01:40 +0000 (17:01 -0700)]
formatting: tab removal

8 years agowin/tty/topl.c formatting bit
PatR [Fri, 20 May 2016 23:42:03 +0000 (16:42 -0700)]
win/tty/topl.c formatting bit

8 years agoUnify monster use healing potions checks
Pasi Kallinen [Fri, 20 May 2016 17:35:02 +0000 (20:35 +0300)]
Unify monster use healing potions checks

8 years agozap beam symbol descriptions
PatR [Fri, 20 May 2016 01:12:45 +0000 (18:12 -0700)]
zap beam symbol descriptions

They aren't walls.

Noticed while working on a potential change for far-look while
swallowed, zap beams have a bogus description of "wall" that
showed up when looking at '/' and '\\'.  I'm guessing that vbeam
and hbeam were cloned from actual wall symbols and then lslant
and rslant got cloned from them.  There doesn't seem to be any
other reason for the description, which is both wrong and applies
to symbols which aren't on the screen at a time when the player
can use far-look to examine them.  It's been this way since the
creation of the second cvs repository used to start the current
git one; I didn't attempt to go back any farther than that.

8 years agomon digging lint
PatR [Fri, 20 May 2016 00:34:00 +0000 (17:34 -0700)]
mon digging lint

8 years agoInterrupt a multi turn action if hp or pw is restored to maximum
Pasi Kallinen [Thu, 19 May 2016 19:01:41 +0000 (22:01 +0300)]
Interrupt a multi turn action if hp or pw is restored to maximum

via UnNetHack by Patric Mueller

8 years agoAdd more lighting variance to bigroom v2
Pasi Kallinen [Thu, 19 May 2016 17:57:56 +0000 (20:57 +0300)]
Add more lighting variance to bigroom v2

8 years agoUnify pet and monster digging item checks
Pasi Kallinen [Thu, 19 May 2016 15:46:25 +0000 (18:46 +0300)]
Unify pet and monster digging item checks

8 years agoUnify shop location stocking test
Pasi Kallinen [Thu, 19 May 2016 15:05:54 +0000 (18:05 +0300)]
Unify shop location stocking test

8 years agoshop_keeper bit
PatR [Thu, 19 May 2016 01:13:01 +0000 (18:13 -0700)]
shop_keeper bit

This started as formatting cleanup but ended up adding a bit more
useful information if the impossible ever gets triggered.

8 years agofix #H4343 - obscure tty bug while swallowed
PatR [Wed, 18 May 2016 23:36:18 +0000 (16:36 -0700)]
fix #H4343 - obscure tty bug while swallowed

When --More-- was written to leftmost column of line 2 while the
hero was swallowed, after player acknowledged it and the top line
was cleared, the cursor ended up in the wrong place.  I still
don't understand what in the world is going on here, but adding
'flush_screen(0)' after 'swallowed(1)' in docorner() makes the
problem go away.  Why is the behavior different when --More-- is
in the first column than when it's anywhere else?

After that fix, I commented the whole thing out.  The swallowed
optimization is just not significant enough to justify peeking at
core internals.

Core bit:  prior to those two changes, I tried inserting 'bot()'
into swallowed().  It moved the mis-positioned cursor from the
end of the second status line to on the map just right of the
bottom right corner of the swallowed display.  That didn't fix
anything, but I've left it in place.  bot() to update status is
needed following cls(); now it happens before redrawing the map
instead of at some point after.

8 years agofix bz451 - non-sequitur role prompt
PatR [Wed, 18 May 2016 08:49:56 +0000 (01:49 -0700)]
fix bz451 - non-sequitur role prompt

For OPTIONS=role:Valk,race:!human,align:!lawful (where first+second
contradicts third or vice versa), you'd get
  Shall I pick your Dwarven Valkyrie's for you?
where the what-to-pick field names are empty.  Now, align:!lawful
gets overridden, producing
  Shall I pick your Dwarven Valkyrie's alignment for you?
and then you'll end up lawful regardless of whether you answer yes
or no.  That may be suboptimal but does emphasize that the original
alignment constraint couldn't be honored.  (Things just fell out
that way and I haven't tried to make it behave any other way.)

While testing the fix, I noticed that OPTIONS=role:Valk,race:random
prompted
  Shall I pick your Valkyrie's race and alignment for you?
instead of honoring 'race:random' without asking, so I've tried to
fix that too.

Role selection has become insanely complex, so one or the other of
these fixes has probably broken some other permuation of partial
specification.  Both of the changes here have been done in the core
without touching any interface-specific role selection code.

8 years agocorpse_chance()
PatR [Wed, 18 May 2016 01:21:02 +0000 (18:21 -0700)]
corpse_chance()

It was hard to test the attempting-to-revive-shopkeeper-corpse
fix when dying shopkeepers kept declining to leave corpses.  Make
shopkeepers always leave corpses (modulo various circumstances
which prevent all corpses).  I don't know whether or not temple
priests ought to receive the same treatment.

8 years agofix 'crash when reviving shopkeeper'
PatR [Wed, 18 May 2016 01:10:31 +0000 (18:10 -0700)]
fix 'crash when reviving shopkeeper'

Reported directly to devteam, zapping wand of undead turning at a
shopkeeper's corpse would cause a crash.  'Traits' to fully recreate
the shk were attached to the corpse, but the temporary monster
created on the map intended to be relaced by the shk didn't have any
eshk struct, and the sequence replmon() -> replshk() -> inhishop()
attempted to access mtmp->mextra->eshk when trying to reattach the
shk to his/her shop.  No other mextra structs involve pointer fixups,
so pets, priests, vault guards don't need extra handling.

I tested four cases.  #1 and #3 had no shop bill at the time; I'm not
sure about #2.  These all worked.
 1) shk killed inside shop, resurrected there;
 2) killed outside shop on the shop level, resurrected there;
 3) killed inside his shop, corpse carried to different level before
    being resurrected;
 4) killed and resurrected on different level from shop after hero
    stole something (teleported out of shop with unpaid item)--shk
    left shop to chase hero and followed him/her up some stairs.

8 years agorole parsing lint
PatR [Sun, 15 May 2016 01:34:15 +0000 (18:34 -0700)]
role parsing lint

8 years agomisc core formatting
PatR [Sun, 15 May 2016 01:26:48 +0000 (18:26 -0700)]
misc core formatting

Some of these are post-3.6.0, some just got overlooked before the
3.6.0 release.

8 years agoimplement #H4340 - indirect kills vs pacifism
PatR [Sat, 14 May 2016 23:57:56 +0000 (16:57 -0700)]
implement #H4340 - indirect kills vs pacifism

Implement the suggestion that a monster killing itself with acid
to avoid turning to stone or with fire to avoid turning into green
slime not break pacifist conduct even if the player caused the
"turning into" situation that triggered the accidental suicide.

Along the way I discovered a serious bug:  zhitm() applies damage
to target monster but leaves it to caller to finish killing off
that monster when damage is fatal, but muse_unslime() called it
without checking whether the monster should die.  For fire breath
that shouldn't matter since all fire breathers are immune to fire
damage, but when support for wands of fire and fire horns was
added later it just cloned the fire breath code and neglected to
check for fatal damage.  The result was that a monster with 0 HP
would be left on the map, then impossible "dmonsfree: 1 removed
doesn't match 0 pending" would be given when taking it off fmon
list, but a stale monster symbol (presumably level.monsters[][]
pointer too) was left on the map which eventually led to monsndx
panic or arbitrary crash.

8 years agofarlook when underwater
PatR [Sat, 14 May 2016 11:02:07 +0000 (04:02 -0700)]
farlook when underwater

Replace "dark part of a room" with something more sensible when
examining the map while underwater where water/lava/ice within the
3x3 grid centered on the hero is all that can be seen.  Adjacent
non-water, non-lava, non-ice spots are now described as "land".
(Note: this stuff doesn't apply on the Plane of Water where being
underwater gets handled differently.)  Spots outside that 3x3 grid
are now described as "unreconnoitered", which sounds a bit odd but
I couldn't come up with anything better.  "Not visible" is accurate
when the hero can see but needs adjusting when he can't, bringing
us right back to the current conundrum.  I suppose "not accessible"
might be viable but nitpickers would consider it to be inaccurate
if hero has teleport capability.  (There are a couple of references
to "unknown" from earlier versions of this revision.  I think
"a ghost or unexplored or unknown or land or air (land)" is the only
place left where the player might see it, and it seems reasonable
there, although perhaps it ought to be changed to "unreconnoitered".)

Also fix farlook while swallowed and blind, where blindness was
overriding swallower Id even though it doesn't do so for mon_nam()
and things which use that like combat feedback.

8 years agodifferent fix for #H4332 - Qt crashes upon quit
PatR [Sat, 14 May 2016 09:13:07 +0000 (02:13 -0700)]
different fix for #H4332 - Qt crashes upon quit

Quiting without ever examining inventory caused the Qt interface
to issue an impossible(), then crash due to deferencing a Null
pointer.  The prior fix was to suppress the validation code that
was crashing.  This changes things so that the inventory window
always gets at least one use, allowing the Qt validation code to
succeed.  tty and X11 are ok with it; win32 needs to be verified.