]> granicus.if.org Git - nethack/log
nethack
4 years agonuget restore task
nhmall [Sat, 5 Jun 2021 03:01:49 +0000 (23:01 -0400)]
nuget restore task

4 years agowindows substitution error in gcc Makefile
nhmall [Sat, 5 Jun 2021 01:46:03 +0000 (21:46 -0400)]
windows substitution error in gcc Makefile

4 years agoa few formatting bits for zap.c
PatR [Fri, 4 Jun 2021 22:51:36 +0000 (15:51 -0700)]
a few formatting bits for zap.c

4 years agowindsys.c name tidbit
nhmall [Fri, 4 Jun 2021 12:51:42 +0000 (08:51 -0400)]
windsys.c name tidbit

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Fri, 4 Jun 2021 12:49:47 +0000 (08:49 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agomsdos Install.dos tidbit
nhmall [Fri, 4 Jun 2021 12:49:20 +0000 (08:49 -0400)]
msdos Install.dos tidbit

4 years agoDon't bind quit to any key by default
Pasi Kallinen [Fri, 4 Jun 2021 06:13:27 +0000 (09:13 +0300)]
Don't bind quit to any key by default

Quit is not a commmand you usually need very often, and generally
don't want to use by accident.

Apparently, on Spanish keyboard layout, n-with-tilde is interpreted
by the Windows NetHack as M-q, and the key is next to l. Loot also
asks for confirmation, just like quit.

Prevent stuff like this by not binding the quit command to any key.

4 years agocron daily Files update
nhmall [Fri, 4 Jun 2021 04:27:20 +0000 (00:27 -0400)]
cron daily Files update

4 years agowindows doc update tidbit
nhmall [Fri, 4 Jun 2021 04:24:46 +0000 (00:24 -0400)]
windows doc update tidbit

4 years agoWindows build warning and Makefile update
nhmall [Fri, 4 Jun 2021 04:14:37 +0000 (00:14 -0400)]
Windows build warning and Makefile update

.\hack.c(2657): warning C4389: '!=': signed/unsigned mismatch
Visual Studio autodetection update for Makefile.msc

4 years agopipelines update
nhmall [Fri, 4 Jun 2021 04:01:37 +0000 (00:01 -0400)]
pipelines update

4 years agowindows and visual studio follow-up bit
nhmall [Fri, 4 Jun 2021 03:43:32 +0000 (23:43 -0400)]
windows and visual studio follow-up bit

4 years agochange references from winnt to windows
nhmall [Thu, 3 Jun 2021 16:14:27 +0000 (12:14 -0400)]
change references from winnt to windows

rename sys/winnt to sys/windows
move vs (visual studio) folder out of win/win32 and into sys/windows
rename include/ntconf.h to include/windconf.h
rename winnt.c to windsys.c
place visual studio projects into individual subfolders.

This will hopefully resolve GitHub issue #484 as well.

4 years agounix/Makefile.top fetch-Lua bit
PatR [Thu, 3 Jun 2021 00:13:56 +0000 (17:13 -0700)]
unix/Makefile.top fetch-Lua bit

% make spotless
% sh sys/unix/setup.sh sys/unix/hints/macOS.2020
% make fetch-Lua

worked, but the last ended with

|rm include/nhlua.h
|rm: include/nhlua.h: No such file or directory
|make: [fetch-Lua] Error 1 (ignored)

which might frighten skittish users (like me).  Check whether the
constructed header file exists (so is assumed to be for an earlier
Lua version) and only delete it in that case.  No more scary report
of benign failure when it isn't there (after 'make spotless' or for
brand new source setup).

Also, some time ago we came to the conclusion that 'if [ ]' was an
extension for GNU 'bash' and wouldn't work with some older actual
'sh' implementations.  This replaces the one post-3.6 instance of
|if [ ! -d foo ] then bar; fi
in Makefile.top with
|if test -d foo; then true; else bar; fi
Testing was successful but done with bash rather than an old sh. :-}

4 years agoMakefile command echo suppression
nhmall [Wed, 2 Jun 2021 23:21:37 +0000 (19:21 -0400)]
Makefile command echo suppression

4 years agosupport for build with current Lua version 5.4.3
nhmall [Wed, 2 Jun 2021 23:12:47 +0000 (19:12 -0400)]
support for build with current Lua version 5.4.3

On some platforms this may require:
make spotless
make fetch-lua

I did attempt to force a reminder message about the latter to
Makefile.top this time, and hope that works correctly for everyone.

4 years agofix pull request #521 - valk+warrior alignment
PatR [Wed, 2 Jun 2021 00:14:50 +0000 (17:14 -0700)]
fix pull request #521 - valk+warrior alignment

Valkyrie player monster was set to be chaotic even though valk
hero is lawful by default and can also be neutral but not chaotic.
Change it to be lawful.  Warrior quest monsters attending leader
were also chaotic; change to lawful to match revised valk.  If
hero is a neutral valk then both the player monster and warriors
get changed to neutral at start of game (and stay that way even
if hero changes alignment).  The leader defaults to neutral but
gets changed to lawful for lawful valk hero.

Attentdant quest monsters with the healer leader were lawful but
if they gain enough experience they get promoted to healer, so
make them neutral like the latter.

I've added some miscellaneous comments and done a small amount of
reformatting.  Comment about alignment changing in bones applies
to all roles that can be played with different alignments, not
just to valkyries.  It isn't new; I just thought that it ought to
be mentioned somewhere.

Fixes #521

4 years agoappend_str(pager.c) again
PatR [Mon, 31 May 2021 22:28:19 +0000 (15:28 -0700)]
append_str(pager.c) again

More for issue #524.

The revised append_str() was still vulnerable to unsigned subtraction
overflowing from small negative value to huge positive one, if caller
ever passed an outbuf buffer which already had more than BUFSZ
characters in it.

