Commit Graph

7240 Commits

Author SHA1 Message Date
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
Bart House
26171ed9f5 Ignore .vs hidden folders generated by visual studio 2017. 2018-11-10 20:33:30 -05:00
Bart House
20e8482e6e Fix crash that can occur when panic is called early. 2018-11-10 20:26:20 -05:00
Bart House
0a3f6d17df Removed the defining of WIN32CONNDEBUG for NethackW.
Defined NOTTYGRAPHICS for NethackW.
2018-11-10 20:25:49 -05: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
91f973306b build and bug fixes for USE_OLDARGS
New:  call to panic() in impossible() used arbitrary string as a
format so was vulnerable to percent signs in that string.  (This
potentially serious problem is not limited to USE_OLDARGS.)

Old:  revised message string for impossible ("save/restore might fix
this" instead of "perhaps you'd better quit") passed wrong number of
arguments to pline() when using the clumsy VA_PASSx() mechanism (was
missing arg 0 for the fixed-arg format argument).

Old:  varargs config_error_add() in files.c wouldn't compile for
USE_OLDARGS.  Evidently no one has been impacted by that but this
fixes it anyway.  (Two problems:  prototype used FDECL() when it
should have been using VDECL(), and calls to config_error_add() in
the same file would need the VA_PASSx() stuff to force presence of
all optional args.  I moved it instead of adding the latter.)
2018-11-08 15:33:03 -08:00
Pasi Kallinen
f9f1236f26 Fix some buffer underflows 2018-11-08 21:02:24 +02:00
Pasi Kallinen
afd793e9b7 Fix memory leak in makedefs 2018-11-08 17:38:36 +02:00
Pasi Kallinen
0bb6754998 Fuzz testing debug tool
Add code to run a fuzz tester, simulating (more-or-less) random
keyboard mashing. There's no option to turn it on, you need to
set iflags.debug_fuzzer on via a debugger or something along
those lines.
2018-11-08 15:55:49 +02: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
nhmall
6fb2000feb fix odd wording "The boulder triggers and fills a pit" 2018-11-07 17:06:45 -05:00
Pasi Kallinen
75f6001afc Report insanities via impossible 2018-11-07 18:50:09 +02:00
Pasi Kallinen
c6ade9c715 Prevent out of array index 2018-11-07 18:39:00 +02:00
nhmall
0fb263ea88 fix broken build cause by missing semicolon 2018-11-05 15:33:02 -05:00
Pasi Kallinen
e8eadac3c8 Feedback on trying to pick up stairs or altar 2018-11-05 18:35:20 +02: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
PatR
89a3f4a3fd ^X again
Add a new line for one last missing status field:  gold.
Also add one for proficiency with current weapon.

Move a few lines from 'characteristics' to 'background' and a few
more from 'characteristics' to new 'basics', leaving characteristics
with the six original characteristics:  Str, Con, Dec, &c.
2018-11-02 00:59:01 -07:00
PatR
3e8f199a9f fix #H7501 again - searching
Previous change resulted in 'finding' visible monsters.
2018-11-02 00:41:33 -07: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
22b5abe4f4 watchmen at genocide prompt
Report stated:
	type "watchmen" into a genocide prompt, it says no such creatures exist in the world
	type "watchman" and it says "wiped out all watchmen"

fixes #151
2018-10-31 08:49:18 -04:00
PatR
50259daa72 tty/topl.c comment tidbit 2018-10-30 14:26:40 -07:00
Pasi Kallinen
312f7ccc10 X11: Fix msghistory restore segfault 2018-10-30 17:40:22 +02: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
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