]> granicus.if.org Git - nethack/log
nethack
3 years agoReading a magic marker shows the specific red ink color
Pasi Kallinen [Sat, 19 Feb 2022 11:11:20 +0000 (13:11 +0200)]
Reading a magic marker shows the specific red ink color

3 years agoAllow creating unhidden traps in special levels
Pasi Kallinen [Sat, 19 Feb 2022 10:38:24 +0000 (12:38 +0200)]
Allow creating unhidden traps in special levels

des.trap({ type = "rust", seen = true });

3 years agoKnight quest home level has some saddled warhorses
Pasi Kallinen [Sat, 19 Feb 2022 09:51:06 +0000 (11:51 +0200)]
Knight quest home level has some saddled warhorses

Also, when creating a saddle in a monster inventory in special
level lua code, automatically saddle the monster, if possible.

3 years agoTowels should weigh more than blindfolds
Pasi Kallinen [Sat, 19 Feb 2022 08:32:54 +0000 (10:32 +0200)]
Towels should weigh more than blindfolds

There's more cloth in a towel than in a blindfold.

3 years agoCandy bars are bright blue in text mode
Pasi Kallinen [Sat, 19 Feb 2022 08:24:50 +0000 (10:24 +0200)]
Candy bars are bright blue in text mode

There's lots of brown comestibles, but no bright blue.

3 years agoUnix command line parsing
PatR [Fri, 18 Feb 2022 22:38:24 +0000 (14:38 -0800)]
Unix command line parsing

Move a bunch of stuff out of main() into new early_options(): '-dpath'
playground directory handling, '-s ...' show scores instead of playing,
and the 'argcheck()' options:  --version, --showpaths, --dumpenums,
and --debug (not to be confused with -D).  Also introduce
| --nethackrc=filename
| --no-nethackrc
to control RC file without using NETHACKOPTIONS so that that is still
available for setting other options.  They can start with either one
or two dashes.  --no-nethackrc is just --nethackrc=/dev/null under the
hood.  '-dpath' can now be '--directory=path' or '--directory path'
but the old syntax should still work.  '-s ...' can be '--scores ...'.

Basic call sequence in unixmain relating to options is now
|main() {
|  early_options(argc, argv[]);
|  initoptions(); /* process sysconf, .nethackrc, NETHACKOPTIONS */
|  process_options(possibly_modified_argc, possibly_modified_argv[]);
|}
Options processed by early_options() that don't terminate the program
are moved to the end of argv[], with argc reduced accordingly.  Then
process_options() only sees the ones that early_options() declines to
handle.

Most early options were using plain exit() instead of nh_terminate()
so not performing any nethack-specific cleanup.  However, since they
run before the game starts, there wasn't much cleanup being overlooked.

chdirx() takes a boolean as second argument but all its callers were
passing int (with value of 1 or 0, so it still worked after being
implicitly fixed by prototype).  Change them to pass TRUE or FALSE.

argcheck() was refusing (argc,argv[]) with count of 1 but then it was
checking 0..N-1 rather than 1..N-1, so it tested whether argv[0] was
an argument instead of skipping that as the program name.  Change to
allow count of 1 with modified argv that has an option name in argv[0].
That happens to fit well with how early_options() wanted to use it.

3 years agoKnights get no caitiff penalty against undead
Pasi Kallinen [Fri, 18 Feb 2022 19:29:31 +0000 (21:29 +0200)]
Knights get no caitiff penalty against undead

3 years agoMartial arts users never deal no damage with a clumsy kick
copperwater [Mon, 13 Apr 2020 00:56:44 +0000 (20:56 -0400)]
Martial arts users never deal no damage with a clumsy kick

From EvilHack, under the basis that anyone trained in martial arts (or
is in a powerful kicking polyform or wearing kicking boots) should be
immune from landing such a poor kick. This bypass used to happen only
50% of the time; now it happens all the time.

Note that this only averts the "Your clumsy kick does no damage" case:
it remains possible for a powerfully kicking player to kick clumsily and
have the monster evade or block, for example if they are fumbling or
wearing bulky armor.

Also, documentation: I added a comment explaining what the incredibly
dense and confusing logic is with i and j happening here, for the next
poor soul that has to read that code.

3 years agoUse defines for pet hunger limits
Pasi Kallinen [Thu, 17 Feb 2022 18:03:39 +0000 (20:03 +0200)]
Use defines for pet hunger limits

3 years agoWield and swapweapon ext cmd fail return values
Pasi Kallinen [Thu, 17 Feb 2022 09:06:28 +0000 (11:06 +0200)]
Wield and swapweapon ext cmd fail return values