Also the semantics were changed.  If there wasn't room for the whole
" or "+string to be appended, it used to add as much as would fit.
The revised version changed that to all-or-nothing.  This changes it
back, although players will probably never know the difference.

4 years agoTribute: Feet of Clay
PatR [Mon, 31 May 2021 14:59:12 +0000 (07:59 -0700)]
Tribute: Feet of Clay

Add a page citation for passage #1 and change the wording of that
passage to match the book:  the second "does not need" should be
"doesn't even need".

Also make the comments about various added passages (for other
books) be more consistent.

4 years agopotential buffer overflow in append_str
nhmall [Mon, 31 May 2021 14:21:44 +0000 (10:21 -0400)]
potential buffer overflow in append_str

fixes #524

4 years agoadd ^ and " choices to / command
PatR [Mon, 31 May 2021 00:31:47 +0000 (17:31 -0700)]
add ^ and " choices to / command

Like /m for nearby monsters and /O for all objects, implement /^
and /" to view a list of nearby traps or all known traps.  Only
lists discovered traps (or mimics immitating traps, or detected
door or chest traps iff still shown as such on map), but lists
map traps even when an object or monster at the same location is
blocking view of them.

For traps on the Water and Air levels that have been mapped, they
will only be listed when within line of sight so that this feature
can't be used to track portal location as it moves around.  However,
when within line of sight it does allow the portal to be recognized
if that has become covered.

4 years agowhatis / quick-whatis for '^'
PatR [Sun, 30 May 2021 08:31:54 +0000 (01:31 -0700)]
whatis / quick-whatis for '^'

When using '//' or ';' to examine the map and player uses '^' to
move the cursor to the next displayed trap, have cursor go to
locations containing webs, the vibrating square, or other non-'^'
trap when such is the next trap symbol up.  Otherwise looking at
webs is very tedious because '"' is treated as a look-at command
rather than than a target symbol.

4 years agosp_lev.c reformatting
PatR [Sun, 30 May 2021 08:01:01 +0000 (01:01 -0700)]
sp_lev.c reformatting

Mostly reformatting but fixes a bug in mapfrag_free(); would matter
if the same map fragment gets freed a second time.

4 years agospecial level loading error
PatR [Sat, 29 May 2021 20:34:32 +0000 (13:34 -0700)]
special level loading error

For the baalz 'lit=0' fix, I first tried 'lit=false'.  That isn't
supported and triggered an error, but the error reporting passed
a null pointer to sprintf() for a %s argument.  OSX's stdio shows
"null" instead of crashing in that situation; most implementations
wouldn't be so forgiving.

It intends to complain about "false" but that won't work if the
unexpected value doesn't get put into the lua table.  I don't know
how to fix that aspect of this.  This fix just avoids passing a
null pointer to sprintf.  Plus some miscellaneous reformatting.

4 years agofix pull request #523 - lighting on baalz level
PatR [Sat, 29 May 2021 20:33:15 +0000 (13:33 -0700)]
fix pull request #523 - lighting on baalz level

Details for baalz level are different from other levels and that
unintentionally gave it a chance to be lit.  Force it to be unlit.

Fixes #523

4 years agotribute update: Maskerade
PatR [Wed, 26 May 2021 20:19:36 +0000 (13:19 -0700)]
tribute update: Maskerade

Accept "novel named Masquerade" when wishing for Maskerade.

Add four new passages, bringing total to 13.

4 years agoCheck genocided zombies before raising the zombified corpse
Pasi Kallinen [Wed, 26 May 2021 06:00:26 +0000 (09:00 +0300)]
Check genocided zombies before raising the zombified corpse

Fixes #520

4 years agoUnix 'make update'
PatR [Mon, 24 May 2021 01:14:13 +0000 (18:14 -0700)]
Unix 'make update'

Revise Makefile.top to remove the obsolete commands which change
the last modified date of save and bones files during 'make update'.
Using file dates to validate save files against nethack hasn't been
useful for many years.

Also, update assorted comments.

4 years agoMonsters can gain resistances by eating corpses
Pasi Kallinen [Sun, 23 May 2021 16:02:38 +0000 (19:02 +0300)]
Monsters can gain resistances by eating corpses

This is based on both the EvilHack implementation by
k21971 <keith.simpson1971@gmail.com>, and xNetHack
implementation by copperwater <aosdict@gmail.com>.

4 years agoUnlock your quest by killing your quest leader
Pasi Kallinen [Sun, 23 May 2021 05:55:58 +0000 (08:55 +0300)]
Unlock your quest by killing your quest leader

Allow killing your quest leader, just to make games winnable if you
converted before doing the quest.
Boost the quest leaders and give them some equipment. King Arthur
gets Excalibur. Killing quest leader gives really bad luck and
makes your god angry at you, and killing quest guardians gives
smaller penalties.

This is based on both the EvilHack implementation by
k21971 <keith.simpson1971@gmail.com>, and xNetHack
implementation by copperwater <aosdict@gmail.com>.

4 years agoPets are more careful about attacking monsters at low health
copperwater [Wed, 30 Jan 2019 13:17:52 +0000 (08:17 -0500)]
Pets are more careful about attacking monsters at low health

Another SliceHack feature. However, the math implemented by SliceHack
seemed incorrect, so I tweaked it.

Pets previously attacked monsters of up to one level higher than them as
long as they were above 25% health. Now, they will attack monsters as
follows:
100%: up to level + 2 (pets could not attack this high before)
80%+: up to level + 1
60%+: up to same level
40%+: up to level - 1
25%+: up to level - 2

The case that prevents any attacks below 25% health still exists.

4 years agoExploding spheres cause real explosions
Pasi Kallinen [Sat, 22 May 2021 10:27:54 +0000 (13:27 +0300)]
Exploding spheres cause real explosions

