Commit Graph

13669 Commits

Author SHA1 Message Date
PatR
88c8e92e76 debugpline() fix
Something which occurred to me when looking at the magic whistle code.
It's behavior can vary depending upon whether pline()/You()/&c has
been called and that is detected by checking whether pline() has reset
iflags.last_msg.  Change the debugpline() mechanism to prevent it from
interfering with that.
2022-06-19 02:30:45 -07:00
nhmall
c3fcf9dbd6 silence three compile warnings
apply.c:495:22: warning: variable 'optr' set but not used [-Wunused-but-set-variable]
    struct permonst *optr;
                     ^
1 warning generated.
cmd.c:4577:26: warning: variable 'how' set but not used [-Wunused-but-set-variable]
    const char *dothat, *how;
                         ^
cmd.c:4578:29: warning: variable 'viawindow' set but not used [-Wunused-but-set-variable]
    boolean prefixhandling, viawindow;
                            ^
2 warnings generated.
2022-06-19 04:56:48 -04:00
PatR
e6a5ef8e59 magic whistle followup 2022-06-19 01:40:07 -07:00
nhmall
c0561bdb3c use the new Makefile target
Also, try setting continueOnError: true
2022-06-18 13:52:49 -04:00
nhmall
1d46fad717 some documentation-related changes
add a command-line pdf option to Makefile for use in CI.
fix .tex file errors.
2022-06-18 13:32:17 -04:00
nhw_cron
c56756b941 This is cron-daily v1-May-8-2022. 000files updated: Files 2022-06-18 11:32:40 -04:00
nhmall
0147b2bfdf follow-up bit 2022-06-18 11:03:59 -04:00
nhmall
40c74a2030 typo in last commit 2022-06-18 10:44:22 -04:00
nhmall
98a4673a0c Guidebook datestamping
Allow the hints file to apply a correct timestamp to
the Guidebooks prior to use.

Detect the NH_DATESUB in the Guidebook.mn or Guidebook.tex
files and replace the datestamping line that follows.

If git is available, it determines the hash of the last commit
applied to doc/Guidebook.mn, and then determines the date of
that commit.  The interim Guidebook.dated.mn (or
Guidebook.dated.tex) gets the datestamp applied.

If git isn't available or doesn't correctly provide the hash
for doc/Guidebook.mn, it should just continue to use whatever
hard-coded date in the Guidebook.mn source file (it uses it
instead of the interim file).
2022-06-18 10:29:15 -04:00
PatR
304888c99f feedback for bad command prefix usage
The old code to supply a list of directions if a prefix was followed
by a non-direction didn't work as intended anymore.  Add some more
precise feedback for gGF mis-use and comment out some code that never
gets executed.

A number_pad user can get a complaint about 'G' when using '5' followed
by a non-directional command.  Too bad for them.

