Commit Graph

15011 Commits

Author SHA1 Message Date
Pasi Kallinen
77f241581c Split dungeon.lua level reading to separate function 2023-03-01 18:33:24 +02:00
nhmall
fd3057483f fix an issue when HANGUPHANDLING isn't defined
This is a contrived issue since HANGUPHANDLING is probably
defined for UNIX
2023-03-01 10:54:04 -05:00
nhmall
d241dab992 typo fix 2023-03-01 10:43:35 -05:00
nhmall
0bb94002ff update minimal build test in CI
This could trigger a couple of additional follow-up commits if the build fails.
2023-03-01 10:41:21 -05:00
copperwater
69d37be878 Fix: using a selection in a lit des.region modified it
The intuitive behavior when passing a selection to des.region, e.g.

    local foo = selection.area(07,02,10,24)
    des.region(foo, "lit")

is that foo will remain unmodified for further use. However, this wasn't
the case whenever making a lit region from it, because in order to light
walls adjacent to the lit area, the selection was having a grow
transformation applied as well. (This also seems like a problem - it
grows the selection even if what is being lit is not surrounded by
walls. I added a note in lua.adoc about this behavior.)

This fixes the selection mutation by cloning the passed-in selection and
growing the clone which leaves the original one unaffected.

This should not affect any special levels currently because the only
instance of des.region being used with a selection appears to be in
bigrm-2, which specifies *unlit* areas, which did not get grown.
2023-03-01 17:32:15 +02:00
Pasi Kallinen
ea2cd80349 done_hup is compile-time optional for some reason 2023-03-01 17:08:16 +02:00
Pasi Kallinen
fc7a32b86e Tutorial level
Add a tutorial level to teach commands to new players.
Very much a WIP.

Breaks save and bones compat.
2023-03-01 14:00:29 +02:00
nhmall
7aead98a49 fix a soundeffects typo 2023-02-28 16:15:56 -05:00
PatR
844e71e18e drawbridge revisited
Take the DEADMONSTER() check back out.  It adds some protection
against something that should never happen but also adds confusion
that it might actually happen.  Dead monsters aren't on the map.

Avoid 'if (cond) foo();' without braces if foo() might expand into
nothing.

Clean up the occupants[] array when finishing with drawbridge.
2023-02-28 12:14:23 -08:00
PatR
ffdaa5556e drawbridge fix - double death
Make sure a dead monster that hasn't been purged from the fmon list
yet can't be hit by opening/closing/destroyed drawbridge.  I don't
think that could happen because the monster gets removed from the
map, but add some bullet-proofing.

Also, give drawbridge smash/crash sound effects even when player
can see whatever is happening instead of just when only hearing the
activity.
2023-02-28 10:33:44 -08:00
PatR
6ba11256ba partial fix for #K3869 - curses: meta characters
Meta-key fix for curses interface running on top of ncurses library.
Previously only digits and lower case letters would produce a meta
character when combined with Alt (or Option on Apple keyboards), now
it should work for any basic character (not arrows or other function
keys).  It only works on terminals that send two characters ESC k
for Alt+k but that is not a change in behavior.

curses interface running on top of PDcurses library uses different
code which isn't fixed by this.  The alt key fixup it does have was
already present in curses_read_char() and recently got duplicated in
curses_convert_keys().  At least one other routine calls the latter
so it was necessary, but curses_read_char() calls that routine so
doesn't need to keep its own copy of the fixup.
2023-02-28 10:14:25 -08:00
nhmall
7c0d65718c paste error 2023-02-28 00:09:37 -05:00
nhmall
42e337c306 return correct ALT-key sequences with PDCurses
They weren't working at all because the values of ALT_A through ALT_Z
were out of the normal char range with PDCurses, and caught by the default
case in the switch, where reject got set.

/* use key as-is unless it's out of normal char range */
        reject = ((uchar) ret < 1 || ret > 255);
2023-02-28 00:05:04 -05:00
nhmall
d31db79558 more macOS.370 macro usage 2023-02-27 11:47:09 -05:00
nhmall
a2047714d1 fix a 'make bundle' error
make[1]: *** No rule to make target `../util/uudecode', needed by `/Users/testuser/nethack/NHsource/bundle/NetHackTerm.app/Contents/Resources/NetHackTerm.icns'.  Stop.
make: *** [bundle] Error 2
2023-02-27 11:08:51 -05:00
nhkeni
c2f7e7a0ac Start using 3 part version numbers. 2023-02-27 10:18:14 -05:00
nhmall
8736bf2517 remove an unused, incorrectly-spelled soundeffect 2023-02-26 15:44:04 -05:00
nhmall
d56558ee31 follow-up for seffects.h
Make it emit nothing without one of the expected #defines.
2023-02-26 09:46:45 -05:00
nhmall
abdc8e6cbe Revert "update Makefile.nmake"
This reverts commit 8c7922635e.
2023-02-26 09:42:35 -05:00
PatR
dda1cbdf83 pull request #973 - antagonostic undecagonstring
Pull request from Kufat:  add new hallucinatory monster from Iain
M. Banks' _The_Culture_ book series:  "antagonistic undecagonstring".

