Commit Graph

18339 Commits

Author SHA1 Message Date
Ingo Paschke
c5dfd1fc5c Fetch BSD regex from GitHub at build time
Replace bundled Spencer regex with a fetch-regex build step that
clones https://github.com/garyhouston/regex.git, generates the
required .ih and regex.h headers via mkh, and copies the result
into sys/amiga/regex/.

Usage: make CROSS_TO_AMIGA=1 fetch-regex

The fetched sources are not tracked in git.
2026-03-24 01:21:00 +01:00
Ingo Paschke
cb0b11be11 Add portable utilities for creating tiles, add AmigaFont to symbols
- bmp2iff_host: convert nhtiles.bmp to Amiga IFF tile files. Uses
  the AMIV UI palette in pens 0-15, remaining pens filled with tile
  colors sorted by frequency.
  Usage: bmp2iff_host -planes N input.bmp output.iff

- xpm2iff_host: convert XPM to IFF for tomb.iff (RIP screen).
  Adapted from xpm2iff.c, Copyright (c) 1995 Gregg Wonderly.

- Auto-select tiles32.iff (5 planes) or tiles16.iff (4 planes)
  based on screen color depth at runtime.

- Fix NO_GLYPH in amiv_lprint_glyph: return early to prevent
  blitting with uninitialised data (caused black spots).

- Add AmigaFont symbol set to dat/symbols for AMII text mode.
2026-03-23 21:11:56 +01:00
Ingo Paschke
cee390482c Add BSD POSIX regex for Amiga
Add Henry Spencer's BSD regex implementation (from ixemul) to provide
POSIX regular expressions for the Amiga port, enabling menu coloring
and config file pattern matching.

Copyright (c) 1992 Henry Spencer, The Regents of the University of
California. BSD license.
2026-03-23 20:48:28 +01:00
Ingo Paschke
2d597cb9fa Revive Amiga port for NetHack 3.7
Update the Amiga Intuition window port (AMII/AMIV) for the 3.7
window_procs API. Key changes:

- Update all window function signatures for 3.7
- Add assembly trampolines for AmigaOS register-based callbacks
- Convert all K&R function definitions to C99
- Add cross-compilation build system (cross-pre1/pre2/post.370)
  using bebbo's m68k-amigaos-gcc with -noixemul -std=gnu17 -m68000
- Clipping fixes: viewport centering, simplified ScrollRaster,
  duplicate Ctrl-R suppression, glyph buffer invalidation
- Add menucolor support in menu rendering
- Move native txt2iff.c and xpm2iff.c to outdated/
- Add nethack.cnf and README.amiga
2026-03-23 20:48:06 +01:00
Ingo Paschke
7b89255ea8 Move Amiga port files from outdated/ to sys/amiga/
Move the active Amiga source files back into their proper locations.
Legacy native build files (Makefile.ami, Build.ami, etc.) remain
in outdated/ as they are not used by the cross-compilation build.
2026-03-23 20:46:56 +01:00
Ingo Paschke
1ca15d99ff Fix clipping: move cliparound after vision_recalc
cliparound() was called before rhack(), triggering a map redraw with
stale vision data followed by a second correct redraw. Move it after
vision_recalc() so the map is redrawn once with correct data.
2026-03-23 20:46:31 +01:00
Ingo Paschke
e07eb1a550 Fix vision: remove NO_MACRO_CPATH
The non-macro q_path() function wrappers in vision.c pass the first
two arguments in the wrong order to the _q*_path() functions, swapping
rows and columns. This causes the Bresenham line-of-sight code to use
column values as row indices into viz_clear_rows[ROWNO], producing
out-of-bounds access and infinite loops.

NO_MACRO_CPATH selects these broken function wrappers. It was only
defined for Amiga (in config1.h), so the bug never triggered on other
platforms. Remove the define to use the correct macro versions.
2026-03-23 20:46:08 +01:00
nhmall
8d33cafb3e update tested versions of Visual Studio 2026-03-17 2026-03-17 14:25:24 -04:00
Pasi Kallinen
1c5cf5382b Hellfill variance 2026-03-17 17:29:43 +02:00
Pasi Kallinen
66e7123678 Categorize more commands as general commands
"general commands" tend to be ones which take no game time,
or are non-diegetic.
2026-03-17 13:38:12 +02:00
Alex Smith
b6df17f342 Iron shoes protect / partially protect against certain trap types 2026-03-17 00:05:16 +00:00
Pasi Kallinen
13e7d21b93 Replace magic number with define 2026-03-16 15:36:23 +02:00
Pasi Kallinen
619de1ec0e Make monster destroy armor -spell erode armor first
Instead of outright destroying the armor, the spell will instead
first erode the armor.  The spell hits 2-4 times, so if it hits
the same armor 4 times, it will get destroyed.  This does not
hit erodeproof armor.

