Commit Graph

4247 Commits

Author SHA1 Message Date
nhmall
07fadd5e69 fix nhl_loadlua() failures on Windows
The [dlb_]fopen() requires an RDBMODE argument on Windows.
ftell(), fseek(), and fread() interactions can be problematic otherwise.
2021-08-22 19:25:13 -04:00
PatR
1c2706e083 fixes entry for gold dragon scales in bones
Closes pull request #577
2021-08-21 22:55:57 -07:00
nhmall
9bb96322a8 compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
2021-08-21 07:59:18 -04:00
PatR
35831023b1 when spellbook being read becomes cursed
Revisit a 3.6.1 fix.  When the hero is occupied reading a spellbook
and something causes it to become cursed without interrupting (post-
Wizard harassment's malignant aura), always stop reading instead of
just when the book's bknown flag is already set.
2021-08-18 17:40:09 -07:00
Pasi Kallinen
f43bfc3f71 Lua: diagonals for selection floodfill 2021-08-15 13:50:28 +03:00
nhmall
de9acca911 fixes37.0 entry for pull request 574 (from entrez) 2021-08-12 09:12:58 -04:00
Patric Mueller
456e62ef1f tty: use bright colors directly on supporting terminals
Terminals supporting more than 8 colors can directly display the bright
colors (upper 8 colors of the 16 color palette).

The tty port now only uses bold for displaying bright colors as a fallback to
previous behavior for terminals with 8 colors.
2021-08-07 11:53:36 +02:00
PatR
62e09ae9f3 fix github issue #564 - unicorn vs displaced hero
Unicorns attempted to avoid being in direct line with the hero's
actual location even when displacement causes unicorn to think hero
was at some other spot.  Change to avoid lining up with presumed
location even if that leaves the monster lined up with the hero.

While in mon.c, reorder the static function declarations near the
beginning of the file to match their order within it.

Fixes #564
2021-08-06 17:59:53 -07:00
PatR
828cbcf4ab tribute update: The Amazing Maurice
Add four new passages to The Amazing Maurice and His Educated Rodents,
bringing total to 14.

When wishing, accept truncated title "The Amazing Maurice" as well as
the full title.
2021-08-05 17:44:04 -07:00
PatR
91ee7f28ee fix engraving with miscellaneous items
Reported directly to devteam:  when selecting an item to engrave
with, "getobj refactor"'s stylus_ok() classified none-of-the-above
objects as not viable instead of allowing arbitrary things to
engrave in the dust or give specific can't-use-that messages like
for food.  Make the suggested fix:  change default result when
checking an inventory item for applicability from GETOBJ_EXCLUDE
to GETOBJ_DOWNPLAY.

Engrave feedback rather than getobj selection:  splash of venom
isn't necessarily wizard mode-only so don't reject attempting to
engrave with it as using an illegal object.  And remove the extra
question mark from its "poison pen" message.
2021-08-05 12:32:30 -07:00
PatR
fdf0bfd8a4 wizard mode light source bug
In wizard mode if you're already polymorphed and you choose your
role's form when polymorphing again, polyself() calls rehumanize()
to restore your original shape.  rehumanize() turns off any light
the hero is emitting from polymorph form.  After it returned,
polyself() then tried to do the same thing based on a cached value.
If the previous form had been emitting light, that resulted in an
impossible() warning "del_light_source: not found type=1, id=N".

Couldn't happen in normal play because a request to polymorph into
any role monster is usually rejected; it's only honored in wizard
mode for current role.  Noticed when testing something while in
gold dragon form but this bug predates addition of that monster.

Clear the cached value when rehumanize() returns to polyself().
2021-08-04 13:26:56 -07:00
nhmall
e16b98b61d NetHackW before and after tile additions
The NetHackW.res file wasn't being forced to be rebuilt if
the tiles were changed as they were recently.

Fix the Makefile.msc dependency so that it is.
Also have 'nmake clean' clear the generated *.res files.
2021-08-04 15:48:17 -04:00
PatR
1e7155df0c fix github issue #562 - baby gold dragon
wouldn't grow up into gold dragon because the pairing was omitted
from the little-to-big list.

Fixes #562
2021-08-03 15:00:03 -07:00
PatR
e5f96cd329 diagonal movement glitch
|..X..
|.X}X.
|..X..
When testing the odd Samuari moats, I discovered that you could
easily walk diagonally between any two of the solid stone pillars
and fall into the water but you would always drown because it's a
no-teleport level and the crawl routine wouldn't let you back out
via that same diagonal.

