Commit Graph

8908 Commits

Author SHA1 Message Date
nhmall
7698e27eed Merge branch 'NetHack-3.6' 2019-06-20 22:33:33 -04:00
PatR
2fe57af3f3 fix #H8833 - wishing for "<foo> amulet"
and receiving a random amulet instead of an "amulet of <foo>".
Although the failure to produce the 'right' amulet wasn't a regression
compared to earlier versions as the report indicated, supporting that
wish is straightforward.
2019-06-20 18:42:35 -07:00
PatR
2da552e22f fix #8924 - demonic bribery while hero is deaf
Even though it isn't using verbalize() to make a specific statement,
don't let a demon ask the hero for a bribe when the hero is deaf.

Also, give alternate setup messages in a couple of places where a
divine voice is overriding deafness.
2019-06-20 13:08:47 -07:00
PatR
05958e9b3a comment typo for "transient" 2019-06-20 10:59:48 -07:00
PatR
72afb0d4f6 muse wand/horn feedback for monst zapping at self
Recent commit 5d59b288c9 changed monster
zapping a fire horn at self to cure sliming to not use the wand-zap
feedback routine, but inadvertently did for zaps of wands of fire too.
Use the zap routine for wand and play-instrument routine for horn.
2019-06-20 10:54:59 -07:00
nhmall
2a5d7ed536 Merge branch 'NetHack-3.6' 2019-06-20 10:18:32 -04:00
PatR
8bfe6f82f1 Re-do the formatting for help on menu control keys
and add the non-configurable keys:  space, return, and escape.
2019-06-20 02:26:48 -07:00
PatR
2a5080e6f9 update contact URL
Reviewing the help choices revealed an out of date one.
2019-06-20 01:24:10 -07:00
PatR
9f6588af49 curses text windows
Most of the entries for '?' looked awful because curses was using
((terminal_width / 2) - 2) for the window width ('- 2' was to make
for for a border around the popup window, regardless of what the
'windowborder' option was set to).  Splitting text that has been
manually formatted for 80 columns "worked" but looked bad when not
required.

Some of the help files are using 79 characters on a few lines,
producing wrapped text when displayed.  Those would look better if
limited them to 78 or if curses can be modified to suppress the
window border when the entire display is being covered by a popup.
2019-06-20 01:14:50 -07:00
PatR
3ea0cc1483 fuzzer tweak tweak
Recent fuzzer tweak had an unintended side-effect:  NUL character is
used to indicate a mouse click and we weren't setting up fake value
for one of those.  Go back to avoiding NUL when obtaining a random
value for user's keystroke.
2019-06-20 00:53:45 -07:00
nhmall
3640c3c2b2 merge bit 2019-06-18 21:50:51 -04:00
nhmall
30cfcf3b12 Merge branch 'NetHack-3.6' 2019-06-18 21:43:54 -04:00
PatR
1c03d09701 curses map window
tty ignores map column #0 (0-based index), like the core, and draws
the map in screen columns 1 (1-based index) through 79, leaving screen
column 80 blank.  curses was drawing all 80 map columns and since #0
was always unused, screen column 1 was blank and the map was shown in
2 through 80.  Change curses to work like tty.

This was too easy; there may be problems lurking.  One known issue: it
should be made smarter about when clipping/panning is necessary since
it thinks that a full 80 columns are needed but 79 suffice.
2019-06-18 03:52:28 -07:00
PatR
c9962c9d34 mkroom.h update
Give room type enums explicit values so that it is easier to find
them when searching by value rather than by name.

