Commit Graph

6239 Commits

Author SHA1 Message Date
PatR
ef5aeba167 interface feedback by #version
When there was only one supported interface included in the program,
feedback of

|Supported windowing system:
|"tty" (traditional text with optional line-drawing)

was missing the intended final period.  When there were more than
one, the clause describing the default could be preceded by a
spurious space.

|Supported windowing systems:
|"tty" (traditional text with optional line-drawing) and "Qt" , with a
|default of "tty".

There was a fixup for " , " but it only worked as intended when
that was on the last line, not when the default's text spanned lines.

This adds description of "Windows GUI" to the mswin entry.  X11 could
have its formal name "The X Windows System" as the description but I
didn't add that since it just seems like extra verbosity.  Apparently
Qt doesn't stand for anything else so still has no extra description.
2020-08-04 12:00:17 -07:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
PatR
2b8763c9fe partial fix for 'msg_window' option processing
options.c gave some unused variable warnings in the 'msg_window'
parsing if compiled without having tty enabled.

The 'msg_window' option should be available if either tty or curses
is the interface in use, hidden otherwise.  The code to parse it
was included if TTY_GRAPHICS is enabled, so it worked in curses for
a tty+curses binary but not curses without tty one.  This fixes that.

It is still displayed by 'O' when X11 or Qt is in use if the binary
also supports tty or curses.  I've left that as is.
2020-08-03 15:42:09 -07:00
nhmall
d39ae5ce79 Support a build with tty,Qt,x11,curses on macOS Catalina 10.15
Assuming you have the prerequisite packages, You can specify the
window ports to include on the make command line:

make WANT_WIN_QT=1 WANT_WIN_X11=1 WANT_WIN_CURSES=1 WANT_WIN_TTY=1 all

Prequisites for window ports beyond tty:
(some sample homebrew commands to obtain them shown but that is not the
 only way):

xquartz for x11 support
	brew install xquartz

Qt for Qt support
	brew install Qt
2020-08-02 23:03:13 -04:00
PatR
d3e77393ab fix github issue #376 - duplicate prompt
When chatting to the quest leader to try to gain access to the
rest of the quest, if your experience level is good enough but
your alignment strength isn't, in wizard mode you'll get prompted
about whether to have piety boosted.  Normally you would answer
'y' and be able to go to lower quest levels.  But if you answer
'n' you'll immediately be prompted a second time.  Not because
the no response didn't register but because the if/else-if/else
logic checks twice for whether your alignment is inadequate and
if you answered no the first time it will still be too low the
second, with the first answer not carrying over.

Fixes #376
2020-08-02 12:18:11 -07:00
PatR
427f8e42d8 ^X vs hunger, encumbrance
When hunger state is "not hungry" (so omitted from the status line),
say so in the status section of ^X output.  Mainly so that wizard
mode can append the internal nutrition value without inserting an
entire line that [previously] wouldn't be present in regular play.

