Commit Graph

2515 Commits

Author SHA1 Message Date
PatR
ac9bdc8aa7 fix #H7585 - can't untrap from edge of pit
Attempting to untrap an adjacent location failed if you had escaped a
pit, claiming that you couldn't reach.  You can't reach the bottom of
the pit if you're not in it, but you should be able to reach adjacent
spots normally.
2018-11-21 19:16:23 -08:00
PatR
2beb36fc61 Schroedinger's Cat
If hero was carrying Schroedinger's Box at end of game, disclosing
inventory converted it into an ordinary box.  That interferred with
subsequent disclosure when writing DUMPLOG, which saw an empty box
if inventory had been shown or the special box with newly-determined
contents if not.  I tried a couple of ways to fix it and decided
that redoing it was better in the long run.

Schroedinger's box is still flagged with box->spe = 1, but instead
of having that affect the box's weight, now there is always a cat
corpse in the box.  When opened, that will already be in place for
a dead cat or be discarded for a live one, but the weight will be
standard for container+contents and when box->cknown is set it will
always be "containing 1 item" (which might turn out to be a monster).

Some temporary code fixes up old save/bones files to stay compatible.

TODO:  food detection used to skip Schroedinger's Box; now it will
always find a corpse, so some fixup like the ridiculous probing code
is needed.
2018-11-21 03:10:49 -08:00
nhmall
03ef9da591 Merge branch 'macosx-curses-fall2018' into NetHack-3.6.2-beta01 2018-11-20 21:01:48 -05:00
nhmall
f295b00ad1 fixes updates for curses and Xcode 2018-11-20 21:00:03 -05:00
PatR
d15dacc44c fix #H7530 - corpse from corpseless monster
Migrating monster attempting to arrive on a level which is already
full of monsters gets killed off.  It was leaving a corpse without
regard for whether it was a type of of monster which should never
leave corpses.

I'd prefer that it be put back on the migrating_mons list rather
than be killed off, but this just suppresses impossible corpses.
2018-11-20 13:13:23 -08:00
nhmall
7ee4fa3c3f some curses window-port doc bits 2018-11-19 10:40:51 -05:00
nhmall
923e1c5854 Merge branch 'NetHack-3.6.2-beta01' into win-curses 2018-11-19 09:57:58 -05:00
PatR
40ce977522 fix #H7573 - impossible zero payment in money2mon
When paying for shop door or wall damage, if the entire amount was
covered by shop credit then impossible "zero payment in money2mon"
would occur as the shop code tried to transfer 0 zorkmids from hero
to shopkeeper after using credit to pay.
2018-11-18 18:48:59 -08:00
nhmall
cb43061076 curses changes to existing files 2018-11-16 20:51:22 -05:00
PatR
6ecf97f6e3 vms build/install update
New-ish files 'engrave', 'epitaph', and 'bogusmon' added for 3.6.0
were not handled by playground setup.  NetHack runs without them so
limited testing didn't notice.

Add 'makedefs -s' to build them and include them in installed files.

Also, remove 'makedefs -m' and obsolete monstr.c.
2018-11-16 09:16:48 -08:00
nhmall
a9dcb37ca7 augment codepage850-to-Unicode mappings in nttty 2018-11-16 08:09:18 -05:00
nhmall
acdc62a861 stale gold symbol displayed after symset change
a stale gold symbol could be displayed on the status line following a switch
to a new symset, as observed and reported for Windows RogueEpyx symset.

An update is required for gold in the status line for a change to
any of the following:
    context.rndencode value
    the encoded glyph value for COIN_CLASS
    the gold amount
2018-11-15 02:34:45 -05:00
PatR
bd4cacbc52 fix #H7536 - pet vampire behavior
Vampires tend to take vampire bat form and stay that way, unless/until
there's a closed door they want to pass in which case they change to
fog cloud form.  Those shifted forms are weak, so pet vampires tend
not to attack other monsters, and if they don't take damage, they
won't change to vampire form.  So, when comparing relative strength of
self and foe while deciding whether to attack another monster, treat
their own strength in weak form as if in vampire form, making them be
more aggressive.

