]> granicus.if.org Git - nethack/log
nethack
6 years agoStill more enums
Pasi Kallinen [Sat, 31 Mar 2018 08:43:38 +0000 (11:43 +0300)]
Still more enums

6 years agoUse more enums
Pasi Kallinen [Sat, 31 Mar 2018 05:57:22 +0000 (08:57 +0300)]
Use more enums

6 years agoSilence yet another warning
Pasi Kallinen [Sat, 31 Mar 2018 04:47:41 +0000 (07:47 +0300)]
Silence yet another warning

6 years agofix #H7015 - explosion chain reaction bug
PatR [Sat, 31 Mar 2018 00:05:23 +0000 (17:05 -0700)]
fix #H7015 - explosion chain reaction bug

The fix to prevent "crushed by a gas spore's explosion" set killer.name
to an empty string after a gas spore explosion finished, but that made
nested explosions end up with empty killer.name after the innermost
call completed.  explode() shouldn't have been hanging on to a pointer
to a global value that is subject to change while it executes.  Making
a local copy of the current value at the time explode() is called will
solve that (I hope...).

Simply reverting the reset of killer.name wouldn't have been correct.
The innermost explosion would still be clobbering killer.name for any
outer MON_EXPLODE explosions in progress.  When the only exploding
monster is gas spore, that wouldn't be noticeable.  But having other
types of exploding monsters and a chain reaction which affected more
than one type would have exposed that bug.  I think this fixes both
aspects of this problem but don't have a second type of exploding
monster to verify the second part.

6 years agoDon't store int into unsigned
Pasi Kallinen [Fri, 30 Mar 2018 17:34:19 +0000 (20:34 +0300)]
Don't store int into unsigned

6 years agoFix some warnings
Pasi Kallinen [Fri, 30 Mar 2018 16:42:46 +0000 (19:42 +0300)]
Fix some warnings

Remove an unused variable, add missing FALLTHRUs, and use the same
FALLTHRU wording where it wasn't recognized by gcc

6 years ago{dgn,lev}_lex.c - suppress yyunput() complaint
PatR [Tue, 27 Mar 2018 23:34:47 +0000 (16:34 -0700)]
{dgn,lev}_lex.c - suppress yyunput() complaint

When dgn_comp.l and lev_comp.l are processed by older versions of
flex, 'gcc -Wunused' complains when compiling dgn_lex.c and lev_lex.c
because flex creates 'static void yyunput()' and nethack doesn't use
it.  Newer versions honor macro YY_NO_UNPUT to hide the offending
code, but that doesn't help with older versions (like the one
masquerading as 'lex' on OSX).  Adding a dummy usage would probably
cause problems with other lexers, so change it from static to
'void yyunput()' as a 'sed' fixup in util/Makefile after flex has
finished.  That will be a no-op when yyunput doesn't exist or isn't
static.

In addition to the sys/unix/Makefile.utl change, this checks in new
sys/share/{dgn,lev}_lex.c with the fixup in place.

6 years agoSupport EDIT_GETLIN for win32
Pasi Kallinen [Tue, 27 Mar 2018 17:22:34 +0000 (20:22 +0300)]
Support EDIT_GETLIN for win32

... but only without popup_dialog

6 years agoCompile-time option to allow some prompts remember the input
Pasi Kallinen [Mon, 26 Mar 2018 19:58:28 +0000 (22:58 +0300)]
Compile-time option to allow some prompts remember the input

Define EDIT_GETLIN to make the tty, X11, and Qt4 windowports to
remember the input strings for wishing and annotation.

6 years agoCleaver tidbit
PatR [Thu, 22 Mar 2018 02:12:51 +0000 (19:12 -0700)]
Cleaver tidbit

Fix a comment typo.  While in there, change the cleave attack to
swing counter-clockwise the very first time instead of setting up
for that but then toggling to the opposite direction before the
actual attack.  Also, refactor a bit of common code for choosing
< xdir[], ydir[] > index for next target.

6 years agoFix X11 segfault when quitting without dumplogfile defined
Pasi Kallinen [Tue, 20 Mar 2018 15:34:49 +0000 (17:34 +0200)]
Fix X11 segfault when quitting without dumplogfile defined

Guard dumplog-specific output by checking we actually are putting
the output into the dumplog.

This is a post-3.6.0 bug.

6 years agowishing for containers
PatR [Tue, 20 Mar 2018 00:59:24 +0000 (17:59 -0700)]
wishing for containers

Noticed while investigating the broken chest whose lock was already
broken:  wishing for locked, unlocked, or broken chest (or large box)
was treated as asking for something unknown.  Add support for those
three prefixes, although they only have meaning for chest and box.
If more that one is specified in the same wish, whichever one comes
last overrides the others.

Also, "empty" was already an accepted prefix (for tins); honor it for
containers too.