I was a bit concerned about the length, but it is quite a bit
shorter than the longest entry:  "one-eyed one-horned flying purple
people eater".

Closes #973
2023-02-25 23:55:22 -08:00
Kufat
b435cd840a Bogusmon from The Culture (Iain M. Banks)
Add the antagonistic undecagonstring from The Hydrogen Sonata as a hallucinatory monster.
2023-02-25 23:54:07 -08:00
nhw_cron
261d1c0f22 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-02-25 16:30:24 -05:00
nhmall
8c7922635e update Makefile.nmake 2023-02-25 16:28:58 -05:00
nhmall
cb0c7e00d1 update Xcode project 2023-02-25 16:20:10 -05:00
nhmall
4b7c3e6a5e new file include/seffects.h 2023-02-25 16:07:29 -05:00
nhmall
9168e1f30b remove a maintenance/synchronization requirement
adds a file include/seffects.h
2023-02-25 16:05:27 -05:00
nhmall
4cc717ceb4 add a comment to include/sndprocs.h 2023-02-25 14:51:59 -05:00
nhmall
945241c3b2 add comment prior to soundeffect_automapping table 2023-02-25 14:38:53 -05:00
nhmall
536cc9aaf6 include the two new sounds to list of sought files 2023-02-25 14:26:15 -05:00
Pasi Kallinen
00c756ba75 Lua: Traps without victims
Traps may get corpses generated on them on early dungeon levels,
to warn off fragile starting heroes. Allow creating traps in lua
without the corpse.
2023-02-25 18:05:09 +02:00
PatR
4fd7d51cb2 fix #H2694 - egg hatching feedback
A bug report from ten and half years ago...
If a carried egg hatches, the message is
|<foo> drops from your pack.
and if tame, is followed by
|Its cries sound like {mommy,daddy}.
The latter was issued even when <foo> has no speech capability.

Replace "its cries sound like" with "its <vocalize>ing sounds like"
for suitable value of <vocalize>.

This adds two new monster sounds, MS_BELLOW and MS_CHIRP, also two
new sound effect codes, se_chirp and se_croc_bellow.

We had MS_SILENT for crocodile.  On wikipedia, crocodile is described
as the most vocal reptile.  Adult males make a load bellowing noise
and hatchlings make a chirping noise.

This changes crocodile, titanothere, and baluchitherium from MS_SILENT
to MS_BELLOW and baby crocodile from MS_SILENT to MS_CHIRP.  Chirp
might be appropriate for lizards and lizard-like amphibians but I've
left those as MS_SILENT.