Despite active explosion attacks being called explosions in-game,
they only affected a single target, and were handled differently
from actual explosions. Make them do an actual explosion instead.
This should make spheres more interesting and inspire different
tactics handling them.

Because spheres deal more damage on average and can destroy items
in their explosions, their difficulty has been increased slightly.

Polyselfed hero exploding won't cause elemental damage to their
own gear.

Originally from xNetHack by copperwater <aosdict@gmail.com>.

4 years agoMore hallu colors
Pasi Kallinen [Sat, 22 May 2021 05:56:54 +0000 (08:56 +0300)]
More hallu colors

4 years agoLua: nhcore script with function callbacks
Pasi Kallinen [Fri, 21 May 2021 14:54:53 +0000 (17:54 +0300)]
Lua: nhcore script with function callbacks

Adds possible callbacks for "start_new_game", "restore_old_game",
"moveloop_turn", and "game_exit" which when defined, will be called
from core code at the appropriate time.

Adds lua hooks for dump_fmtstr (only if DUMPLOG), dnum_name, u.moves,
u.uhave_amulet, and u.depth.

4 years agoconfig error reporting
PatR [Fri, 21 May 2021 15:52:18 +0000 (08:52 -0700)]
config error reporting

Try to handle the convoluted error handling better.  Not very
thoroughly tested...

4 years agofix github issue #514 - 'O' segfault
PatR [Fri, 21 May 2021 15:40:39 +0000 (08:40 -0700)]
fix github issue #514 - 'O' segfault

The #version command retrieves the lua version number to include
in its output, but it was leaving the 'in_lua' flag set.  So if a
later 'O' command tried to complain about a bad option value, the
error reporting routine crashed.

4 years agofix github issue #515 - grappling hook internals
PatR [Fri, 21 May 2021 01:56:03 +0000 (18:56 -0700)]
fix github issue #515 - grappling hook internals

Grappling hook used to have an undiscovered description of "iron hook"
and when that was removed, the oc_name_known flag was left set as if
for something that could become discovered.  I'm not sure whether that
made any difference anywhere.

Gold piece was in a similar situation, except that it wasn't because
an alternate description had been present and then removed.  That one
definitely didn't make any difference anywhere.

Fixes #515

4 years agoMake anti-magic fields drain more energy
Pasi Kallinen [Thu, 20 May 2021 17:40:56 +0000 (20:40 +0300)]
Make anti-magic fields drain more energy

... and make them actually deal damage based on the energy
it would've drained, if you have Antimagic.
Also prevent them appearing too early in the dungeon.

Allow drain energy attacks (and anti-magic traps) drain more
than your level of energy.

Make eating magical monsters such as wizards and shamans give
the same tiny buzz bonus as eating a newt.

4 years agoBoost HP of some golems
Pasi Kallinen [Thu, 20 May 2021 16:25:11 +0000 (19:25 +0300)]
Boost HP of some golems

Idea from SporkHack by Derek Ray, but values are different.

4 years agotribute: Interesting Times
PatR [Thu, 20 May 2021 10:04:31 +0000 (03:04 -0700)]
tribute: Interesting Times

Add missing italics to several words in passage 1.

Add three new passages, bringing the total to 13.

The third one ended up being fairly long.  I made note of it
intending just the bacon joke but when transcribing I backed up
quite a ways.  The context is fairly unusual for a Discworld story.

4 years agoConflict based off of charisma
Pasi Kallinen [Wed, 19 May 2021 15:34:57 +0000 (18:34 +0300)]
Conflict based off of charisma

Higher charisma will make it more likely for monsters to be affected.
Conflict will also now require the monster to see the hero.

Originally from SporkHack by Derek Ray.

4 years agofix pull request #513 - applying books
PatR [Wed, 19 May 2021 01:31:04 +0000 (18:31 -0700)]
fix pull request #513 - applying books

Applying a novel to flip through its pages described them as having
"ink" rather than "magical ink" but that wasn't a very suitable way
to distinguish them from spellbooks since their ink never fades.

The Book of the Dead's pages "glowed faintly red" even when the
hero couldn't see them.

Fixes #513

4 years agofix github issue #511 - no death message when
PatR [Tue, 18 May 2021 23:26:38 +0000 (16:26 -0700)]
fix github issue #511 - no death message when

level-drained below level 1.  No "you die" or equivalent, just
straight to being life-saved or to "do you want your possessions
identifed?".  Change it to issue "Goodbye level 1."  The fact
that it is has been fatal will become obvious.  An issue comment
on github pointed out where the fix was needed.

Fixes #511

4 years agofix github issue #512 - fuzzer vs #exploremode
PatR [Tue, 18 May 2021 22:41:51 +0000 (15:41 -0700)]
fix github issue #512 - fuzzer vs #exploremode

When the fuzzer is running, don't allow a randomly generated M-X
keystroke to switch from debug mode to explore mode.

[Unintended side-effect of the combination of two earlier changes:
assigning M-X as default key for #exploremode and allowing someone
in debug mode to voluntarily downgrade to explore mode (which should
never impact normal play and makes some types of testing simpler).]

Fixes #512

4 years agoChange touch of death from instadeath to maxhp reduction and damage
Pasi Kallinen [Tue, 18 May 2021 15:58:30 +0000 (18:58 +0300)]
Change touch of death from instadeath to maxhp reduction and damage

Touch of death will now do 50 + 8d6 damage, and drain max HP for half
of that. If the drain is equal or greater than your max HP, then it
will kill you instantly.

Change originally from SporkHack by Derek Ray.

4 years agoKnights get no metal armor penalty for clerical spells
Pasi Kallinen [Tue, 18 May 2021 14:00:16 +0000 (17:00 +0300)]
Knights get no metal armor penalty for clerical spells

Originally from SporkHack by Derek Ray.

4 years agoMonsters can see player resistances
Pasi Kallinen [Mon, 17 May 2021 16:01:09 +0000 (19:01 +0300)]
Monsters can see player resistances

