Commit Graph

17446 Commits

Author SHA1 Message Date
Pasi Kallinen
f7e86aa150 Add a new bigroom variant "two hexagons" 2024-12-21 12:19:26 +02:00
Pasi Kallinen
e7a714849e luahelper doc nit 2024-12-21 12:06:20 +02:00
nhmall
d42c4faea0 suppress "Entering directory" messages from the output 2024-12-21 01:19:34 -05:00
nhmall
f490e54d88 update target all in dat/luahelper 2024-12-21 01:15:54 -05:00
nhmall
7c54d9e651 add support for vs files.props to dat/luahelper 2024-12-21 01:13:45 -05:00
nhmall
20511564f7 utility to help maintain lua files on platform builds
Use by:

  make -f dat/luahelper [target]

  Target examples:

      Visual Studio nmake  : make -f dat/luahelper devhelp-nmake >file.txt

      msys2 GNUmakefile    : make -f dat/luahelper devhelp-msys >file.txt

      Xcode project.pbxproj: make -f dat/luahelper devhelp-xcode >file.txt

      all: generate txt files for all the above
2024-12-21 00:47:18 -05:00
nhmall
f6a5236beb follow-up to #1343 fix for telepathic hero
telepathic hero can discern which particular monster just
read a scroll, even though he cannot see the monster
2024-12-20 15:30:37 -05:00
nhmall
a35e5779f6 heard incantation: don't trump telepathy with 'I'
GitHub 1343 report by @ars3niy:
"When you are blind and see with telepathy a monster whom you then hear read
a scroll, said monster turns into an "I". While it reveals which one exactly
read the scroll, it is strange that you can no longer see it with telepathy
until it moves to another square."

Fixes #1343
2024-12-20 13:04:08 -05:00
Pasi Kallinen
cc31017265 Use NO_MATERIAL instead of a magic number 2024-12-20 19:39:16 +02:00
nhmall
45b2a6c49a more C standard progress
There was a transcription error in the comments in cstd.h for
the standard list of header files, where only the description
remained for <stdlib.h>, not the name of the file itself.

Remove several extraneous inclusions of the standard C99 headers.

Tested on the following afterwards:
Linux (using hints/linux.370) including tty, curses, qt6, and X11
macOS (using hints/macOS.370) including tty, curses, qt5, and X11
Windows MSYS2 using sys/windows/GNUmakefile
Windows Visual Studio using sys/windows/Makefile.nmake
msdos cross-compile on Ubuntu using djgpp cross-compiler
2024-12-20 10:32:38 -05:00
PatR
837da48621 fix issue #1340 - winter wolf, hellhound alignment
Issue reported by k21971:  winter wolf cub and hellhound pup were
defined with alignment -5 (chaotic) while winter wolf and hellhound
were 0 (neutral).

K2 suggested that winter wolf plus cub both be neutral and hellhound
plus pup both be chaotic but I've gone another way:  both cub and
pup are now 0 and both adults are -5.

Fixes #1340
2024-12-19 19:59:13 -08:00
PatR
8a7f3b2b6b more issue #1303
Various bits I had in progress before Michael's commit.

Mainly forget engravings when bones are saved instead of leaving them
flagged as seen for the next hero who gets the level.
2024-12-19 18:18:11 -08:00
nhmall
21d35e768c bump EDITLEVEL for previous two commits DEC19-2024 2024-12-19 17:54:55 -05:00
nhmall
111ef1e1a5 consume a bit in obj.h for future resolution of a TODO in bones.c
Since EDITLEVEL is being incremented for the previous patch anyway,
add the "name_from" bit to the obj struct now, as groundwork for
the code change mentioned in a TODO comment in bones.c:

            /* strip user-supplied names */
            /* Statue and some corpse names are left intact,
               presumably in case they came from score file.
               [TODO: this ought to be done differently--names
               which came from such a source or came from any
               stoned or killed monster should be flagged in
               some manner; then we could just check the flag
               here and keep "real" names (dead pets, &c) while
               discarding player notes attached to statues.] */
            if (has_oname(otmp)
                && !(otmp->oartifact || otmp->otyp == STATUE
                     || otmp->otyp == SPE_NOVEL
                     || (otmp->otyp == CORPSE
                         && otmp->corpsenm >= SPECIAL_PM))) {
                free_oname(otmp);
            }

Also, the bitfield per-byte groupings identified in the struct
weren't accurately reflected, so rearrange the Bitfields,
and correct the per-byte groupings.

This invalidates existing save files and bones.
2024-12-19 17:54:14 -05:00
nhmall
f7853be3dc fix GitHub issue 1303 related to engravings
GitHub issue reported by ars3niy:
https://github.com/NetHack/NetHack/issues/1303

@ars3niy commented on Oct 27:
Stepping on a square with a dust or "graffiti" engraving while blind
produces no message because presumably you can't read them by swiping
the floor with your hands, however the engraving glyph still shows up on
the map afterwards. While this helps zen players, it looks like a bug.

