Commit Graph

14983 Commits

Author SHA1 Message Date
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
Pasi Kallinen
5d659cf1f6 Tips and option to disable them
Adds a more general way to handle gameplay tips, and adds
a boolean option "tips", which can be used to disable all
tips.  Adds a helpful longer message when the game goes
into the "farlook" mode.

Also adds a lua binding to easily show multi-line text
in a menu window.

Breaks save compat.
2023-02-19 15:56:18 +02:00
PatR
80842979aa reverse main bit of 'build fix: COMPRESS_OPTIONS'
I realized that I put opts[] inside a block that would go out of
scope while it was still needed.  When I went to fix that, I
discovered that it is already present where it ought to be.  My
'experimentation' should have defined COMPRESS_OPTIONS sooner so
that the outer scope would see it.

This doesn't revert the previous commit because a couple of comments
and a bit of reformatting from it are still useful.
2023-02-18 18:03:21 -08:00
PatR
91d6a79c11 build fix: COMPRESS_OPTIONS
While experimenting I tried defining COMPRESS_OPTIONS and files.c
would no longer compile.  Evidently nobody has been using that.
2023-02-18 17:32:26 -08:00
nhmall
84390fa600 expand C99=1 with macOS.370 and linux.370 hints
In addition to C99=1 on the make command line, also allow
C89=1 or C11=1 or C23=1.

NOTE: Those won't all lead to a successful build of NetHack,
and the use of C23=1 (-std=c2x) will only be valid on recent
compiler versions (clang-15, for one, accepts it).
2023-02-18 11:35:40 -05:00
nhmall
20f2c5569b Cross-compiling update 2023-02-18 00:55:01 -05:00
PatR
5fd6c02170 pyrolisk feedback
From a report 9 years ago, a pet pyrolisk was repeatedly gazing at a
grey-elf and nothing happened.  It turned out that the elf was wearing
an elven cloak which was negating damage some of the time (most of the
time back then) but with no indication that that's what was happening.

This makes many types of damage that are negated by MC say so.
Probably other types of damage should do likewise.
2023-02-17 14:40:26 -08:00
nhmall
d1fda1773a fix a warning on Linux for X11 if -std=c99 2023-02-17 16:56:27 -05:00
PatR
04ef7cba46 Address github issue #983 - getpos valid locations
Issue reported by entrez:  when getpos() is being used to have the
player pick a map location, if player types '$' (for some operations
like jumping or applying a polearm) then valid spots are highlighted
but the highlighting obscures what was shown on the map.  I'm not
sure whether this 'fixes' the issue but it's probably good enough.
Allow typing another '$' to toggle the highlighting back off,
redisplaying the map in the process, without needing to move the
cursor or type ^R to accomplish that.  Toggling seems more intuitive.

This is a lot more complicated than it needs to be because I assumed
that the background aspect of highlighting stayed visible when the
glyphs were reverted.  It doesn't work that way but I haven't thrown
out the effort to make toggling the highlights work sanely.  Prior
to this, typing '$' again just redrew the highlighting again, with
no visible effect.

Closes #983
2023-02-17 12:21:54 -08:00
nhmall
24dab18167 allow setting the standard
CSTD can be manually set near the top of src/Makefile, util/Makefile
or by including c99=1 or C99=1 on the build make command line if
using the linux.370 or macOS.370 hints files.
2023-02-17 10:23:40 -05:00
nhw_cron
ee32339634 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-02-17 08:55:11 -05:00
PatR
6cf079b3f6 3.7: add doc/fixes36.7 as doc/fixes3-6-7.txt 2023-02-16 23:43:37 -08:00
nhmall
709125a915 update patchlevel.h with NetHack 3.6.7 release info 2023-02-16 21:06:06 -05:00
nhmall
7aab1c0b76 Guidebook update 2023-02-16 20:56:33 -05:00
nhmall
288cc01f3a Merge branch 'naming-overflow-fix2' into NetHack-3.7 2023-02-16 18:52:47 -05:00
Pasi Kallinen
91dc1ea834 Fix angering monsters with non-hero magic rays
Can't use gc.context.mon_moving to check if the ray was caused
by hero, as some rays can happen while hero is moving in response
to their action - for example a bolt of lightning from a god.
dobuzz() uses positive type values for magic rays caused by hero,
so just use that.
2023-02-15 11:28:09 +02:00
Michael Meyer
7f0bbc28a8 Don't anger target via mon vs mon zap/breath
dobuzz() was modified in 677b32c2a7 to anger the target, but beams
handled by dobuzz() don't necessarily originate from the hero.  Monsters
can zap wands that hit other monsters, dragons can use their breath
attacks, etc.  Those things were causing the targets to become angry at
the hero.
2023-02-14 09:22:56 +02:00
Michael Meyer
3890491ef0 Fix: message when pet moves from water to eat
The <x,y> params of dog_eat are the pet's starting position that turn,
not necessarily the position of the object being eaten.  If the pet is
doing a combined move-and-eat action, <x,y> will be its original spot,
but it will have already moved to <mtmp->mx,mtmp->my>, where the food
object also is.