Hostile vampires shouldn't need any comparable change.  They don't use
relative strengths when deciding whether to attack something.
2018-11-13 16:29:48 -08:00
PatR
a97d0b7270 fix github issue #159 - eating nurse corpses
Fixes #159

The nurse monster definition is flagged to be able to convery poison
resistance when a corpse or tin is eaten, but the post-corpse code
for nurse healed HP and cured blindness then skipped the intrinsic
handling.
2018-11-13 15:05:54 -08:00
PatR
ab7fb9360e fix #H7065 - clairvoyance shows trap over monsters
and over the hero.  3.6.0's clairvoyance tried to show things in
a non-standard sequence, which was intentional but had unintended
side-effects like the disappearing monsters complained about in the
report.  To make it work as intended would have required --More--
whenever it kicked in, which is much too intrusive when it happens
every N turns rather than when explicitly casting the spell.

Redo it substantially, and give preference to monsters over objects,
objects over traps, and traps over underlying terrain like normal
vision-based display does.  It now detects all monsters within its
bounding box but shows ones which aren't directly in view as
"unseen monster" unless via spell cast at skilled or expert, or at
basic when also having intrinsic clairvoyance.
2018-11-11 14:28:54 -08:00
nhmall
a0b53ee391 merge 2018-11-11 10:29:52 -05:00
PatR
e486d941ed couple of #wizintrinsic fixes
When #wizinstrinsic was expanded to be able to set any timed attribute,
some that need more than just a timeout counter were left inconsistent.
1) Timed Flying wasn't blocked by levitation, and existing flight
   wasn't becoming blocked by timed levitation.  Also, eventual flight
   timeout wasn't updating the status line, so false 'Fly' condition
   remained shown until a status update happened for some other reason.
2) Setting timer for Warn_of_mon didn't set up any type of monster to
   warn about so wouldn't do anything.  This sets that to grid bug
   unless already set due to polymorph form or artifact that warns.

The end.c portion is just a bit of formatting.
2018-11-10 18:22:38 -08:00
PatR
e8a8f142ae otransit_msg() fixes
Fixes #156

githib issue #156 complains that "The Excalibur falls down the stairs,"
is using poor grammar despite the fact that the usual drop message is
"You drop the +0 Excalibur."  I agree.  Change it to be "Excalibur
falls down the stairs."  (Drop message remains unchanged.)

While looking at that, I noticed that when knocking other items down
stairs, text was being appended to the formatted object name.  It was
probably safe due to the space reserved for inserting a prefix while
formatting an object's name, which becomes available for a suffix
after that name has been copied into otransit_msg()'s local buffer,
but using a separate buffer is safer.
2018-11-10 01:37:23 -08:00
PatR
8551df2a7a impossible worm_cross non-adjacent location
Attempting to mount a long worm tail could yield
\#ride -> mount_steed() -> test_move() -> worm_cross() ->
impossible("worm_cross checking for non-adjacent location").
2018-11-09 15:43:50 -08:00
PatR
4f541fe216 ^X about armor
Enlightenment feedback for "nudist" was added 3.5 years ago.  Ever
since, ^X has been reporting "you are not wearing any armor" when
wearing a shield without any other armor.

Since Valkyrie starts in that situation, it's very surprising that no
one ever noticed 'til now (or did notice and didn't bother to report).
2018-11-07 14:50:44 -08:00
nhmall
359b59753f fixes update for odd wording 2018-11-07 17:08:41 -05:00
PatR
f68883beb3 removing all items via 'A' when looting container
Followup to 'fix #148' patch:  looting a container with menustyle:Full
wasn't offering a chance to remove everything in one go.  That was due
to an error I introuduced 2.5 years ago with commit
529dad8ef1 when I changed how the flags
passed to query_category() were being set up.  It accidentally switched
'A' from take-out to put-in but the only code to handle 'A' at that
time would take everything out (from container to inventory).