Show an internal value for encumbrance too, although that would be
better if it also included some indication of the amount where the
encumbrance state changes.  Encumbrance is confusing and I didn't
pursue that.
2020-08-01 19:17:56 -07:00
PatR
22b4ed0be5 Lev vs Fly via #wizintrinsic
I noticed that Qt status showed both Lev and Fly at the same time
when they should be mutually exclusive (Levitation overrides Flying).
I wasted a bunch of time trying to track down a Qt problem but it
turned out to be a core issue.  If Flying is set first (which won't
happen if both are set in the same #wizinstrinsic operation), setting
Levitation via #wizintrinsic was attempting to update the flag that
indicates that Flying is blocked, but doing so too soon and failing.
Setting Lev via other means while Fly was already set didn't have
this problem so it wouldn't occur during normal play.

Also, #timeout lists timed properties which can have a timeout value
in normal play, then a separator, followed by properties that can
only become timed due to #wizintrinsic.  Move Displacement from the
second group to the first now that it can be obtained as a timed
value by eating a displacer beast corpse.
2020-08-01 06:11:20 -07:00
PatR
9cb3fa9cf2 mon->mhpmax sanity check
The check for mon's max HP being at least as high as its level
turns out to be wishful thinking.  Just disable it.  Maybe we'll
flag critters who got or gave up HP during cloning and let them be
exceptions, then turn it back on, but not now.  Or maybe reduce
mon->m_lev when cloning.  That would weaken them though.

Keep the 1 extra HP that an earlier fix for this check gave to
monsters who rolled the minimum possible value while being created
(Nd8 that yielded N boosted to N+1, 1d4 for 1 boosted to 2).
2020-08-01 05:11:20 -07:00
PatR
97cc689553 tin identification
Tin handling code used tin->cknown to indicate that the variety
(soup, deep fried, pureed, &c) was known, but neither object
identification nor end of game disclosure was setting cknown for
that type of object.

^I behaves as if cknown is set, so the problem was hidden during
times when anyone was likely to be paying attention.
2020-07-31 13:14:09 -07:00
nhmall
6357505948 makemon and mkobj follow-up initialization bit 2020-07-31 10:00:14 -04:00
nhmall
8b2750ab60 lower the code upkeep for mextra and oextra pointer additions 2020-07-31 09:42:17 -04:00
PatR
c64049306d candy bar wrappers
Adopt the suggestion that candy bar stacks which get split should
keep the same wrapper text for both halves of the stack.  The patch
stuck with using obj->o_id to manage the wrapper which prior to the
patch wasn't a factor in merging and splitting.  Switch to obj->spe
instead, comparable to tin varities, so mergability is already
taken care of.

End of game disclosure tacks on T-shirt text to formatted items.
Do the same for candy bar wrappers.
2020-07-30 19:25:57 -07:00
PatR
00d1e729da more mind flayer vs headless target
Recently combat between monster mind flayer and headless monster was
changed to skip extra tentable-for-drain_intelligence attacks after
hitting with one for no effect.  Do the same for monster mind flayer
against headless poly'd hero and for hero poly'd into mind flayer
versus headless monster.  As before, it only applies to additional
actions during the current attack.  As soon as the attack is over,
the ineffectiveness of intelligence drain upon target is forgotten.
2020-07-29 11:10:01 -07:00
PatR
0a575befcc identify tweaks
Give better feedback if reading a scroll of identify when it is the
only item in inventory (making that empty when scroll is used up).

Reading a cursed scroll of identify used to always ID 1 item besides
itself.  Change it to behave like confused identify--only identifying
itself--if read when the scroll hasn't been discovered yet.  Same as
before when scroll has already been discovered:  identify 1 item.
2020-07-28 13:10:11 -07:00
PatR
3cc82cbbe7 venom bit
I looked for places where changing "{blinding,acid} venom" into
"splash of {blinding,acid} venom" might make messages become too
verbose.  Turns out to have been unnecessary work because the full
name won't be used unless you get a venom object in inventory and
formally identify it.  Wizard mode, or bones from wizard mode, is
necessary for that to happen so the possibility can be ignored.
[The name change is still useful for wizard mode wishing though.]

Many messages use hard-coded "venom" instead of xname() so won't
be affected even if such identification takes place.  However,
thitmon() was producing
 |The <mon> is hit by the splash of venom.
 |The splash of venom blinds the <mon>.
which seems rather redundant even without the longer full object
name.  So change the second message to be generated as
 |The venom blinds the <mon>.
It also shortens "cream pie" in first line to "pie" in second one.
2020-07-27 09:20:12 -07:00
PatR
fae75f5930 troll corpse revival
Prevent corpses left by cancelled trolls from reviving.  Their
revival is an innate ability but is clearly a magical one, so make
that be subject to cancellation magic.

Change existing corpses that are scheduled to revive to rot instead
if they get cancelled as objects.  Rider corpses are excluded.

Uncancel an ice troll whose corpse is put into an ice box.

Commit e9f53ab7f6 at the end of May
to fix corpses taken out of ice boxes by monsters changed removing
corpses from ice boxes by anybody to always give them rot-away
timers, even for trolls.  Make an exception for ice troll corpses:
give those revive timers instead.
2020-07-26 11:13:43 -07:00
PatR
0fe9905cf8 rocks vs unicorns
A reddit thread mentioned that throwing rocks at unicorns behaved
the same as throwing gems at them:  not treated as an attack and if
teleporting away is allowed, they will.  Change to treat shooting
gems and glass at unicorns with a sling as an attack rather than as
just giving the gem or piece of glass to them, and treat throwing
or shooting rocks and gray stones as an attack too.

If picked up by blind hero while not yet seen, gems and glass
format as "gem" and rocks and gray stones format as "stone" so the
player can always tell the difference.  Forgetting to unwield a
sling before interacting with a unicorn is on the player's head.
2020-07-26 07:46:07 -07:00
PatR
f66b645878 couple of comment typos 2020-07-24 17:39:48 -07:00
PatR
42245f8e67 wizard mode vs venom object names
I tried wishing for "splashes of venom" but was told that no such
thing exists even though "splashs of venom" and "2 splash of venom"
both work to produce "2 splashes of venom".  After the spurious
failure, retrying with EDIT_GETLIN enabled showed that "splashes"
had been singularized to "splashe" so fix that.

"2 splashes of venom" IDed to "2 uncursed blinding venoms" because
the base name omits "splash of" prefix.  And due to that, explicitly
wishing for "splash of {acid,blinding} venom" didn't work either.
Change the names to include the prefix, and add a hack to makedefs
to keep generating the old macro names without the prefix.  (Wishing
for "{acid,blinding} venom" still works due to post-3.6.6 changes
to " of " matching.)
2020-07-24 14:45:59 -07:00
PatR
c1c515af9f weapon skill usage
A recent newsgroup or reddit complaint stated that only 75% of a
monks attacks used martial arts.  It turned out to be true; the
'valid_weapon_attack' intended to control whether skill gets
exercised was being overloaded for skill use.  So the monk's 1..4
base damage used skill for 2..4 but not for 1.  That was never
intended (nor for other roles and other skills; a damage value of
1 is meant to miss out on a chance to train the skill for future
enhancement but should still get a skill bonus or penalty for the
current attack).
2020-07-24 13:12:13 -07:00
PatR
97cbbaa0ac more feedback for monk suit penalty
Refine the enlightenment feedback when a monk has both a suit penalty
and an increase accuracy bonus.
2020-07-20 15:04:25 -07:00
PatR
afbcf3f9a9 monk's to-hit penalty for wearing a suit
If hero is a monk who is wearing a suit, have ^X mention the to-hit
penalty for that in the status section even though it isn't a normal
status line item.  Combat feedback makes it annoyingly obvious, but
player might forget if MSGTYPE=hide is used to suppress the "Your
armor is rather cumbersome..." message.
2020-07-20 03:00:28 -07:00
PatR
74e0be478a remove old bonesid workaround
Noticed when the comment about "this can go away when compatibility
with 3.6.x is no longer needed" was modified recently.  Make it and
the code it applied to go away.
2020-07-17 10:14:24 -07:00
PatR
abe4db6e60 fix pull request #365 - monster max HP
The recently added sanity check for monster maximum HP was giving
false complaints when Nd8 monster had N mhpmax.  Most noticeable
for level 1 monsters (level 0 monsters use 1d4 instead of 0d8 and
weren't affected) but possible for higher level ones if they were
unlucky--from their own perspective--with all their d8 rolls.

Give level N monsters a minimum of N+1 HP, so minimum of 2 for
level 1 monsters, making 1/8 of those stronger.  Same minimum for
level 0 monsters, 25% of which will become stronger now.  (The pull
request's patch gave every Nd8 monster 1 extra HP; this only does
so for Nd8 and 1d4 ones which have rolled lowest possible amount.)

Also relax the sanity check so that existing to-be-3.7 save files
don't continue to trigger sanity complaints for existing monsters
that have the old minimum.

Fixes 365
2020-07-14 17:03:51 -07:00
PatR
ee7fbc4a61 mind flayer vs headless target
When a mind flayer scores a hit against a headless target (or worm's
tail), there's a message that says that the attack hits and that the
target is unharmed.  Since an ordinary mind flayer has 3 such attacks
per turn and a master mind flayer has 5, it can become excessively
verbose.

This doesn't eliminate the attacks until a hit fails to do harm, so
ordinary misses still get repeated if they happen first.  Once a
successful hit doesn't do anything, any remaining AT_TENT+AD_DRIN
attacks are silently skipped.  That way feedback isn't as verbose
and mind flayers don't seem to be quite so stupid about using their
tentacles when those won't work.  Unfortunately they need to relearn
the lesson every turn they attack.
2020-07-14 05:43:51 -07:00
PatR
a37975b625 fix pull request #367 - mind flayer psychic blast
hitting a hidden monster didn't reveal that monster.  It stayed
hidden despite the feedback describing it as if it could be seen.

The pull request's two line fix handled a monster's blast hitting
another monster but left two related issues as-is:  monster's blast
hitting hidden poly'd hero left hero unrevealed and poly'd hero's
blast left hidden monster unrevealed.  Same code, different bug:
poly'd hero's blast affected mindless monsters.

This unhides an affected target before the message about it being
hit rather than after.  That would look better if preceded by a
message describing the object (mimic or hides-under) or furniture
(mimic) or empty spot (ceiling hider) as being or concealing a
monster but I didn't put in sufficient effort to accomplish that.

Fixes #367
Fixes #362
2020-07-14 04:55:53 -07:00
PatR
12498ffa44 fix github issue #372 - Wizard escaping dungeon
If the Wizard fled up the stairs on level 1 and escaped the dungeon
(which can only happen if he isn't carrying the Amulet or any of
the invocation items), the number_of_wizards counter wasn't being
decremented.  If that was the only Wizard, he couldn't be brought
back into play because he wasn't on the migrating monsters list, and
he wouldn't appear on the Plane of Earth when the hero eventually
went there.  If that was one of two, the remaining one couldn't use
Double Trouble anymore.  (I'm not sure about Earth handling in that
situation; should be moot now.)

Wizard mode blessed genocide of "*" when the Wizard is on current
level caused the same problem.

Fix by keeping the number_of_wizards counter up to date if mongone()
is called for the Wizard, handling both cases.  Also, don't let the
Wizard escape the dungeon unless he's one of two at the time, making
the first case no longer possible.

If wizard mode blessed genocide of "*" is used on the level where
the quest nemesis is present, the killed-the-nemesis feedback will
now be given.  I'm not completely convinced that this was the right
thing to do, but it only applies to wizard mode so may not matter.

Fixes #372
2020-07-13 01:58:44 -07:00
PatR
581a27bf98 others_check() comment
Starting out replacing ambiguous pronoun "it" since it might seem
to be referring to "--More--" rather than to "...", then ended up
rewriting whole paragraph.
2020-07-10 01:37:46 -07:00
PatR
0bd2c3154d fix default engraving/epitaph/bogusmon corruption
Fixes #369.
Fixes #370.

The default entries inserted by makedefs -s (starting in 3.6.6,
to guard against having an empty data file which led to divide by
zero crash when nethack picked a random entry) lacked a terminating
newline so the first entry from the file (for the usual case when
that data file wasn't empty) got implicitly concatenated to it.
If the first entry got chosen during play, the initial portion
corresponding to the default entry was decrypted properly but the
concatenated portion corresponding to file's first line didn't.
So gibberish was appended to default engraving or epitaph or bogus
monster; also, the input file's first line would never appear.

The newline fix in makedefs is different from pull request #370
but accomplishes the same thing.

The bulk of the patch is an enhancement to #wizrumorcheck to show
first (default inserted by makedefs), second (first in input file)
and last engravings, epitaphs, and bogusmons in addition to rumors.
The command name has become a little misleading but the limited
functionality doesn't call for separate commands.
2020-07-09 19:23:19 -07:00
nhmall
8e945073aa clear up a couple of warnings
src\mapglyph.c(330): warning C4013: 'has_color' undefined; assuming extern returning int
src\options.c(4820): warning C4101: 'tmpwin': unreferenced local variable
src\options.c(4821): warning C4101: 'any': unreferenced local variable
2020-07-07 20:37:06 -04:00
nhmall
1443ceecc5 more patchlevel consolidation 2020-07-07 08:55:11 -04:00
nhmall
3cecb97da6 consolidate build status /patchlevel info settings in one place - patchlevel.h 2020-07-06 09:12:22 -04:00
nhmall
5a437b336a remove SYSFLAGS and MFLOPPY code
A check into github issue 364 confirmed that
ba6edbe5dc
had incorrectly updated the bwrite sizeof entry for sysflags.

The SYSFLAGS and MFLOPPY code is all in the outdated part of the tree, so just
remove it rather than re-correct it.

Closes #364
Closes #207
2020-07-05 08:50:13 -04:00
PatR
cdcc43a689 boulder breaking feedback
Noticed when checking the sokoban conduct's counter.  Breaking
a line of boulders in one zap reported seeing the first but only
hearing the others, despite the first one being gone by the time
the second one was hit and so on down the line for the rest.
2020-07-03 03:27:39 -07:00
PatR
9c97bc44df more sokoban conduct
The initial implementation of sokoban conduct neglected xlogfile.
2020-07-03 03:20:25 -07:00
PatR
8801ec34eb fix github pull request #355 - Sokoban cheating
Track sokoban cheating (taking actions that incur a luck penalty).
The pull request only reported the number of times (possibly zero)
that the player broke nethack's sokoban rules when reporting the
"you obtained the Sokoban prize" achievement, which is when the
count is most meaningful, but this implements it as a full-fledged
conduct instead.  This way the #conduct command can be used after
"creative nethacking" to check immediately whether an action has
violated the Sokoban rules so a player willing to put in a bit of
effort can eventually learn which actions have a negative impact.

The new conduct is only shown during games where the character has
entered the Sokoban branch, but once that has happened it gets shown
no matter the location at the time of #conduct or end of game.

Most of this wasn't in the pull request:  expanding the Guidebook to
give more information about sokoban and its conduct.

Bump EDITLEVEL to invalidate to-be-3.7 save files because u.uconduct
has been extended.

Fixes #355
2020-07-03 02:21:30 -07:00
nhmall
b8c13ea17a Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-07-02 15:55:55 -04:00
nhmall
e4b18f0545 fix github issue 361 to make user_sounds useful even if MSGTYPE is hidden
fixes #361

Also, experminental introduction of vt_sounddata to enable tty to pass
a sound file index to the terminal side of things where perhaps someone
can add code to something like hterm to take the information relayed by
NetHack to trigger user_sounds locally even if playing on a server.

Compile time option TTY_SOUND_ESCCODES required to build that support in.

It should be independent of TTY_TILE_ESCCODES.
2020-07-02 15:49:45 -04:00
PatR
926a0ca446 talking walls
Add the "if these walls could talk" gag.  Use an array of message
strings rather than switch/cases of pline calls, and add a couple
more messages.

Also, only give wall feedback if the map indicates a wall (so not
while blind unless the wall is already known) and prevent chat from
pinpointing secret doors (via lack of wall feedback when they're
shown as walls).
2020-07-01 18:01:30 -07:00
PatR
3a94f0a9f8 couple of source formatting bits 2020-07-01 07:49:38 -07:00
PatR
2760dc3f16 book of the dead fixes
After writing the log message for the bell change, I decided to
test the Book and found some issues:
1) reading it while blind discovered the book's type but wasn't
   marking the book object as if it had become seen (dknown);
2) reading it while blind gave sighted feedback if it was cursed;
3) reading (blind or not) when either of the other two invocation
   tools are cursed referred to those as "artifacts" even though
   they aren't artifacts; the discoveries list describes them as
   "unique items" but that makes for a clumsy message--use "relics"
   instead.