Lastly, wishing for "box" failed.  Give a large box instead.  I went
back and forth about whether to do the same for "small box" and ended
up not including it, but turns out that small/medium/large prefix for
globs ends up making "small box" and "medium box" match "box" which
has now become a synonym for "large box".  I'm not sure whether that
is a bonus or a bug; small box is clearly not the same thing as large
box, but getting the only available box when asking for any box seems
better than claiming not to understand the request.

6 years agofix #H6960 - redundant feedback for '#force'
PatR [Mon, 19 Mar 2018 22:48:46 +0000 (15:48 -0700)]
fix #H6960 - redundant feedback for '#force'

When using #force at a spot which has a broken or unlocked chest (or
large box) whose lock state has been previously discovered, avoid
|There is a broken chest here, but its lock is already broken.
|There is an unlocked chest here, but its lock is already unlocked.
by suppressing "broken"/"unlocked" from the chest description for
that particular message.

We might still want to change "broken chest" to "damaged chest" but
I don't think there should be any reference to its lock as the reason
it's broken or damaged.  The fact that #loot, #force, and applying a
key still treat it as a container is sufficient to reveal that it
functions as one.

6 years agorevert box naming
nhmall [Mon, 19 Mar 2018 11:13:07 +0000 (07:13 -0400)]
revert box naming

6 years agoTypofix
Pasi Kallinen [Mon, 19 Mar 2018 06:22:14 +0000 (08:22 +0200)]
Typofix

6 years agowin32-gui: fix truncated status fields call to get dimensions of the text bounding...
Alex Kompel [Mon, 19 Mar 2018 04:57:38 +0000 (21:57 -0700)]
win32-gui: fix truncated status fields call to get dimensions of the text bounding rectangle needs to be made after the font is set in order to get the accurate reading

6 years agowin32-gui: Do not auto-assign non-alphabet accelerator characters to menu items....
Alex Kompel [Sun, 18 Mar 2018 19:52:30 +0000 (12:52 -0700)]
win32-gui: Do not auto-assign non-alphabet accelerator characters to menu items. Picking up pile that contains gold forces accelerators to start with $ so the next one becomes %, ...

6 years agomissed one, transcription error
nhmall [Sun, 18 Mar 2018 14:29:45 +0000 (10:29 -0400)]
missed one, transcription error

6 years agomisplacement
nhmall [Sun, 18 Mar 2018 14:11:51 +0000 (10:11 -0400)]
misplacement

6 years agoremove a couple where normal man->men rules should apply
nhmall [Sun, 18 Mar 2018 14:09:45 +0000 (10:09 -0400)]
remove a couple where normal man->men rules should apply

6 years agoanother dictionary consulted, another couple of prefixes
nhmall [Sun, 18 Mar 2018 13:54:18 +0000 (09:54 -0400)]
another dictionary consulted, another couple of prefixes

6 years agojust a couple of additional pluralization bits
nhmall [Sun, 18 Mar 2018 13:24:38 +0000 (09:24 -0400)]
just a couple of additional pluralization bits

6 years ago3rd time fixes36.1
nhmall [Sun, 18 Mar 2018 13:09:08 +0000 (09:09 -0400)]
3rd time fixes36.1

6 years agotypo in fixes36.1
nhmall [Sun, 18 Mar 2018 12:52:34 +0000 (08:52 -0400)]
typo in fixes36.1

locks -> lock

6 years agomore message adjustments to chests with broken locks
nhmall [Sun, 18 Mar 2018 12:49:25 +0000 (08:49 -0400)]
more message adjustments to chests with broken locks

6 years agobroken large box wording change
nhmall [Sun, 18 Mar 2018 03:05:52 +0000 (23:05 -0400)]
broken large box wording change

> When you try to #force a large box or chest whose lock is already broken from a
> previous #force, the game tells you "There is a broken large box here, but its
> lock is already broken." It's minor, but this implies that the box being broken
> is separate from the lock being broken (as well as that the box itself *can* be
> broken).

change the wording to "lock-damaged box" and suppress
", but its lock is aleady broken" when "lock-damaged box" has
already been displayed.

(Nobody particularly likes the wording "lock-damaged box" either, but at least
it seems less misleading)

6 years agomore plural refinement
nhmall [Sat, 17 Mar 2018 02:34:13 +0000 (22:34 -0400)]
more plural refinement

6 years agosys/unix/gitinfo.sh
PatR [Fri, 16 Mar 2018 07:39:05 +0000 (00:39 -0700)]
sys/unix/gitinfo.sh

Avoid '[[ ... ]]' to cater to a more rudimentary shell.

6 years agoox tweak
nhmall [Fri, 16 Mar 2018 02:19:28 +0000 (22:19 -0400)]
ox tweak

6 years agomore pluralization bits
nhmall [Fri, 16 Mar 2018 02:02:41 +0000 (22:02 -0400)]
more pluralization bits

Handle more *man and *men cases.

Some plural usage of completely made up fruit names that should
be entered in singular form but have what appears to be a
valid plural name it will end up singularized. Not much
we can do about that for ficticious words.

For instance, if you try to name your fruit bigmen or snakemen
and you intended that to be the singular name, NetHack will likely
singularize it to bigman or snakeman.