Also some reformatting.
2019-06-18 02:43:41 -07:00
PatR
7e1f020846 curing green slime bit
A recent change to make_slimed() overlooked a different recent change
in how mon->m_ap_type and youmonst.m_ap_type are referenced.  In this
case it had no impact; fix on general principles.
2019-06-18 02:39:45 -07:00
nhmall
8562c6839e merge branch NetHack-3.6 part 2 2019-06-17 15:25:10 -04:00
nhmall
4fdc78fce1 Merge branch 'NetHack-3.6' 2019-06-17 15:24:53 -04:00
PatR
273662c58c monster overflow on Plane of Air
Make Air behave the same as Earth, Fire, and Water if monsters are
forced off the level for some reason.
2019-06-17 10:09:16 -07:00
PatR
24d6d6b070 fuzzer tweaks
Prevent the fuzzer from randomly toggling the 'silent' option.  If
you use the default value of True then this eliminates most--but not
all--of the beeping that happens when it is running.  I'm not sure
where the remaining beeps are coming from.

Modify the random keystroke selection to implement some bias towards
direction keys that I thought had already been there, plus a higher
chance to entering digits to initiate number responses.
2019-06-17 09:31:01 -07:00
nhmall
2b754e0c92 Merge branch 'NetHack-3.6' 2019-06-15 18:54:28 -04:00
PatR
820320ba55 EDIT_GETLIN when naming monsters and objects
Like #annotate, #name monster, #name individual object, and #name
object type are places where it makes some sense to have an existing
name be the default for the new name, in case taking off from the end
and/or adding to the end is more convenient than retyping everything.

When there is an existing name used as default, clearing that default
and hitting <return> is not enough to remove the name, you still need
to 'assign a new name' of <space> to do that.
2019-06-15 08:19:32 -07:00
PatR
747981d0c5 take two: tty bug with long 'autodescribe' text
Messages on tty which bypass message history weren't handling long
lines properly.  If the text wrapped to line 2, that continuation
portion was left on the screen after whatever operation that put it
here was finished.  (To reproduce:  assign a long name to a monster
with a long type name so that the combined length exceeds the display
width, then move the cursor over it with ';' or '/' while autodescribe
is On.)

This time prompting isn't adversely affected.
2019-06-15 07:18:47 -07:00
nhmall
938a2c1b64 Merge branch 'NetHack-3.6' 2019-06-15 08:54:45 -04:00
PatR
9cbc8ace42 tty bug with multi-line prompts
This effectively reverts 1ad2415315
because it was interfering with prompts that spanned more than one
line (by inserting '--More-- + erase' between displaying of prompt and
getting input for the answer).

So we're back to the situation where autodescribe feedback when moving
the cursor will leave text on the second line if it generates text too
wide for one line.  (^R redraws the screen correctly.)
2019-06-15 05:11:08 -07:00
PatR
f0633e6541 EDIT_GETLIN vs monpolycontrol
For wizard mode 'monpolycontrol', the getlin() answer buffer for the
"Change <monster> @ <x,y> into what kind of monster?" prompt is also
used to format the coordinate portion of that prompt, so when
EDIT_GETLIN is enabled getlin() was inadvertently given "<x,y>" to use
as default response.  Clear it after the prompt is formatted instead
of via an initializer.  Also, shorten the prompt on the first try:
"Change <monster> @ <x,y> into what?", expanding to the old prompt if
retry is needed.

