The set-but-not-used warning for 'ret' revealed an actual bug this
time. Parsing sysconf cares whether any errors were encountered
when parsing its contents, but BINDINGS=key1:cmd1,key2:cmd2 only
returned the result of the first key in the comma-separated list
because the result from recursive calls was lost to the set-but-
not-used variable. Just adding use of that variable would have
ended up reporting success if any key bound succesfully rather than
requiring that they all do as sysconf parse handling intends.
Also, binding comma to a command required that it be specified by
its numeric value because parsing via recursion ate up the actual
commas. Now allow "BINDINGS=,:cmd" or "keyM:cmdM,,:cmdN" or
"BINDINGS=\,:cmd" or "keyM:cmdM,\,:cmdN".
It also recognizes "BINDINGS=',':cmd" and "keyM:cmdM,',':cmdN" but
that yields an invalid key error for "','". I thought txt2key()
supported that but it doesn't. I've left this in because the error
about ',' not being recognized as a key seems better than one about
"'" not being a valid key bind and then accidentally binding single
quote via post-comma "':command".
'toptenwin' defaults to false, so the high scores list at end of game
gets written to stdout by default. stdout might be a bit bucket if
the game is started from a menu somewhere or from Explorer or Finder
or something comparable. Even when started from a terminal, writing
to stdout is bad if running asynchronously ('nethack &').
Have Qt init force the 'toptenwin' option to true to show the high
scores in a pop-up text window. The "since you were in wizard mode
your score is ignored" line also goes to a pop-up text window now too.
An extra <return> is needed to dismiss that when quitting if you go
through the full disclosure sequence.
'nethack -s' writes scores to stdout before interface initialization
takes place, so isn't affected by this change. That's intentional so
that 'nethack -s > ~/myscores' can be used to capture the output.
Pull request from vultur-cadens: when engraving with a weapon, the
occupation routine doesn't dull it on the last character, so engraving
a single character never dulled the weapon. Didn't apply to engraving
with other types of items.
Closes#651
After the fairly recent glyph changes, the icons shown for roles and
races during the character selection dialog all were all depicted by
the giant ant tile. I might have noticed this sooner but usually
have '-@' on the command line to bypass selection.
Document 'HWounded_legs' vs 'EWounded_legs'; they aren't used the way
other properties use their intrinsic and extrinsic values. And they
switch from hero to steed when riding. (Can't start riding when
hero's legs are wounded and the steed's legs magically heal when hero
dismounts, so existing wounds never transfer from one to the other.)
Having one leg become injured when the other already was would cure
the other leg but keep the longer of their two timeouts for the new
injury. Eliminate that mystery cure. Since their timeouts aren't
tracked separately, the best that can be done is to make both legs
eventually recover at the same time.
Make ^X report which leg is the wounded one when only one of them is.
(It already implicitly reports the both-legs case by using plural.)
When zapping a wand of probing downward while riding, include wounded
leg feedback for the steed.
Simplify wounded leg feedback when probing self a little bit.
Make drinking blessed potions of full healing cure wounded legs for
hero when not mounted or for steed when mounted. (The latter is a
bit strange--hero drinks potion, steed gets affected--but it's magic.)
Make drinking uncursed potions of full healing or blessed potions of
extra healing cure wounded legs for hero (but not steed; the magic
either isn't that strong or maybe not that reliable...).
In verbose mode, the gold in your wallet is totaled separately from
that in containers in your pack, and the two are listed separately.
In terse mode, just print the total of both.
Only known gold is mentioned.
I had a minor merge issue when incorporating Ray's Qt6 port from
github.com/chasonr/NetHack/Qt6 but it got resolved. This still builds
with Qt5 (and that's the only aspect I've been able to test) but is
supposed to work with Qt6 too. It adds a new hints file for OSX and
someone might need to create a comparable one for linux. Or maybe
the differences can be folded into the existing hints as conditional.
Closes#525
Wield a polearm and use 'f'ire to automatically hit with it,
if there's a single valid target.
With fireassist-option, will swapweapon to a polearm.
This only applies if quiver is empty and autoquiver is off.
A giant that is carrying a boulder and standing on ice who drowns when
the ice gets melted could die a second time if the resulting pool gets
plugged by the boulder. It results in an impossible from dmonsfree()
about bookkeeping inconsistency when dead monsters are removed at the
end of the turn. The fuzzer escalates that to a panic.
Give messages when sickness countdown has nearly expired to warn
player that hero is dying and also so that death at the end doesn't
seem so abrupt after an arbitrary period with just "TermIll" and/or
"FoodPois" on the status line.
Also, abuse constitution each turn when Sick (either variation, but
not a double amount if both).
This one has me baffled, first how/when it happened and then why no
one reported it. The line
current_mesg->turn = g.moves;
vanished from mesg_add_line() at some point. It is visible in diff
context of commit 99ed00012e from March,
2019 but I can't find any commit since that time which removed it.
[I've been using
git log --no-min-parents --no-max-parents --patch win/curses/cursmesg.c
and then searching within the pager. Maybe that's flaky, but if so,
things wouldn't be any less strange.]
The missing line resulted in mesg->turn being uninitialized, so when
^P compared consecutive messages to decide whether they were issued on
the same turn, arbitrary junk made them all seem to be from different
turns so "---" got inserted before every message. I suppose that if
someone uses a malloc that zeroes the memory it hands out, mesg->turn
field would always be 0 and ^P would behave as if all messages were
from the same turn, so not show any "---" separators. Then players
might not be aware that "---" between groups of messages was intended.
[The messages ought to be grouped by move rather than by turn, but
that's something the core would have to provide.]
When testing the urgent message for having weapon be snagged by a
bullwhip, in between the occasional weapon grabs (which mention
flicking the bullwhip) I saw lots of regular attacks that said
"<mon> swings his bullwhip." That is accurate but seems odd, so
change it to "<mon> lashes his bullwhip." Do same for the hero.
While working on that, I discovered that monsters using a polearm
for a ranged attack always showed "<mon> thrusts <a polearm>" even
for ones that aren't defined as piercing so should be swung rather
that thrust. And they're allowed to do that when adjacent where
there isn't enough room to thrust or swing a long polearm. Now it's
"<mon> bashes with <a polearm>" in that situation.
Dragon scales and dragon scale mails will provide some extra effects
when worn:
- blue: very fast speed
- black: level-drain resistance
- green: sickness resistance
- gold: hallucination resistance
- orange: free action
- red: infravision
- white: slow digestion
- yellow: stoning resistance
gray and silver don't have extra effects - those two are already the
best ones, so don't need any.
If persistent inventory is displayed and contains an entry for a leash
attached to a pet and the pet's type or name changes, the perm_invent
window didn't get updated to reflect the new leash information:
x - leash (attached to <mon>)
Report was for polymorph but applied to growing into bigger form and
to being (re-/un-)christened as well.
This fixes the broken paper doll display. Changes for new glyphs
added code to an 'if' but not to the corresponding 'else'.
Showing map column 0 as something other than blank is still a problem.
The splash window shows a red dragon and says "loading". I'm pretty
sure that that used to be a crisp image but it is now a fuzzy one.
It doesn't use glyphs or their tiles so shouldn't have been affected
by changes to them.
Follow up on some old groundwork. For tty, if the core has designated
a message as 'urgent', override any message suppression taking place
because of ESC typed at the --More-- prompt. Right now, "You die"
messages, feedback about having something stolen, feedback for
"amorous demon" interaction (mainly in case of armor removal), and
exploding a bag of holding are treated as urgent.
The "You die" case is already handled by a hack in top-line handling;
I left that in place so the conversion of 3 or 4 pline("You die.*")
to custompline(URGENT_MESSAGE, "You die.*") was redundant. There
are probably various non-You_die messages which precede done() which
should be marked urgent too.
Other interfaces might want to do something similar. And we ought to
implement MSGTYPE=force or MSGTYPE=urgent to allow players to indicate
other messages that they want have to override suppression. But I'm
not intending to work on either of those. I mainly wanted to force
the magic bag explosion message to be shown since a sequence of "You
put <foo> into <bag>." messages is a likely candidate for --More--ESC.
monstone() was using a hardcoded value when flagging the statue of
a unique monster as historic and didn't get updated when the corpse
and statue flags kept in obj->spe were changed last June by commit
04a8ddcce1.
Closes#643
If hero has intrinsic see-invisible and a gremlin steals that, the
map wasn't being updated to hide invisible monsters (until the next
iteration of moveloop() after other monsters finished current turn).
Teleporting a monster only updated the map. Give a message
so blind players can get the same information.
Making a monster invisible gives the same message, if you
cannot detect invisible.
Several other places where monsters teleported themselves
now also give the same message.
When a wielded glob shrank away to nothing, an impossible warning:
"obfree: deleting worn obj" would be issued.
If a glob is quivered or wielded or set up as swap weapon when it
shrinks away to nothing, clear the relevant weapon slot before
destroying the glob.
Won't happen for monsters since they never wield globs. Also won't
happen for migrating objects (which overload obj->owornmask) because
they have to have arrived somewhere in order to have their shrink
timer execute.
When polymorphing while already polymorphed, picking your own role
will rehumanize (wizard mode only; restores old characteristics and
experience level, unlike becoming a new man which can change those
and even be fatal if level drops below 1). But it didn't work if
you were a priest or priestess because name_to_mon() yields aligned
cleric monster rather than cleric role.
Polymorphing into a vulnerable form while wearing an amulet of
strangulation says "your amulet still constricts your neck" if your
previous form was also vulnerable or "your amulet beings constricting
your neck" if previous form wasn't vulnerable. But a change nearly
6 years ago to have the status line be updated to say "Strangling"
during the message--instead of next status update after it--caused
the "still constricts" variation to always be given even when the
"begins constricting" was appropriate.
Keep track of the highest value that u.uhpmax and u.uenmax have
attained, in new u.uhppeak and u.uenpeak. They aren't used for
anything yet. u.mhmax (max HP while polymorphed) isn't interesting
enough to track.
Not save and bones compatible so increments EDITLEVEL.
Author: PatR <rankin@nethack.org>
Date: Fri Dec 3 18:35:12 2021 -0800
showrace when hero can't see self
This supersedes pull request #644 by entrez, "Fix: expanded-glyphs
hero color regression". The code to change color for the hero in
special circumstances (for 'showrace' and for some PC rogue stuff)
was relying on the hero's map coordinates rather than verifying
that the hero was shown at that spot. When the hero is invisible
and lacks see invisible, he isn't shown. But the color of whatever
could be seen beneath him was incorrectly having its color changed
(to HI_DOMESTIC for showrace or to YELLOW for PC rogue).
Closes#644
Reported by entrez: applying a bullwhip towards a medium or small
peaceful monster used to be an attack but that stopped working when
'safepet' was extended to peacefuls in order for the hero to be able
to swap places which those. Also, side-effects were different when
hero applied the whip from within a pit compared to when not in one.
This allows the hero trapped in a pit to try to snag furniture or a
boulder even when a small or medium is present, and escaping that
pit if successful. (It still snags big monsters in preference to
furniture/boulder at their location.) When no such non-monster
target is available, it attacks the monster if hostile or peaceful
but not when tame. When revealing a previously unseen monster it
prevents snagging that monster's wielded weapon because hero couldn't
possibly target the weapon in that situation.
This makes other changes, mostly dealing with finding and exposing
concealed monsters, which may introduce some new bugs.
Since I was already in the right place, implement snagging an item
off the floor while flying. It isn't necessary since a flyer can
pick things up off the floor directly, but there isn't any pressing
reason to disallow it. Supersedes the commit in pull request #632
by RojjaCebolla.
Closes#632
3.6.1 changed a bunch of messages in shk.c to give the actual shk
name even when a the shopkeeper couldn't be seen, to avoid things
like "You owe It <N zorkmids> for <item>." But there are various
messages issued outside of shk.c which were overlooked. Fix those.
Closes#642
Simplify a glob handling bit in a recent shrink_glob change used when
catching for lost time upon returning to a level.
Revise a clumsily worded fixes entry.
Fix a comment typo in makedefs that's been there for a bunch of years
now. It's been within the diff context for several recent patches
and I still hadn't noticed it until just now.
Populating some of the types of special rooms can pick monsters that
sometimes come in groups, and getting a group could have some members
spill out of the room (or inhibit other random choices by filling some
spots that haven't been populated yet, preventing subsequent monster
creation there).
The misbehavior isn't new so it seems surprising that no one has ever
previously reported this.
Closes#640
of Sky
Add a page citation for Monstrous Regiment passage 1 and add four new
passages, bringing its total to 12.
Add two new passages to A Hat Full of Sky, bringing its total to 13.
Solve the uneven distribution situation that has been present for
picking random rumors for a long time and for random engravings,
epitaphs, and hallucinatory monster names since 3.6.0. This relies
on the previous partial solution where short lines have been padded
to a longer length. When that length is N and random seek lands in
a long line of length L, retry if the position is in the first L-N
characters. Put differently, it if takes more than N characters to
reach the next newline, reject that random seek and try again. This
effectively makes long lines behave as if they had the same length
of N as the short lines have been padded to and when all lines are
the same length, all entries have the same chance to be chosen.
While testing 'the("Capitalized Hallucinatory Monster")' I noticed that
some hallucinatory monsters showed up more often than others. When
the random engravings, epitaphs, and bogus monsters were converted from
hard-coded arrays to data files accessed by random seek (3.6.0), they
became subject to the same distribution irregularites that rumors suffer
from. The chance that an entry will be chosen depends upon the chance
that a random seek will hit somewhere in the line which precedes it, so
entries that follow long lines are more likely to be chosen and entries
that follow short lines are less likely. We improved that for rumors
by having makedefs pad the shortest lines. Distribution still isn't
uniform but is much better than it was (and could be further improved
with a longer padding length at the cost of making data files bigger so
possibly slower to access; both overall size and access speed mattered
back when floppy discs were supported but are probably irrelevant now).
Start doing the same thing for the newer files: pad the shortest lines
to increase the chance that seek will find them. The tradeoff is that
the data files become bigger. Rumors, engravings, and epitaphs lines
are all at least 60 characters now; bogus monsters are at least 20.
These are the data file sizes I see (in bytes: old, new; padding for
rumors was already in use so its size hasn't changed):
bogusmon 4449 7211
engrave 1326 2894
epitaph 14159 24075
rumors 49173 49173
The only place that padding is noticeable in-game is #wizrumorcheck.
A shop-owned glob picked up by the hero was added to shop's bill
and if that shrank to nothing it moved from the unpaid portion to
used-up portion as intended. But once there it retained obj->owt
of 0 and if 'sanity_check' was enabled, that triggered a warning
every move until finally paid for. Both the 'Ix' list of used-up
items and itemized shop billing revealed a weight of 0 aum if
'wizweight' was enabled.
Keep track of the weight a glob had when it becomes unpaid, then
reset from 0 to that amount if it becomes used-up. This overloads
the obj->oextra->omid field which is an unsigned int previously
only used for corpses. Now for globs it is pre-bill obj->owt which
is also unsigned int. I didn't add new oextra access functions for
it; it is only used in two places and existing omid ones suffice.
Reported by entrez: when fruit name is given the name of an artifact
that doesn't use "the" at the start of its name, messages about the
artifact could be altered. Example was fruit=Excalibur causing usual
|You are blased by Excalibur's power!
to unintentionally change to
|You are blased by the Excalibur's power!
because of a false match during special handling for named fruit in
function the().
This fixes that, and also changes basic inventory formatting. Former
|f - an Excalibur
will now be
|f - Excalibur
for a fruit that has been assigned that name. When sort pack in On,
as it is by default, that will be listed under Comestibles rather than
under Weapons so really shouldn't fool anyone. And
|f - 2 Excaliburs
also breaks the illusion.
This formatting change only affects named fruits. User assigned names
for object types or for individual objects behave the same as before.
Noticed while testing revised "the" handling and trying to trigger
"you can't polymorph into [the] Oracle", if the character was human
it would turn into a new man or woman instead of having the unique
form be rejected.
Function the() wasn't supposed to be used for monsters because many
of the ones with capitalized names confuse it, but over time multiple
instances of the(mon_nam()) have crept into the code. Instead of
ripping those out, modify the() to handle that situation better.
Pull request #636 by entrez dealt with this with one extra line of
code, but could end up scanning all the names in mons[] repeatedly
if the("Capitalized string") gets called a lot. This uses a similar
one line fix but calls a whole new routine that scans through mons[]
once collecting all the relevant special case names. As a bonus,
it does the same for hallucinatory monster names which name_to_mon()
couldn't handle.
Fixes#626
Fixes entry for pull request by entrez. If poly'd hero is wearing
an amulet of magical breathing, avoid gradually losing hit points
while out of water when in aquatic form. You won't be able to put
on an amulet of magical breathing if already in aquatic form, but
you could have one carry over from being worn in some other form.
Implemented for monsters too but won't have any effect during play
for them because they never use that particular type of amulet.
Closes#635
Reported by Vivit-R, the chance of freeing a monster from being
trapped in a web was very small and failure resulted in creation of
a new web at the hero's spot, eventually making it impossible to
attempt to #untrap the monster (if hero escaped the new web and moved
to another spot adjacent to trapped monster, eventually surrounding
it with webs). [That's actually misleading. Escaping the new web
but staying at the same spot lets the player try again; repeat as
needed.... But chance of failure still seemed way too high.]
This reduces the chance of failure from 29/30 to 6/7 and makes the
chance of spreading the web after failure be 1/3 instead of 100%. It
also supplies missing feedback about the monster still being trapped
if the attempt to make a new web fails.
Closes#608
If the hero left a level that had globs on the floor or in floor
containers or being carried by monsters and stayed away for a
while, returning to the level only shrunk them by one unit of
weight. Account for all the time away. The complexity of this
has steadily grown; I hope its peak has been reached.
I had wizweight On when testing glob changes and noticed
|Slasher drops a gold piece (0 aum).
Coins are supposed to weigh 1/100 of a unit, and the calculation
rounds rather than simply truncates any fraction, but that still
yielded 0 for quantities of 1..49. Force any non-zero stack of
gold to weigh at least 1 unit.
Also, add a check for attempting to weigh a quantity 0 or less
(of anything, not only for gold) just in case.
Globs never rotted away but did become tainted after a relatively
short while, which seemed like a contradiction. Change them to never
be tainted but shrink by 1 unit of weight approximately every 25
turns. An ordinary glob (one that hasn't combined with any others)
starts out weighing 20 units, so it takes about 500 turns to vanish.
That's roughly twice as long as a corpse takes to rot away.
Shrinking globs give feedback when in hero's invent or in a container
in hero's inventory, but rarely (when going from an exact multiple
of 20 weight units; that is, from integral number of N globs to
N-1 + 19/20, or if weight reduction triggers an encumbrance change).
When a glob goes away completely, there is feedback for those two
circumstances and also for seeing the glob vanish from the floor.
I haven't touched how much nutrition eating a glob confers. I have
changed formatting of glob names to use "small", "medium", "large",
"very large" instead of "small", [no adjective], "large", &c. You
still need to have at least five globs coalesced together for the
adjective to become "medium", same amount as before.
I don't think EDITLEVEL needs to be modified but have incremented it
anyway to play things safe.
Add a page citation to passage #1 of Night Watch, and add five new
passages, briging the total to 12.
Add four new passages to The Wee Free Men, bringing the total to 13.