If monsters see you resist something, generally elemental or magical
attack, or if they see you reflect an attack, they learn that and
will adjust their attack accordingly.

Originally from SporkHack, but this version comes via EvilHack with
some minor changes.

4 years agokill extremely long running games
PatR [Sun, 16 May 2021 23:48:33 +0000 (16:48 -0700)]
kill extremely long running games

If move counter ever hits one billion, quit.  Leaving it unlimited
means that it could eventually wrap to a negative value and break
various things.

4 years agofood prayer tweak
PatR [Sun, 16 May 2021 23:42:20 +0000 (16:42 -0700)]
food prayer tweak

Guard against 16-bit int overflow when augmenting prayer timeout
for long running games.

4 years agotweaks to role-specific prediscovered objects
PatR [Sun, 16 May 2021 02:13:29 +0000 (19:13 -0700)]
tweaks to role-specific prediscovered objects

Characters who start out knowing non-magic armor should not know
cornuthaum and dunce cap.  (Which suggests that those probably
ought to be classified as magic.)

Take away knowledge of polearms from barbarians and valkyries.

Add knowledge of all bows/crossbows, arrows/bolts, and spears to
rangers.

Add knowledge of all daggers to rogues.  (Very minor; non-elves
recognize elven daggers and non-orcs recognize orcish daggers.)

4 years agofix #K586 - eucalyptus leaf falling on hero's head
PatR [Sat, 15 May 2021 00:13:48 +0000 (17:13 -0700)]
fix #K586 - eucalyptus leaf falling on hero's head

[From 14 months ago; I've got an old email for this but can't find
 it in the bug list.]

Some things shouldn't hurt the hero when thrown upward and falling
back on head.  I've been pretty conservative about what won't do
any harm.

4 years agomore object->dknown handling
PatR [Thu, 13 May 2021 16:38:53 +0000 (09:38 -0700)]
more object->dknown handling

Fix a couple of places that set obj->dknown to 0 to deal with some
special cases where it should be left at 1.  (Other places do that
but deal with potions where hardcoded 0 remains appropriate.)

4 years agofix issue #509 - shop 'glob' pricing segfault
PatR [Wed, 12 May 2021 23:13:40 +0000 (16:13 -0700)]
fix issue #509 - shop 'glob' pricing segfault

A recent change made it possible for a glob to have its dknown flag
cleared and that exposed globby_bill_fixup() passing Null shopkeeper
to get_cost(), triggering a crash.

Make the routine that clears dknown/known/bknown/&c also be the
routine used to initialize those flags for a new object so that it
is the place that handles various special cases.  That hides the
shop bug again.

But also fix the shop bug even though it won't be triggered.

Fixes #509

4 years agofix saddle sanity check code
PatR [Tue, 11 May 2021 22:59:19 +0000 (15:59 -0700)]
fix saddle sanity check code

Fix some bad code for "no saddle" caused by careless editing that
changed (uncomitted)
  char *ns = 0;
  if (foo)
    ns = "foo";
  else if (bar)
    ns = "bar";
by splicing lines together and accidentally ended up with
  char *ns;
  ns = foo ? ns = "foo" : bar ? ns = "bar" : 0;
when
  char *ns;
  ns = foo ? "foo" : bar ? "bar" : 0;
was intended.

I'm a bit surprised that the intermediate form without any
parentheses around 'ns = "bar"' compiles at all.  C99?  I don't
think that it would have if it had been processed as C90 or pre-ANSI.