Prior to that, removing everything worked as intended and putting in
everything wasn't supported.  Now 'A - autoselect all' is a viable
choice for both in and out.
2018-11-03 23:17:49 -07:00
PatR
6002db106c fix github issue #154 - #loot in A-autoselect all
Fixes #154

With menustyle:Full, picking 'A - autoselect all' when putting items
into a container ran code for taking things out and there wasn't any
corresponding code for putting things in.

Add some put-in-everything code.  Taking things out doesn't offer
'A - autoselect all' as a choice so the code mentioned above may now
be dead.  Taking everything out seems like something that's much more
likely to be desired than putting everything in.
2018-11-03 17:45:31 -07:00
PatR
9ca519d9f7 yet another ^X revision...
Hopefully this will be the last one.  Change from a text window to
a menu so that it is possible to scroll backwards (without needing
scrollbars) via '^' and '<' keys.  End of game disclosure for
attributes still uses a single-forward-pass text window.

Also, move the recently added weapon proficiency line from the new
'basic' section to right after the "you are wielding" line at the
end of the 'status' section.
2018-11-03 02:01:11 -07:00
Pasi Kallinen
d7c042eb80 Make Mjollnir lightning noisy 2018-11-02 20:49:11 +02:00
nhmall
4e98337abc grammar 2018-11-01 21:04:23 -04:00
PatR
ac81022eed fix #7501 - searching while blind
My "fix github issue #38 - indentation vs 'if {}'" patch, commit
d2ae45984e, broke finding unseen
monsters via searching.  Most notable if blind, but applied to
invisible monsters too.
2018-11-01 17:37:47 -07:00
nhmall
0ea7fbad7a single fixes36.2 entry for special case wish/genocide since release 2018-10-31 09:11:57 -04:00
nhmall
77c9930662 typo fix 2018-10-29 07:28:35 -04:00
PatR
858e9ce00d fix github issue #148 - life-save while swallowed
Life-saving was setting u.uswldtim to 0, presumably intending that
to stop the hero from being digested, but it actually resulted in
being totally digested on the swallower's next turn if the death
being short-circuited wasn't digestion.  Change life-saving to make
swallower or grabber release the hero instead of tinkering with
u.uswldtim.  In addition to rescuing the hero from digestion, it
prevents an eel which has just drowned the hero (who has survived
drowning via life-saving) from pulling him/her back into the water
on its next turn.  It will need to make another successful grab to
do that now.

While testing, I noticed that if I was polymorphed and wearing an
amulet of unchanging, life-saving didn't restore my HP-as-a-monster
and due to the recent change to force that to 0 when the hero dies,
I died again immediately after my life was saved.  So this bug was
latent in the past and became noticeable in the last couple of days.
2018-10-28 16:03:42 -07:00
PatR
747ebf0ead fix #H7487 - dead with non-zero HP
Report was for being fried by angry deity.  There are lots of deaths
that don't involve subtracting HP until it hits 0 or less; I haven't
bothered tracking down which ones don't set u.uhp to 0 before they
call done().

No effect on life-saving or declining to die except for HP:0 being
visible on the status line during their messages.
2018-10-27 19:55:18 -07:00
PatR
d77ecd4ae5 X11 menu tweaks
Restore handling for keystrokes on PICK_NONE menus so that scrolling
via keys works for them.  (That handling was disabled as part of the
patch to support MENUCOLORS.)

Enable [cancel] button for all menus.  (That had apparently been
grayed out for PICK_NONE menus since day 1 for X11 windowing.)
2018-10-27 19:26:56 -07:00
nhmall
aa0b973001 fix Guidebook.tex processing due to wrong brace used
[36] [37] [38] [39] [40] [41] [42] [43]
! Extra }, or forgotten \endgroup.
l.4602 ``{\tt up}'' and ``(\tt down}
                                    '' set the field attributes for when the...
