Commit Graph

14930 Commits

Author SHA1 Message Date
G. Branden Robinson
ecd2e4dba1 Set up *roff hyphenation more carefully.
* doc/Guidebook.mn: Remove workaround, in favor of...
* doc/tmac.n: ...setting automatic hyphenation mode appropriate to
  hyphenation systems used by AT&T-descended troffs on the one hand
  ("suftab") and groff (TeX hyphenation patterns) on the other.

modify results of pull request #977 to target tmac.nh instead.

Guidebook update to trigger the process following pull request 977.
2023-02-09 20:07:18 -05:00
PatR
4acc3cde36 pull request #976 - D of AP
Pull request from entrez:  combining just-picked-up (P) with explicit
accept without confirmation (A) for multi-drop (D) ignored the
just-picked-up part and dropped everything.

Affects menustyle:Full.  For menustyle:Traditional, 'A' operates very
differently and combining 'a' with 'P' or vice versa already does the
right thing.

Closes #976
2023-02-09 15:48:45 -08:00
Michael Meyer
51c0221383 Fix: 'A'+'P' regression when dropping by type
Selecting both 'P' (the just-picked-up items category) and 'A' (the
'auto-select relevant items' flag) when dropping items by type with 'D'
was automatically dropping every item in inventory instead of only items
that were marked as just having been picked up.  Basically, it was
causing 'A' to act like it did before b65c93c amended its functionality.

This commit is more-or-less identical to 991e739, both in terms of the
problem and the fix, except that it applies to dropping items instead of
looting.
2023-02-09 15:34:09 -08:00
PatR
5073aacffe pull request #975 - maybe_unhide_at()
Pull request from entrez:  mayby_unhide_at() operating on the hero
rather than on a monster was buggy because it was looking at the wrong
fields when checking for being hidden (recently fixed) and for being
trapped (fixed here) because those are tracked by fields in 'u' rather
than in 'youmonst'.

Closes #975
2023-02-09 15:31:41 -08:00
Michael Meyer
e725c195d9 Tweak maybe_unhide_at() a bit more
A monster may be unhidden if it's caught in a trap, but maybe_unhide_at
was checking mtmp->mtrapped across the board, which wouldn't work for
the hero.  Use u.utrap instead under those circumstances.  Also refactor
a bit so it shouldn't need the repeated guards against mtmp being null.
2023-02-09 15:17:51 -08:00
nhmall
738bccc344 updated to Makefile bundling 2023-02-09 15:25:42 -05:00
PatR
a807b208ba wintty.c and cursstat.c formatting bits
Apply another old stashed commit.
2023-02-09 10:48:04 -08:00
nhmall
a443747211 eliminate some Xcode warnings on macsound.m 2023-02-09 12:10:22 -05:00
Pasi Kallinen
861fd82926 Fix the part I forgot 2023-02-09 08:33:32 +02:00
nhmall
4ce722b8b2 more follow-up 2023-02-08 18:12:15 -05:00
nhmall
c67d9e96a6 correct a typo 2023-02-08 17:48:26 -05:00
nhmall
aad0586239 add new macOS target 'bundle'
This creates a new target 'bundle' for make on macOS, when using
sys/hints/macOS.370.

The 'bundle' recipe:
    - creates a subdirectory of src called 'bundle', and creates
      a bundle (nethack.app/ etc) below that.
    - the executable that is placed inside the bundle
      (bundle/nethack.app/Contents/MacOS/nethack) will find resources
      within the bundle, including the sounds, so a manual placement
      of the sounds into your '~/Library/Sounds' is no longer
      required when using the executable that's inside the bundle.
    - the sounds are included in the bundle if a soundlib option is
      chose at build time (for example 'make WANT_MACSOUND=1'), such
      that the bundled executable supports sounds.
    - the executable inside the bundle seems to find the resources
      it needs, even if invoked through a symlink elsewhere that points
      to the executable that's inside the bundle (only limited testing of that
      has been done).
    - at some point, its probably appropriate to add a
      'mv bundle/nethack.app <proper location>', possibly under
      a subsequent 'make install' step.
    - right now, the bundle step has a dependency on 'update'. I don't
      know if that's the right ordering or not, yet.