@ville-v commented 3 days ago:
Searching while blind also reveals the engravings. Here is a save file
demonstrating the issue.
[...]

This adds an erevealed bit to engravings, to accompany the the eread
bit that is already there.

eread:      refers to the text of the engraving
erevealed:  refers to the engraving map symbol

Hopefully, this resolves issue 1303 without creating additional bugs.

This invalidates existing save files and bones.

Fixes #1303
2024-12-19 17:53:43 -05:00
PatR
1e431139b4 fix issue #1342 - garbled iron bars message
Issue reported by elunna:  the message given when zap_over_floor()
hits iron bars with lightning or acid was substituting a couple of
words or phrases in the wrong order, resulting in
|The {melt|dissolve} iron bars somewhat but remain intact.
when the iron bar location is flagged as non-diggable.  It should be
|The iron bars {melt|dissolve} somewhat but remain intact.

Not mentioned:  the corresponding message for locations that aren't
flagged as non-diggable used "melt" unconditionally.  Change it to
keep "melt" for lightning but switch to "corrode away" for acid.

Fixes #1342
2024-12-19 13:11:01 -08:00
Pasi Kallinen
5de7f986a0 Forget obj trap known in bones file 2024-12-19 15:29:29 +02:00
Pasi Kallinen
87694e1a95 Hero remembers trapped boxes
After finding a trap on a chest or a large box, remember it
as trapped: "You see here a trapped large box."
Randomly generated chests and boxes can be obviously trapped.
Allow defining obviously trapped containers via lua.

Invalidates saves and bones.
2024-12-19 13:11:25 +02:00
PatR
27a03ef75b more /e /E
Discovered but covered engravings weren't being shown by /e and /E.
2024-12-19 01:11:14 -08:00
PatR
01e781fff3 /e /E lint
In look_engrs(), 'sym' isn't used anymore.
2024-12-18 18:14:30 -08:00
PatR
65070b7462 fix /e and /E
A fix in Janurary to avoid appending engraving text or headstone
text when examining a map location where a monster or object covers
the engraving or headstone inadvently broke the /e and /E variations
of the '/' command, which is intended to list such text even when
covered.
2024-12-18 02:15:09 -08:00
Pasi Kallinen
faf2267aba Use correct variables, not where we are trying to go 2024-12-18 10:35:54 +02:00
nhmall
f32e766728 MIPS cross-compile bit
Use 3 additional Makefile variables
2024-12-17 19:16:00 -05:00
PatR
6e587fb282 fix out-of-bounds not in test_move()
Commit 0381e61624 fixed a problem
for mon vs hero in test_move(), but the situation can also happen
with mon vs mon which doesn't use test_move().
2024-12-17 13:46:25 -08:00
Pasi Kallinen
80a0a309ea Don't advance spell skills when using wizcast 2024-12-17 22:55:22 +02:00
nhmall
6ce2ae956e simplify inclusion of debugging capability in msdos package
This build command will include line number info, gdb.exe or nhgdb.bat in the package:

        make CROSS_TO_MSDOS=1 WANT_DEBUG=1 package

This build command will not include line number info, gdb.exe or nhgdb.bat in the package:

        make CROSS_TO_MSDOS=1 package
2024-12-17 15:33:39 -05:00
Pasi Kallinen
20c456cbbb Avoid using doopen return value in test_move
We can't rely on doopen_indir return value to
check whether hero moved and opened a door.
Instead, explicitly check whether the door is still
closed, and whether hero moved.
2024-12-17 20:58:02 +02:00
nhmall
8da4f74dcf revisit some coordxy casts inherited from time of xchar
The ones below marked "left,revisit" might be worthy of code changes

explode.c:removed: arg sx,sy passed to breaks() are coordxy and so are the parameters
invent.c: removed: discover_artifact() parameter is xint16, so change cast to match
mail.c: removed: gv.viz_rmin[] contains coordxy's, and enexto() 2nd param is too
mkmaze.c: removed: x, y are coordxy and so are cc->x, cc->y
mkroom.c: removed: tx, ty are coordxy and so are parameters to occupied()
mplayer.c: left,revisit: x,y declared int, but mk_mplayer() params are coordxy
sp_lev.c 2890: left alone: x,y declared int, but is_ok_location() params coordxy
sp_lev.c 4114: left alone: cast from lua_Integer
sp_lev.c 4123: left alone: cast from lua_Integer
sp_lev.c 4650: left alone: cast from lua_Integer returned from lua_tointeger
sp_lev.c 4765: left alone: cast from int_Integer returned from lua_tointeger
sp_lev.c 4772: left alone: cast from int_Integer returned from get_table_int
teleport.c 366: left alone: cast from int returned from rn2()
timeout.c 2171: left alone: cast from long
vault.c: left,revisit: guardx,guardy declared int, but bestcc fields are coordxy
worm.c 791: left,revisit: wseg.wx, wseg.wy are coordxy, so are nx, ny, but not
                          ox, oy; why are ox, oy needed at all?