Many real dictionary words that end in "men", however, should
be handled a wee bit better now. A real word such as stamen,
for example.

6 years agofix plural of box
PatR [Thu, 15 Mar 2018 20:05:08 +0000 (13:05 -0700)]
fix plural of box

"boxen" may be hacker slang for plural of "box", but "foxen" is
definitely not the plural of "fox".  Restrict the "ox"->"oxen"
entry to full word "ox", not "*ox" suffix.

6 years agoMake graves white
Pasi Kallinen [Thu, 15 Mar 2018 16:42:22 +0000 (18:42 +0200)]
Make graves white

Making them easy to distinguish from walls.

6 years agoAttempting to open down or at yourself is same as #loot
Pasi Kallinen [Wed, 14 Mar 2018 18:06:35 +0000 (20:06 +0200)]
Attempting to open down or at yourself is same as #loot

Trying to open at the same location as you did nothing,
make it loot instead. Apparently #looting is also annoying
when using vi-keys.

Based on code by aosdict

6 years agoFix the filename in qt4 hints file
Pasi Kallinen [Wed, 14 Mar 2018 17:02:07 +0000 (19:02 +0200)]
Fix the filename in qt4 hints file

6 years agoUpdate Files
Pasi Kallinen [Wed, 14 Mar 2018 16:44:24 +0000 (18:44 +0200)]
Update Files

I don't know how the automatic Files update should work,
so adding the Qt4 files manually.

6 years agoprevent pline() segfault
PatR [Tue, 13 Mar 2018 18:27:04 +0000 (11:27 -0700)]
prevent pline() segfault

The use of debugpline() in tty_curs() got me wondering what would
happen if debugpline() was called while pline() is in progress.  I
don't know how to trigger the bad coordinate situation, so I put an
unconditional debugpline() in the NHW_MESSAGE case of tty_putstr()
and used DEBUGFILES=wintty.c to enable it.  Instant segfault, and
the backtrace was short and not useful so the stack might have been
clobbered.  I didn't spend any time trying to figure where or why
the segfault occurred.

Change pline() so that if it is called while the previous pline()
hasn't finished yet (ie, recursively), use raw_print() and return
early.  The raw_print message isn't very useful--it pops up wherever
the cursor happens to be, just like the cursor position bug that has
been an issue recently--but does get delivered without any segualt
and isn't completely useless if DUMPLOG is enabled and you save or
quit before the message buffer gets recycled.  Message readability
situation could be improved but avoiding the segfault was my goal.

Putting any debugpline() into *_raw_print() would be inadvisable....

6 years agowindows spotless bit
nhmall [Mon, 12 Mar 2018 12:47:37 +0000 (08:47 -0400)]
windows spotless bit

6 years agofix an out of range issue on WIN32 tty
nhmall [Mon, 12 Mar 2018 03:38:00 +0000 (23:38 -0400)]
fix an out of range issue on WIN32 tty

6 years agoensure tty_curs() behaves the same whether DEBUG defined or not
nhmall [Mon, 12 Mar 2018 03:29:06 +0000 (23:29 -0400)]
ensure tty_curs() behaves the same whether DEBUG defined or not

ensure tty_curs() behaves the same whether DEBUG defined or not
when it comes to positioning the cursor.

The return statement, in the debug case only, was preventing
the cursor from being moved following a range check, so the
next output was written whereever the cursor happened to be
previously.

The messaging that detects the failed range check will get
written in the DEBUG defined case hopefully allowing resolution
to the range check failure, but now the cmov will still
be attempted just as it is in the case where DEBUG is not
defined.

6 years agofix #H6955 - wielded potion 'object lost' panic
PatR [Sun, 11 Mar 2018 19:39:01 +0000 (12:39 -0700)]
fix #H6955 - wielded potion 'object lost' panic

Report classified this as 'segfault' but it's actually a controlled
panic().  When hero has lycanthropy and is wielding a potion of unholy
water while in human form, if that potion is boiled then it triggers
a transformation to beast form which in turn causes wielded weapon to
be dropped.  When the code unwinds back up through potionbreathe() to
destroy_item(), the boiled potion won't be found in inventory any more
and useup() -> useupall() -> freeinv() -> extract_nobj() panics.

6 years agolast gitinfo bit?
PatR [Sat, 10 Mar 2018 20:55:28 +0000 (12:55 -0800)]
last gitinfo bit?

If dat/gitinfo.txt is being created from scratch, say so instead of
saying "updated".

6 years agomore Unix gitinfo
PatR [Sat, 10 Mar 2018 20:32:52 +0000 (12:32 -0800)]
more Unix gitinfo

When make uses 'makedefs -v' to create date.h, force it to create
gitinfo.txt all the time instead of just when that doesn't already
exist.  Use 'make GITINFO=0' to get the previous behavior.

To skip it entirely, you need to do that and also make sure that
some file by that name already exists.  'touch dat/gitinfo.txt' or
perhaps 'echo "#no git" > dat/gitinfo.txt' would suffice.