The crawl routine is also being used by travel for the last step--a
post 3.6 change--so there was an unnecessary restriction on diagonal
movement there too.
2021-08-02 17:44:03 -07:00
PatR
5e4150be9a Samurai "moat"
Samurai home level has two isolated moat spots, each within a set
of four solid stone pillars (depicted here as 'X' instead of blank).
|..X..
|.X}X.
|..X..

Having them be described as "moat" looked pretty silly.  Keep them
moat but special case their description to be "water".  It would be
simpler to change them to be pools, but that would make a slight
change in behavior (pools can be boiled away to become pits, moats
can't; probably should have made the simpler change anyway...).
2021-08-02 17:40:28 -07:00
PatR
ef17c0fa82 tribute update: The Last Hero
Add six passages, bringing total to 13.
2021-07-30 17:28:00 -07:00
Pasi Kallinen
de73a32d7d Implement wishing for walls in wizmode 2021-07-30 20:52:46 +03:00
PatR
1ada454fbe wizard mode ^T
Noticed while testing the stair labeling, knowing the teleport away
spell (and without innate teleport ability--not sure whether that's
a factor), using ^T always attempted to cast the spell, even if you
used m^T to explicitly request wizard mode telport on demand.  Since
my samurai had no chance to cast such a high level spell, I couldn't
use ^T any more.

With a different character, I ended up with 15(2) energy after a ^T
attempt failed.  I've put in a fix for this but after the other one
I don't think it matters.
2021-07-29 10:25:18 -07:00
PatR
0891ef4e22 fix #K2154 - monster wearing alchemy smock
For the hero, a worn alchemy smock confers both poison resistance
and acid resistance.  For monsters, it was only conferring poison
resistance.  Change ut to add acid resistance too.
2021-07-28 13:45:56 -07:00
nhmall
30ede24d98 cron daily Guidebook.txt update 2021-07-27 15:40:16 -04:00
PatR
068fa6c658 fix #H2797 - avoid "vision clears" if hero can't see
From 8 years ago, sitting on a throne and getting the confers-see-
invisible result gave "your vision becomes clear" message even when
hero was blind (who stays blind at the time).  Give an alternate
message if hero is blind, with another alternate when the blindless
is due to being poly'd into something without eyes.
2021-07-27 12:29:46 -07:00
PatR
3c49cd2074 drowning monster's [lack of] corpse
From the newsgroup 6.5 years ago,
| Subject: Re: Reviving drowned pets impossible
if you displaced your pet into water and it drowned, it would never
leave a corpse.  That seems to be moot these days because a pet or
peaceful monster which would drown will refuse to swap places, but
change corpse handling anyway.
2021-07-27 12:18:55 -07:00
nhmall
b4d0d6fa58 date bump to match 267ac5 update to Guidebook source 2021-07-27 14:47:46 -04:00
Pasi Kallinen
267ac5add2 Add colored branch stairs
Different color for stairs that go to another dungeon branch.

Adds four new glyphs, S_br{up,dn}{stair,ladder}, which use the
same character as normal stairs/ladders, but yellow color.
In tiles, the up/down arrow is yellow-green instead of while-blue.

This feature has been around a lot and is in several different
variants, but this is implemented from scratch so tiles work too.
2021-07-27 17:21:01 +03:00
Pasi Kallinen
141a7915d6 Bugle playing should not scare some monsters
Make awaken_soldiers match awaken_monsters in what monsters
it can scare.
2021-07-26 21:40:23 +03:00
PatR
b70f00578c fix github issue #558 - 'altmeta' input
Setting the 'altmeta' option affects how ESC is handled.  Normally it
is for terminals/emulators which transmit two character sequence ESC c
when the user types Meta+c, but it can also be used to construct meta
characters 'manually' by typing ESC c.  Unfortunately setting this
option has a side-effect of requiring a second character after ESC
before our readchar() will return, so it is only honored when parse()
wants the next command, not for general input.

When readchar() was recently split into two parts, the use of static
variable 'alt_esc' by parse() and readchar() was removed.  That
resulted in requiring the user to type a second character whenever
ESC was typed, instead of just when it was transmitted or typed as
the prefix of a command that uses a meta-character keystroke.

Instead of just putting 'alt_esc' back, do things differently by
adding static 'getting_cmd' flag instead.

Fixes #558
2021-07-25 10:52:11 -07:00
Pasi Kallinen
7f39d53ad3 Lua: improve level testing
Add des.finalize_level() used for testing in conjunction with
des.reset_level().
Add nhc.DLB to return 0 or 1 if DLB was defined at compile-time.
Change the test_lev.lua to give more informative messages instead of
just lua error when required file doesn't exist.
Add bigrm-11 to the level tests.
2021-07-24 10:49:06 +03:00
PatR
5a09a01a13 gold dragon and scales
Add two new monsters and two new objects:
 gold dragon
 baby gold dragon
 gold dragon scale mail
 set of gold dragon scales

A couple of variants seem to have added these already, but this came
off my ancient list of monsters to add and was done from scratch.
It's a clone of silver dragon, but instead of having reflection and
breathing cold, a gold dragon emits light and breathes fire; because
of the latter it can be seen with infravision like a red dragon.
Adult gold dragons are lawful as in the AD&D Monster Manual rather
than chaotic as the wiki pages show for the variant versions.

Worn gold dragon scales operate similar to wielded Sunsword:  when
blessed, radius is 3 (same as a lamp), if uncursed, radius is 2, and
if cursed, radius is 1 (but functions as 2 when worn by the hero,
otherwise there would be no tangible effect).  Gold dragon scale mail
gets an extra +1, making blessed gold DSM have a bigger radius than
lamps.  Embedded scales have radius 1 regardless of BUC state; light
for that case comes from the gold dragon monster form the hero is in.
When not worn, gold scales and scale-mail don't emit any light.

The tiles use a mix of yellow (for gold) and red.  The two object
tiles seem reasonable variations of the corresponding silver dragon
ones.  The two monster tiles definitely need work since the silver
ones were mostly cyan and changing that to red did not produce very
good result; subsequent attempt at a mixture was haphazard at best.
2021-07-23 10:41:57 -07:00
PatR
8e2f168544 tribute update: Thief of Time
Add a page citation to passage #1; add six new passages (bringing
total to 14).
2021-07-22 17:02:06 -07:00
Pasi Kallinen
932b6d03c9 Lua: Make des.monster use boolean params 2021-07-22 11:05:40 +03:00
nhmall
bed1645f5b Guidebook.txt to July 21, 2021 current (retry) 2021-07-21 14:58:06 -04:00
nhmall
5841e31f3e Guidebook.txt update to July 21, 2021 current 2021-07-21 14:33:44 -04:00
nhmall
2f35b2ac54 Guidebook date bump to reflect most recent update 2021-07-21 11:29:35 -04:00
Pasi Kallinen
893a14e2bd Remove special doinv key
The same thing can be done in config file with BIND=0:inventory
2021-07-21 16:33:10 +03:00
Pasi Kallinen
bfe8727c59 Add retravel to Guidebook.tex 2021-07-21 11:03:36 +03:00
Pasi Kallinen
433f0cc15f Add new command: #retravel
Retravel travels to the previously selected destination.