Supersedes pull request #803
2022-06-17 17:59:05 -07:00
PatR
e5180d1587 magic whistle bandage
Reported by entrez:  if magic whistle summoned a pet onto a trap, the
messages produced could be in the wrong sequence or contradictory.
The code was collecting counts and name-of-first for shift (was seen
before whistling, seen at different spot after), for appear (wasn't
seen before, now is), and for disappear (was seen before, now isn't)
before dealing with a trap at arrival location.  The trap could issue
a message (including pet killed, pet sent away--teleport trap, hole,
&c--or pet changed shape--which occurred after its name/old shape was
saved for use when it was the only one in its category), and finally
the summary message was issued.

Change the code to handle arriving in a trap before the collection
into the three categories that provide feedback, and skip the latter
if any message was given during mintrap().  That handles the most
glaring anomalies like killed followed by shifted location or takes
on new shape followed by old shape shifted or appeared.  But it no
longer gives specific shift/appear/disappear feedback for those cases.
Pets that don't land on traps or who land on ones that don't issue
any feedback aren't affected.

The accessibility aspect of this--message feedback in order to avoid
tedious screen reading of the map--will need to be satisfied by the
trap feedback unless/until someone comes up with a better solution.
One possibility is an option to allow player to have rloc() always
issue its vanish and appear messages.  Right now it does so when magic
whistle hasn't been discovered yet, then avoids that hyper-verbosity
(if hero has multiple pets) once it has.  Or the whistle code could
count the number of pets first, then behave as if such an option is in
effect when the count is small and only resort to the current summary
method if the count is larger than some threshold.
2022-06-17 14:58:02 -07:00
Patric Mueller
5863d95837 Typo in opthelp 2022-06-17 16:57:03 +02:00
nhmall
7e6449b66e add macOS-latest entry to CI 2022-06-17 10:23:27 -04:00
nhmall
130940ece8 use corrected imagename in CI 2022-06-17 10:15:13 -04:00
nhmall
e597cf80fc add macOS monterey to CI 2022-06-17 10:05:13 -04:00
nhmall
15217ca4dd pipelines fix 03 2022-06-17 09:41:30 -04:00
nhmall
45e95fd3ce pipelines fix 02 2022-06-17 09:30:24 -04:00
nhmall
7f797b1c20 pipelines fix 01 2022-06-17 09:25:43 -04:00
nhmall
8ac6e46d60 add newer ubuntu and gcc to CI 2022-06-17 08:50:21 -04:00
PatR
6c91f52908 documentation update
Incorporate the diff from entrez describing the travel_debug wizard
mode option and removing obsolete M prefix from the Guidebook.  That
missed a reference to it in the description of '_'.

I put M back in case someone who has used it with earlier versions
tries to use it and gets a no-such-command complaint so goes looking
for it.

Also, make the mention of ^X at the end of the discussion of status
stand out a bit.  The indentation of its paragraph made it line up
with the preceding text instead of making it be distinct from that.

The TeX changes are untested and given the amount of punctuation
characters used, it will be surprising if they all have been quoted
properly.
2022-06-17 03:18:52 -07:00
PatR
3806dae153 ignoring features when checking version compat
The nomakedefs stuff for cross-compiling support broke the code to
treat enabling or disabling some optional features as not breaking
save and bones file compatibility.  It was relying on a macro whose
definition was local to mdlib.c rather than propagated among files.
makedefs still constructs date.h with a value indicating the ignored
features but the actual compatability check doesn't use that anymore.
Toggling SCORE_ON_BOTL shouldn't have caused existing files to be
rejected but they were.
2022-06-16 11:00:53 -07:00
PatR
479945257b minor perm_invent fix 2022-06-16 09:42:52 -07:00
nhmall
ab169d7961 recent changes caused a compile issue with QT
On a machine with both homebrew and macports, the presence of
macports was causing the homebrew Qt settings to be overwritten
right after they were set. Check to see if QTDIR is already
defined before proceeding with QT macports.
2022-06-15 22:22:15 -04:00
nhmall
ef0620eadd remove a couple of debugging-output lines in macOS.370 2022-06-15 19:17:30 -04:00
nhmall
3c9fa6d9d6 another macOS.370 hint tweak 2022-06-15 19:07:28 -04:00
nhmall
1f2033562d correct some conditional code in hints macOS.370 2022-06-15 18:58:44 -04:00
nhmall
57390a7b2c more macOS.370 ncurses tinkering 2022-06-15 18:34:47 -04:00
nhmall
f3dc168366 some macports updates
if macports is detected:
- check for ncurses from macports
- adjust the library search path to include /opt/local/lib
- adjust the C compiler include search path to include /opt/local/include
  via -I/opt/local/include.
- if libncursesw* is in /opt/local/lib, link with it.

Also, USEMACPORTS=1 will use macports if you have both homebrew and macports.
It isn't required, but the ordering in the Makefile will use homebrew first
otherwise.
2022-06-15 16:00:13 -04:00
PatR
3c75e6b01a itemized billing vs persistent inventory, round II
Reported by entrez:  buying an unpaid item using itemized billing used
to result in the price information for unpaid items disappearing when
they get shown by perm_invent.  (Their status as unpaid didn't change;
persistent inventory just got redrawn without cost information.)  The
fix for that didn't handle buying a used-up item.  There's no invent
update for the gone-item item but there is one for moving gold out of
hero's inventory to add to shopkeeper's inventory.  The vanishing
price phenomenon applied to that situation too.

I can't think of any situation where persistent inventory would want
to hide unpaid status and/or cost, so always prevent those from being
excluded during perm_invent update.
2022-06-14 15:48:45 -07:00
PatR
00fd2b79de simulated mouse click for #therecmdmenu
The #therecmdmenu command calls getdir() which issues an "in what
direction?" prompt.  This allows you to answer with "_" instead of a
regular direction, then it will call getpos() to allow you to move
the cursor and type "," (or ";") to behave as if a left-click had
been done or type "." (or ":") to behave as right-click.

Ordinarily I would think of the 'normal' getpos() response of "."
as suitable for left-click, then one of the other getpos finishers
for right-click, but comma is left of period on a standard keyboard
and that seems useful for remembering which is used for which click.

Left clicking on a spot farther than one step away offers travel,
throw iff lined up, and also click-look as choices.  If you right
click farther than one step away, it will only offer click-look.
The look choice for either left or right click isn't inhibited by
having the clicklook option set to False.  After all, player is
explicitly choosing the menu entry to look at something.

New getdir.mouse can be bound to some other key than "_" and the
getpos.pick* responses could already be re-bound, but there's no
separate getdir.left/right that could be used to bind different keys
from those used for the four getpos responses.
2022-06-13 16:06:06 -07:00
PatR
145232a16f fix 'simplify streamlined act_on_act()'
Still more PR #777.  Commit c4c6c3d73a broke #therecmdmenu travel,
throw, and far-look.  It was restricting dx and dy unnecessarily
and that resulted in not specifying the correct location when the
destination was farther than one step away.

Testing those properly requires a mouse.  I've implemented a way
to simulate a left or right click at getdir()'s prompt (only useful
for #therecmdmenu).  That will be committed separately.
2022-06-13 14:44:20 -07:00
Patric Mueller
193d0c4332 Color check for 256 and 24 bit color output with enhanced symbols
Adding a check for using the 256 or 24 bit color escape sequnces only if
the terminal supports it.
2022-06-13 20:52:58 +02:00
Patric Mueller
1685b5e16b Fix wrong glyph for tuwall in Enhanced1 symset 2022-06-13 20:52:58 +02:00
PatR
c4c6c3d73a simplify streamlined act_on_act()
More PR #777:  there's no need for there_cmd_menu() to pass absolute
<x,y> instead of <dx,dy> for a couple of actions.  Those actions can
reconstruct <x,y> by adding <dx,dy> to <u.ux,u.uy>.
2022-06-13 11:30:59 -07:00
PatR
778eb2603d better feedback for '& m' and '? f m'
For the description of what a keystroke does, augment 'm' (or whatever
key has been bound to #reqmenu) to replace the default description
|m      prefix: request menu or modify command (#reqmenu).
with
|m      movement prefix: move without autopickup and without attacking
|m      non-movement prefix: request menu or modify command (#reqmenu).

The text is delivered by pline so tty will issue --More-- between the
two lines.
2022-06-13 04:41:31 -07:00
PatR
20c43287eb hack.c reformatting
Mostly adjusting some wide lines.  Should be no change in generated
code.
2022-06-13 03:35:46 -07:00
PatR
b49e8bdfb6 streamline act_on_act()
Refine the code from pull request #777 by changing act_on_act() to
take 3 arguments instead of 6.  x,y and dx,dy are mutually exclusive
so it doesn't need both pairs provided that the caller is adjusted
to pass the ones appropriate for the action, and dir is easily
derived from dx,dy for the couple of cases that use it.
2022-06-13 03:13:11 -07:00
PatR
fe34d4e3e3 noxious quest nemeses
Refine the code added by pull request #763 to check the quest nemesis
death message for reference to noxious fumes rather than having the
three relevant roles be hardcoded.
2022-06-12 13:19:13 -07:00
nhmall
ca3e406601 some Qt6 Makefile tinkering
Adjust for a package available on ubuntu jammy jellyfish 22.04 LTS,
but one that doesn't seem to follow the norm.
2022-06-12 11:59:34 -04:00
PatR
14fec29c13 fixes entry for pull request #770 - wizard splbook
Pull request from matteverett:  for generating starting equipment,
mark a wizard as having received a level 1 spellbook when getting
guaranteed force bolt so that the random second spellbook can be
level 1, 2, or 3 as intended rather than unintentionally be forced
to be level 1.

Closes #770
2022-06-11 15:32:37 -07:00
Matthew Everett
f2bef98dac Move check for starting L1 spellbook to include non-random spellbooks 2022-06-11 15:29:37 -07:00
PatR
fbd7d5cd37 pull request #798 - fix typo in disclosure \
of vanquired monsters.

Pull request from janne-hmp:  the test for how many spaces to insert
in front of "the <unique monster>" couldn't match prefix "the "
because it was specifying a length of 3 instead of the 4 required to
include the trailing space.

Despite that clear error, the code worked as intended because the
default value of 0 is the same as an explicit value of 0 it would
have gotten if it had matched "the ".  So there is no change in the
resulting vanquished monsters display.

Closes #798
2022-06-11 15:13:30 -07:00
janne-hmp
dd949cf185 Changed the comparison length of "the " from 3 to 4 to account for the space in the end. 2022-06-11 14:59:57 -07:00
PatR
ad3aa545dc monsters less likely to dig in Sokoban
Make monsters being created in Sokoban that are given a random
defensive item be less likely to receive a wand of digging.  Should
result in fewer extra holes needing to be plugged.

Resurrected from an old stash entry.  I have no recollection of why
I didn't consider it to be ready for prime time way back then.
2022-06-11 11:38:52 -07:00
nhmall
ccddb9156a cut-and-paste error follow-up 2022-06-11 14:00:15 -04:00
nhmall
6c61004b06 g++-12 bits, mostly Qt5 related
I forced a test compile to -std=c++20 mostly to see what we would
be up against. There was only a small number of things and they
are corrected in this commit.

c++20 has some issues with comparisons and bit twiddling between
different enums.

The vendor-supplied Qt5 header files triggered some of those issues as
well, so the qt_pre.h and qt_post.h NetHack header files were adjusted
to make those new warnings go away.  I have not tested Qt6 under the
new compiler and c++ version yet.

Because there are multiple pragmas in qt_pre.h now, the conditional
ifdef structure in there was modified a little to make maintenance
simpler and have a single pragma push at the top. The pragma pop
comes after the Qt vendor-supplied header files, and is done
in qt_post.h.

The display.h macro cmap_to_glyph() was used in
a Qt c++ file and triggered a series of warnings because of that.
Rather than write c++20-friendly versions of those macros, the
simple fix is to provide a function on the C side of things
to front the cmap_to_glyph() macro, so fn_cmap_to_glyph()
was added.

Also thrown into this commit, PatR picked up on the fact that for
yesterday's new warning in qt_menu.cpp, the compiler had correctly
picked up on the fact that the format range of the variable 'cash'
had been correctly upper-capped at 999999999L in the warning message
because of an assignment prior. He suggested that perhaps by also adding
    if (cash < 0)
       cash = 0;
the warning might be eliminated altogether.
After a test, that was proven to be correct, so yesterday's
more-kludgy change is reverted and replaced with that variable
variable restriction ahead of the snprintf().
2022-06-11 13:52:58 -04:00
nhmall
46e58c8e95 Merge branch 'pr791' into NetHack-3.7 2022-06-11 11:07:42 -04:00
nhmall
18fe0bef02 cleaning-up on gd_move() pr #791
Closes #791
2022-06-11 11:06:08 -04:00
nhmall
7b17659f58 Merge branch 'fix-vault' of https://github.com/argrath/NetHack into pr791 2022-06-11 11:02:23 -04:00
SHIRAKATA Kentaro
20fa315bfc fix warnings 2022-06-11 17:18:34 +09:00