6 years agoFix WINCHAIN compilation
Pasi Kallinen [Sat, 10 Mar 2018 19:48:22 +0000 (21:48 +0200)]
Fix WINCHAIN compilation

6 years agoH5239 not hypocrisy to speed up your own pet
nhmall [Sat, 10 Mar 2018 18:17:21 +0000 (13:17 -0500)]
H5239 not hypocrisy to speed up your own pet

H5239 1100

6 years agopluralization special case tweak
nhmall [Sat, 10 Mar 2018 16:28:01 +0000 (11:28 -0500)]
pluralization special case tweak

mongoose -> mongooses, not mongeese

6 years agopluralization bits
nhmall [Sat, 10 Mar 2018 15:43:34 +0000 (10:43 -0500)]
pluralization bits

6 years agomplayer valkyries w/ Mjollnir
PatR [Fri, 9 Mar 2018 22:11:04 +0000 (14:11 -0800)]
mplayer valkyries w/ Mjollnir

If an mplayer Valkyrie on the Astral Plane is given a war hammer,
give her gauntlets of power instead of random gloves since that will
either be Mjollnir or a very wimpy endgame weapon.  (Maybe someday
mplayer Valkyrie's will be able to throw Mjollnir; their chance of
having it on the Astral Plane is moderately high if it hasn't already
been created prior to arriving there.)

I also gave monsters wearing gauntlets of power a 3..6 damage bonus
for hand-to-hand.  While making that change, I noticed that monsters
wielding a scalpel or tsurugi wouldn't split puddings, unlike the
hero (a post-3.6.0 change), so fix that.

6 years agoFiles update
PatR [Thu, 8 Mar 2018 18:26:08 +0000 (10:26 -0800)]
Files update

I'm not sure of the status for possibly maintaining 'Files' via
automation, so manually add the new file 'gitinfo.sh' to sys/unix.
There was a sys/unix/hints file that wasn't listed, so add linux-qt4.
The whole win/Qt4 subdirectory is missing though.  I don't even
remember that being added.

6 years agonhversioning update
PatR [Wed, 7 Mar 2018 01:16:49 +0000 (17:16 -0800)]
nhversioning update

Update dat/gitinfo.txt if the current branch is different from the
one recorded in the file, not just when the commit hash is different.

Make the usual output less verbose so that it fits within 80 columns.

6 years agostuck_in_wall tweak
PatR [Mon, 5 Mar 2018 20:26:44 +0000 (12:26 -0800)]
stuck_in_wall tweak

When divine aid granted temporary Passes_walls ability to stuck hero,
it was giving 4d4 turns (4..16, avg 10).  But the first warning that
it's timing out is given at 4 turns left so wouldn't be seen if the
random amount of time picked was the minimum.  Switch to 4d4+4 (8..20,
avg 14) so that the message at 4 turns left will always happen.

6 years agoremoving a monster from current level
PatR [Mon, 5 Mar 2018 20:01:31 +0000 (12:01 -0800)]
removing a monster from current level

I ended up not using this, but it might as well be included for
potential future use.  Extend mlevel_tele_trap() to support forcing
a monster off the current level to make room either for the hero or
some other monster.  goto_level() does something similar when the
hero is arriving on a level.  This is for situations where the hero
is already there (such as divine aid attempting to fix STUCK_IN_WALL).