3 years agoFix fire auto-swapweaponing to polearm
Pasi Kallinen [Thu, 17 Feb 2022 07:12:03 +0000 (09:12 +0200)]
Fix fire auto-swapweaponing to polearm

When you have a polearm as secondary weapon, have a fireassist on,
and press 'f' to fire, the code tries to swapweapon to the polearm.
This failed badly and got stuck in a loop if you were also wearing
a shield - as polearms are two-handed and shield prevents wielding
those.

Add a new "command failed" result, and clear the command queue
in that case. Also make swapweapon and wield actually return
the ECMD flags back to the rhack loop.

3 years agoZombies groan
Pasi Kallinen [Wed, 16 Feb 2022 21:03:18 +0000 (23:03 +0200)]
Zombies groan

3 years agobuild tested with visual studio 2022 17.1.0
nhmall [Wed, 16 Feb 2022 20:57:03 +0000 (15:57 -0500)]
build tested with visual studio 2022 17.1.0

3 years agoHallucinatory rays
Pasi Kallinen [Wed, 16 Feb 2022 19:09:20 +0000 (21:09 +0200)]
Hallucinatory rays

When hallucinating, use nonsensical names for the rays
(wands, spells, and breath weapons), and random ray glyphs.

Original code from xNetHack by copperwater <aosdict@gmail.com>,
inspired by a YANI by Kahran042.

3 years agogroundwork for nethackrc name on command line
PatR [Wed, 16 Feb 2022 08:36:26 +0000 (00:36 -0800)]
groundwork for nethackrc name on command line

I've implemented 'nethack -nethackrc=filename' as an alternative to
'NETHACKOPTIONS='@filename' nethack' but at the moment it doesn't
work because the command line parsing comes after the run-time config
file has already been processed.  But this part should work, or maybe
have problems spotted and fixed if it doesn't.  The RC file part of
initoptions_finish() has been rewritten so that it won't need extra
replication of
|  set_error_handling()
|  process_file()
|  reset_error_handling()
|  if (NETHACKOPTIONS) {
|    set_error_handling()
|    process_options()
|    reset_error_handling()
|  }
I've tried to test all the combinations mentioned in the comment but
am not sure that I covered everything, particulary for repeating
earlier tests after making incremental changes.

3 years agoLooting will fall through to force
Pasi Kallinen [Wed, 16 Feb 2022 06:49:12 +0000 (08:49 +0200)]
Looting will fall through to force

If you have autounlock on, and don't have unlocking tool, but
are wielding a weapon usable for forcing the lock.

3 years agoobsolete nhlan.c follow-up
nhmall [Tue, 15 Feb 2022 20:22:34 +0000 (15:22 -0500)]
obsolete nhlan.c follow-up

- visual studio project files
- .gitattributes

3 years agoFix broken fireassist
Pasi Kallinen [Tue, 15 Feb 2022 18:16:28 +0000 (20:16 +0200)]
Fix broken fireassist

When I recently refactored the rhack loop, I also broke fireassist,
as rhack was clearing the command queue unconditionally.

3 years agoUse grounded macro
Pasi Kallinen [Tue, 15 Feb 2022 16:44:56 +0000 (18:44 +0200)]
Use grounded macro

3 years agoThis is cron-daily v1-Feb-11-2022. 000files updated: Files
nhw_cron [Tue, 15 Feb 2022 13:24:07 +0000 (08:24 -0500)]
This is cron-daily v1-Feb-11-2022.  000files updated: Files

3 years agoanother obsolete function reference
nhmall [Tue, 15 Feb 2022 13:16:21 +0000 (08:16 -0500)]
another obsolete function reference

3 years agoremove obsolete function and references
nhmall [Tue, 15 Feb 2022 13:13:27 +0000 (08:13 -0500)]
remove obsolete function and references

3 years agoUnix argcheck() usage
PatR [Mon, 14 Feb 2022 19:18:08 +0000 (11:18 -0800)]
Unix argcheck() usage

The checking for command line flags --version, --showpath, and one
or two others was inside #if CHDIR.  I don't know whether anyone
ever disables that configuration option, but it shouldn't control
whether those flags are handled.

3 years agoman page update
PatR [Mon, 14 Feb 2022 18:57:49 +0000 (10:57 -0800)]
man page update

For nethack.6, include the recently added 'optmenu' help file among
the list of files.

