Commit Graph

6176 Commits

Author SHA1 Message Date
PatR
b47a456630 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.
2016-06-13 17:46:34 -07:00
Pasi Kallinen
8fdd2318c1 Change deserted temple ghost messages 2016-06-13 11:25:34 +03:00
Pasi Kallinen
942ee14d0f Move generic usernames to sysconf 2016-06-13 11:01:05 +03:00
Pasi Kallinen
3f5116fbd4 Add more hallu liquids 2016-06-13 10:26:13 +03:00
PatR
4ff8d8ac7e 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.
2016-06-12 17:52:12 -07:00
PatR
4e12bb6144 more cmdhelp
Some number_pad handling which wasn't present in the original cmdhelp
but is acted upon in cmd.c.
2016-06-11 15:35:35 -07:00
Pasi Kallinen
2ca57b9969 Change fountains to bright blue
It's "sparkling water" after all, and makes it more obvious they're
different from water.
2016-06-11 22:43:58 +03:00
Pasi Kallinen
01d580cc0a Make ray bounceback depend on the wall type. 2016-06-11 22:26:27 +03:00
Pasi Kallinen
69aca5ac96 Reduce #turn undead helpless duration 2016-06-11 21:33:12 +03:00
Pasi Kallinen
939e507345 When attacking a peaceful monster, make other peaceful monsters react. 2016-06-11 20:27:55 +03:00
Pasi Kallinen
b75ce0b996 Prevent diagonal jump through open door 2016-06-11 19:27:50 +03:00
PatR
9ad584523f 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.
2016-06-11 00:16:11 -07:00
PatR
1eb4d3432e "fix" bz 431 - phrasing of alignment description
The character attributes (^X) description of alignment includes
information about whether the alignment is different from what it
started out as, and is used in a verbose sentence which names the
entire three-deity pantheon.  Someone thought
  You were chaotic, temporarily on a mission for Foo
  who was opposed by Bar (lawful) and Quux (neutral).
was in need to better phrasing.  It looks straightforward to me
(the temporary aspect indicates that a helm of opposite alignment
was causing 'chaotic').  I was going to mark it "won't fix" until
I noticed that you could also get
  You were lawful, now on a mission for Bar
(when permanent, one-time alignment change was causing 'lawful').

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

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

Both of these changes leave something to be desired, but I'm
going to mark the bz entry closed.
2016-06-09 17:08:37 -07:00
PatR
ebd6bb62f5 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.
2016-06-09 11:42:34 -07:00
PatR
60b7e9bc17 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.)
2016-06-08 16:54:01 -07:00
PatR
ca22b3fe46 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.
2016-06-08 14:58:35 -07:00
PatR
d92ae04afb 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.
2016-06-08 05:35:53 -07:00
Pasi Kallinen
3502cfcc5a Hallucinatory liquids for water, lava, and acid 2016-06-07 20:57:50 +03:00
Pasi Kallinen
a157c4873d Fix typo 2016-06-07 08:58:52 +03:00
PatR
a846f811af 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.
2016-06-06 18:13:04 -07:00
PatR
8c0810f687 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.
2016-06-06 17:42:58 -07:00
Pasi Kallinen
e276540230 Remove extraneous curses gfx define 2016-06-06 21:16:01 +03:00
Bobby Durrett
1c8f312fb6 Fix crash with MAIL env variable 2016-06-05 21:10:26 -07:00
PatR
e3c15574ac lint cleanup 2016-06-05 14:52:01 -07:00
PatR
30638db579 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.
2016-06-05 14:50:30 -07:00
PatR
9c6e5a0563 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.
2016-06-05 06:33:42 -07:00
PatR
4ef23c6ac4 '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.
2016-06-05 01:09:52 -07:00
keni
a8e1700f51 Merge branch 'NetHack-3.6.0' 2016-06-04 09:30:59 -04:00
PatR
8e307be556 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....
2016-06-04 06:06:20 -07:00
Pasi Kallinen
c36bc0043c Improve the Guidebook config file section 2016-06-04 12:43:09 +03:00
Pasi Kallinen
ad9e3dcef9 Comment the limitation and reason 2016-06-04 08:14:41 +03:00
Pasi Kallinen
b4c14f0c34 Fix #H4369: what-is reporting singular of null when given only spaces 2016-06-04 08:02:08 +03:00
Pasi Kallinen
5009a67264 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.
2016-06-04 01:06:07 +03:00
Pasi Kallinen
4d594f77c2 Split direction key showing into separate function 2016-06-03 21:08:43 +03:00
Pasi Kallinen
cc839a56c6 Clear leashmon when leash is generated, even without obj init 2016-06-03 19:33:51 +03:00
PatR
358552a587 comment formatting bit 2016-06-02 18:01:28 -07:00
PatR
94a4f57d53 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.]
2016-06-02 17:11:13 -07:00
Pasi Kallinen
984785b13c Give a hint that containers are looted instead of opened 2016-06-02 18:11:41 +03:00
Pasi Kallinen
8240db3445 Show in inventory which monster a leash is attached to 2016-06-02 16:35:21 +03:00
PatR
894d6c6859 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.
2016-06-02 01:08:34 -07:00
PatR
a5d57430be 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.
2016-06-01 18:45:52 -07:00
Pasi Kallinen
a5d3d0fdb8 Make coyote names deterministic 2016-06-01 18:38:21 +03:00
Pasi Kallinen
5503c5e1e4 Disable object pile display when hallucinating
Hallucination shows object piles under boulders
2016-06-01 18:29:05 +03:00
PatR
4ce52dc07f 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
2016-06-01 05:58:22 -07:00
Pasi Kallinen
e138a4b069 Fix travel occasionally walking you into pools
This was a bug introduced post-3.6.0 in commit 9a2eb370e7
2016-05-31 20:41:39 +03:00
PatR
d41e097ea8 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.
2016-05-31 06:37:14 -07:00
PatR
c68dfe8f52 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).
2016-05-31 05:35:56 -07:00
PatR
30855febad 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.
2016-05-31 04:44:21 -07:00
PatR
71113a6971 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.
2016-05-31 00:08:17 -07:00
PatR
7404597ac5 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.
2016-05-30 17:56:47 -07:00