2020-07-01 07:35:44 -07:00
PatR
b2789979e5 relent on silver bell usage...
Allow a hero in silver-hating form to ring the Bell of Opening when
on the vibrating square so be able to perform the invocation ritual.
But only at that location and only if the stairs aren't there yet.

This is about on par with being able to read the Book of the Dead
while blind although that isn't limited to a specific location.
2020-07-01 06:48:07 -07:00
PatR
7d7b98f0ae mhpmax of life-drained monsters
The report about problems after stone-to-flesh on a petrified
long worm included stethoscope feedback of 0(-1) hit points, after
life-draining.  I was unable to reproduce a maximum hp of -1 and hope
that it was a side-effect of the [already fixed] stale mon->wormno
value used when resurrecting the long worm.  Anyway, this changes
life-draining to never take mon->hpmax below mon->m_lev + 1 (the +1
is needed to cope with m_lev==0 monsters).  The same limit is also
applied to monster life-saving but more to avoid replicating the
arbitrary minimum of 10 (four instances) then because it might be
less than m_lev+1 somehow.

Sanity checking now tests whether a monster's max HP is less than
its level + 1 so if there are ways other than life-drain attacks for
it to drop that low, the fuzzer will choke.  The new check also tests
whether a monster's current HP is greater than max HP.