I didn't do anything about '-windowtype=xyzzy' though; there are some
other command line changes in the pipeline.  The existing '-w' that
the new longer form enhances isn't in there either.

I took my name out for the claim of copyright.  I've barely ever
touched this file.  We see if that breaks the automated processing.

3 years agoMonster or hero placement should avoid wall of water
Pasi Kallinen [Sun, 13 Feb 2022 16:06:45 +0000 (18:06 +0200)]
Monster or hero placement should avoid wall of water

3 years agoFlying should not allow monsters to walk on the wall of water
Pasi Kallinen [Sun, 13 Feb 2022 15:54:01 +0000 (17:54 +0200)]
Flying should not allow monsters to walk on the wall of water

Also applies to levitating monsters.

3 years agoWall of water should block monster lined-up checks
Pasi Kallinen [Sun, 13 Feb 2022 15:21:57 +0000 (17:21 +0200)]
Wall of water should block monster lined-up checks

Prevents monsters from eg. throwing items through the water.

3 years agocut error
nhmall [Sun, 13 Feb 2022 14:10:53 +0000 (09:10 -0500)]
cut error

3 years agoremove NHAccess symset, github issue #638
nhmall [Sun, 13 Feb 2022 14:07:41 +0000 (09:07 -0500)]
remove NHAccess symset, github issue #638

Closes #638

3 years agoWater walking doesn't help in wall of water
Pasi Kallinen [Sun, 13 Feb 2022 12:38:54 +0000 (14:38 +0200)]
Water walking doesn't help in wall of water

3 years agoImprove avoiding walls of water
Pasi Kallinen [Sun, 13 Feb 2022 12:19:40 +0000 (14:19 +0200)]
Improve avoiding walls of water

3 years agoFix the "wall of water" and paranoid:swim
Pasi Kallinen [Sun, 13 Feb 2022 09:00:09 +0000 (11:00 +0200)]
Fix the "wall of water" and paranoid:swim

3 years agoUse proper locomotion when avoiding water or lava
Pasi Kallinen [Sun, 13 Feb 2022 08:56:40 +0000 (10:56 +0200)]
Use proper locomotion when avoiding water or lava

3 years agounix command line
PatR [Sat, 12 Feb 2022 19:42:17 +0000 (11:42 -0800)]
unix command line

I wanted to be able to specify -windowtype:foo on the command line so
that I didn't have to use "NETHACKOPTIONS='windowtype:foo' nethack"
and it turned out that such an option already exists, as "-wfoo".
I either never knew about that or had completely forgotten it.  Anyway,
this makes specifying windowtype be more versatile.

"-wX11" still works; now "-w X11", "-windowtype=X11", "-windowtype:X11"
work too, with "--" variations of the latter too also supported.  The
long name can be truncated to any leading substring of "windowtype",
although it has to be at least "wi" for "--"; "--w" is rejected.

Also, any errors reported while processing the command line are
treated like config file processing errors rather than just delivered
with raw_printf().  On tty at least, they used to vanish when the
screen cleared to start the game, with no chance to read them.  Here's
an example from after this change.  It sets windowtype to tty and then
overrides that with X11.

|% ./nethack --w:Qt --win tty -wX11 -windowtype
|
|
| * Unknown option: --w:Qt.
| * Window type [nothing] not recognized.  Choices are:  tty, curses, X11, Qt.
|
|2 errors on command line.
|
|
|Hit return to continue:

This should probably be better integrated with argcheck() or vice
versa but the only change to that was a couple of formatting bits.

Anything that already worked should continue to work just the same,
aside from the improvement to the error feedback.

3 years agofixes entry for pull request #677 - com_pager
PatR [Sat, 12 Feb 2022 15:56:14 +0000 (07:56 -0800)]
fixes entry for pull request #677 - com_pager

From argrath, have com_pager_core() check for null return from
nhl_init() to pacify some code checker.  If nhl_init() ever fails,
the program will never get far enough to try to use com_pager().

Closes #677

3 years agoCheck the return value of nhl_init() on com_pager_core()
SHIRAKATA Kentaro [Wed, 9 Feb 2022 20:24:34 +0000 (05:24 +0900)]
Check the return value of nhl_init() on com_pager_core()

nhl_init() can return NULL.

3 years agoAdd paranoid:swim to prevent typoing into water or lava
Pasi Kallinen [Sat, 12 Feb 2022 14:30:39 +0000 (16:30 +0200)]
Add paranoid:swim to prevent typoing into water or lava

In the name of accessibility: Prevent moving into dangerous liquids.