This also allows specifying 'chameleon' when <monster> is a chameleon,
'doppelganger' when it's a doppelganger, and 'sandestin' when it's one
of those (but not 'doppelganger' when it's a chameleon or sandestin,
and so forth), instead of blanket refusal to accept any non-vampire
shapechanger as the choice.
2019-06-15 04:13:34 -07:00
PatR
a336caf461 do_mname bit
Couple of tweaks I made to do_mname() while investigating the tty
autodescribe wrapping issue.
2019-06-12 18:04:00 -07:00
PatR
1ad2415315 tty bug with displaying long 'autodescribe' text
Messages on tty which bypass message history weren't handling long
lines properly.  If the text wrapped to line 2, that continuation
portion was left on the screen after whatever operation that put it
here was finished.  (To reproduce:  assign a long name to a monster
with a long type name so that the combined length exceeds the display
width, then move the cursor over it with ';' or '/' while autodescribe
is On.)
2019-06-12 17:57:24 -07:00
nhmall
61fefd9a9e Merge branch 'NetHack-3.6' 2019-06-11 23:24:41 -04:00
PatR
cf088d2126 mklev.c formatting and comments
I made these to 3.7.0- and decided to bring them back to 3.6.2+
because of the 'TODO'.
2019-06-11 18:54:32 -07:00
PatR
9125b5943e 3.7: automatic annotation for vibrating square
Add "Gateway to Moloch's Sanctum" to the vibrating square level if you
step on the square or detect/magic map it as a pseudo-trap, an extra
hint for players who manage to get that far but then don't know what
to do next.  (I think I may also add a randomly placed floor engraving
along the lines of "For a good time, consult the Oracle of Delphi."
as a gag variant of "For a good time, call <name> at <phone number>."
Not very thematic for Gehennom but could conceivably nudge someone in
the right direction.  But it could give away the level for experienced
players who haven't located the vibrating square yet.)

The annotation sticks until the one for "Moloch's Sanctum" gets added.
That happens when the temple on the sanctum level is entered or the
altar there has become mapped (in view or via magic mapping).

Could break existing 3.7.0- save files (but probably won't, since
at least two bits were available unless using an ancient 'Bitfield()
allocates whole bytes' configuration).  That's the reason I didn't
put this into 3.6.2+.
2019-06-11 09:29:14 -07:00
nhmall
fea4fd0e00 Merge branch 'NetHack-3.6' 2019-06-10 18:04:45 -04:00
PatR
9ee6e1c839 wizweight vs globs
The wizard mode runtime option 'wizweight' appends an object's weight
to its formatted description, but that was skipped for globs on the
assumption that it had already been included.  But that inclusion only
happens in shops so most globs lacked weight feedback.
2019-06-10 09:52:34 -07:00
nhmall
f167fe4d7e Merge branch 'NetHack-3.6' 2019-06-10 08:05:46 -04:00
PatR
5d59b288c9 muse wand/horn feedback
One of the claims in #H8849 was that a monster which zapped a wand
that the hero had fully identified made hero's knowledge of it revert
to "a wand".  That doesn't happen; it had to have been a different
wand which hadn't been seen up close yet.  But the hero should lose
track of known number of charges if a wand is zapped outside his/her
view.  When implementing that I noticed that a monster playing a fire
horn to burn away slime was using the routine that gives wand
feedback.  Add a separate, similar routine for magical horn feedback.

Half this diff is due to moving a naming support routine from mhitm.c
to do_name.c.
2019-06-10 03:16:52 -07:00
nhmall
9ac8e07d9e Merge branch 'NetHack-3.6' 2019-06-09 14:09:18 -04:00
PatR
319dcf4746 curses EDIT_GETLIN - discarding preloaded answer
EDIT_GETLIN is more complicated on curses than on tty due to way that
long lines are handled....

Using ESC to get rid of the default response removed it from the
answer buffer but didn't erase back to the end of actual prompt,
making it look as if it was still there.  Fixing that for a one-line
prompt+answer was needed and would have been easy but it also needs to
be prepared to go back to prior lines.  Both the prompt and the answer
could conceivably span lines although in practice it will usually just
be one line or else prompt+answer combined spanning to a second line.

This hasn't been exhaustively tested been seems to be working correctly.
2019-06-09 07:07:34 -07:00
nhmall
797579399c Merge branch 'NetHack-3.6' 2019-06-09 09:45:14 -04:00
PatR
56d16fc7ee more ^G of "hidden <monster>"
Fix a couple of glitches and add an enchancement.  The monster
attributes structure left the 'hidden' field uninitialized unless user
specified "hidden".  Mimics were being flagged with mon->mundetected
because they pass the is_hider() test but they 'hide' by taking on an
appearance rather than being unseen due to mundetected.  hides_under()
monsters fail the is_hider() test, but can become mundetected if there
is at least one object present.  Eels/other fish are neither is_hider()
nor hides_under() but can be mundetected at water locations.  So alter
'hidden' handling to deal with these various circumstances.

Asking for 'hidden' for any type of creature will result in having its
location be highlighted if it can't be actively seen or detected.  So
using '2000 ^G piranha' will fill up the Plane of Water "normally" but
'2000 ^G hidden piranha' will result in a ton of draw-glyph/delay/
draw-other-glyph/delay sequences and take a painfully long time.  Moral
of the story:  don't combine 'hidden' with a large count unless you
want to spend quite a while watching the level's fill pattern.  Turning
off the 'sparkle' option will cut the flashing in half but still take
a long time.  If you really need to fill a level with hidden creatures
and can't bear the flashing/highlighting, use blessed potion of monster
detection or #wizintrinsics to have extended detect.  Then all created
monsters will be seen so none will trigger location highlighting.

If you create a 'stalker' or 'invisible stalker' or 'invisible <other-
mon>' its location won't be highlighted, but for 'hidden stalker' or
'hidden invisible stalker' or 'hidden invisible <other-mon>' it will
(provided you don't actually see it due to See_invisible or sensemon()).
2019-06-09 06:11:09 -07:00
nhmall
83b95526a4 a 3.7 merge fix for a recent display.c change 2019-06-09 09:01:22 -04:00
nhmall
26bf4f1e11 Merge branch 'NetHack-3.6' 2019-06-09 08:43:40 -04:00
nhmall
f1f085c7fd display effect bits 2019-06-09 08:08:50 -04:00
nhmall
5f676aa56c extend wizard-mode display effect to unseen invisible monsters 2019-06-09 07:46:14 -04:00
nhmall
8a82a67d41 overlooked rn2_on_display_rng bit 2019-06-09 07:41:11 -04:00
nhmall
54d24d0333 make display effect code reusable and move it to display.c 2019-06-08 23:19:29 -04:00
nhmall
ea9a385d67 fixes entry and a display effect related to is_hider wishing 2019-06-08 22:40:51 -04:00
nhmall
15fa1f0ac7 debug mode wishing for hidden hiders 2019-06-08 21:54:06 -04:00
nhmall
2f5013670d Merge branch 'NetHack-3.6' 2019-06-08 14:39:36 -04:00
PatR
a64a2f85f4 fix github pull request #197 - curses CR handling
Fixes #197
Fixes #195

Add a call to nonl() to tell curses not to convert carriage return (^M)
to newline.  Line input accepts both ^J and ^M as end of line/end of
input, but the core's command processing treats ^M as "unknown command"
(by default; someone could use the BIND option to assign some command
to that character).  The end result is that accidentally pressing the
<return> or <enter> key (or Ctrl+M key combination) won't make the hero
run towards the bottom of the screen as if the user had typed ^J.  The
curses docs also claim that it allows more optimization during screen
updating by making ^J work as plain linefeed rather than ^M^J newline.

The tty interface can achieve this (the 'do not convert ^M to ^J part',
not the 'more optimization' part) by issuing the command 'stty -icrnl'
(on Unix or sufficiently Unix-like system) prior to running nethack,
but that has no effect when using the curses interface (at least with
ncurses on OSX where I've tested it).

A better fix would be to look up the current terminal settings at
program startup and only call nonl() if -crnl was in effect so that
curses and tty would behave the same in this regard, but curses is
supposed to let us avoid those sorts of messy details....
2019-06-08 08:55:44 -07:00
PatR
e107fdb4ab 3.7 X11 collission with variable 'g' 2019-06-08 07:51:45 -07:00
PatR
6553fbb6f5 3.7 monst->mtemplit 2019-06-08 07:38:13 -07:00