Polymophred hero killing a golem or vortex by vampire bite reported
"<Mon> dies."  Give an alternate message since those aren't alive.
2020-06-27 18:15:19 -07:00
PatR
ae5e02b9c0 comment typos: afternmv
[g.]'afternmv' was misspelled 'aftermv' multiple times.
2020-06-23 15:31:50 -07:00
PatR
4870ee5281 failing to read a novel while blind
Adopt the contribution to use "you can't read the words" when
trying to read a novel when blind rather than defaulting to
spellbooks' "you can't read the mystic runes."  An unseen novel
is already described as "a book" instead of "a spellbook" so the
alternate feedback doesn't give away any information.
2020-06-22 18:19:11 -07:00
nhmall
b87d2242af one file missed in yesterday's commit 2020-06-09 09:04:15 -04:00
Patric Mueller
8564ee95b0 Record number of wishes and artifact wishes in xlogfile 2020-06-07 16:39:58 +02:00
nhmall
f4c1e84bdd ignore windows link workfiles 2020-06-07 08:49:27 -04:00
PatR
330728a8c7 boolean option processing
Option parsing for booleans tried to accept "optname:true" or
"optname:yes" or "optname:false" or "optname:no" but it didn't work
because boolean options with a value were rejected before getting
to that.  Make parsing for booleans get far enough to handle those
values, treat them as case-insensitive, and add "on" and "off" as
additional choices.  "true" and "false" can be truncated to 3
letters, the other values need to be fully spelled out but are all
only 2 or 3 letters long.
2020-06-06 13:44:48 -07:00
PatR
6f9cd70226 comment clarification 2020-06-03 14:33:17 -07:00