Commit Graph

7209 Commits

Author SHA1 Message Date
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
Pasi Kallinen
fd60e11d8d X11: Remove leftover file display stuff 2018-10-27 20:47:27 +03:00
Pasi Kallinen
6d70997869 X11: Reuse menu code to display files
Previously the code used the ASCII Text Athena widgets for displaying
file contents. Unfortunately, the widget made it impossible to control
scrolling or pretty much anything else.

Use the menu code instead, making the file display window behave properly.
2018-10-27 13:58:59 +03: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
Pasi Kallinen
742ec3dd49 X11: Don't hilite the help ext menu entry
Both the "help" button at top and the "help" extended menu command
were hilighted by the X resources. Make the top buttons have
"btn_" prefix, so they're easily distinguished in the resources.
2018-10-25 15:58:22 +03:00
Pasi Kallinen
ef4f56242c X11: Make TTY status obey hilite_status 2018-10-24 20:04:28 +03:00
Pasi Kallinen
45ecbb84d6 X11: Move color and font structs
... so that other window types can also use them.
2018-10-23 20:30:48 +03:00
Pasi Kallinen
6381c32a39 X11: Adjust some colors to differentiate them 2018-10-23 17:48:54 +03:00
PatR
a6ab5c8a49 X11 status display
Flag some unused parameters and remove some unused variables.
Fix compile for !defined(TEXTCOLOR).
2018-10-22 15:28:19 -07:00
Pasi Kallinen
0470065b47 X11: TTY-style status lines
Set X resource NetHack*fancy_status: False to enable the TTY-style
status lines. Default is the fancy status.

This patch is somewhat unfinished - even though the TTY-style status
allow for status hilites, the colors don't work correctly yet.
Also changes the fancy status to use the windowport notification code.
2018-10-22 21:26:56 +03:00
Pasi Kallinen
b653d0d137 X11: Mouse wheel scrolling for message window 2018-10-21 19:30:05 +03:00
Pasi Kallinen
d648f4c371 X11: save and load message history 2018-10-21 17:26:24 +03:00
keni
17b48480a5 Remove "makedefs -m" and monstr.c from the Unix build. 2018-10-20 23:14:34 -04:00
nhmall
77376fc979 two more windows supporting bits 2018-10-20 23:14:34 -04:00
nhmall
270c228b60 windows build mods to support branch change
Changes to be committed:
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
	modified:   win/win32/vs2015/NetHack.vcxproj
	modified:   win/win32/vs2015/NetHackW.vcxproj
	modified:   win/win32/vs2015/files.props
	modified:   win/win32/vs2017/NetHack.vcxproj
	modified:   win/win32/vs2017/NetHackW.vcxproj
	modified:   win/win32/vs2017/files.props
2018-10-20 23:14:33 -04:00
keni
f222023bd8 Deprecate "makedefs -m".
mons[].difficulty takes over for monstr[]
Invoking "makedefs -m" gives a deprecation message; it is also included
in the (now mostly empty) monstr.c.
Ports should now remove "makedefs -m" from their build procedures but this
commit does not include that change.
2018-10-20 23:14:33 -04: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
f211953b43 WINCHAIN cleanup
This started out as some formatting cleanup for src/windows.c but
ended up removing calloc() from the WINCHAIN code, plus fixing a
couple of compiler complaints for win/chain/wc_trace.c.

I tried to actually run with +trace enabled and never managed to
get anything to happen.  trace_procs_init() was never called.  I've
never tried to use it before so don't know whether something which
used to work has gotten broken or I'm just doing it wrong.
2018-10-20 02:23:45 -07:00
Pasi Kallinen
7ed01793b4 X11: Fix couple issues from recent changes
Segfault due to arg array overflow, and a theoretical fix for
a hang on a Mac during player selection if -@ parameter was given
on the command line.
2018-10-20 11:17:41 +03:00
PatR
69eb642620 unitm.c formatting
Some inconsequential stuff I've extracted out of a patch I've stalled
out on.
2018-10-20 00:43:16 -07:00
nhmall
530b2f06f1 Files merge cleanup 2018-10-19 18:13:26 -04:00
keni
3b298d40c2 fix numerical ordering in Files 2018-10-19 17:55:37 -04:00
PatR
f25f92c271 wishing bit
Allow wishing for "cookie" or "pie" to succeed since we have items
those can match.

Unrelated:  allow ^G of "genie" for similar reason.
2018-10-19 01:47:29 -07:00
keni
327336ff01 Update Files. Add missing files and missing .lev section. 2018-10-18 23:22:31 -04:00
nhmall
c8b73b08cd Revert "fix github issue #94 - files missing from Files"
This reverts commit ec19b52d8d.
2018-10-18 21:43:36 -04:00
PatR
ec19b52d8d fix github issue #94 - files missing from Files
Fixes #94

I thought maintenance of this was going to be automated?
Add missing special levels:  bigroom6..10.lev and medusa3..4.lev
in the generated at build time section of dat/.
2018-10-18 17:54:30 -07:00
PatR
d2ae45984e fix github issue #38 - indentation vs `if {}'
Fixes #38

In 3.6.1, some code in mfind0(detect.c) was mis-indented in a way
which suggested that the grouping within braces might not be what was
intended, and that was right--there was a pair of braces missing when
compared with older versions of the code involved.  A previous patch
(post-#38) had changed the indentation to match the surrounding braces
without really addressing the issue.  But it turned out not to make
any difference either way since mundetected is only used by hiders
and eels.  This reorganizes the relevant code to make it simpler to
understand, I hope.
2018-10-18 17:15:42 -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
PatR
622b77476b X11 compile bit 2018-10-18 12:57:07 -07:00
Pasi Kallinen
3f94cee340 X11: Add key and mouse scrolling to extended command menu 2018-10-18 21:33:17 +03:00
Pasi Kallinen
d454855c54 X11: Handle the -@ parameter 2018-10-18 19:29:42 +03:00
Pasi Kallinen
fa5e5ac4b4 X11: Obey menu movement keys 2018-10-18 18:39:27 +03:00
Pasi Kallinen
c687bb7cd8 X11: Revert finding scrollbars in same window
Apparently this doesn't work, for some reason every widget reports
a different window, even when they are in the same window ...
Maybe widgets inside and outside a viewport are technically
in different windows?
2018-10-18 17:19:42 +03:00
PatR
f051ecb388 X11 winmenu.c housekeeping
Fix a couple of compiler complaints, and move some new local functions
out of the region of the file labeled `global functions'.
2018-10-17 14:43:44 -07: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
4db9a06c6c X11: Find scrollbars in same window
Adding scroll() translations to a window with no scrollbars
scrolled the main window message area.
2018-10-16 20:44:56 +03:00
Pasi Kallinen
24674e10e5 X11: Add geometry handler on perm_invent win only 2018-10-16 19:21:46 +03:00
Pasi Kallinen
8c17825afd X11: Remember perm_invent window geometry
Instead of remembering the geometry at window closing time,
remember it immediately when it changes.
2018-10-16 19:08:49 +03: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