Also change the scroll of destroy armor, so that blessed one will
destroy a cursed armor, if hero is only wearing that.
2026-03-16 11:24:19 +02:00
PatR
b70da87d3e 'onefile' tidbit 2026-03-12 13:17:11 -07:00
PatR
c30eea477d Shroedinger's dead cat
Give experience to the hero if opening Shroedinger's Box reveals a cat
corpse rather than releasing a live cat.

It feels a bit odd to assess a bonus rather than a penalty.
2026-03-12 13:12:42 -07:00
nhmall
7cff1696b7 update tested versions of Visual Studio 2026-03-12 2026-03-12 09:28:37 -04:00
Pasi Kallinen
226157004b Make migratemons ignore debug_mongen
Same as wizgenesis, migratemons should create monsters even
when random monster generation is disabled.
2026-03-11 17:35:23 +02:00
PatR
d6bff63025 X11 comment thinko
Fix a phrasing mistake that was introduced when unmatched apostrophies
were removed from the sample NetHack.ad file.
2026-03-08 03:17:42 -07:00
PatR
be0bed8f3c rephrase comment
Triviality: add a couple of commas so that a comment won't be misread.
2026-03-08 03:14:29 -07:00
PatR
c47990d750 fixes3-7-0.txt typo 2026-03-06 13:43:51 -08:00
PatR
98da3a3db6 fix drawbridge + place_monster impossible
Reported via email direct to devteam.

If a monster killed by a drawbridge survives via life-saving and a
second monster also survives (in the reported case, it was a xorn
who will always survive bridge destruction), the second monster will
be placed at the same spot.  That triggers an impossible
"placing <2nd mon> over <1st mon>, at <x,y>, mstates 0 0 at Dlvl N?".
If the first monster survives due to pass_walls rather than due to
life-saving and a second survives too, one of them should end up being
moved to a different spot and not trigger the impossible (not verified
via testing).

When a monster survives via life-saving, kill it again even if there
is no second monster involved.
2026-03-05 12:57:20 -08:00
nhkeni
33a6a9a765 add optionally-built file nhlua to .gitignore 2026-03-04 16:52:04 -05:00
nhmall
7261c848c7 update tested versions of Visual Studio 2026-03-01 2026-03-01 09:25:55 -05:00
PatR
ef6e2a9624 fix #15306b - vision blocking sanity check
Update vision affected by invisible mimics if polymorphing hero gains
or loses See_invisibls.  Avoids triggering a sanity_check impossisble
if an invisible mimic is mimicking a boulder.
2026-02-25 18:30:11 -08:00
PatR
398681fd18 fix? #S15277 - Engulfer gets placed over itself
Bug report was that engulfer killed hero who was life-saved and expelled
onto a rolling boulder trap which resulted in the death of a bystanding
monster.  That triggered an impossible about placing the engulfer onto
the map at an already occupied spot (containing the engulfer itself)
while dealing with the dead bystander.

This removes the code in mon_leaving_level() that was putting the
engulfer on the map.  I'm no longer able to reproduce the problem it
was intended to solve, and if that problem (message delivery about the
swallow attack delivered with the engulfer missing from the map) exists,
it would be less severe than the impossible feedback.  I didn't attempt
to reproduce the actual reported problem since the code removal should
make it moot.

Once again, the bug report via the web contact form got misclassified
as spam.
2026-02-20 19:29:55 -08:00
PatR
e19f4552e9 pull request #1403 - reset stat abuse/exercise
Pull request from greg-kennedy: when a characteristic is repaired via
restore ability, set exercise and abuse for that characteristic to 0.

