Commit Graph

2712 Commits

Author SHA1 Message Date
nhmall
2aee73642d fix some billing and pricing issues when globs coalesce
payment issue caused by glob coalescing
glob pricing did not consider coalesced weight
2019-05-17 12:04:01 -04:00
PatR
4201c21d23 farlook feedback for overloaded symbols
When using '/' or ';' and picking--not just viewing the autodescribe
feedback for--a space or '#' on the map, the game would produce
 That can be many things (stone)
or
 That can be many things (corridor)
unlike the usual
 -     the interior of a monster or a wall or an open door (wall)
when the symbol matched more than 4 things.  I first changed it to
append the full sentence's missing period, but ultimately switched to
 #     can be many things (corridor)
so that the symbol that "many things" refers to isn't hidden.  This
works better for ^P where player isn't looking at the symbol anymore.
2019-05-16 15:26:35 -07:00
nhmall
717829627a add windows startup msg fix to fixes36.3 2019-05-11 22:04:56 -04:00
PatR
4a1f1292d9 fix #H8712 - curses menu selector overflow
The curses interface would assign menu selector characters a-z, A-Z,
and then 0-9, but trying to type 0-9 would start a count rather than
select an entry, and if the display was tall enough for more than 62
entries, the ones after '9' were ASCII punctuation characters.
Limit the number of entries per page to 52 + number_of_'$'_entries
(which should be 0 or 1) so that it won't run out of normal letters.

The perm_invent window, if enabled, ought to allow more than that
because it isn't used to make selections and might have an arbtirary
number of '#' overflow entries.  But I'll leave that for somebody
else to tackle.

Tested by temporarily setting the limit to 26 instead of 52 since
I'm not able to display anything tall enough to exercise the latter.
2019-05-11 03:04:53 -07:00
PatR
0ef58589f1 place_object vs multiple boulders
When place_object() puts a non-boulder underneath a boulder, make it
put the non-boulder under all the boulders there rather than just under
the topmost one.  Otherwise the map display will show the non-boulder
rather than the 2nd boulder if the top boulder gets moved away by some
means other than pushing.  (Pushing explicitly brings lower boulder to
top of pile in order to try to push it next.)

Reproduce by:  wish for boulder--it will drop.  Drop something else--
the something-else will end up under the boulder.  Repeat.  The second
boulder will be on top but the second something-else will be next in
the pile, above the first boulder.  Now polymorph into a giant and pick
up the first boulder, then move away from that spot.  Map will show
second something-else instead of the remaining boulder.

This fairly simple fix should work reliably on new games since boulders
will end up being consecutive on the top of piles.  For old games,
boulders after the topmost could be anywhere and still yield a display
glitch, but since that's all the problem is (I hope...), we ought to
be able to live with that until old games eventually go away.