4 years agothree warnings building with gcc 10
nhmall [Tue, 11 May 2021 13:24:21 +0000 (09:24 -0400)]
three warnings building with gcc 10
---
insight.c: In function â€˜status_enlightenment’:
insight.c:937:28: warning: â€˜ (’ directive writing 2 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
  937 |         Sprintf(buf, "%s %s (%s)", ustick ? "holding" : "held by",
      |                            ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from insight.c:15:
../include/global.h:274:24: note: â€˜sprintf’ output 5 or more bytes (assuming 260) into a destination of size 256
  274 | #define Sprintf (void) sprintf
insight.c:937:9: note: in expansion of macro â€˜Sprintf’
  937 |         Sprintf(buf, "%s %s (%s)", ustick ? "holding" : "held by",
      |         ^~~~~~~
insight.c:918:29: warning: â€˜%s’ directive writing up to 255 bytes into a region of size 252 [-Wformat-overflow=]
  918 |         Sprintf(buf, "%s by %s",
      |                             ^~
  919 |                 is_animal(u.ustuck->data) ? "swallowed" : "engulfed",
  920 |                 heldmon);
      |                 ~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from insight.c:15:
../include/global.h:274:24: note: â€˜sprintf’ output 5 or more bytes (assuming 260) into a destination of size 256
  274 | #define Sprintf (void) sprintf
insight.c:918:9: note: in expansion of macro â€˜Sprintf’
  918 |         Sprintf(buf, "%s by %s",
      |         ^~~~~~~

---

zap.c:475:1: warning: old-style function definition [-Wold-style-definition]
  475 | release_hold()
      | ^~~~~~~~~~~~

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Mon, 10 May 2021 22:52:07 +0000 (18:52 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agopipelines build attempt 2
nhmall [Mon, 10 May 2021 22:51:29 +0000 (18:51 -0400)]
pipelines build attempt 2

4 years agomore tribute: Soul Music
PatR [Mon, 10 May 2021 22:16:21 +0000 (15:16 -0700)]
more tribute: Soul Music

Add page citations for first two passages and some missing italics
to the first one.  Fix spelling of "fossil" in passage 8.

Add two short, new passages bringing total to 13.

4 years agotry simple fix for pipelines gcc-8 issue
nhmall [Mon, 10 May 2021 18:25:53 +0000 (14:25 -0400)]
try simple fix for pipelines gcc-8 issue

4 years agoAllow webs to be placed without a giant spider on them
Pasi Kallinen [Mon, 10 May 2021 14:48:47 +0000 (17:48 +0300)]
Allow webs to be placed without a giant spider on them

Allow creating webs without spiders in the lua level scripts:

des.trap({ type = "web", spider_on_web = 0 });

Based on xNetHack commit by copperwater <aosdict@gmail.com>.

Also changes the Spider nest themed room to generate without
spiders when the level difficulty is 8 or less.

4 years agosuppress monster health
PatR [Sun, 9 May 2021 19:54:45 +0000 (12:54 -0700)]
suppress monster health

For the time being at least, take out "uninjured/barely wounded/
slightly wounded/wounded/heavily wounded/nearly dead" description
on monsters examined with ';' or '//' or '/m' and on final tombstone
and logfile entry if hero gets directly killed by a monster.

Maybe it will be revisited later....

4 years agoAccept "waiting" on special level des.monster() specifications
Pasi Kallinen [Sun, 9 May 2021 09:15:48 +0000 (12:15 +0300)]
Accept "waiting" on special level des.monster() specifications

Allow specifying "waiting" for monsters created via lua level scripts.
This sets the monster strategy to make it wait for the hero
to be in visual range before allowing the monster to move.

Also makes the monster inside the Mausoleum themed room use this feature,
to prevent out of depth liches bothering the player unprovoked.

For example:

des.monster({ class = "D", waiting = 1 });

4 years agoFix compile error on Windows
Pasi Kallinen [Sun, 9 May 2021 08:43:51 +0000 (11:43 +0300)]
Fix compile error on Windows

Fixes #508

4 years agocorpse eating feedback
PatR [Sun, 9 May 2021 08:13:32 +0000 (01:13 -0700)]
corpse eating feedback

Avoid the message combination
|You have a very bad case of stomach acid.
|This acid blob corpse tastes okay.

4 years agofix github issue #507 - filename buffer overflow
PatR [Sun, 9 May 2021 01:02:00 +0000 (18:02 -0700)]
fix github issue #507 - filename buffer overflow

when compressing or uncompressing a save file.  Defining
VAR_PLAYGROUND forces PREFIXES_IN_USE to be defined, and the latter
causes docompress_file() to be called with save file name containing
a full path instead of just save/xyzzy.Z relative to the playground.
Depending on the value of VAR_PLAYGROUND, that could be too long for
the buffer used to make a copy of the name with ".Z"/".gz"/".bz2"
appended.

Probably only applies to Unix/linux/OSX configurations.

Fixes #507

4 years agofix pull request #505 - undead turning
PatR [Fri, 7 May 2021 18:58:58 +0000 (11:58 -0700)]
fix pull request #505 - undead turning

zapped at corpse flagged as "no revive".  A fairly recent change
made undead turning override no-revive if it hit someone carrying
a corpse flagged that way (corpse of a troll killed by Trollsbane
or stuffed in an ice box or explicitly cancelled) but neglected to
do so for corpses zapped while on the floor.  This fixes that, for
undead turning zapped by monsters as well as by the hero.

Fixes #505

4 years agofix pull request #504 - partly eaten food
PatR [Fri, 7 May 2021 00:52:30 +0000 (17:52 -0700)]
fix pull request #504 - partly eaten food

that has no nutritional value.  Prevent applying the partly eaten
attribute to wished for food if the full nutrition isn't at least 2.
The problem case was 0 nutrition wraith corpse, yielding "partly
eaten food (1) more nutritious than untouched food (0)" when setting
the corpse's weight.  That one was possible in 3.6.x, unlike corpse
that was actually partly eaten and then revived as a zombie (which
was just fixed for triggering the same warning).

Wishing really ought to ignore "partly eaten" for anything that is
normally eaten in one bite but I'm not sure how to handle that.

Fixes #504

4 years agofix github issue #493 - hero item knowledge
PatR [Thu, 6 May 2021 19:36:32 +0000 (12:36 -0700)]
fix github issue #493 - hero item knowledge

Issue was about being asked what to call a previously seen potion
which has been picked up and thrown by an unseen monster.  Hero
shouldn't remember what the item description was.  This is a much
more general change than just fixing that.  Any item picked up by
an unseen non-tame monster will have all its *known flags cleared
since the hero can't see what that monster does to it.  Same if an
item is picked up while seen but then used when unseen.

Unseen pets are excluded from the pick up case--but not the use
case--because they pick up and drop stuff continually and players
would just slaughter them if they caused item information to be
forgotten.

Fixes #493

4 years agofix github issue #503 - bad Magic Key logic
PatR [Thu, 6 May 2021 18:42:14 +0000 (11:42 -0700)]
fix github issue #503 - bad Magic Key logic

When unlocking a trapped container, any blessed key was behaving
as if it was the rogue's Master Key of Thievery:  detecting the
trap, asking whether to untrap, and always succeeding if player
responds with yes.  The intended behavior is that the Master Key
will behave that way for a rogue if not cursed and for non-rogue
if blessed; it wasn't supposed to affect ordinary keys at all.

Fixes #503

4 years agoFix: uninitialized buffer in mhitm theft feedback
Michael Meyer [Wed, 5 May 2021 21:57:53 +0000 (17:57 -0400)]
Fix: uninitialized buffer in mhitm theft feedback

If a monster with a theft attack (nymph or leprechaun) stole something
from an invisible monster (e.g. while under the influence of conflict),
and the attacking monster was not itself invisible, the monster name
buffer used when printing the "<foo> suddenly disappears!" message would
be used while still uninitialized.  The attacking monster's name was
only copied into the buffer if the defending monster was visible, but
would be used regardless to print the pline if the attacking monster was
visible and teleported away successfully after the attack.

4 years agoFix: nymph theft vs monster
Michael Meyer [Wed, 5 May 2021 22:51:26 +0000 (18:51 -0400)]
Fix: nymph theft vs monster

Nymphs' item theft attack against other monsters was broken in 1696019,
when a break used to select a particular item in the target monster's
inventory was changed to an early return.

4 years agoEntering special room, wake up only that room
Pasi Kallinen [Wed, 5 May 2021 17:32:47 +0000 (20:32 +0300)]
Entering special room, wake up only that room

... instead of doing a level-wide wake-up.

Fixes #429

4 years agotribute update: Lords and Ladies, Men at Arms
PatR [Mon, 3 May 2021 21:18:21 +0000 (14:18 -0700)]
tribute update: Lords and Ladies, Men at Arms

For Lords and Ladies, add a new, 13th passage.

For Men at Arms, include a page citation for the first passage
and add some missing italics to that one.  Add a missing word to
the second passage.

4 years agofix pull request #498 - unseen demon "looks angry"
PatR [Mon, 3 May 2021 21:10:09 +0000 (14:10 -0700)]
fix pull request #498 - unseen demon "looks angry"

When a potentially bribable demon lord becomes angry because the
hero is wielding Excalibur or Demonbane, avoid "It looks angry"
if the demon can't be seen.  The pull request just suppressed the
message in that situation; I've added an alternate one.

Fixes #498

4 years agofix github issue #499 - perm_invent menu_headings
PatR [Mon, 3 May 2021 20:50:48 +0000 (13:50 -0700)]
fix github issue #499 - perm_invent menu_headings

Implementation of '|'/#perminv command for scrolling perm_invent
deliberately disabled menu_headings (video attribute for object
class separator lines) on the persistent inventory window under
curses.  I don't recall why (possibly because it isn't actually
a menu) but there's no compelling need to do that, so reinstate
heading attributes.

Fixes #499

4 years agofix #K3317 - warning when eating corpse
PatR [Sun, 2 May 2021 01:36:46 +0000 (18:36 -0700)]
fix #K3317 - warning when eating corpse

The report was misleading because the warning about partly eaten
food being more nutritious than untouched food was actually given
when the partly eaten corpse was used to calculate hit points of
the new monster as the corpse was reviving as a zombie, rather
than when a bite was taken from it.  Pull request #497 had correct
analysis and a fix, although I've put the fix in a different place.

Closes #497

4 years agofix pull request #496 - ^X feedback typo
PatR [Wed, 28 Apr 2021 20:08:39 +0000 (13:08 -0700)]
fix pull request #496 - ^X feedback typo

Issue #495 and pull request #496 are both about a typo in recently
modified ^X feedback displayed when held by a monster:  "createure"
should be "creature".

Closes #496
Closes #495

4 years agoexplode() arguments
PatR [Tue, 27 Apr 2021 19:53:50 +0000 (12:53 -0700)]
explode() arguments

Argument explanation and Formatting.

4 years agofix "Killed by foo, while paralyzed by a monster"
PatR [Thu, 22 Apr 2021 23:13:41 +0000 (16:13 -0700)]
fix "Killed by foo, while paralyzed by a monster"

If the killer and the paralyzer are the same monster, truncate
that to "Killed by a foo, while paralyzed".  When not the same,
spell out the paralyzer's monster type instead of using generic
"monster".  "Killed by a fox, while paralyzed by a ghoul", or
"Killed by a ghoul, while paralyzed by a ghoul" *if* they were
two different ghouls.

4 years agotribute: Small Gods
PatR [Tue, 20 Apr 2021 21:53:42 +0000 (14:53 -0700)]
tribute: Small Gods

Add page number citations for the first two passages and add three
new passages.  That brings the total for Small Gods up to 15 which
is a bit on the high side, but they all seemed worthy.

While in there, fix a transcription mistake in Lords and Ladies #7:
"to" should be "be".

And two fixes for Jingo #11's footnote, change "genious" to "genius",
remove second "was" from "was, oddly enough, was one [...]".

Also, add a comment about the Amazing Maurice.

I've tried to bring the fixes37.0 entries about tribute fixes up to
date.  They're mostly minor and mostly neglected to include updates
for that.

4 years agoHallucinatory liquids for water damage messages
Patric Mueller [Tue, 20 Apr 2021 11:38:34 +0000 (13:38 +0200)]
Hallucinatory liquids for water damage messages

4 years agoanother scrambled message when given '-' as object
PatR [Mon, 19 Apr 2021 00:34:26 +0000 (17:34 -0700)]
another scrambled message when given '-' as object

This is similar to commit 98d381de46c47325abbdafda7894238c59f18cb8
(which mis-classified the bug as post-3.6), using #rub on a lump
of royal jelly and supplying '-' rather than an egg as the target
yielded "You mime rub the royal jellying on something."  Change
it to be "You mime rubbing the royal jelly on something."

4 years agofix pull request #488 - regressions for 'a'pply
PatR [Mon, 19 Apr 2021 00:02:11 +0000 (17:02 -0700)]
fix pull request #488 - regressions for 'a'pply

Restore some old behavior for the apply command that was changed
by the "getobj refactor" patch.  You couldn't attempt to apply
potions to determine whether they were oil, couldn't apply gray
stones once touchstone was discovered, and attempting to apply
arbitrary items gave "that is a silly thing to apply" rather
than "sorry, I don't know how to use that."

4 years agofix pull request #492 - select_do_line of a point
PatR [Sun, 18 Apr 2021 21:13:57 +0000 (14:13 -0700)]
fix pull request #492 - select_do_line of a point

Latent bug:  selection_do_line() for a single point produced
spurious line(s).

I haven't got a test case so am taking this one on faith....

While in there, do some nearby formatting fixups in sp_lev.c.

Fixes #492

4 years agofix github issue #490 - rolling boulder traps
PatR [Sun, 18 Apr 2021 21:02:57 +0000 (14:02 -0700)]
fix github issue #490 - rolling boulder traps

Don't include "Click!" in the feedback when a rolling boulder
trap is triggered if the hero is deaf.  Some feedback based on
being able to see a monster be hit by a rolling boulder should
also be reported if the location can be seen and an invisible
monster can be sensed there.  Change "you hear rumbling in the
distance" to "you hear rumbling nearby" when unseen activity is
close.  If the boulder itself is visible when it starts to roll,
report seeing that instead of hearing rumbling.

Fixes #490

4 years agofix github issue #486 - feedback while engulfed
PatR [Sun, 18 Apr 2021 20:29:54 +0000 (13:29 -0700)]
fix github issue #486 - feedback while engulfed

Issue is about monster shape changes being sensed via telepathy
while hero is swallowed, so player gets told about things that
aren't being shown on the map.  Similar situation while underwater;
only monsters in adjacent water spots are shown on the screen, but
messages about sensed monsters will continue to be given.  It isn't
limited to shape changing; lots of places include telepathy,
extended monster detection, and warning against specific types of
creatures as criteria to decide whether the hero 'sees' something
that isn't directly visible happen.

Change sensemon() to behave as if being swallowed or underwater
blocks telepathy, extended monster detection, and warning.  I
consider this to be experimental, but it needs much wider testing
than would take place if put into its own test branch.  It can be
tweaked or reversed if that turns out to be necessary.

There should be no change in behavior when not swallowed and not
underwater.  But for either of those two situations, some messages
that have been getting delivered may be different (such as using
"it" instead of sensed monster's name) or suppressed.

Fixes #486

4 years agofix pull request #489 - applying an empty lantern
PatR [Sun, 18 Apr 2021 00:36:14 +0000 (17:36 -0700)]
fix pull request #489 - applying an empty lantern

The message given when attempting to light a lantern with no power
left described it as a lamp.  Change that to lantern.  Also, "has
run out of power" duplicates the message given when it burns out;
change that part to "is out of power".

Your lamp has run out of power.  ->  Your lantern is out of power.

Fixes #489

4 years agofix pull request #491 - color of converted altar
PatR [Sun, 18 Apr 2021 00:16:44 +0000 (17:16 -0700)]
fix pull request #491 - color of converted altar

A display optimization assumed that the color of a glyph wouldn't
change unless the glyph itself changed, but there is a single glyph
for all altars and unaligned is shown with a different color than
the three aligned ones.  If there was an unaligned altar outside
of Gehennom (orcish mine town, some quests) and an invisible hero
(without see invisible) converted it, it stayed the old color until
there was some other reason to update that screen location.

Fixes #491

4 years agocontainer vulnerability to water damage
PatR [Sat, 17 Apr 2021 19:41:30 +0000 (12:41 -0700)]
container vulnerability to water damage

We used to have the contents of chests and large boxes be immune to
water damage, oilskin sacks immune unless the sack was cursed, other
containers be vulnerable.  Some reddit discussion about ice boxes in
unnethack indicates that they are treated like oilskin sacks, which
makes sense.  This adds that to nethack and also makes chests and
large boxes behave similarly.  So it's now:  nothing is immune even
when cursed (except statues); oilskin sacks, ice boxes, and other
boxes are immune to water damage unless cursed; all other containers
vulnerable even when not cursed.
|
|                  Old                  New
|immune all        statues,             statues
| the time         chests, large boxes
|
|immune when BU,   oilskin sacks        oilskin sacks,
| vulnerable if C                       ice boxes,
|                                       chests, large boxes
|
|vulnerable        ordinary sacks,      ordinary sacks,
| all the time     bags of holding,     bags of holding
|                  ice boxes
|
I suspect that the old ice box classification might have been an
accident caused by the Is_box() predicate yielding False for it.

The changes won't make much difference to actual play.  Chests and
large boxes are rarely carried and never start out cursed, ice boxes
even more so, and sacks/bags haven't been changed.  However, players
might intentionally curse a container to keep strong pets from
picking it up, or be carrying a box because they haven't found a bag
yet and then muck about with fountains or thrones and get it cursed.

4 years agotopten: UPDATE_RECORD_IN_PLACE
PatR [Sat, 17 Apr 2021 06:01:04 +0000 (23:01 -0700)]
topten: UPDATE_RECORD_IN_PLACE

'final_fpos' shouldn't have been moved to the 'g' struct.  Even if
a game went all the way through topten and was restarted as a new
game that also went all the way through topten, 'final_fpos' would
get a new value rather than being messed up by a stale old one.

4 years agoOPTIONS=scores:own
PatR [Fri, 16 Apr 2021 22:35:25 +0000 (15:35 -0700)]
OPTIONS=scores:own

From a beta tester six years ago:  specifying 'scores:own' resulted
in an option setting of 'scores:3 top/2 around/own' when player
wanted 'scores:0 top/0 around/own'.  Change it so that when fewer
than all three fields are given new values, the others are reset
rather than having their old values merge with new settings.

Also, 'scores:none' can be used to get 'scores:0 top/0 around/!own'
to skip the scores at the end without skipping notification of
whether the ending game's score made it into the top N list.
Options parsing accepts '!scores' and then ignores the negation.
Changing the optlist flags for 'scores' to allow negation resulted
in a complaint about missing value; I gave up instead of pursuing
that.  'scores:none' should suffice.

Setting 'scores:!top/own' or 'scores:!around/own' would behave as
'scores:1 top/!own' or 'scores:1 around/!own', respectively.
'scores:!top/!around/own' behaved as 'scores:1 top/1 around/own'
(note affect of two prior negations on final field compared to
single negation in the earlier two variations).  This fixes those.

4 years agoremove curse vs saddle
PatR [Wed, 14 Apr 2021 19:51:20 +0000 (12:51 -0700)]
remove curse vs saddle

Prayer reward can already uncurse a cursed saddle because hero is
stuck on it.  Allow scroll/spell of remove curse to do so too.

The original riding implementation in slash'em operated with the
saddle in hero's inventory rather than in the steed's, so it would
have handled this without any extra effort.  Presumeably that was
overlooked when incorporating riding into nethack changed it to
have saddle be part of the steed's inventory instead of hero's.

4 years ago^X feedback when held by unseen monster
PatR [Tue, 13 Apr 2021 21:50:12 +0000 (14:50 -0700)]
^X feedback when held by unseen monster

When swallowed and blind, the swallowing monster is described
accurately, but being held rather than swallowed describes the
monster as "it".  That's normal, but the status feedback section
of ^X output lists
|You are held by it.
which looks pretty weird.  Change that to be
|You are held by an unseen creature.

4 years agoopening magic vs holding monster
PatR [Tue, 13 Apr 2021 20:51:57 +0000 (13:51 -0700)]
opening magic vs holding monster

Zapping wand of opening or spell of knock at engulfer while swallowed
would make the engulfer expel the hero; this change makes zapping
other holders release their hold.  Zapping self now achieves the same
effect, as does breaking a non-empty wand of opening.  When poly'd
hero is holding a monster rather than being held, that monster will
be released.

Engulfers can't re-engulf for 1 or 2 turns after releasing the hero
in order to prevent hero from being immediately re-engulfed.  Impose
the same limitation on other holders.

4 years agolevel teleporters vs Ft.Ludios
PatR [Mon, 12 Apr 2021 20:25:52 +0000 (13:25 -0700)]
level teleporters vs Ft.Ludios

From newsgroup discussion where slash'em changes have revealed a
latent nethack bug:  prevent placing level teleporters in single-
level branches.  The Knox level doesn't have any level teleporters
(or random traps) but wizard mode wishing could create them there.
They wouldn't do anything because the only possible destination
would be the same level.  Pushing a boulder onto one used to trigger
an infinite loop (and still does in slash'em, which has other
single-level branches besides Ft.Ludios) trying to relocate it.

Boulder pushing was changed 15 years ago to prevent the infinite
loop and to avoid giving "the boulder disappears" message when a
level teleporter failed, but rolling boulder traversal lacked that
same change--it wasn't vulnerable to looping but could give an
inaccurate message claiming that the boulder disappeared when it
actually didn't.  Fixing this is a bit late; rolling boulder trap
creation was recently changed to not choose a path that rolls over
teleportation or level tele traps any more.

4 years agoQt extended command "rest"
PatR [Mon, 12 Apr 2021 00:53:57 +0000 (17:53 -0700)]
Qt extended command "rest"

When Qt's extended command selection dialog is set for all commands
or all normal mode commands, it displays the "#wait" command as
"wait (rest)".  Picking by mouse is straightforward; the extra text
on the button has no effect.  Picking by typing "#wa" will choose it;
there aren't any other choices matching that so the player never gets
as far as typing 'i'.  This change allows the player to type "#rest"
as an alternate way to choose it.  "#re" matches some other stuff
and the choice is left pending, adding 's' makes it unique but not
explicitly chosen (so still possible to back up), then adding 't'
chooses it.  The core never knows the difference.

4 years agoQt extended command selection
PatR [Sun, 11 Apr 2021 21:55:45 +0000 (14:55 -0700)]
Qt extended command selection

Simplify extended command selection under Qt by allowing the
autocomplete subset be one of the choices for its [filter].  That's
the same subset as X11 uses, where #q is unambiguous for #quit
instead of competing with #quaff and #quiver.

Unlike under X11, the player can use [filter] to switch to the full
command set and get access to a few commands which have no useable
key and aren't flagged to autocomplete.  (Mostly obscure wizard mode
commands but #exploremode is in that situation.)

In normal and explore modes, the [filter] button just toggles between
two sets of commands (all normal mode commands vs autocomplete normal
mode commands).  In wizard mode there are four choices and you might
need to click on [filter] up to three times to step through to the
target one among four sets (all commands, all normal mode commands,
autocomplete commands for both normal and wizard, full subset of just
the wizard mode commands).

4 years agotweaks to a few command flags
PatR [Sun, 11 Apr 2021 21:13:52 +0000 (14:13 -0700)]
tweaks to a few command flags

The #twoweapon command was flagged as autocomplete back when using
an extended command was the only way to execute it.  Take that off
since simple 'X' suffices.  Do the same for wizard mode commands
that can be invoked with control characters.  Probably ought to do
the same for #overview too but this change doesn't.

I started to add the autocomplete flag for #exploremode but that
would require an extra letter for #enhance so I decided not to.

There are some wizard mode commands that can't be executed under
X11 because they aren't flagged to autocomplete and its extended
command selection widget only offers autocomplete commands as
choices.  I haven't attempted to change that.

Always require paranoid confirmation for #panic rather than just
when it has been enabled for #quit.

4 years agodata.base novel titles
PatR [Thu, 8 Apr 2021 18:49:10 +0000 (11:49 -0700)]
data.base novel titles

Reduce the extra indentation of the Discworld titles from 4 spaces to 2.

4 years agoQt text windows
PatR [Thu, 8 Apr 2021 18:42:55 +0000 (11:42 -0700)]
Qt text windows

For Qt, always render text windows with fixed width font instead
of switching from proportional to fixed when the text contains
any line(s) with four consecutive spaces.  That was really meant
for menu lines without selector letters which want to be lined
up under or over ones with such, and wasn't a very good heuristic
for text windows.

Most of the text files for the '?' command happen to have such
lines so are already being shown with fixed-width font.  data.base
entries were hit or miss; most have attribution lines indented by
four or more spaces but some don't, so display was inconsistent:
some were shown with fixed-width font and some with proportional.