[Noticed but not changed:  lizards and lizard-like amphibians aren't
flagged as oviparous.  Shouldn't they be?]
2023-02-25 07:02:19 -08:00
nhmall
52c2ce0caf Makefile.mingw32 placement 2023-02-24 17:45:02 -05:00
nhmall
db60679665 Windows: add lua files dependency 2023-02-24 17:40:35 -05:00
PatR
d75beae272 address github issue #987 - curses: arrow keys
Issue reported by jeremyhetzler:  left and right arrows produced
unexpected characters when trying to use them to edit text that is
being entered.

The curses interface converts arrow keys and function keys related
to the keypad into movement keys (hjkl or 4286 depending on the
number_pad setting).  But it was doing that all the time, not just
when nethack wanted movement keys.  This extends the existing
program_state.getting_a_command flag to getdir() so that it can be
used for controlling that in addition to 'altmeta' support.

Typing an arrow when interacting with the map (actual command or
getpos, now getdir too) will still work.  Typing one when making a
wish or naming a pet will issue a beep and be treated as if '\0' had
been typed, and that normally gets treated as if ESC had been typed.
[Possible room for improvement there.  Losing the whole text when
trying to back up a character feels a bit harsh.]

Treating left arrow as escape rather than as h or 4 will probably be
enough to train players not to try to edit text with it after they
get burned by that a time or two.

Bonus fix:  curses' keystroke conversion only supported traditional
number_pad behavior, not the inverted phone number pad layout.

Closes #987
2023-02-23 14:02:28 -08:00
Pasi Kallinen
4ce149b2cf Lava walls vs cold rays
Lava walls have a small chance of turning into solid stone wall
when hit by a cold ray. Before this they turned to floor, which
was obviously wrong.
2023-02-22 11:55:24 +02:00
nhmall
700ca5a7b2 update tested versions of Visual Studio 2023-02-21 2023-02-21 23:51:02 -05:00
nhmall
4ac7725fde Guidebook update 2023-02-21 23:03:19 -05:00
nhmall
049ab7a5df remove some macgraphics references; some Amiga
Also closes #183
2023-02-21 22:54:56 -05:00
PatR
ecf247a2a6 tty_display_file()
For the !defined(DEF_PAGER) config, if the file to be displayed
can't be opened, refresh the screen after complaining about that
rather than when no complaint is issued.
2023-02-21 14:00:31 -08:00
PatR
998b5af644 non-Unix sysconf updates
For non-Unix systems, disable the "description of NetHack's command
line" entry in the help command's menu.
2023-02-21 11:15:08 -08:00
nhmall
da92b9b173 paste error in read.c 2023-02-21 11:52:36 -05:00
Pasi Kallinen
1efdbacd48 Remove extra backslash from EOL 2023-02-21 17:34:06 +02:00
Pasi Kallinen
08ced2a58b Lava walls cover objects
Items landing into a wall of lava are covered up by it.
Kicking behaves the same as wall of water: splashes,
but doesn't move the item.
2023-02-21 17:06:32 +02:00
PatR
923249085a fixes entry for PR #978 - suppress monster's name
for <new form> portion of messages "<old form> turns into <new form>"
to avoid named vampires yielding "Dracula turns into Dracula".

Pull request from entrez:  a couple of engulf messages used regular
monster naming for vamp-shifters transforming rather than dying.
3.6.1 had fixes for this for basic monster death but didn't handle
engulfing.

Fixes #978
2023-02-20 13:04:44 -08:00
Michael Meyer
3be8e9447e Avoid "It turns into [Name]" on vamp engulf
Apply a similar fix as a791b4b and f441696 ended up settling on for
normal vampire transformation to the vampire transformation that happens
when their shapeshifted form is engulfed.
2023-02-20 12:44:43 -08:00
PatR
c2ec99ecf1 fix #K3863 - replace 'for (int i=0;...' in core
The Makefiles and some of the hints have already been updated to
specify that C99 is required in response to #K3863.  The code was
evidently being compiled in the default mode of an old version of
gcc and that mode complained that C99 was required to specify a
declaration in the initializer clause of a
'for(initialize;test;update)statement'.  Other C99 features used
by nethack were apparently accepted as extensions in the default
conformance mode.

There's only one such declaration in the core code so replace it
with a separate declaration and ordinary 'for' loop.

win/Qt/{lots}.cpp and win/win32/{few}.c have these declarations but
the core didn't.
2023-02-20 12:22:14 -08:00
nhmall
99d784795b fix issue in Guidebook.tex 2023-02-19 21:40:52 -05:00
nhmall
a92ed87c93 fix recover on Linux
Also, recover should be a target-side utility, not host. That
really only makes a difference if you are cross-compiling.
2023-02-19 15:06:55 -05:00
PatR
eb889a2cdb [un]compress wait() feedback
At some point this may need to be commented out, but for the time
being report failure by wait() during the fork()+exec()+wait()
sequence when compressing or uncompressing a save file.

For the benefit of 'git log':  uncompressing an old save file or
compressing a new one fails when running nethack under control of
gdb (GNU Project's debugger) on OSX.  Noticed and reproducible on
OSX 10.11.6; no idea about more recent versions.  wait() returns -1
and sets errno to 4, "interrupted system call", and leaves the
variable that receives the child process's exit status as is.
NetHack has been relying on that exit status variable without
checking whether wait() returns success or failure.

This changes nethack's behavior when wait() fails.  It is now
intentionally failing compress/uncompress (by init'ing the status
to 1) after it was briefly treated as success (due to a recent
commit that set status to 0 before calling wait()), after a long
time of accidentally failing due to not setting varible 'i' (was 2
after being used for another purpose).  In addition to initializing
to failure prior to calling wait(), replace use of 'i' with a new
variable that is only used for this, possibly making the code more
comprehensible.

By the way, the issue with compress and uncompress failure when
running under control of gdb on OSX is not new.  I don't use gdb
a lot and have gotten tired of rediscovering this misbehavior.
2023-02-19 11:18:56 -08:00
nhmall
68b795483d Guidebook update 2023-02-19 10:52:56 -05:00