[A map display glitch doesn't explain a corrupted 'uball' so this fix
doesn't solve that.]
2019-05-10 15:21:59 -07:00
PatR
0f6346f372 fixes36.2 update for posterity
Change of couple entries which describe fixed bugs to use past tense
instead of present tense.  Fix a typo or two and a couple of instances
of clumsy wording.  Move a dead-fake-hero-on-trap entry from normal
fixes section to exposed-by-git section since it was a post-3.6.1 bug.
Move two VMS entries from exposed-by-git section to interface-specific
section where they were intended.

I didn't make it through the whole file so there may be more room for
improvement.  It's too late for 3.6.2 but the copy of doc/fixes36.2 in
later versions will be 'better'.
2019-05-09 17:15:14 -07:00
nhmall
aeb3c7a623 new fixes36.3 2019-05-08 19:32:35 -04:00
nhw_cron
76090dd648 This is cron-daily v1-Feb-22-2019. guidebook updated: doc/Guidebook.txt 2019-05-07 15:34:05 -04:00
nhmall
cf2a9b7797 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-05-07 14:11:33 -04:00
keni
5676508180 Guidebook.mn: drop unneeded escaping 2019-05-07 13:53:24 -04:00
nhmall
c8777ea7ca 3.6.2 release bits into Guidebook 2019-05-07 08:40:46 -04:00
PatR
e2eeca2ed0 bones bit: crysknife vs green slime
Being turned into green slime never drops hero's inventory so invent
objects shouldn't be subject to obj_not_held() handling.

obj_not_held() does apply to undead.  Arising as a mummy or vampire
doesn't go through the trouble of dropping everything and picking it
back up, but there is a point in the die...arise sequence where the
hero is implicitly a corpse so nobody is holding his/her stuff.
2019-05-05 14:48:43 -07:00
Pasi Kallinen
bed2c2307e Fix monster trapped state being wrong
When cloning a monster, clear the clone trapped and hiding states.
When splitting a monster (eg. a black pudding), the clone could
be placed on a trap, so do mintrap.
When removing a monster from the map, clear the trapped state.
2019-05-05 22:58:27 +03:00
Pasi Kallinen
f55e9ddd7c Fix impossible if monster cannot be relocated from tele region 2019-05-05 22:30:20 +03:00
keni
fe055cd6bc This is cron-daily v1-May-5-2019. guidebook updated: doc/Guidebook.txt
to 948099800b722f9be0e8f9c8d4d96cfda5cea98e
2019-05-05 13:32:53 -04:00
PatR
0dc85b93b4 fix github issue #188 - #chat to succubus/incubus
Fixes #188

The change to fix setting SEDUCE=0 in sysconf broke chatting with
seductive demons by unintentionally changing the way Null attack
argument was handled.  It's still handled differently than it used
to be, but I think this difference is correct.
2019-04-30 11:35:06 -07:00
PatR
c4ae9115cb fix github issue #187 - 'reassess' panic with Qt5
Fixes #187

Qt5 gave "status 'reassess' before init" panic at start of new game.
Don't call status_initialize(REASSESS) from set_usamon()--used for
hero setup as well as for hero polymorph--unless it was previously
called from display_gamewindows() with !REASSESS [which happens when
windowprocs.wincap2 has WC2_STATUS_HILITES or WC2_FLUSH_STATUS set].
2019-04-28 17:32:16 -07:00
PatR
75db8e004d fix #H8612 - splashes of venom might stay intact
If a poly'd hero spits venom and it lands at a 'soft' spot such as
water, it would remain as an intact venom object.  (Venom spat by
monsters seems to always be used up regardless of where it lands.)
2019-04-25 07:11:42 -07:00
PatR
f838967c04 vampshifting Vlad
Vlad keeps his own form when carrying the Candelabrum, but if you
manage to get that away from him he should behave like other vampires.
He wasn't though; a high level wizard casting polymorph on him would
change him into an arbitrary monster rather than into a wolf/bat/cloud
that revives as Vlad when killed.
2019-04-24 16:59:44 -07:00
PatR
f441696908 fix #H8619 - hallucination vs vampire transform
|The seemingly dead vampire bat rises as a vampire.
was overriding hallucination when describing both old and new forms.
In 3.6.0 it only overrode the dying shape (explicitly so, presumeably
because the feature was brand new) and honored hallucination for the
revived shape.  The 3.6.1 fix to prevent non-hallucinating:  'The
seemingly dead Foo rises as Foo.' for a named vampire unintentionally
overrode hallucination for the revived shape.

Change it to honor hallucination for both before and after monsters
|The seemingly dead grid bug rises as a microscopic space fleet.
2019-04-24 14:02:09 -07:00
PatR
cd6b5ef933 mimicking a corpse
Noticed while looking over mimic hiding.  When on an object, a mimic
will hide as that type of object.  But for a corpse, it picked a random
monster type and could choose one that doesn't leave a corpse.  Also as
a tin it would always be an empty one, but there doesn't seem to be any
way for a player to learn that.
2019-04-20 16:00:29 -07:00
PatR
ab4625a6bf quantum mechanic hits
Noticed while trying to find the reason for the wildmiss impossible(),
you could be teleported and then drop dead at the destination.  A QM's
AD_TLPT hit also does 1d4 physical damage which gets applied after the
teleport.  Getting "You die." seemed pretty strange, particularly after
picking the destination with telport control.  This makes sure that the
damage will never be fatal when teleport is attempted.
2019-04-19 17:32:36 -07:00
PatR
4aa673c20e fix #H8579 - mimics mimicking shop objects
Showing the price of a shop object when examining it with '/' or ';'
didn't include a price if it was actually a mimic.  This makes fake
objects have prices when appropriate, but it is only a partial fix
because moving away from a mimic causes nethack to forget the fake
object's dknown flag for most types of objects.

That could be solved by adding an mobj field to mon->mextra, which
will break save compatibility, or by adding a whole extra set of
object glyphs for object-with-dknown-set.  The latter could probably
be done without breaking backwards save compatibility (new program
using old files) but it seems like more effort that it'd be worth and
it would break forwards save compatibility (old program attempting to
use new files--something we've never claimed to support).
2019-04-18 15:41:54 -07:00
PatR
5bc6bb0f49 another bit of reformatting 2019-04-17 19:01:47 -07:00
PatR
0776a864f1 slightly better shop repair feedback
During shop repair, give a message about the shopkeeper using a spell
(if hero is close enough) before "Suddenly, <various repairs occur>."
And when shop repair is for a single untrap of landmine or bear trap
adjacent to shk (and the hero can see it happen), say "<Shk> untraps
<trap>" rather than just "Suddenly, a trap is removed from the floor!"
2019-04-13 17:28:26 -07:00
PatR
5534eab514 probing fix
For the inventory of a probed monster, if the probing took place in
a shop the inventory display would have selling price appended to
all the items.  That wouldn't really be a problem if it was just for
a pet who was carrying one shop item, but it applied to every item
being carried by any probed monster (including shopkeeper) with no
regard for whether the shop actually claimed ownership.
2019-04-13 15:57:16 -07:00
PatR
86e5022293 fix #H8534 - thrown pick-axe vs "scum!"
Change in meaning of mnearto()'s return value wasn't progagated to
shkcatch().  Make it an int instead of boolean so that it can
communicate both 'moved successfully' and 'moved but had to move
another monster out of the way to do so'.
2019-04-11 15:38:51 -07:00
nhmall
558216e0c5 Guidebook.tex corrections 2019-04-10 17:22:18 -04:00
PatR
2724c88191 Guidebook update
Tweak the status hilites section.  Add a bit of detail about how to
specify both color and attribute and/or multiple attributes.  Also,
change the Guidebook's table of status fields to be column-oriented.
With the exception of 'score', reading down the three columns now
matches going across the status lines.  The previous ordering started
row-oriented but then became scrambled compared to the usual display.

As usual, Guidebook.tex is best guess....
2019-04-09 15:46:19 -07:00
PatR
24d09e64a3 tty blink & dim attributes
Enable blink and dim for the TERMLIB + !NO_TERMS configuration of the
tty interface.  Blink now works the same as in the curses interface
for status highlights.  The terminal emulator I'm using has an escape
sequence for dim but it evidently doesn't do anything (same no effect
as with curses), so that isn't adequately tested.
2019-04-09 13:16:54 -07:00
PatR
f52e9865f2 fix #H8481 - placing monster at <0,0>
mon_arrive() -> m_into_limbo() -> migrate_to_level() -> wormgone()
followed by place_monster() "for relmon".  relmon() was changed (last
November, cc5bb44a9a) to not require
the monster be on the map, so just get rid of the place_monster() that
was trying to put the "gone" long worm at <0,0>.

Also, another m_into_limbo() bit:  make mdrop_special_objs() check the
location and send any dropped items to random locations if the monster
dropping things isn't on the map, instead of placing them at <0,0>.
2019-04-06 12:57:29 -07:00
PatR
8c4e792770 curses ">>" (terse "--More--")
I've noticed many instances of the game pausing and not being sure why,
then pressing <space> and having it resume.  The curses interface had
a tendency to put its equivalent of the --More-- prompt, >>, somewhere
where that wasn't visible, either off the right hand edge (possibly) or
underneath the window borders if those were enabled.  Especially the
very last one it issues prior to exit.  (An extra one compared to tty
behavior.)

This ended up being a pretty substantial overhaul of message window
handling.  I wouldn't be surprised if it has off-by-one errors which
happen to be paired up and cancel each other out.  ">>" is still drawn
in orange if guicolor is on, now in inverse video when that is off.
If it happens to be drawn at the same screen location in consecutive
instances, the first ">" will toggle between blink and not blink so
that there'll be no doubt as to whether the keypress registered when
dismissing it (moot if the text preceding it is different but there's
no attempt to be smart enough to check that, just screen placement).
2019-04-04 17:55:40 -07:00
PatR
e5fea0291e curses prompting
Make the same fix to curses that was done for tty in 3.6.1:  don't
let MSGTYPE entries be matched against prompt strings.  Like tty,
curses was using ordinary pline() to issue prompts; something like
MSGTYPE=hide"yn"
could wreak havoc.  Switch to custompline(OVERRIDE_MSGTYPE,...).
2019-04-04 13:52:14 -07:00
PatR
10dac50433 X11 extended commands menu scrolling
Support for scrolling within menus via first-/previous-/next-/last-
page keystrokes ("^<>|" by default) was added to X11's general menu
handling but the extended commands menu uses a special menu rather
than a general one.  This clones the relevant code to add support for
those keys to extended commands.
2019-04-01 09:27:09 -07:00
PatR
0cad960428 X11 extended command selection
The expansion of the extended commands list to include every command
has made picking extended commands out of X11's menu become tedious.
This uses the existing 'extmenu' option (previously tty-only) to
control whether all the commands are present or just the traditional
subset not bound to non-meta keystrokes ('adjust', 'chat', 'loot', &c).
2019-04-01 08:58:49 -07:00
PatR
cd12422af5 curses message suppression
The curses interface was using 'moves' as if it meant "moves" rather
than "turns".  Typing ESC at >> (curses' terser version of --More--)
prompt would suppress messages for the rest of the current turn rather
than just the rest of the current move.  So if the hero got an extra
move due to being Fast, there would be no feedback during that move.
2019-03-31 15:34:46 -07:00
PatR
0a847f46f9 streamlined status update for 'time'
When the 'time' option is on and context.botl isn't already set,
call a simpler status update routine that ignores all other fields.
When that flag is already set, full status update takes care of time
along with the other fields.

Expected to reduce bottom lines processing time but not screen I/O.
Only lightly tested.
2019-03-31 08:23:36 -07:00
PatR
c8fdb040cb curses status highlighting
window.doc states that the colormasks argument to status_update() is
only relevant for BL_CONDITION, but curses was relying on it to be
passed for BL_FLUSH as well.  Yesterday's changes stopped the latter
and broke highlighting of status conditions.  Other interfaces appear
to honor the description in window.doc.
2019-03-31 07:04:23 -07:00
PatR
c63d3fbfbb bogus status updates
I finally figured out why status gets updated periodically even if
none of the fields have changed.  Once a temporary highlight times
out, it starts a cycle of timeouts every 'statushilites' turns.  When
I worked on this before, it was convoluted but not this convoluted.

In moveloop, if 'context.botl' call bot; in bot
  call evaluate_and_notify_windowport;
  for each field, call evaluate_and_notify_windowport_field:
    call hilite_reset_needed and set 'reset' to the result;
    if 'reset' is True then do status_update
      and set 'curr->chg' and 'prev->chg' to True.
Then in moveloop call status_eval_next_unhilite:
  for each field
    if 'curr->chg' set 'curr->time' to moves+hilite_delta;
    on the call after hilite_delta ('statushilites') moves,
      call hilite_reset_needed which returns True if there is any
      rule for temporary highlight and set 'context.botl'.
Go back to start.  If multiple fields had temporary timeouts and
they were activated on different turns so expired on different turns
you could conceivably end up with context.botl being set every turn.

My first writeup trying to explain all this was wrong.  I won't
testify about the accuracy of this one in court....

This extends the highlighting data structure to track the current
rule that's in use.  And for that to make sense, it eliminates the
merging of settings from multiple matching rules.  So anybody with
 hit-points/up/inverse
 hit-points/up/green
 hit-points/up/bold
will need to manually merge their rules like
 hit-points/up/green&inverse+bold
or else whichever rule matches last will be the only one in effect.

There are a lot of miscellaneous changes made as I flailed about.
The three most significant ones are that there is no guesswork over
what kind of highlight rule is in effect, status_eval_next_unhilite
will only set a timeout value if the current rule is for a temporary
highlight, and hilite_reset_needed will only return True if a timeout
is for a temporary highlight (probably moot after the _next_unhilite
change).
2019-03-31 00:33:33 -07:00
PatR
68542da636 curses: save/restore message history
Have the curses interface save and restore message history for use
by ^P.  It doesn't spit the saved messages out into the visible
message window after restore; that's too distracting.
2019-03-29 17:03:03 -07:00
PatR
14d8ed199e tty: panning while clipped
Noticed while testing statuslines on a small terminal window.  Using
the cursor to pick locations that panned the map to view a new subset
would end up showing a new view of the regular map rather than a
different section of what was currently displayed.  For farlook that
caused monsters to take on new hallucinatory forms which was fairly
inconsequential, but for #terrain and various forms of detection it
reverted to the ordinary map instead of showing the map features that
the player requested or the temporarily revealed monsters and such.

Most interfaces keep track of the whole map and just show their view
of the new subset when panning, similar to redisplay after being
covered up and then re-exposed, but tty isn't doing that.  I made
same change to Amiga as to tty since the code it was using was very
similar.  I haven't touched any of the other interfaces and assume
that they don't need this.  I've verified that curses and X11 don't.
2019-03-29 14:35:36 -07:00
PatR
25a456bb2a getpos when teleporting
Using repeated ^T to become hungry was very tedious due to the extra
response required every time.
2019-03-29 11:50:56 -07:00
PatR
d1dade164e tty statuslines:3
Implement the 'statuslines' option for tty.  2 and 3 line status are
similar to curses.  Tty's version doesn't include insertion of extra
spaces for enhanced readability, or ignoring 'showexp' when space is
needed for other fields, or right justifying 'score' and suppressing
it when there isn't room for the entire number.  It continues to have
abbreviated condition and encumbrance descriptions that curses lacks
which get used when the normal ones take up too much space.

'statuslines' can be set with 'O' so it is feasible to switch back
and forth between 2 and 3 lines on the fly.  But only if the display
is at least 25 lines (actually ROWNO+4) or else CLIPPING is enabled
at build time.

This fixes the bug where after resorting to abbreviated condition
values it sometimes (always?) wouldn't switch back after more room
became available.  Abbreviated encumbrance values had problems too
(lack of leading space and not changing value if encumbrance changed
to anything other than unencumbered) and this fixes that as well.
2019-03-29 04:21:18 -07:00
PatR
81d755a9e0 fix githib issue #179 - random drawbridge state
Fixes #179

The Valkyrie goal level has two drawbridges and one of them was set to
have 50:50 chance to be closed (raised).  But 'random' for drawbridge
open/closed (or lowered/raised) state was always choosing open (lowered).
This fixes that and also changes that level to have the old settings
(southern open, northern 50:50) for 75% of the time and new settings
(both 50:50) for 25% of the time.  So there's now a 12.5% chance that
both will be closed instead of both always being open (due to the bug
with handling random).
2019-03-28 08:40:40 -07:00
PatR
91ab87db2e tty hitpointbar
Catch up with curses and have hitpointbar work even if statushilites
is 0 to suppress other highlighting.  Indirectly fixes #H8389 by
making the circumstance which triggered that bug no longer do so.
2019-03-26 19:27:11 -07:00
PatR
42cb4ac3e8 disclosure fix
Back in December, a change was made to suppress status when u.uhp == -1.
But if the hero died with exactly that amount, the status display would
be blanked out during end of game disclosure.  Force u.uhp to be 0 when
dying.  That was already happening if death occurred while hero still
had positive HP, but not when damage took him/her to negative.
2019-03-26 19:16:01 -07:00
PatR
e12d2d326b fix #H7454 - Cleaver vs long worm tails
Cleaver's ability to hit up to three adjacent targets could kill a
long worm and then try to cut it in two.  When this was first reported
I was unable to reproduce it, but this time I've managed to do so.
But not reliably, so it's hard to claim that it's now fixed.  However,
the new report's explanation of why it happens and suggested fix was a
big help.  I had been trying to hit three tail segments, but you need
to attack a segment next to the head, then have Cleaver hit and kill
the head first (50:50 chance depending upon whether current swing is
clockwise or counter).  Worm cutting would be looking at the location
of the targetted segment but there won't be any monster there when the
head dies.  (Cleaver's attack itself already copes the situation where
its 2nd and/or 3rd potential targets aren't there any more by the time
it's ready to try to hit them.)
2019-03-26 16:58:52 -07:00
PatR
59ab965863 curses ^P - support msg_window:full
curses uses 'reversed' (LIFO) style when displaying previous messages.
Use the existing (previously tty-only) 'msg_window' option to also
support 'full' (FIFO).  The actual code needed as just a couple of
lines; tweaking options parsing and the documentation was more work.
2019-03-24 19:20:21 -07:00
PatR
ee53a9fea6 curses message recall, memory leaks
Using ^P right after resize or 'O' of align_message, align_status,
statuslines, or windowborders would result in
'curses_display_nhmenu: attempt to display empty menu'
because some memory cleanup I added several weeks back was being
executed when the curses interface tore down and recreated its
internal windows.

This fixes ^P handling by making sure that that menu (which is just
text but uses a menu to support '>'/'<'/'^'/'|' scrolling) will never
be empty and it also fixes the window deletion to not throw away
message history until it's final deletion at exit time.

^P uses a popup window to display previous messages and it was never
deleting that window, just creating a new one each time.  Same with
the routine which displays an external help file.  Using either or
combination of both close to 5000 times would probably make internal
window creation get stuck in an infinite loop.  Delete those windows
after they're used so it'll never be put to the test.

The memory cleanup I added for map/status/messages/invent was only
being preformed at end of game, not when saving.  Fix that too.
2019-03-24 17:50:26 -07:00
PatR
d989b36763 revamped curses status display
I've overhauled the status display for curses.  Horizontal layout
supports both 2 lines and 3 lines which can be changed dynamically
via using 'O' to set 'statuslines'.  Fields are spread out a little
more than they used to be, making it more readable--at least to me--
but the extra spaces get squeezed out when lines become too long.
If 'showexp' is on and either conditions or hunger+encumbrance go
off the right edge, experience points are suppressed (but the option
is left on, so they'll come back once there is room).

For traditional 2-line hozizontal status, if hunger+encumbrance+
conditions go off the right edge even after experience points are
knocked out, there will be a '+' in the rightmost column if there
are any conditions that are all the way off.  At present it doesn't
use the tty method of switching to abbreviated condition names to
reduce their legnth.  I'll probably tackle that eventually if no one
beats me to it.

For 3-line horizonal status, there was an older implementation (but
disabled via #if 0) with gold and score moving to the third line.
(I'm not sure how status conditions were handled.)  This one ignored
that and modified 2-line from scratch, moving alignment from line one
to line 2 and level description, time, and conditions from line 2 to
line 3.  It looks like this (view with a fixed-width font...).

Wizard the Hatamoto            St:16 Dx:15 Co:18 In:8 Wi:11 Ch:7    S:25
Lawful  $:21  HP:25(25)  Pw:6(6)  AC:4  Xp:2/21  Hungry Burdened
Dlvl:1  T:36                                     Blind Lev

Score is actually right aligned with the edge but I've deleted several
spaces to keep the line shorter here.  The status conditions line up
with the hunger slot as that shifts due to changes in gold/HP/power/AC/
experience, and conditions prefer that column even when hunger and/or
encumbrance are blank.  Howver, if the number of conditions increase to
the point where they would go off the edge, the whole list shifts left
instead of trying to stay lined up with hunger.  (It's just coincidence
that the lefthand parts of lines 2 and 3 seem to line up in this sample.
In general, they don't.)

The vertical layout has reordered most of the fields and now has a few
blank lines to separate those fields into some groups for readability.
Lines have the form of
Field-name  : Value
and when highlights apply, now they only affect the value portion.
Single digit characteristics are padded with a leading space so that
all six of them line up (for "18/xx", "/xx" protrudes to the right).
HP and Pw are aligned with each other.  Hunger and encumbrance share a
line.  When there are more than three conditions, they're shown three
per line instead of wrapping across lines.  And if too many lines are
present, it will squeeze out enough blank ones to fit.

To see the vertical status, you need a display size of at least 106
columns with 'windowborders' explicitly off, or 110 with them on; also
set option 'align_status' to 'right' or 'left'.  (With borders on,
including the default 'auto' setting, the vertical status appears at
width of 108 columns, but does so by hiding 2 columns of the map; using
110 columns avoids that.)  Resizing from outside the game or changing
align_status via 'O' both cause dynamic reconfiguration of the layout;
there's no need to save, make config changes, then restore.
2019-03-23 17:38:23 -07:00