2018-10-27 19:18:27 -04:00
PatR
1273d6817e provide dungeon location in ^X feedback
Dungeon level wasn't included in ^X output, so it wasn't actually
giving all status fields and attempting to rely on it when turning
off 'status_updates' was leaving a gap in feedback for the player.
Add an extra line to the first section where character's name and
patron deity are reported, giving current location.
|You are in the Dungeons of Doom, on level 5.
or
|You are in the endgame, on the Elemental Plane of Fire.

The information is more explicit than the basic status field, but
you can already get similar information via #overview so it isn't
giving away extra info.
2018-10-27 03:45:18 -07:00
PatR
bb62ab6fc1 another Guidebook update - mostly NETHACKOPTIONS
Move some 'roff macros from Guidebook.mn to new file tmac.nh.

Header for tmac.nh is not being updated, even after explicitly adding
it to .gitattributes.  I'm not sure what I've done wrong.  (I'm using
'git nhadd doc/' here rather than explicit 'git nhadd doc/tmac.nh'.)

In Guidebook.mn, change the ``setenv NETHACKOPTIONS'' example so that
it fits within one line in Guidebook.txt.  (I looked at 3.4.3's
edition of that file and the example went not just beyond the margin
of the formatted text but beyond 80 columns, so wrapped in an ugly
fashion.)  I had previously changed 'autoquiver' to 'color' to shorten
it, now have changed '!autopickup' to '!leg' to show an example of
truncated option name as well as shorten, and also 'fruit:papaya' to
'fruit:lime' to squeeze out the last two columns needed to fit within
the text margin while retaining 'name:Blue Meanie' as requested.
Guidebook.txt shows both NETHACKOPTIONS examples with indentation
suppressed, Guidebook.ps uses normal indentation (evidently using a
narrower font, even with \f(CR (constant-width Roman) to approximate
TeX's \tt, since the indented example fits fine and looks better).

Some Guidebook.tex catchup.  I suspect that lots of bits and bobs
don't match between Guidebook.mn and Guidebook.tex these days.
Particularly quoting and variant font (italics, bold, \tt) usage.
Also the recently added box around the sample screenshot.  This
modifies the screenshot to match Guidebook.mn's, reflecting change
in status field spacing by STATUS_HILITES.
2018-10-27 00:42:11 -07:00
PatR
3f3bec8687 fix github issue #150 - delayed encumbrance msg
Fixes #150

> A very minor one, but there are some situations where your encumbrance
> level can change, but the message (such as '`Your movements are now
> unencumbered.`') isn't given until your next move or turn, even though
> the status line updates immediately.  For example, praying while weak
> and gaining a point of strength.  Picking up or dropping items or
> interacting with containers does _not_ have this problem.

This is usually fixed on a case by case basis.  Any attempt to add
blanket encumbrance check mid-turn (when updating status, for instance)
is sure to introduce message sequencing problems.  Perhaps such a check
could be added at the end of the hero's move....

This fix handles the cases where prayer causes a change to strength:
major: fix starvation, minor: fix weak from hunger, boon: golden glow
(restore strength and satisfy hunger--probably no-ops in this regard
or would have had trouble fixed rather than receive a boon).  Directly
curing stat loss (minor: poisoned) already dealt with encumbrance.

> Possibly related to the quirk whereby polymorphing into a form with
> different speed gives you one move movement at your old speed?
> (Polymorphing into a sessile monster gives you one last move.)

Not at all related.  That movement bug affected 3.6.0 but was fixed in
3.6.1.
2018-10-26 16:35:21 -07:00
PatR
2986a807de fix #7470 - Sting vs webs
When trapped in a web, trying to move while wielding Sting gives the
message "Sting cuts through the web."  In 3.6.1 and earler, that
also released you from the trap, but with 3.6.2-beta nothing happens.

It had nothing to do with the recent web spinning patch.  My change
to have being trapped block levitating and flying included replacing
a lot of direct manipulations of u.utrap with set_utrap() and
reset_utrap() in order to keep the lev/fly blocking and unblocking
localized.  Unfortunately, the old 'u.utrap = 0' when wielding Sting
while stuck in web was deleted in error at that time.
2018-10-26 15:09:48 -07:00
PatR
b7b261e8e1 stinking cloud vs drawbridge
While looking at something else, I noticed that newsym() was checking
for pool and lava by examining the terrain type directly rather than
using the pool and lava checks, so it would never show a gas cloud at
a closed drawbridge (the spot in front of the portcullis).  Level's
terrain at a closed drawbridge spot is DRAWBRIDGE_UP; need to look at
drawbridgemask field to figure out whether the accessible terrain at
that spot is moat or lava.
2018-10-25 14:15:55 -07:00
PatR
b9d99b343d Guidebook.mn #extended commands
Change the extended command section from a mixture of
|#cmd This is a short-named command.
|#command
|     This is a long-named command.
to every command having its descriptive text start on the next line
|#cmd
|     This is a short-named command.
|#command
|     This is a long-named command.
which results in a longer document but the extended commands section
is much easier to read.

No change to Guidebook.txt, where the previous command name padding
was wide enough to accomplish the same for fixed-width tty font.
There is an update to that though; a previous change omitted it.
2018-10-20 14:56:50 -07:00
PatR
f856837335 Guidebook.tex quoting
Change instances of 'C' and ``C'' to `C'.
Change a few double quotes, "..." to ``...''.
Remove some trailing spaces (for Guidebook.mn too).

One tweak in wording:  for #offer, ``use `m' to skip items on altar''
followed by ``you'll need to find an altar'' sounded strange.  Move the
``skip items on altar'' sentence after the ``need an altar'' sentence.
2018-10-18 14:37:41 -07:00
Pasi Kallinen
fa5e5ac4b4 X11: Obey menu movement keys 2018-10-18 18:39:27 +03:00
PatR
c2825991f3 Guidebook.txt update 2018-10-17 05:25:51 -07:00
PatR
4cd983cb6f Guidebook.mn single quotes
Replace `C' and 'C' with \(oqC\(cq (open and close single quote).
For plain text output, the new form generates the first form.  Most
single quotes were using that, but there was quite a bit of C-style
char quoting that was somewhat inconsisent.

There are several text changes too, mostly small.  The few I can
remember are
  replacing several ``#twoweapon'' with `X';
  pets:  change 'cat' to 'kitten' and mention that horses are
    vegetartian where it claims that pets usually feed themselves;
  NETHACKOPTIONS:  add `bash' to the shells mentioned,
    describe `NETHACKOPTIONS=@filename' better,
    shorten the example (it's still too long for Guidebook.txt);
  Configuring Status Hilites:  expand the `behavior' descriptions
    to mention the value limits for percentage and absolute, and
    include post-3.6.1 '<=' and '>=' for them,
    add omitted fields `hunger' and `title' to text match.

I also changed a bunch of examples in the option configuation section
from bold font to constant-width Roman which more closely resembles
the \tt font in TeX.  Probably a whole bunch of other bold items
ought to follow suit.

Issues:
  title for section 9.3 (NETHACKOPTIONS) is too close to the sample
    config file at the end of section 9.2;
  as mentioned above, the sample ``setenv NETHACKOPTIONS foo'' is
    much too long for Guidebook.txt, and ``NETHACKOPTIONS=foo'' is
    slightly too long; they're ok in Guidebook.ps (assuming default
    page size);
  does `WIZKIT=~/wizkit.txt' actually work?  That's the example shown.
2018-10-17 05:22:36 -07:00
PatR
ebc89522ae a few Guidebook tweaks
I started out updating Guidebook.mn to use \(oq and \(cq for single
quotes but ended up including some new text.  I've separated that
part out (there are a few instances of altered quoting in the midst
of it--the separation wasn't 100%) to commit separately.

Add verbiage to "choosing race" and several commands:  f, s, S, t,
w, and ^X.

Change `E-' and `w-' to use minus sign instead of hyphen.  The TeX
edition uses \tt font for those which has the same effect of making
those dashes be more prominent.

Fix typo/thinko in `IX':  Guidebook.mn and Guidebook.txt said that
displayed inventory items whose bless/curse state is "known".
Guidebook.tex had it right, "unknown".
2018-10-16 15:18:09 -07:00
Pasi Kallinen
b3c8acfeeb X11: Allow toggling mouse_support off
Prevents accidental mouse clicks on the map.
2018-10-16 18:09:54 +03:00
Pasi Kallinen
ddf6d13fd1 X11: Don't reuse perm_invent window for picking an object
The core wants to reuse the permanent inventory window for choosing
an object from inventory, but the perm_invent window could be
hard to focus - it could even be on another display!

Instead, create a temporary new window from which the user can
pick an inventory item.
2018-10-16 17:39:45 +03:00
PatR
e0f5cfe0b3 fix #H7453 - 'bonesknown' for dead hero
Dead hero's map coordinates are set to <0,0> part way through bones
creation, then were being used to record grave location for overview
feedback with "final resting place for <dead hero>" if/when another
character got those bones and found the grave (actually, spotted the
location where first hero died regardless of whether a grave gets
placed there).  Record dead hero's pre-<0,0> coordinates as intended.

Not previously noticed because in wizard mode the final resting place
becomes part of overview info as soon as bones are loaded rather than
waiting for the death location to be reached.
2018-10-15 18:26:49 -07:00
PatR
51256055fb refresh Guidebook.txt again
Features the 'boxed' screenshot.  Unfortunately, pushing that to the
next page changes all the following pages, so diff is big.
2018-10-14 17:49:27 -07:00
PatR
ac2514c149 Guidebook.mn screenshot
Putting a box around the simulated screenshot has a side-effect of
forcing it to the next page if there isn't room on the current page.
And it looks at least as good as the old top and bottom horizontal
lines, if not better.  This also eliminates the blank left-most
column (relative to those lines) which isn't part of the screenshot.

There are issues:
1) for Guidebook.ps, the "Figure 1" label underneath seems to be
   too close to the box; I didn't try to force a blank line in front
   of it because that increases the risk of pushing it to the next
   page if the figure lands at the bottom;
2) for Guidebook.txt, the "Figure 1" label actually overwrites the
   bottom line of the box, and the embedded space allows the line
   to show through:  "---Figure-1---"; I tried using "\ Figure\ 1\ "
   to see if that might hide the issue by making it seem that the
   label in intended to be on that line, but it didn't help--
   unbreakable-space evidently does not imply always-visible-space;
3) the box is one column wider than the rest of the document (the
   previous horizontal lines were two or three columns wider, so
   this is actually a tiny imrovement); squeezing out some whitespace
   to make the status lines narrower didn't help--or at least not
   enough; squeezing some spaces was needed to match STATUS_HILITES-
   era status formatting anyway.
4] if there was a footnote (we have some for trademarks) on the same
   page as the screenshot, either the footnote or the table would
   probably become confused, perhaps both.  I think we just pretend
   that that will never come up....
5} I've made no attempt to alter Guidebook.tex to try to match.

I'm throwing in the towel.  Fixing this up is way beyond my limited
'roff/tbl capability.  (There's probably a much more straightforward
way to achieve what we want.)
2018-10-14 17:46:48 -07:00
PatR
79fe07d86f bring Guidebook.txt up to date
I may not get around to doing anything with 'C' vs `C' vs \(oqC\(cq
for a while.  Bring Guidebook.txt up to date now rather than waiting
so that the repository's copy reflects the #H7444 fix.

This has ended up with substantial spurious differences due to it
placing padding in different spots during line justification.  I
hope that's due to different groff version using a slightly different
algorithm rather than something like phase of the moon.  :-]
There also differences caused by "..." taking less space than ``...''.
2018-10-14 15:09:40 -07:00