make WANT_MACSOUND=1 update
make WANT_MACSOUND=1 bundle

or, you can probably get away with:

make WANT_MACSOUND=1 bundle

if the nethack bundle is the goal anyway.

make clean
will clear the bundle subdirectory and everything below it.
2023-02-08 17:17:43 -05:00
PatR
ab00de45d1 mread() in restore.c
Update and apply an old stashed commit:  hide the casts in calls to
mread() made in restore.c.  Some split lines get recombined and there
is less clutter when reading the code.
2023-02-08 12:59:47 -08:00
PatR
bfd3cee886 Unix Makefiles
Move building uudecode for unpacking .Wav files from Makefile.dat to
Makefile.utl and add uudecode to util's 'make spotless'.
2023-02-08 11:38:47 -08:00
nhmall
37b5eae64d suppress one more warning 2023-02-08 13:07:37 -05:00
nhmall
da71e22fac suppress some warnings if SND_SPEECH is not defined
apply.c:1413:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1570:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1650:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:1697:23: warning: unused variable 'shkp' [-Wunused-variable]
        struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                      ^
apply.c:2157:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:2165:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(corpse->ox,
2023-02-08 12:44:14 -05:00
Pasi Kallinen
79f3491b21 Fix hero unhiding
maybe_unhide_at tried to handle both a monster and hero, but
hero being hidden is in u.uundetected flag, and the code was
only checking the monster mundetected field.

The code should probably be changed, either to change all uses
of the u.uundetected to gy.youmonster.mundetected, or perhaps
use a macro ... but these changes are all too big for me
to tackle for now.
2023-02-08 17:10:27 +02:00
nhmall
6cc35abba3 follow-up - Change the terminology in mO menu 2023-02-08 00:06:56 -05:00
nhmall
08404ddac3 Options menu should indicate unavailability of voices
If SND_SPEECH is not defined (such as via Makefile WANT_SPEECH=1),
indicate so on the options menu.
2023-02-07 23:41:12 -05:00
nhmall
dbc148342b try work-around for Guidebook.txt nroff ver diffs 2023-02-07 21:40:36 -05:00
PatR
042d40faac generic objects refinement
Give generic objects a name as well as a description to avoid some
potential object formatting problems.  Also remove the 'unique' flag
from them to avoid confusion.  Not exhaustively tested.
2023-02-07 16:47:42 -08:00
nhw_cron
57178b75ff This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-02-07 17:56:59 -05:00
PatR
0196300682 still more shop shared wall
Neither my fix for #969 nor the followup by entrez dealt with this:
if you were in one shop and dug the wall it shared with another shop,
sometimes the shopkeeper for the room your were in would teleport to
you and demand payment--or attack if you lacked funds--other times the
one from the far room would do so.  For the latter, if you maneuvered
to the gap in the wall (possibly declining to die if angry shopkeeper
managed to kill you) you would get "this shop is deserted" (which is
accurate) but if you subsequently died there, you could get "Welcome
to so-and-so's shop" when the shopkeeper who abandoned her shop was
returned to occupancy after one of them took possession of invent.
And the welcome message might come from the shop that hadn't been
deserted and that you had never left.  (Perhaps always from that one;
I'm not sure.)

Possibly the shopkeeper for the room you're in should get priority
when demanding payment for repairs so that the other one won't
abandon the far shop, but I didn't attempt to tackle that.  This
just suppresses room entry messages when returning the shopkeeper to
her shop if the game is ending.

Not fixed, but amusing:  in one of the tests, the 'far' shopkeeper
who had teleported into the near shop to demand payment for the dug
wall picked up an item from the near shop (in the case I noticed, a
hardware store shk picked up a food ration; just an ordinary item
owned by the stop) while pursuing me to the wall gap.  One shk was
stealing from the other.  :-)
2023-02-07 14:02:06 -08:00
PatR
b00f18f6ea pull request #969 - dying in shared shop wall
Pull request by entrez, following up issue by k2:  when deciding
whether a shopkeeper should taken possession of dying heros invent,
check all rooms the hero is in rather than just the first.  Deals
with dying in a gap of a wall shared by two shops.

Original issue was about "place_object: <item> off map <0,0>" but
an earlier commit fixed that (I hope).  That commit had a typo in
the issue number and closed #965 (which was already closed) instead
of #969 (which this pull request reopened anyway).

Closes #969
2023-02-07 13:49:44 -08:00
Michael Meyer
a5c0090bac More #969: handle shared walls in inherits()
inherits() only examined the first item in u.ushops, so some shopkeepers
that should have had first dibs were ignoring the hero, one of the
causes of #969.  Examine the entire u.ushops array instead of just the
first item so that the hero's position within the shop will be correctly
identified (and do the same in set_repo_loc, though it's probably not
really necessary there).
2023-02-07 13:48:23 -08:00
nhmall
ed83be4b26 update GB 2023-02-07 14:38:07 -05:00
Pasi Kallinen
b51d548b73 Add S_lavawall to Guidebook 2023-02-07 21:32:18 +02:00
nhmall
2c89196627 fix macsound build error with certain combo of preprocess defines 2023-02-07 01:09:08 -05:00
nhmall
fbd9a7bae8 another update to the soundlib interface
sound_verbal(char *text, int32_t gender, int32_t tone, int32_t vol,
             int32_t moreinfo);
    -- NetHack will call this function when it wants to pass text of
       spoken language by a character or creature within the game.
    -- text is a transcript of what has been spoken.
    -- gender indicates MALE or FEMALE sounding voice.
    -- tone indicates the tone of the voice.
    -- vol is the volume (1% - 100%) for the sound.
    -- moreinfo is used to provide additional information to the soundlib.
    -- there may be some accessibility uses for this function.

It may be useful for accessibility purposes too.

A preliminary implementation has been attempted for macsound to test
the interface on macOS. No tinkering of the voices has been done.

Use of the test implementation requires the following at build time with make.
    WANT_SPEECH=1
That needs to be included on the make command line to enable the test code,
otherwise just the interface update is compiled in.

I don't know for certain when AVSpeechSynthesizer went into macOS, but older versions
likely don't support it, and would just leave off the WANT_SPEECH=1.

If built with WANT_SPEECH=1, the 'voices' NetHack option needs to be enabled.

It was a bit strange, when I first started up the test, to hear Asidonhopo,
the shopkeeper, talking to me as I entered his shop and interacted with him.
2023-02-07 00:44:36 -05:00
Pasi Kallinen
7aeba46690 Pickaxing or whipping a liquid wall 2023-02-07 07:36:51 +02:00
PatR
ce02aebfa6 tweaks to offering on other alignment's altar
Mostly formatting, but also moves the call to the new routine.
2023-02-06 16:24:03 -08:00
PatR
834101396f pull request #968 - offering on other alignment
Pull request from argrath:  split the code that handles offering
on an alter of another alignment out of dosacrifice() into its own
routine.

Closes #968
2023-02-06 16:05:59 -08:00
SHIRAKATA Kentaro
32080bc7fd split offering to different alignment alter into a separate function 2023-02-06 16:05:35 -08:00
PatR
5d5445d85b fix github issue #972 - moving while trapped
Reported by elunna:  a monster trapped in a pit or web that was
adjacent to a polymorph trap could enter that trap to change shape.
It would remain flagged as trapped but there's no way to escape
from a polymorph trap so it would be stuck.

Fix supplied by entrez:  when a monster is picking MUSE strategy,
don't allow it choose "enter polymorph trap" if it is currently
trapped.

I entered the changes from the diff manually and added a bunch of
minor formatting bits.

Fixes #972
2023-02-06 15:50:39 -08:00
PatR
1d06fa62a9 attempt to fix github issue #965 - place_object
Issue reported for a hardfought player by k2:  dying in a shop wall
produced "place_object: <item> [0] off map <0,0>" when hero's invent
was dropped.  It happened in Mine Town where multiple shopkeepers are
present and it is possible to have two shops share a wall.

I could not reprouce the problem, even after setting up--and dying
various times at a gap in--a wall shared by two shops.

paybill() -> inherits() -> set_repo_loc() sets up the destination
prior to disclosure and finish_paybill() -> drop_upon_death() later
places invent at the spot iff bones are going to he saved.  inherits()
is convoluted and evidently took at least one path that failed to
call set_repo_loc().  Change it to always call set_repo_loc() when
returning 'True' so that the destination should always be set if
really_done() calls finish_paybill().

Some followups by entrez are probably still useful.

Closes #965
2023-02-06 11:47:37 -08:00
Pasi Kallinen
7401b44fa1 Walls of lava
Add "walls of lava", basically lava which blocks vision and
require a bit more than just levitation or flight to move through.

No levels use this yet, as testing isn't thorough enough.
2023-02-06 19:23:42 +02:00
Pasi Kallinen
b85fb2a197 Split itemaction key pushing to separate function 2023-02-05 21:29:19 +02:00
Pasi Kallinen
dbfd7879df Split engulfer explosion message into separate function 2023-02-05 20:26:52 +02:00
nhmall
20c6e1b6e6 macsound: 2 params are UNUSED always 2023-02-05 11:53:19 -05:00
nhmall
f6b135f3e1 fixes3-7-0.txt update 2023-02-05 11:45:05 -05:00
nhmall
47c44e4907 typo fix in macsound.m 2023-02-05 11:41:59 -05:00
nhmall
43af05a6b8 Unchanging and improvisations
Adds a reveal.

Increments EDITLEVEL.
2023-02-05 11:32:58 -05:00
nhmall
5034f7f936 update macsound to support 'volume' interface parameter 2023-02-05 11:32:12 -05:00
Pasi Kallinen
d3430bed9f Prevent certain items from random erosion
Prevent wished for items (unless specified), artifacts,
armor and weapons of NPC heroes, and ammo from Longbow of Diana
being generated eroded.
2023-02-05 16:46:54 +02:00
Pasi Kallinen
ee3daba8c9 Split peaceful responses into separate functions 2023-02-05 08:24:34 +02:00
copperwater
50b18b1324 Fix: default lregion exclusion area occupied real space on the map
The intuitive behavior of des.levregion or des.teleport_region when
"exclude" is left unspecified is that there is no exclusion area.
However, this wasn't actually the case: since l_get_lregion defaulted
the exclusion area to (0,0,0,0) and exclude_islev to 0, this meant that
the 0,0 space on the map would always be excluded from regions. In cases
where a region was specified with its inclusion area constrained to the
0,0 space of the map, this would create a "Couldn't place lregion"
impossible message.

This fixes that issue by defaulting the exclusion area to (-1,-1,-1,-1),
and if the exclusion area is left unspecified, forces exclude_islev=1.
This means that the exclusion zone will be outside the walkable space of
the level where it can't cause any problems.

If a level designer puts negative coordinates in their inclusion or
exclusion parameters, this might not work correctly, but negative region
coordinates aren't currently used anywhere and probably shouldn't be
supported anyway.
2023-02-05 07:49:19 +02:00
PatR
9ce98594a4 up/down level feedback
With sounds on, using #levelchange to drop more than one level only
gave the level-loss sound effect once.  Level-gain sound was better
because the more verbose messaging triggered --More-- before moving
on.  Have both gain and loss use urgent_pline() in case messages
are being suppressed due to ESC, and have both request --More-- to
make the player acknowledge the message.  That has a side-effect of
letting the sound play to conclusion.
2023-02-04 15:28:13 -08:00
PatR
6cf077a684 depend.awk update
cppregex.cpp recently had `#include "extern.h"' added as the last
quoted include.  That gets set to "" while collecting dependencies,
then preceded by a space when output.  So the unexpected trailing
space was new and wasn't caused by a change of awk versions as I
was suspecting.  This removes it.
2023-02-04 12:58:06 -08:00
nhw_cron
967046fd96 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-02-04 15:40:17 -05:00
nhmall
d14ed8b9de enable achievement sounds in macsound
Requires rebuild of your Makefiles via hints file (for new stock wav additions).

If you've been testing by copying the wav files manually to
~/Library/Sounds, you'll need to copy them again to pick up
the additional wav files.
2023-02-04 15:37:17 -05:00