mlevel_tele_trap(mon, (struct trap *) 0) will usually move 'mon' off
the level, scheduled to migrate back if the hero leaves the level and
subsequently returns.  'Usually' because it doesn't work in endgame
and certain monsters are excluded regardless of dungeon location, so
caller has to be prepared to try to move another monster (or resort
to goto_level()'s unconditional forced migration).

6 years agoFix garbage value warning
Pasi Kallinen [Mon, 5 Mar 2018 19:09:15 +0000 (21:09 +0200)]
Fix garbage value warning

6 years agogitinfo.txt on Unix
PatR [Sun, 4 Mar 2018 22:17:13 +0000 (14:17 -0800)]
gitinfo.txt on Unix

Hide the scary perl command during 'make all' feedback in src/.
I'm not a shell programmer but this works fine for me when skipping
NHgithook::NHversioning because dat/gitinfo.txt is already present,
when creating dat/gitinfo.txt successfully, and when creation fails
because perl can't find NHgithook.pm.  It hasn't been tested when
perl itself is absent.

6 years agomore nmake spotless
nhmall [Sun, 4 Mar 2018 15:37:43 +0000 (10:37 -0500)]
more nmake spotless

6 years agomsc makefiles update timestamp on copied files
nhmall [Sun, 4 Mar 2018 15:30:17 +0000 (10:30 -0500)]
msc makefiles update timestamp on copied files

6 years agomsc Makefile
nhmall [Sun, 4 Mar 2018 15:25:11 +0000 (10:25 -0500)]
msc Makefile

6 years agoupdate nmake spotless for windows
nhmall [Sun, 4 Mar 2018 15:09:35 +0000 (10:09 -0500)]
update nmake spotless for windows

6 years agomore msc makefile tweaks
nhmall [Sun, 4 Mar 2018 14:54:29 +0000 (09:54 -0500)]
more msc makefile tweaks

6 years agowindows cmdline dependency bit
nhmall [Sun, 4 Mar 2018 14:11:01 +0000 (09:11 -0500)]
windows cmdline dependency bit

6 years agowindows cmdline Makefile
nhmall [Sun, 4 Mar 2018 14:07:16 +0000 (09:07 -0500)]
windows cmdline Makefile

6 years agofix prayer infinite loop
PatR [Sun, 4 Mar 2018 00:46:39 +0000 (16:46 -0800)]
fix prayer infinite loop

Reported internally, if a prayer resulted in 'fix all troubles' and
one of those was TROUBLE_STUCK_IN_WALL but safe_teleds() couldn't find
any place to relocate the hero to, nothing was done and STUCK_IN_WALL
would be found again as the next trouble to fix.  Since safe_teleds()
eventually resorts to trying every single spot on the map, there was
no other result possible than failing to find an available spot again,
nothing would be done, and next trouble would be STUCK_IN_WALL, ad
naseum.

I started out with a fix that looked for secret corridors to expose
and doors to open, to make more space available, then try to move a
monster off the level, then try digging out rock and/or walls and
smashing boulders.  None of those guarantee success and I got bogged
down by the digging case.  This was going to be a last resort if all
of those still failed to make somewhere to move the hero, but for now,
at least, I'm skipping all that other stuff and going directly to the
last resort:  give the hero Passes_walls ability for a short time, and
let him or her find own way out of trouble.  The next trouble to fix
won't be STUCK_IN_WALL because Passes_walls makes that a non-issue.

I'm not thrilled with the new messages involved but want to get this
behind me.

6 years agoburied_ball()
PatR [Sat, 3 Mar 2018 23:26:49 +0000 (15:26 -0800)]
buried_ball()

Noticed when I was looking at float_up()/float_down() vs being trapped.
(I have a substantial patch for that but it involves infrastructure
changes so will have to go into master instead of the 3.6.0 branch.)
buried_ball() was using nested loops as a very convoluted way to test
  if (otmp->ox >= cc->x - 2 && otmp->ox <= cc->x + 2
   && otmp->oy >= cc->y - 2 && otmp->oy <= cc->y + 2)
I think this revised version is closer to what was intended.

There are issues.  buried_ball() finds the buried iron ball nearest to
the specified location--which is always the hero's current location--
rather than the one which was 'uball' before being buried.  A player
can spot that since iron balls aren't necessarily identical.  Also, it
searches within a radius of two steps but a tethered hero is only
allowed to move one step away from buried ball, so something is off.

6 years agoaklys tweaks
PatR [Sat, 3 Mar 2018 18:54:43 +0000 (10:54 -0800)]
aklys tweaks

It turns out that Mjollnir before the recent aklys enhancement and
aklys since then would end up both wielded and quivered if it returned
to thrower's hand while quiver was empty.  Remove it from quiver before
restoring it to hand.

Limit the throwing range of an aklys if it is expected to return (ie,
thrown while wielded as primary) since it is a "thonged club" which is
supposedly attached by a cord to the thrower's wrist or hand.  I have
no idea how long a real cord like that might be.  I set the range limit
to BOLT_LIM/2.  Shorter makes throw-and-return uninteresting for an
item that needs to be wielded to throw--so would probably be swapped
back and forth with a stronger melee weapon or longer range missile
weapon--and longer seems absurd.

6 years agoenable USE_WIN_IOCTL code unless explicitly avoided
nhmall [Sat, 3 Mar 2018 17:58:53 +0000 (12:58 -0500)]
enable USE_WIN_IOCTL code unless explicitly avoided

 Changes to be committed:
modified:   doc/fixes36.1
modified:   include/unixconf.h
modified:   sys/share/ioctl.c

github pull request #19 made reference to resulting code behaviour
being better when windows were resized when USE_WIN_IOCTL was defined.

The logic for including the necessary enabling code in the build in
sys/share/ioctl.c was an explicit "opt-in" strategy, so anything not
deliberately and explicitly listed was not able to take advantae
of the potentially useful code. The need to add #defines to that
list would have been perpetual as new platforms came online, and
unnecessarily restrictive for everything else.

This switches the logic to include the code by default now,
and thus
unless there is an explicit "opt-out" by uncommenting
AVOID_WIN_IOCTL in include/unixconf.h

Some platforms, and we have no way of knowing which ones, may have
to ensure that AVOID_WIN_IOCTL is #define'd.

6 years agotypo missing word
nhmall [Sat, 3 Mar 2018 15:24:26 +0000 (10:24 -0500)]
typo missing word

6 years agointerim dungeoneer, README update
nhmall [Sat, 3 Mar 2018 15:19:47 +0000 (10:19 -0500)]
interim dungeoneer, README update

6 years agoMake spotless should remove qt4 specific files
Pasi Kallinen [Sat, 3 Mar 2018 14:58:07 +0000 (16:58 +0200)]
Make spotless should remove qt4 specific files

6 years agoAdd catch-all database entry for the polearms
Pasi Kallinen [Sat, 3 Mar 2018 14:15:12 +0000 (16:15 +0200)]
Add catch-all database entry for the polearms

6 years agoCleaver update
PatR [Sat, 3 Mar 2018 02:19:23 +0000 (18:19 -0800)]
Cleaver update

I worked on this a while back but didn't commit it because I couldn't
figure out the dead monster which wouldn't die.  Pasi beat me to that.

Clean up the Cleaver code some and make the three-target swing alternate
between counter-clockwise and clockwise to simulate normal right-to-left
swing followed by left-to-right backswing.  (Alternation happens on each
swing regardless of whether it is consecutive with the most recent one.
That's suboptimal but easy....)  Also, stop three-target attack early if
hero is life-saved after being killed by a passive counter-attack from
the first or second target.

Prevent rogue backstab and two-hander breaking foes' weapons when using
Cleaver hand-to-hand because getting more than one of either of those
bonuses at a time would be excessive.  I think allowing those for the
primary target but not for the two adjacent ones would be better, but I
just thought of that and am not going back for another round of revising.

This doesn't incorporate the two pull requests:  one to avoid hitting
tame or peaceful adjacent targets unless the primary was also tame or
peaceful, the other to avoid hitting unseen adjacent targets.  I'm not
sure if that includes remembered-unseen 'I' on the spot or no monster
shown at all.  (There's a third one about updating the map but it isn't
needed for the existing Cleaver code either before or after this patch.)
I'm in favor of the first one and am not sure about the second.  My
original concern was that someone could use Cleaver to find/hit three
unknown monsters at a time via 'F' prefix, but forcefight aimed at
thin air doesn't reach the Cleaver code so that can't happen, nor can
attacking two known close monsters at once by targetting an empty spot
between them.

6 years agodate bit
nhmall [Fri, 2 Mar 2018 20:35:07 +0000 (15:35 -0500)]
date bit

6 years agofixes typo bit, pt3
Pasi Kallinen [Fri, 2 Mar 2018 14:56:18 +0000 (16:56 +0200)]
fixes typo bit, pt3

6 years agofixes typo bit, pt2
Pasi Kallinen [Fri, 2 Mar 2018 14:38:52 +0000 (16:38 +0200)]
fixes typo bit, pt2

6 years agofixes typo bit
Pasi Kallinen [Fri, 2 Mar 2018 14:32:29 +0000 (16:32 +0200)]
fixes typo bit

6 years agoFix Cleaving giving dmonsfree warning
Pasi Kallinen [Fri, 2 Mar 2018 13:49:45 +0000 (15:49 +0200)]
Fix Cleaving giving dmonsfree warning

Due to inverted logic, hitting a blue jelly with the Cleaver could cause
a dmonsfree warning - the jelly would die, but then come back to life
via the passive attack.  This is a post-3.6.0 bug

6 years agoFix comment typo
Pasi Kallinen [Wed, 28 Feb 2018 07:17:06 +0000 (09:17 +0200)]
Fix comment typo

6 years agoMjollnir bit
PatR [Tue, 27 Feb 2018 17:28:15 +0000 (09:28 -0800)]
Mjollnir bit

Ue the same object name formatting for the new "Mjollnir fails to
return" message as is used for most of the other throwing messages.

6 years agothrow-and-return for aklys
PatR [Mon, 26 Feb 2018 19:18:29 +0000 (11:18 -0800)]
throw-and-return for aklys

The comment I added to data.base--to explain that despite what the
short description says, an aklys wouldn't return to sender after being
thrown--was bugging me, so I've made aklyses behave like Mjollnir.
If thrown when wielded as primary weapon, it will usually return and
usually be re-wielded.  I also added a new message when either thrown
Mjollnir or thrown aklys is expected to return and fails to do so.

Most of the diff to dothrow.c is a change in indentation level.  The
amount of code needed was quite small.

Autopickup for thrown Mjollnir which had failed to return was putting
it into the quiver slot if that was empty.  Note quite an outright bug,
but it started wielded and can't be thrown if quivered, so exclude it
from the stuff that will auto-fill the quiver slot when added to invent
(post-3.6.0 issue).

6 years agofix #H4997 - "Congratulations" -> "Well done"
PatR [Mon, 26 Feb 2018 16:35:33 +0000 (08:35 -0800)]
fix #H4997 - "Congratulations" -> "Well done"

Reported suggested that "congratulations" was too modern for use by
your god during ascension and that the longer phrases which were
shortened to yield it were too modest for the god to use.  Make the
suggested change.

6 years agoMerge githash
keni [Mon, 26 Feb 2018 14:03:12 +0000 (09:03 -0500)]
Merge githash

6 years agofinal msdos bit un-revert a reversion
nhmall [Sun, 25 Feb 2018 23:15:28 +0000 (18:15 -0500)]
final msdos bit un-revert a reversion

6 years agofixes36.1 catch-up bit for deaf whistling
nhmall [Sun, 25 Feb 2018 22:52:33 +0000 (17:52 -0500)]
fixes36.1 catch-up bit for deaf whistling

6 years agoBug 734 - #H4611: Whistling while deaf
nhmall [Sun, 25 Feb 2018 22:42:31 +0000 (17:42 -0500)]
Bug 734 - #H4611: Whistling while deaf

fixed

6 years agomsdos Makefile update for posix regex
nhmall [Sun, 25 Feb 2018 21:28:46 +0000 (16:28 -0500)]
msdos Makefile update for posix regex

6 years agoupdate msdos header
nhmall [Sun, 25 Feb 2018 20:15:10 +0000 (15:15 -0500)]
update msdos header

6 years agoupdate msdos Makefile so at least possible to build
nhmall [Sun, 25 Feb 2018 20:09:56 +0000 (15:09 -0500)]
update msdos Makefile so at least possible to build

6 years agoresolve part of H4422 related to .exe versions
nhmall [Sun, 25 Feb 2018 17:20:50 +0000 (12:20 -0500)]
resolve part of H4422 related to .exe versions

I also saw
 that looking at the details of both windows .exes that they indicate file
 version 3.5.0.0. Shouldn't it be 3.6.0.0 for the NH version 3.6.0

6 years agoanother msdos bit
nhmall [Sun, 25 Feb 2018 04:32:54 +0000 (23:32 -0500)]
another msdos bit

6 years agofix some msdos build errors
nhmall [Sun, 25 Feb 2018 04:26:25 +0000 (23:26 -0500)]
fix some msdos build errors

6 years agofix #H6861 - whatis behaves weirdly with plurals
PatR [Sun, 25 Feb 2018 03:35:56 +0000 (19:35 -0800)]
fix #H6861 - whatis behaves weirdly with plurals

Report indicated that looking up "more info?" for "kittens" would show
the data.base entry for "kitten" and then when the display window was
dismissed, another "--More--" prompt for a empty second display window
would occur.  Looking up "2 arrows" from a closely-seen object on the
map behaved similarly.  User correctly diagnosed that the two-pass
lookup left the 'found_in_file' flag set from the first pass during
the second but that just clearing that resulted in "I have no info
about such things" on the second pass.  The code is on the convoluted
side and needed an extra flag to handle 'seen on first pass' in
addition to clearing found flag after the first pass.  I also added a
check to skip the second display if primary and secondary keys don't
match each other but both find the same entry.  To test it, I tried
"a +0 aklys named aclys".  That found the aclys entry but failed to
find "+0 aklys", so I added another change to have the key massaging
remove +/-N after removing "a", "an", or "the".

If "Want to see more info \"" + lookup string + "\"?" was too long,
the prompt buffer passed to yn() was being left uninitialized.  Also,
test for too long was based on BUFSZ but yn() complains (to paniclog)
if the prompt is longer than QBUFSZ.  Make checkfile() construct a
truncated prompt if the lookup string is too long.

I untangled some spaghetti by making all the 'goto's be forward.  It
didn't help a lot but did simplify a few early returns by having them
jump to a common exit instead of replicating the file close.

6 years agoUpdate docs, man page.
keni [Wed, 21 Feb 2018 15:58:31 +0000 (10:58 -0500)]
Update docs, man page.
Add last chance attempt to build dat/gitinfo.txt

6 years agoa documentation bit
nhmall [Wed, 21 Feb 2018 02:08:44 +0000 (21:08 -0500)]
a documentation bit

6 years agogitinfo.pl: special case code to allow running it from $TOP or DEVEL without
keni [Fri, 9 Feb 2018 16:48:04 +0000 (11:48 -0500)]
gitinfo.pl: special case code to allow running it from $TOP or DEVEL without
 installing the hooks first
NHgithook.pm: add some warnings if nhversioning can't open files
make sure nhversioning fails before opening gitinfo.txt if it can't get valid
 data

6 years agoIncorporate some git information into NetHack
nhmall [Mon, 29 Jan 2018 03:54:08 +0000 (22:54 -0500)]
Incorporate some git information into NetHack

Incorporate some git information into NetHack so that it
is potentially visible to a player. That's useful when
collecting details about the version that they are
running and, if the gitinfo is present, it can tie the
code to a specific git commit in the repository.

This modifies 'makedefs -v' to check for the presence of a data file
called dat/gitinfo.txt and if it is there, parse out its
contents, then write additional lines to include/date.h beyond
what 'makedefs -v' was previously putting in there, similar to
this sample:

      #define NETHACK_GIT_SHA "0c84e564c78e2024e562d39539376ce2e21eec8e"
      #define NETHACK_GIT_BRANCH "NetHack-3.6.0"

The contents of an appropriate dat/gitinfo.txt are as follows,
and trailing/leading whitespace is not significant:

      githash = 0c84e564c78e2024e562d39539376ce2e21eec8e
      gitbranch = NetHack-3.6.0

It also adjusts the contents of the 'v' version information to
include the additional git info when available.

Also adds some hooks DEVEL/hooksdir and a perl file to DEVEL
for simplifying and automating the deposit of dat/gitinfo.txt
so that it generally reflects the most current git commit.

DEVEL/gitinfo.pl can be used to build dat/gitinfo.txt at any
time without doing a commit, merge, or checkout.
     perl DEVEL/gitinfo.pl

command line --version and -version support

To complement the extra information being provided in the
version by the 'v' command, this also adds support for the
following new command line arguments:
    --version
     -version            Output the NetHack version string then exit.

    --version:paste      Output the NetHack version string and also copy it to
     -version:paste      the platform's paste buffer for insertion somewhere,
                         then exit.

If the paste variation of -version is requested on a platform that
hasn't incorporated any support for the capability, it will deliver
the version info then an error message, prior to exiting.

To support the extended -version:paste variation, a port needs to:
    - provide a port-specific routine to perform
      the paste buffer copy in a port code file.
    - #define RUNTIME_PASTEBUF_SUPPORT in the include/portconf.h header file.

    --skeleton--
    void port_insert_pastebuf(buf)
    char *buf;
    {
     /* insert code to copy the version info from buf into
        platform's paste buffer in a supported way */
    }

macosx and Windows have both added support for RUNTIME_PASTEBUF_SUPPORT

6 years agoswitch docall() to safe_qbuf()
PatR [Fri, 23 Feb 2018 21:07:49 +0000 (13:07 -0800)]
switch docall() to safe_qbuf()

Simplify docall() for object types.  Adds some different complexity to
a new routine so the overall simplification is rather minimal, but we
already have a routine to construct prompt buffers involving formatted
object names without allowing overflow, so use it.

tty getlin() limits the input to COLNO characters, so 80 by default.
To get potential QBUFSZ overflow, I had to increase COLNO in global.h
and rebuild from scratch.  A value greater than 127 triggers a lot of
warnings.  I didn't try 127.  126 gets one warning, involving use of
FARAWAY (defined as COLNO+2) in dogmove.c.

We should change things to limit object names to much less than 80,
but this doesn't attempt to implement that.

6 years agofix "wonky secret door" in Cav quest
PatR [Fri, 23 Feb 2018 15:25:37 +0000 (07:25 -0800)]
fix "wonky secret door" in Cav quest

The earlier fix for hoizontal vs vertical doors would have worked for
the Cav quest (lower left in leader's chamber) where door handling
occurs before wallification, but it wasn't working for minend-3 (east
wall of entry room) which already had walls.  The more recent fix
solved the second case but broke the first one.  I think this actually
solves both modes of door classification.  I hope....

6 years agofix #6870 - clairvoyance feedback
PatR [Thu, 22 Feb 2018 06:44:15 +0000 (22:44 -0800)]
fix #6870 - clairvoyance feedback

Forwarded to the contact form from a github "issue":  in some
circumtances clairvoyance lets you move the cursor around to examine
the revealed map, and when doing so starts with "for instructions
type '?'".  When extended clairvoyance periodically kicks in, as
opposed to explicitly casting the spell, there wasn't sufficient
context to figure out what it was prompting for (unless you actually
answer '?' to get instructions).  Depending upon the most recent
message, it could seem like quite a strange prompt.  Explicitly give
a clairvoyance-specific message prior to that.

Also, the getpos() help was including suggestions for targetting
monsters that aren't appropriate when it's being used for detection.

do_name.c has had quite a bit of formatting rot slip in since 3.6.0.
This fixes up the stuff I spotted by manual inspection.

6 years agopline() -> raw_print() -> dumplog()
PatR [Wed, 21 Feb 2018 03:32:47 +0000 (19:32 -0800)]
pline() -> raw_print() -> dumplog()

Reorder some code in pline() so that early pline messages which use
raw_print() instead of putstr(WIN_MESSAGE) are included in the DUMPLOG
message buffer.  If the game ends soon enough they'll be shown in the
final log; otherwise they'll get pushed out of the buffer once enough
later messages are delivered.

6 years agoMerge branch 'NetHack-3.6.0' into NetHack-3.6.0
Alex Smith [Tue, 20 Feb 2018 21:55:31 +0000 (21:55 +0000)]
Merge branch 'NetHack-3.6.0' into NetHack-3.6.0

6 years agoWake up monsters, and let them stop eating, before angering them
Alex Smith [Tue, 20 Feb 2018 21:53:27 +0000 (21:53 +0000)]
Wake up monsters, and let them stop eating, before angering them

If we do it the other way round, then mimics will forget what
they're mimicking without a seemimic() call, meaning that the
line-of-sight calculations can get confused if the mimic was
mimicking something opaque.

6 years agofix some typos mentioned downstream
nhmall [Tue, 20 Feb 2018 02:32:54 +0000 (21:32 -0500)]
fix some typos mentioned downstream