Closes #1403
2026-02-17 14:56:52 -08:00
Greg Kennedy
822396c2e0 Attribute adjustment resets abuse / exercise counter 2026-02-17 14:51:37 -08:00
Greg Kennedy
06012e7127 Potion / spell of restore ability resets stat abuse as well 2026-02-17 14:51:37 -08:00
PatR
0d2752d05d more cursed potion of invisibility
Give feedback if a visible monster drinks a potion of invisibility
that happens to be cursed so monster fails to become invisible, or if
hero hits a visible monster with a cursed potion of invisibility and
it fails to become invisible.
2026-02-16 19:51:04 -08:00
PatR
b702be4449 more discoveries of unique items
Show the invocation items in the unique items section of the
discoveries list even when they're only flagged as encountered rather
than fully discovered.  The Amulet of Yendor is excluded; it has to
be fully discovered to be shown in that section.
2026-02-16 14:01:59 -08:00
PatR
1bb7146cbd \#knownclass (back-tick) of relics
The ` command already supports selecting 'u' for unique items as a
pseudo-class.  Add support for 'r' as synonym to match the recent
addition of 'relics' to the Guidebook.

The unique item category includes the Amulet of Yendor in addition
to the three invocation items.  'r' shows it too, once it has been
fully IDed.  I'm ambivalent as to whether the Guidebook's Relics
section should mention it.
2026-02-15 12:37:55 -08:00
PatR
651a91f94c explain Amulet wish
In wizard mode, I used ^W to wish for the Amulet of Yendor and was
immediately prompted for another wish.  It was baffling and took a
while to figure out.  Give a message before initiating the wish.
2026-02-15 11:48:40 -08:00
Pasi Kallinen
fe7b3ce09d Empty tin hallu msg 2026-02-15 17:01:49 +02:00
PatR
f4bb0d93e5 observed objects
This has been laying around for a few weeks.  I meant to do more but
have forgotten what the rest would have been.

Don't mark generic objects as dknown.
2026-02-14 21:03:58 -08:00
Pasi Kallinen
78217c3ebd Allow rogues to backstab sleeping or paralyzed monsters 2026-02-13 12:53:21 +02:00
PatR
a561538c2a cursed potions of invisibility for monsters
Extend the recently changed behavior for cursed potion of invisibility.

Monsters won't drink potions of invisibility if already invisible so
can't accidentally or voluntarily make themselves visible again, but
let player make them become visible by hitting them with thrown or
wielded cursed potion of invisibility.

They don't have any concept of temporary invisibility that might let
them remain invisible while losing permanent invisibility, so they
just lose the latter and immediately become visible.
2026-02-12 10:33:09 -08:00
PatR
b074657f2b Guidebook.tex tidbit
This should eliminate an unwanted space.

Untested.
2026-02-12 07:37:31 -08:00
Pasi Kallinen
bbc3eea066 Make sure negatively enchanted boomerang hits anything 2026-02-12 14:32:58 +02:00
nhmall
cccb0303ed update tested versions of Visual Studio 2026-02-12 2026-02-12 07:01:52 -05:00
nhmall
a55ca3ab87 Guidebook.txt update 2026-02-12 06:30:54 -05:00
nhw_cron
2487be72f6 This is cron-daily v1-Jan-12-2026. 005manpages updated: makedefs.txt 2026-02-12 06:28:32 -05:00
PatR
3e24fbcc4e Guidebook.tex Artifacts and Relics
Match recent Guidebook.mn addition of two new subsections for Objects.

Untested.
2026-02-11 15:30:40 -08:00
nhmall
fcd9f5468c some coordxy follow-up
Return a couple of variables that actually held a direction back
to int from coordxy.

bhit() takes int params instead of coordxy.

boomhit() takes int params instead of coordxy.

xytod() renamed to xytodir(), and takes int params (promotion will handle
coordxy params).

dtoxy(coord *, int) renamed to dirtocoord(coord *, int).
2026-02-11 09:40:25 -05:00
Pasi Kallinen
db36ee35de Fix the healer knife bonus
dmgval is also used for monster attacks; move the healer knife
bonus to actual hero-specific code, and make sure it only
applies to hand-to-hand combat.
2026-02-11 08:22:02 +02:00
PatR
1135f5ffe5 Guidebook 'Relics'
List the three invocation items in the same order as the oracularity
about them does.
2026-02-10 13:50:01 -08:00
nhmall
b76d4338be avoid a reported obuf reuse in use_misc()
Report: https://github.com/NetHack/NetHack/issues/1486

Resolves #1486
2026-02-09 08:39:21 -05:00
Pasi Kallinen
4b30e3fab8 Healers may get tiny damage increase with knives
Styled as anatomy knowledge, a healer attacking a monster in melee
with a knife gets +1 damage per 6 dead monsters of that type,
capped at +3 damage.

Handwaving away the fact we're not keeping track who actually
killed the monsters...

Idea from aosdict.
2026-02-08 18:11:06 +02:00
Pasi Kallinen
3877e142e7 Add more bustle to bustling town 2026-02-08 17:19:53 +02:00
nhkeni
525ca734ae add checksum for lua 5.5.0 2026-02-07 21:39:03 -05:00
Pasi Kallinen
63dd80f5ec More code style nits 2026-02-07 17:03:54 +02:00