Now with themed rooms, water and lava are more common, and it's
unreasonable to expect blind players to check every step for those.
With paranoid:swim, just prevent normal walking into those liquids,
unless you prefix the movement with 'm', or if the liquid would not
harm you.

Doesn't completely prevent an accidental dunking - for example
if the hero is impaired or couldn't see the liquid.

This comes from xNetHack by copperwater <aosdict@gmail.com>
with some changes to the code.

3 years agotty PICK_NONE menus
PatR [Sat, 12 Feb 2022 15:28:40 +0000 (07:28 -0800)]
tty PICK_NONE menus

When testing the menu/incomplete map situation I noticed that <return>
didn't work to dismiss the "list autopickup exceptions" menu.  <space>
or <escape> was required.  That was clearly intentional but doesn't
seem reasonable.  Make <return> behave the same for PICK_NONE as it
does for other menu modes in tty and as it does for other interfaces.

3 years agofixes entry for pull request #673 - incomplete map
PatR [Sat, 12 Feb 2022 14:48:42 +0000 (06:48 -0800)]
fixes entry for pull request #673 - incomplete map

Sometimes tty left part of the screen blank after covering the entire
screen with a menu and then switching to a smaller menu that should
have redrawn the map as background.  To reproduce:
|    O     - puts up a big menu
|    :     - enter a search string: "autopickup exception"
| <return> - dismiss the menu after the search makes one match
The autopickup exceptions sub-menu will be shown, with a small border
of map around it but most of the screen blank.  (This behavior was
present before 3.6.0 but may not have been noticed because when the
discovered map doesn't extend to the corner menu's area, the blank
map probably seemed to be intentional.  But if a fringe of map gets
drawn around the menu, that clearly isn't intended.)  The incomplete
map is temporary; once menu is dismissed, it gets redrawn properly.

This adds a flush_screen() call after one particular docrt() call.
Perhaps docrt() should end with its own flush_screen() instead, but
that would require a lot more testing.

Closes #673

3 years agoFix: tty map weirdness after 'full-screen' menu
Michael Meyer [Tue, 8 Feb 2022 22:45:12 +0000 (17:45 -0500)]
Fix: tty map weirdness after 'full-screen' menu

When a 'full-screen' (cw->offx and cw->offy both 0) menu was immediately
followed by an offset menu -- as in the case of selecting certain
options from the options menu, or using loot to take out/put in items
after using ':' to describe the contents of a very full container --
there were some odd interactions with the map.

Only certain parts of the map near/under the menu window would be
redrawn if the first offset menu was followed by another one, while
a getlin prompt would cause the entire map to be redrawn, with parts
intersecting the window being drawn on top of it and obscuring it.
Flushing the display immediately after the docrt call when closing a
full-screen menu seems to fix both these issues.

3 years agofixes3-7-0 typo
PatR [Sat, 12 Feb 2022 13:56:28 +0000 (05:56 -0800)]
fixes3-7-0 typo

Fix misspelling and remove a couple of trailing spaces.

3 years agoShould see rusting next to you if underwater
Pasi Kallinen [Sat, 12 Feb 2022 09:54:47 +0000 (11:54 +0200)]
Should see rusting next to you if underwater

You can see to the adjacent squares, if they're water and you're
underwater - show the item rusting there in that case.

3 years agoUse macro for a location next to hero
Pasi Kallinen [Sat, 12 Feb 2022 09:05:07 +0000 (11:05 +0200)]
Use macro for a location next to hero

3 years agofix gamelog 1st kill vs 1st weapon hit sequencing
PatR [Sat, 12 Feb 2022 00:17:17 +0000 (16:17 -0800)]
fix gamelog 1st kill vs 1st weapon hit sequencing

If the first monster the hero kills is killed by the hero's first hit
with a wielded weapon, report the hit first and kill second instead of
the other way around.  Not as hard to manage as I feared, but bound to
be more fragile than the simpler handling that produced the odd order.

Also while testing it I knocked something into a polymorph trap and it
changed form without any feedback.  Give foo-changes-into-bar message
if the hero is moving and can see it happening.  It isn't needed with
a monster moves deliberately into a polymorph trap but probably would
be useful when that's is unintentional.

The "<hero> enters the dungeon" log message had a trailing period but
other log messages don't have sentence punctuation, so take that off.

3 years agoapple pasteboard
PatR [Fri, 11 Feb 2022 22:43:01 +0000 (14:43 -0800)]
apple pasteboard

Turning on -Wformat-noliteral for Mac triggered a new warning.
Blindly suppressing the warning would have silenced it but would
also have left a real bug in place.  The former format was passing
a string argument to %d format.

This converts the format to a literal with an additional argument
for the non-literal part.  It compiles cleanly but I don't know how
to test it, let alone force an error for it to report.

3 years agomore curses get_count
PatR [Fri, 11 Feb 2022 20:12:35 +0000 (12:12 -0800)]
more curses get_count

A couple of formatting bits I made when investigating cursor
positioning misbehavior for curses menu counts.  No change in
behavior here.

3 years agocurses menu count entry
PatR [Fri, 11 Feb 2022 20:10:20 +0000 (12:10 -0800)]
curses menu count entry

In a curses menu, if you type a digit to start a count, the cursor
jumps to the spot on the screen where the hero is.  Strange and very
noticeable if that spot is covered by the menu, although I didn't
notice it when working on digits as group accelerators (changes for
that didn't trigger this).

Despite the cursor_on_u location, it isn't related to the recent
flush_screen/cursor_on_u changes either.  In 3.6.x, curses used it's
own count entry code.  Early on with to-be-3.7 it was changed to use
the core's get_count(), so uses a different routine to get next input
character.  And the curses edition of that routine deliberately
positions the cursor at the hero's location on the assumption that
it only gets called when the map window is active.

3 years agoMake the "wall of water" stop thrown or kicked items
Pasi Kallinen [Fri, 11 Feb 2022 18:38:29 +0000 (20:38 +0200)]
Make the "wall of water" stop thrown or kicked items

3 years agoDon't show rusting of items landing in water
Pasi Kallinen [Fri, 11 Feb 2022 18:13:20 +0000 (20:13 +0200)]
Don't show rusting of items landing in water

When a thrown item lands in a pool of water, it immediately
rusts - but don't give that message unless the hero is at the same
location and also under the water.  My reasoning: hero can't see items
under water, and by the time the item rusts, it's in the water.

3 years agoGive a sound message when thrown item lands in water or lava
Pasi Kallinen [Fri, 11 Feb 2022 18:05:04 +0000 (20:05 +0200)]
Give a sound message when thrown item lands in water or lava

3 years agocurses: support digits as menu group accelerators
PatR [Fri, 11 Feb 2022 18:04:03 +0000 (10:04 -0800)]
curses: support digits as menu group accelerators

Have curses catch up with tty, X11, and Qt:  if a menu of objects has
any heavy iron balls, their entries can be toggled on or off by using
'0' as a group accelerator.  That's been supported by tty and X11 for
ages and by Qt since yesterday.  This also supports having any digit
as a group accelerator so that the 'O' hack to pick number_pad mode by
typing the digit that matches the value description works (except for
menu entry for mode -1; '5' happens to work for that one but doesn't
match its description).

3 years agoremove unnecessary null checks from christen_monst
nhmall [Fri, 11 Feb 2022 14:08:31 +0000 (09:08 -0500)]
remove unnecessary null checks from christen_monst

Closes #681

3 years agoremove redundant null-check on christen_orc()
SHIRAKATA Kentaro [Tue, 8 Feb 2022 18:17:53 +0000 (03:17 +0900)]
remove redundant null-check on christen_orc()

rndorcname() returns buf2 itself, so orcname is never NULL.

3 years agoQt: support digit chars as menu group accelerators
PatR [Fri, 11 Feb 2022 02:05:50 +0000 (18:05 -0800)]
Qt: support digit chars as menu group accelerators

Have Qt catch up with tty and X11:  in a menu, when not already
entering a count and player types a digit, check whether it is the
group accelerator for any of the menu entries.  If so, toggle their
selection state; if not, begin counting for the next item the player
eventually picks.

3 years agoupdate tested versions of visual studio
nhmall [Thu, 10 Feb 2022 23:58:06 +0000 (18:58 -0500)]
update tested versions of visual studio

3 years agoerror on parse_condition pr #680
nhmall [Thu, 10 Feb 2022 23:18:25 +0000 (18:18 -0500)]
error on parse_condition pr #680

The  while(s[sidx]) { ... was acting as while(1), but the
loop body contained appropriate checks and returns to
function correctly.

Fixes #680

3 years agonumber_pad menu hack
PatR [Thu, 10 Feb 2022 22:18:44 +0000 (14:18 -0800)]
number_pad menu hack

I don't try to toggle 'number_pad' very often, but when I do I almost
always type '0' instead of 'a' for Off or '1' instead of 'b' for On
on the first attempt.  The menu shows
| a -  0 (off)
| b -  1 (on)
| c -  2 (on, MSDOS compatible)
| d -  3 (on, phone-style digit layout)
| e -  4 (on, phone-style layout, MSDOS compatible)
| f - -1 (off, 'z' to move upper-left, 'y' to zap wands)

This change makes '0' through '4' be undocumented group accelerators
for 'a' through 'e' (and '5' for 'f') in the sub-menu put up by 'O'.
tty and X11 worked as-is for '0' and required what amounts to a pair
of one-line changes to handle the other digits.

It doesn't work for curses and Qt (no idea about Windows GUI) because
they insist on treating any typed digit as the start of a count even
if one or more menu entries include that digit as a group accelerator.
(They also fail to support '0' as the group accelerator for iron-ball
class in the menu for multiple-drop.)

3 years agoThis is cron-daily v1-Feb-8-2022. 005manpages updated: recover.txt
nhw_cron [Tue, 8 Feb 2022 17:24:09 +0000 (12:24 -0500)]
This is cron-daily v1-Feb-8-2022.  005manpages updated: recover.txt

3 years agoThis is cron-daily v1-Feb-8-2022. 005manpages updated: nethack.txt
nhw_cron [Tue, 8 Feb 2022 17:24:09 +0000 (12:24 -0500)]
This is cron-daily v1-Feb-8-2022.  005manpages updated: nethack.txt

3 years agoThis is cron-daily v1-Feb-8-2022. 005manpages updated: makedefs.txt
nhw_cron [Tue, 8 Feb 2022 17:24:09 +0000 (12:24 -0500)]
This is cron-daily v1-Feb-8-2022.  005manpages updated: makedefs.txt

3 years agoThis is cron-daily v1-Feb-8-2022. 005manpages updated: dlb.txt
nhw_cron [Tue, 8 Feb 2022 16:24:11 +0000 (11:24 -0500)]
This is cron-daily v1-Feb-8-2022.  005manpages updated: dlb.txt

3 years agoThis is cron-daily v1-Feb-8-2022. 001datesub updated: ./doc/dlb.6
nhw_cron [Tue, 8 Feb 2022 16:24:10 +0000 (11:24 -0500)]
This is cron-daily v1-Feb-8-2022.  001datesub updated: ./doc/dlb.6

3 years agomemory management
PatR [Thu, 10 Feb 2022 20:14:27 +0000 (12:14 -0800)]
memory management

MONITOR_HEAP+heaputil pointed out some unreleased memory.  The livelog
stuff wasn't being freed.  Not surpringly the data used for collecting
and formatting build-options that just got changed from strdup() to
dupstr() wasn't being freed.  And a couple of date/version bits.

3 years agostrdup vs dupstr
PatR [Thu, 10 Feb 2022 18:25:25 +0000 (10:25 -0800)]
strdup vs dupstr

mdlib.c was avoiding alloc() and dupstr() because mdlib.o gets linked
with makedefs and makedefs used to need to avoid those.  But makedefs
doesn't avoid those anymore, so mdlib.c doesn't need to either.

Replace a couple of other strdup() calls in other files too.

3 years agolivelog/chronicle start of game
PatR [Thu, 10 Feb 2022 18:17:34 +0000 (10:17 -0800)]
livelog/chronicle start of game

Add a log entry for the start of a new game.

3 years agocomment out some now dead code
nhmall [Thu, 10 Feb 2022 14:16:29 +0000 (09:16 -0500)]
comment out some now dead code

Closes #670

3 years agologging experience level changes again
PatR [Thu, 10 Feb 2022 13:45:07 +0000 (05:45 -0800)]
logging experience level changes again

The livelog message for losing a level had an off-by-1 error, showing
the level the hero ended up at rather than the level that was lost.

There was a message for regaining a previously lost level when rank
title stayed the same but no such message if the title changed (the
achievement of gaining a particular title only occurs once).

Say "regained" rather than "gained" when gaining a previously lost
level.  (Blessed potions of full healing regain levels but can also
reduce u.ulevelmax so a different way to remember peak experience
level has been added.)

Report level change due to polymorphing into new man/woman/elf/&c.
I hadn't realized that that hasn't been recording achievement for new
rank when applicable and decided to leave things that way.

Report gender change when putting on an amulet of change or becoming
a new man/&c unless hero is polymorphed at the time or experience
level is also changing.

3 years agoMonsters should growl even if you can't hear it
Pasi Kallinen [Thu, 10 Feb 2022 11:41:50 +0000 (13:41 +0200)]
Monsters should growl even if you can't hear it

Call growl even if you are deaf, because growling also
wakes up nearby monsters. Just make growl not show the message
if you can't hear or see the monster.

3 years agoadd comment with some tile palette info
nhmall [Thu, 10 Feb 2022 04:16:48 +0000 (23:16 -0500)]
add comment with some tile palette info

3 years agocursed list vs worn light again
PatR [Thu, 10 Feb 2022 00:38:26 +0000 (16:38 -0800)]
cursed list vs worn light again

Fix a couple of mistakes in commit
 e8341dc9d79dbdc0013a287a9c8dfd627798883b
pointed out by vultur-cadens.  While in read.c, reformat some of the
new livelog stuff.

3 years agolivelog tweaks
PatR [Wed, 9 Feb 2022 22:25:32 +0000 (14:25 -0800)]
livelog tweaks

Log all level gains and loses.  For the existing logging of changes
in rank, mention the level number with the new title.  Classifying
level loss as "minor achievement" seems weird but I didn't see any
choice more appropriate.

Make '#chronicle' autocomplete.  That makes "#ch" ambiguous, but
better to have to type #cha to chat than to have to completely spell
out #chronicle.  (Changing it to #journal would make #j ambigious
but might still be an improvement.)

3 years agopr #675 and pr #676
nhmall [Wed, 9 Feb 2022 21:16:36 +0000 (16:16 -0500)]
pr #675 and pr #676

3 years agoMerge branch 'argrath' into NetHack-3.7
nhmall [Wed, 9 Feb 2022 21:09:37 +0000 (16:09 -0500)]
Merge branch 'argrath' into NetHack-3.7

3 years agoflush_screen() sequencing
PatR [Wed, 9 Feb 2022 21:02:19 +0000 (13:02 -0800)]
flush_screen() sequencing

Call display_nhwindow(WIN_MAP) after curs_on_u().  Instead of calling
it a second time, it's simplest to just update status before updating
the map.

If anything is still leaving the cursor dangling at the end of status
I think it will now dangle at the last updated position on the map.

3 years agoChronicle of major events, and livelog
Pasi Kallinen [Wed, 9 Feb 2022 20:36:19 +0000 (22:36 +0200)]
Chronicle of major events, and livelog

Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.

3 years agoMerge branch 'fix-eat' of https://github.com/argrath/NetHack into argrath
nhmall [Wed, 9 Feb 2022 20:46:31 +0000 (15:46 -0500)]
Merge branch 'fix-eat' of https://github.com/argrath/NetHack into argrath

3 years agoMerge branch 'fix-save' of https://github.com/argrath/NetHack into argrath
nhmall [Wed, 9 Feb 2022 20:45:01 +0000 (15:45 -0500)]
Merge branch 'fix-save' of https://github.com/argrath/NetHack into argrath

3 years agomove null-check on tin_details()
SHIRAKATA Kentaro [Tue, 8 Feb 2022 20:27:21 +0000 (05:27 +0900)]
move null-check on tin_details()

Move null-check of obj and buf before their first use.

3 years agowater description tweaks
PatR [Wed, 9 Feb 2022 19:55:08 +0000 (11:55 -0800)]
water description tweaks

Fix a comment typo and add a couple of extra comments.  The two minor
code changes don't affect behavior but might improve clarity.

3 years agomove null-check on savelev()
SHIRAKATA Kentaro [Tue, 8 Feb 2022 17:39:05 +0000 (02:39 +0900)]
move null-check on savelev()

Move null-check of nhfp before its first use.

3 years agoenhanced water description
PatR [Wed, 9 Feb 2022 12:16:27 +0000 (04:16 -0800)]
enhanced water description

Redo how do_screen_description() handles water.  Mainly by using
waterbody_name() for farlook/quicklook and autodescribe to get
hallucinatory descriptions, but it replaces some old hackery with
quite a bit of new hackery.  Applies to lava and ice too.  The latter
is now "frozen <foo>" when hallucinating, where <foo> has a small
chance to be "water" but will usually be something like "tea" or
"clotted blood".

3 years agotab to spaces follow-up
nhmall [Wed, 9 Feb 2022 10:52:55 +0000 (05:52 -0500)]
tab to spaces follow-up

Also, the commit for 0e9ecb88fbf883350a9feb3c4c616a2e6282d5e3
was missing the issue close directive, so do it here.

Closes #674

3 years agodon't dereference NULL u.ustuck in dobuzz()
nhmall [Wed, 9 Feb 2022 10:47:08 +0000 (05:47 -0500)]
don't dereference NULL u.ustuck in dobuzz()

3 years agotrap magic number follow-up
nhmall [Wed, 9 Feb 2022 00:29:27 +0000 (19:29 -0500)]
trap magic number follow-up

3 years agoreplace some trap function result magic numbers
nhmall [Wed, 9 Feb 2022 00:16:42 +0000 (19:16 -0500)]
replace some trap function result magic numbers

3 years agofix mintrap() return value and resurrect dead code
nhmall [Tue, 8 Feb 2022 22:31:34 +0000 (17:31 -0500)]
fix mintrap() return value and resurrect dead code

fixes #672

3 years agofixes3-7-0.txt updates for pr #669 and pr #671
nhmall [Tue, 8 Feb 2022 21:20:58 +0000 (16:20 -0500)]
fixes3-7-0.txt updates for pr #669 and pr #671

3 years agoMerge branch 'pr671' into NetHack-3.7
nhmall [Tue, 8 Feb 2022 21:10:49 +0000 (16:10 -0500)]
Merge branch 'pr671' into NetHack-3.7

3 years agoMerge branch 'fix-shk' of https://github.com/argrath/NetHack into pr671
nhmall [Tue, 8 Feb 2022 21:09:52 +0000 (16:09 -0500)]
Merge branch 'fix-shk' of https://github.com/argrath/NetHack into pr671

3 years agoAdd null-check on repairable_damage()
SHIRAKATA Kentaro [Tue, 8 Feb 2022 15:17:16 +0000 (00:17 +0900)]
Add null-check on repairable_damage()

Add null-check of dam before its first use.

3 years agowishing for water terrain
PatR [Tue, 8 Feb 2022 19:06:26 +0000 (11:06 -0800)]
wishing for water terrain

Allow a wizard mode wish for "wall of water" to create WATER terrain.
Previously there was no way to do that.  Wishing for "pool" and "moat"
work but "water" for terrain isn't supported because it yields a potion.

3 years agoremove more leading zeroes
nhkeni [Tue, 8 Feb 2022 16:35:44 +0000 (11:35 -0500)]
remove more leading zeroes

3 years agodlb.6: remove leading zero from day-of-month
nhkeni [Tue, 8 Feb 2022 15:31:43 +0000 (10:31 -0500)]
dlb.6: remove leading zero from day-of-month

3 years agoMerge branch 'pr669' into NetHack-3.7
nhmall [Tue, 8 Feb 2022 13:21:34 +0000 (08:21 -0500)]
Merge branch 'pr669' into NetHack-3.7

3 years agoadd null-check on fill_special_room()
SHIRAKATA Kentaro [Tue, 8 Feb 2022 08:20:50 +0000 (17:20 +0900)]
add null-check on fill_special_room()

Add null-check of croom before its first use.

3 years agousing prefixes via their extended command names
PatR [Tue, 8 Feb 2022 00:53:56 +0000 (16:53 -0800)]
using prefixes via their extended command names

Trying to use #reqmenu/#rush/#run/#fight prefixes by their extended
command names didn't work because rhack()'s post-processing was stuck
dealing with the entry for the '#' key after using doextcmd() to run
any command.  Use a static variable (actually a global one since I put
it into struct g) to notify rhack() of the command that ultimately got
executed.

3 years ago<Mon> suddenly appears! vs ^G
PatR [Mon, 7 Feb 2022 23:55:04 +0000 (15:55 -0800)]
<Mon> suddenly appears! vs ^G

For ^G, throttle the monster creation feedback.  Don't say "suddenly"
and don't exclaim the message, just say "<Mon> appears."  Also, use
Norep() so creating lots of similar monsters at once only gives a few
messages (just one unless varied by "next to you" vs "nearby" vs no
qualifier for farther away).  And for mimics created as objects or
furniture, report the sudden appearance of new object or furniture.

3 years agodisallow g/G/F prefix with rush/run commands
PatR [Mon, 7 Feb 2022 22:22:41 +0000 (14:22 -0800)]
disallow g/G/F prefix with rush/run commands

Reject an attempt to specify a conflicting or redundant prefix with
a Ctrl+<move> or Shift+<move> (not numpad) or Alt+<move> (numpad).
'm' prefix is accepted.

3 years agovms bits to c99
nhmall [Thu, 28 Jan 2021 02:15:31 +0000 (21:15 -0500)]
vms bits to c99

3 years agothere was some left-over k&r code in win/chain
nhmall [Mon, 7 Feb 2022 19:58:16 +0000 (14:58 -0500)]
there was some left-over k&r code in win/chain