Also changes the travel-via-mouse to execute the extended command
instead of faking a special key.
2021-07-21 10:59:08 +03:00
PatR
bb74aeef03 fix github issue #552 - "an ukulele"
Add "ukulele" to the exceptions that yield "a u<something>" in case
someone names their fruit that.  Add the shortened form "uke" too.

While in there, generalize "one" handling to accept "one", "one<space>
<anything>" and "one<underscore><anything>" as exceptions in addition
to existing "one<dash><anything>", and "eu<anything>" to replace
existing "eucalyptus".

Fixes #552
2021-07-17 08:32:07 -07:00
Patric Mueller
4c1f2ffa48 Fix heap-use-after-free when attacking monster with potion
Attacking a monster which has a passive attack (e.g. a red mold) with a
wielded potion that breaks during the attack, the variable weapon would
not be correctly reset and passive() would be called with the pointer to the
freed object.
2021-07-17 13:20:14 +02:00
PatR
35a6939b5e tribute update: The Truth
Add page citations to passages 1 and 2 and missing italics to #1.

Add five new pssages, bringing total to 13.
2021-07-16 19:08:53 -07:00
Patric Mueller
f6632e7ce6 Document "readable" Hawaiian shirt designs in fixes37.0
Closes #407
2021-07-16 18:05:48 +02:00
PatR
e9c813b6ba fix issue #510, pull request #519 - vomit effects
Add some vomiting effects:

Trigger divine wrath if hero vomits at an altar's location.  (What
about adding throne and maybe sink special effects too?)

If poly'd into a yellow dragon, breathe (acid) on self.  (I'm not
sure why.)

If on ice and poly'd into an acidic form, melt the ice.  Also,
change melt_ice() to give its message when melting happens at the
hero's location even if hero can't see.

Fixes #519
Fixes #510
2021-07-15 16:10:34 -07:00
PatR
475648bd02 fix github issue #423, pull request #549
Zapping at an object with teleportation resulted in scrambled zap
targetting as soon as any object was hit.

flooreffects() got changed to set bhitpos for handling erosion damage,
but bhitpos is used by wand/spell zap handling to pick the next target
spot.  So a zap that teleported an object resumed one step beyond the
object's destination rather than one step beyond where it was hit.
The rest of the zap could hit things (monsters as well as other
objects) which weren't in line with the original zap.  Reported case
was one of the Riders on Astral, coming from beyond multiple walls to
arrive adjacent to hero (usual position when a Rider gets teleported).

Fixes #549
Fixes #423
2021-07-14 19:21:18 -07:00
PatR
91248a2b7e fix pull request #548 - encumbrance feedback
when polymorphing into "new man".  Characteristic stats are shuffled
if turning into new man, but when already polymorphed those get
overridden by the old pre-polymorph characteristics, resulting in
another encumbrance check which might contradict the one that just
happened.  Skip the encumbrance check done when shuffling stats so
that there's only one and it comes after all changes are finished.

Fixes #548
2021-07-14 18:29:03 -07:00
PatR
938b51c76b tribute update: The Fifth Elephant
Add three new passages, bringing total to 12.

Also, fix a typo in Thief of Time #2:  had "starts" where "stars"
was intended.
2021-07-12 19:12:40 -07:00
PatR
f7436fd02d fix pull request #540 - don't autoquiver aklys
If player throws a wielded aklys and it fails to return, and quiver
is empty when picking it back up, don't put it into that slot because
it needs to be wielded to achieve best throwing effect.  A player who
had wielded it and was using 'f' to throw it might not notice that
it isn't returning until it hasn't returned several times.  Moot if
quiver already has some missile readied.  Don't autoquiver even if
some other weapon is wielded because that might have been done just
to go retrieve the aklys.

The game doesn't keep track of whether a previously thrown item was
wielded at the time, and shouldn't be changed to auto-wield in such
situation.  Leaving quiver empty so that player is prompted for what
to throw is sufficient.

Fixes #540
2021-07-10 19:09:17 -07:00
PatR
f441ef11f6 wishing fixes
Changes in wish parsing included with figurine gender implementation
3 or so weeks ago accidentally broke asking for "large box" and
possibly other stuff.

Re-do "paperback book" handling to accept "paperback" and "paperback
book" but to reject previously accepted "paperback spellbook" when
wishing for a novel by description.
2021-07-10 17:13:46 -07:00
nhmall
60f30b3fcb fixes37.0 update for gold scatter() 2021-07-10 19:46:38 -04:00
nhmall
82526315f1 index out of bounds eating standard eggs
Closes #547
2021-07-10 07:25:12 -04:00
PatR
2c3b9d1d2d wishing for "paperback book"
Something I noticed recently:  a wish request for "paperback book"
yielded "Nothing fitting that description exists in the game."
Asking for "paperback spellbook" worked though.

I'm not sure whether this is the best way to handle this particular
exception but wishing for "paperback book" now works.
2021-07-09 19:40:52 -07:00
Pasi Kallinen
29a8153170 Add a new bigroom variant "boulder maze" 2021-07-09 18:18:31 +03:00