worm.c 955: left alone: wx, wy are coordxy, wseg_at() params are int x, int y
zap.c 5061: left alone: cast from long
2024-12-17 13:02:05 -05:00
Pasi Kallinen
0381e61624 Fix out-of-bounds in test_move
Hero was on the top-left of an open map at (1,0), and
a monster was trying to knock them back to (0,-1).
2024-12-17 18:23:01 +02:00
nhmall
5a3795184f use bash for sys/msdos/fetch-cross-compiler.sh
bash allows arrays thus preventing duplication during fetching
2024-12-16 13:35:05 -05:00
nhmall
0a5948fffc follow-up on msdos cross-compile
Obtain gdb.exe during the execution of sys/msdosfetch-cross-compiler.sh
ahead of the build, so that the Makefile just has to move it into place.
2024-12-15 20:08:10 -05:00
nhmall
69600c3f38 add an optional deploy-to-dosbox target for msdos cross-compile
The WANT_DEBUG=1 will cause the cross-compile to include line
number information in the NetHack executable, useful for
backtraces and gdb debugging sessions.

How a developer can use the optional deploy-to-dosbox target:
    make CROSS_TO_MSDOS=1 WANT_DEBUG=1 dosbox=/mnt/c/dosbox deploy-to-dosbox

where dosbox= points to the directory which will be mounted for
your drive in dosbox

THe deploy-to-dosbox recipe ensures that a target copy of gdb.exe
ends up alongside nethack.exe at the target, including:
  - placing the source code that gdb requires on the target
    in the nhsrc subfolder.
  - an nhgdb.bat that supplies the right switches to gdb
    for locating the NetHack sources.
2024-12-15 10:26:49 -05:00
nhmall
fd7c314e9e adjust compiler switches in msdos cross-compile 2024-12-15 10:15:23 -05:00
nhmall
2965ce4bc5 msdos build correction
ENHANCED_SYMBOLS is defined by default in config.h.
The msdos build tried to #undef ENHANCED_SYMBOLS
in tilemap.c, but doing it in there created a mismatch
between the data struct definition for glyph_map in wintype.h
and the initializers generated in tilemap.c

Move the msdos build catch for ENHANCED_SYMBOLS to
one single place in config1.h so that the code and data agree.
2024-12-15 09:53:50 -05:00
Pasi Kallinen
e778d95ace Accessibility: more message locations pt 7 2024-12-14 16:37:49 +02:00
Pasi Kallinen
79affad312 Accessibility: more message locations pt 6 2024-12-14 16:28:20 +02:00
Pasi Kallinen
141d24bdeb Accessibility: more message locations pt 5 2024-12-14 16:19:14 +02:00
Pasi Kallinen
1849985214 Accessibility: more message locations pt 4 2024-12-14 15:51:55 +02:00
Pasi Kallinen
369f1ff959 Accessibility: more message locations pt 3 2024-12-14 15:36:05 +02:00
Pasi Kallinen
055c0d5954 Accessibility: more message locations pt 2 2024-12-14 15:30:12 +02:00
Pasi Kallinen
8e186fd5e6 Accessibility: more message locations 2024-12-14 15:24:24 +02:00
Pasi Kallinen
7fa38eb7b3 Use pline_mon instead of pline_xy
Forgot about this function. Whoops.
2024-12-14 15:20:17 +02:00
Pasi Kallinen
4f37795f96 Accessibility: pet message locations 2024-12-14 15:00:46 +02:00
Pasi Kallinen
fd23463941 Sparkle shield effect and accessibility
When sparkle is turned off, there are some places where
a monster resisting the effect did not give any message.

This fixes some of those.
2024-12-14 14:34:22 +02:00
PatR
b2b9b685c5 fix issue #1305 - failed #untrap from doorway
Issue reported by loggersviii:  attempting #untrap from an adjacent
doorway can move the hero diagonally out of the doorway.

A followup comment by elunna pointed out that a monster's attack that
results in knockback can produce similar result.

Fixes #1305
2024-12-13 22:48:32 -08:00
PatR
bbb4bfa938 fix issue #1337 - 'fireassist' vs 'f'iring aklys
Issue reported by elunna:  if the 'fireassist' option is on and the
quiver contains ammo, 'f' while wielding an aklys switches to the
ammo's launcher instead of throwing the aklys.

Fixes #1337
2024-12-13 12:30:48 -08:00
nhmall
c7739171a2 follow-up: consoletty.c 2024-12-12 22:46:44 -05:00
nhmall
c7276bcf67 more MSYS2 warning clean-up 2024-12-12 22:35:38 -05:00
nhmall
8bb764e624 follow-up: leading tab to spaces 2024-12-12 17:06:12 -05:00
nhmall
1b607d1757 deal with some MSYS2 warnings 2024-12-12 17:02:37 -05:00