The attempt to check whether the eating was happening out-of-sight
underwater (to suppress the message in that case) was checking the pet's
starting location, not its new location/the location of the food object.
So if a pet moved from water to land to eat something, the chowing-down
message would be improperly suppressed (and presumably the message for a
pet moving from land to water to eat would be improperly left
_un_suppressed, though I didn't actually try to reproduce that).
2023-02-14 09:20:21 +02:00
SHIRAKATA Kentaro
6e1016be45 split kicking a door into a separate function 2023-02-14 09:16:47 +02:00
copperwater
f9fd56b5dc Fix: Change gradient math to avoid isqrt
isqrt adds some noticeable distortion artifacts to gradients (test case
I used is to draw a line from 10,10 to 20,15 with mindist = maxdist = 2
and see how the gradient is biased towards the upper right); changing
the distance calculations to use the square of the distance rather than
the raw distance avoids this. This makes radial gradients more radial,
and square gradients more square.

There still appears to be a bit of bias, but I think this is due to the
line algorithm not lining up perfectly with the tiles.
2023-02-14 09:13:59 +02:00
copperwater
9d0df0c9f0 Invert the behavior of selection.gradient
selection.gradient has some pretty unintuitive behavior, in that it
selects points that are NOT close to the defined center. I've used
gradient selections several times and so far all of them have had to be
negated, because I wanted to select points close to the center with a
decreasing probability further out.

This implements that behavior, and also fixes a bug in which the x,y
coordinates of the gradient center(s) were not converted properly when
used within a des.room or des.map. Also updated the lua documentation
for gradient.

I removed the "limited" argument, as it was previously used to control
whether the rest of the map outside the max given distance would be
included in the selection; now that the area beyond maxdist is naturally
never in the selection, it doesn't have much use. (And I can't think of
a reasonable use case for the inverse: wanting to select points close to
the center, with decreasing chance towards maxdist, but then select the
entire map beyond maxdist.)

Currently this does not affect any special levels or themed rooms
because none of them use selection.gradient.
2023-02-14 09:13:59 +02:00
nhmall
10cafddcb0 more bundle work for macOS
This iteration:

Places the resulting bundle folder off the top of the tree, rather than as a subdirectory of src.

Leaves the Applescript files out for now.

Builds the Info.plist (for now) via hard-coded values in the Makefile.

Builds the bundle launch script on the fly at make-time.

I think this revision may be working, at lease on my test machine.
There are more improvements to be done.
2023-02-12 01:19:05 -05:00
PatR
382fd52fb7 fixes entry for #genocided 2023-02-11 11:49:12 -08:00
PatR
6fd0047784 add #genocided command
Comparable to #vanquished, be able to view info normally available
during end of game disclosure while the game is still in progress.
The new #genocided command lists all genocided and extincted types
of monsters.  Unlike #vanquished, there aren't any sorting choices.

Potential future enhancement:  provide a way to view the genocided
list at the "what do you want to genocide?" prompt.
2023-02-11 11:35:06 -08:00
PatR
df18c96840 Makefile management
Have 'make clean' and 'make spotless' in 3.7 cleanup include/tile.h
from 3.6.  Otherwise use of 'cc -I../include -I../win/share' in
util/Makefile will get 3.6's include/tile.h instead of 3.7's
win/share/tile.h; use of FDECL() causes the old header to break when
used in various tiles utilities.
2023-02-10 16:42:01 -08:00
PatR
a07098b206 X11_hangup()
I was looking at backporting an X11 build fix to 3.6 and decided
that the hangup handling wasn't correct if SAFERHANGUP is defined
(which it is by default).  It didn't attempt to perform a hangup
save.  Also, the handler might return when the X code calling it
expected it to not do so.

I don't know how to force a hangup within X11 so haven't tested
this properly.  It works fine when there's no hangup.  :-/
2023-02-10 15:19:13 -08:00
nhmall
3ada7caf61 missed one, there were two 2023-02-10 14:28:27 -05:00
nhmall
3cd1a09d41 prevent a static analyzer warning 2023-02-10 08:56:06 -05:00
nhmall
24461058e6 more work on bundle and starting from Finder 2023-02-10 01:55:49 -05:00