Pasi Kallinen [Mon, 9 Jan 2023 20:25:23 +0000 (22:25 +0200)]
More interesting Gehennom levels
Instead of just plain old boring mazes, spice up Gehennom by
occasionally adding lava, iron bars, or even mines-style levels
(with lava, of course).
Of the fixed Gehennom levels, only Asmodeus' lair has been changed
to add some random lava pools.
Also some lua fixes and changes:
- Fixed a selection negation bounding box being wrong.
- Fixed a selection negated and ORed returning wrong results.
- des.map now returns a selection of the map grids it touched.
- When using des.map contents-function the commands following the
map are not relative to it.
PatR [Tue, 10 Jan 2023 07:34:32 +0000 (23:34 -0800)]
identifying via menu
From the newsgroup: identifying by menu pops up multiple menus in
succession if the player picks fewer invent entries than are being
granted, but the second and subsequent ones could cover up the
message window and hide the feedback from prior ones.
If multiple popup menus are needed when identifying, issue --More--
before each menu after the first. The code seemed to be trying to
do this already, but it should have used wait_synch() rather than
mark_synch(), or perhaps used display_nhwindow(WIN_MESSAGE, TRUE)
instead of either one of those. For curses, both mark_synch() and
wait_synch() were no-ops. Now they do something. X11's behavior
wasn't right either; it seemed to be lagging one message behind
(something I had noticed recently and then forgotten about; I still
don't remember the context then so don't know whether this fixes
that earlier situation).
PatR [Sun, 8 Jan 2023 09:33:18 +0000 (01:33 -0800)]
allow full-line comments in tiles source files
Accept
<start of line><optional whitespace>#<anything>
as a comment in win/share/{monsters,objects,other}.txt. Existing
<start of line><optional whitespace># tile <rest of line>
is grandfathered in as data.
It wouldn't take much more to accept
<data><optional whitespace>#<rest of line>
comments too but this hasn't gone that far.
Reading the colormap at the beginning of each of the three files
used "%[A-Za-z0-i]" to read one characer into a two-character array.
Change that to "%1[A-Za-z0-9]" so that it can't overflow the buffer
if the input data gets accidentally or maliciously mangled. (Not a
security issue.)
Remove a spurious blank line from objects.txt.
Also, clean up some warnings when compiling gifread.c for gif2txt
although I ultimately didn't do anything with that.
PatR [Sat, 7 Jan 2023 20:48:10 +0000 (12:48 -0800)]
fix for onefile FITSint, FITSuint
I assumed that the complaint about macro refinition was for the two
in alloc.c replacing two from hack.h from another file, but it could
be that those being defined by alloc.c were interferring with the
regular hack.h ones. alloc.c doesn't need them, and was also skipping
an opportunity to use one of them.
PatR [Tue, 3 Jan 2023 07:40:06 +0000 (23:40 -0800)]
show_glyph() impossible
After glyph expansion a while back, a few 'if's had tests of
| else if ((offset = (foo - bar)))
which should be
| else if ((offset = (foo - bar)) >= 0)
Only used if show_glyph() has been passed invalid map coordinates
so never seen.
PatR [Tue, 3 Jan 2023 07:25:38 +0000 (23:25 -0800)]
score feedback punctuation
"Killed by Ms. Manlobbi, the shopkeeper" has the comma changed to
a semi-colon prior to being stored in 'record'. That's intentional,
but "Killed by Ms. Manlobbi; the shopkeeper" looks strange when shown
to the player. Change semi-colon back to comma when writing scores
for display.
nhmall [Mon, 2 Jan 2023 21:06:11 +0000 (16:06 -0500)]
static analyzer bit display.c
A static analyzer pointed out that the 'if' was checking
for null pointer, but the 'else' was not, yet they were
both then dereferencing the same variable.
PatR [Mon, 2 Jan 2023 01:35:06 +0000 (17:35 -0800)]
nethack --windowtype=badchoice
If you used the commandline to ask for an interface that doesn't exist
or isn't available, you'd get complaints about it not being recognized
twice. First before any other options, then again after regular
option processing has taken place. Clear the command line setting if
the first attempt gets rejected so that it won't be retried later and
be rejected again. Probably the game should just quit if setting the
interface fails.
PatR [Sun, 1 Jan 2023 08:21:51 +0000 (00:21 -0800)]
comment fix in display.c
A comment in front of unmap_object() was missing the end of a
sentence in the middle of a short paragraph. That has been the case
as far back as 3.3.0. I found the sentence's full text in 3.2.0
(without checking 3.2.[123]). The rest of the paragraph got changed,
presumably at the same time as the missing part got lost.
While in there, change "any more" to "anymore". According to a
dictionary, the one-word form is the more commonly usage.
PatR [Sat, 31 Dec 2022 21:35:17 +0000 (13:35 -0800)]
fix tilemap - no panic()
tilemap isn't linked with util/panic.o so doesn't have access to
panic(). Despite that, linking on OSX found panic() somewhere.
(It doesn't do format argument substitution, just prints out the
argument we pass as format string, then aborts.)
Instead of calling panic(), print a message to stderr, delete the
incomplete tile.c whose construction has failed, and exit with
failure status. Linking with panic.o wouldn't handle the message
and final failure but not help with the incomplete output file part,
so this hasn't done that.
PatR [Sat, 31 Dec 2022 20:42:52 +0000 (12:42 -0800)]
pull request #942 - shopkeeper chat changes
Pull request from entrez: change some pline() messages to verbalize()
and re-enable some chat feedback given when a shopkeeper is poly'd
into some form that can't speak.
Michael Meyer [Fri, 2 Dec 2022 17:45:00 +0000 (12:45 -0500)]
Use verbalize for shopkeeper price-check #chatting
The shopkeeper is speaking out loud, so use verbalize for consistency
with other types of speech.
I couldn't figure out a way to wrap the multiline version in quotes in a
way that actually worked and looked good, so I restricted this to the
pline responses.
Michael Meyer [Fri, 2 Dec 2022 17:32:35 +0000 (12:32 -0500)]
Tweaks to chatting with mute shopkeeper
A mute shopkeeper shouldn't be able to verbally tell you the prices of
objects. For normal chatting, on the other hand, shk_chat can handle a
mute shopkeeper (by changing from speech to "indications" -- hand signs,
body language, etc), so allow execution to reach that even if the
shopkeeper is mute (in a silent polyform).
Also more generally allow a shopkeeper to continue chatting with normal
shopkeeper responses if polymorphed into another creature, since they
apparently retain their minds (are able to tell you prices, can
transact, etc).
This is mostly inspired by the fact shk_chat has extensive handling for
mute shopkeepers, but it was unreachable as far as I can tell. It is
also funny to think of a newt or something wriggling around to indicate
it's been making a lot of money lately.
PatR [Sat, 31 Dec 2022 20:13:41 +0000 (12:13 -0800)]
pull request #939 - revise #wizsmell command
Pull request from entrez: add a funny message if player targets hero
with #wizsmell command.
I've modified it to put a "remembered, unseen monster" symbol on the
map if sniffing a non-monster location reports a monster's smell and
to remove that symbol if sniffing it reports "no monster there".
Michael Meyer [Thu, 1 Dec 2022 22:56:00 +0000 (17:56 -0500)]
Remove canspotmon() requirement from #wizsmell
You can attempt to smell a monster at particular coordinates even if you
can't see it. Revert the message for the 'can't find a monster there to
smell' case to "That is not a monster", as it was before, since the
change makes it so that you only reach that line if there genuinely is
no monster there (previously it would be reached if there was a hidden
or undetected monster on the specified spot).
Michael Meyer [Tue, 29 Nov 2022 03:37:34 +0000 (22:37 -0500)]
Add a funny message for smelling yourself
I know this is inane, especially for a little-used debug-mode-only
command, but I can't get it out of my head...
The use of the actual monster data instead of the glyph as a proxy ought
to make it somewhat more consistent as well (e.g. hallucination and
'showrace' won't affect the results), though I think that'd hardly be
worth it were it not for the incredibly funny message.
Michael Meyer [Thu, 3 Nov 2022 18:03:00 +0000 (14:03 -0400)]
Make paralysis intefere with seduction attempts
tinklebear on IRC noticed that a hero paralyzed by a floating eye was
still "charmed" and capable of "removing her armor" as part of a nymph's
theft attack. The same thing was true of foocubus seduction: a
paralyzed hero was still able to respond to the questions about whether
particular pieces of armor should be removed (and also do whatever else
may be involved in a successful attack...).
I think paralysis should prevent both those things. Nymph theft will
still work, unless she needs the hero's active cooperation in removing a
bulky piece of armor. Foocubus attacks will be prevented entirely by
paralysis, making it interfere like unconsciousness already does.
Apply a similar constraint to hero vs monster seduction, as well.
PatR [Fri, 30 Dec 2022 20:45:02 +0000 (12:45 -0800)]
some tilemap.c cleanup
I'm headed back to the drawing board for some tiles changes I was
attempting, but before tossing what I had I've extracted a modest
amount of cleanup for the code in win/share/tilemap.c. Some
formatting, a bit of generated formatting, make ENHANCED_SYMBOLS
less intrusive, and an error check to prevent a crash in tilemap
I triggered. Also avoid one in nethack caused by an object (not
included here) which had a description but no name.
PatR [Wed, 28 Dec 2022 19:33:39 +0000 (11:33 -0800)]
followup for miscellaneous objects[] macros
The DUMP_ENUMS definition of 'MARKER()' had the expansion of its
arguments backwards but isn't even needed, so get rid of it rather
than reverse them. nethack --dumpenums handles them separately
from object definitions.
PatR [Wed, 28 Dec 2022 09:50:24 +0000 (01:50 -0800)]
miscellaneous objects[] macros
Replace FIRST_GEM and LAST_GEM with FIRST_REAL_GEM, LAST_REAL_GEM,
FIRST_GLASS_GEM, and LAST_GLASS_GEM and define those along with
objects[] rather than separately. Do the latter for FIRST_AMULET
and LAST_AMULET too. Also new FIRST_SPELL and LAST_SPELL used to
compute MAXSPELLS. (That value looks wrong to me, but this defines
it with the same value as before. If it gets fixed, EDITLEVEL will
need to be incremented.)
This started as just proof of concept that extra information could
be collected as objects[] gets initialized at compile time.
PatR [Mon, 26 Dec 2022 22:56:12 +0000 (14:56 -0800)]
new 'sortvanquished' option
Allow the preferred sort order for the vanquished monsters list to
be specified in the run-time config file
|OPTIONS=sortvanquished:X
where X is t, d, a, c, n, or z. It can also be set to 'A' or 'C'
but those aren't documented and aren't offered as choices when
setting the value interactively, which can be done via 'm O' or by
using 'm #vanquished'.
Guidebook.mn has been updated but Guidebook.tex is lagging again.
PatR [Sun, 25 Dec 2022 21:21:56 +0000 (13:21 -0800)]
{freez,flam,shock}ing spheres difficulty ratings
Adjust mstrength() so it generates difficulty assessments matching
the mons[].difficulty values for freezing spheres, flaming spheres,
and shocking spheres. #wizmodiff now reports "no discrepancies".
PatR [Sat, 24 Dec 2022 08:27:59 +0000 (00:27 -0800)]
fix boomerang equiped in multiple slots
Reported directly to devteam: with one quivered boomerang and a
compatable stack of one or more boomerangs either wielded or in the
alternate weapon slot, throwing the quivered one, failing to hit any
target or obstacle, and catching the returning boomerang would empty
the quiver, merge the caught boomerang with the wielded weapon or
swap-weapon slot, then re-quiver and yield
|x - 2 boomerangs (wielded) (at the ready)
or
|y - 2 boomerangs (alternate weapon; not wielded) (at the ready)
If 'sanity_check' was On, complaints would ensue.
'autoquiver' may need to be On in addition to the thrown boomerang
being the last item in the quiver.
The unsplit portion of the fix feels unclean. There's bound to be a
better way.
nhmall [Fri, 23 Dec 2022 21:38:53 +0000 (16:38 -0500)]
memory not freed
Reported directly by feedback form.
Changes from a recent pull request resulted in more array entries
than MAX_GLYPH, so the for loop in free_glyphid_cache() wasn't going far
enough, leaving some dupstr() strings unfreed.
PatR [Thu, 22 Dec 2022 23:07:33 +0000 (15:07 -0800)]
last? role/race/&c option values update
Keep track of how a role|race|gender|alignment option got its value
so that role:!Tourist in .nethackrc and role:!Priest in NETHACKOPTIONS
yield 'role:!Priest' rather than merging into 'role:!Priest !Tourist'.
It also doesn't write the value into new config file for #saveoptions
if that value comes from environment or command line (not applicable
since the command line arguments for role,&c don't go through options
handling). Also, the old config file value takes precedence over
the current game's value file so that 'role:random' doesn't become
'role:Healer' or such in a new config after the random value gets
picked for play.
This only tracks the role, race, gender, and alignment options but the
concept could be extended to all options. The data would need to be
saved and restored if values set interactively need to be retained in
restore sessions (doesn't apply to role,&c since those don't change
during play).
PatR [Wed, 21 Dec 2022 22:31:13 +0000 (14:31 -0800)]
old pull request #609 - neutral #offer feedback
Pull request from Vivit-R was to change feedback when offering on a
neutral altar from "your sacrifice is consumed in a cloud of smoke"
to "... in a puff of smoke". There were multiple comments, some
agreeing and some disagreeing but no better alternatives offered.
I'm ambivalent to whether any alteration was needed, but think "puff"
sounds rather passive. I looked at a lot of synonyms and considered
"veil of smoke" and "haze of smoke" and even "puff of vapor", but
finally settled on "plume of smoke". It isn't something that appears
and is gone in an instant like the lawful flash of light and chaotic
burst of flame, but I think it is more interesting than cloud or puff.
The PR's commit hasn't been used since 100% of its content is being
superseded.
PatR [Wed, 21 Dec 2022 22:02:05 +0000 (14:02 -0800)]
sequencing issue: dismounting from dying steed
Reported by entrez: if a trap killed hero's steed and dismounting
was fatal for the hero (probably by falling onto the same trap),
impossible "dmonsfree: 1 removed doesn't match 0 pending" warning
occurred during game-over cleanup.
Move the dismount calls in mondead() and mongone() from before their
m_detach() call to the end of m_detach() itself. This led to a
cascade of problems and attempted fixes until finally zeroing in on
place_monster()'s sanity checks and dismount_steed()'s attempts to
work-around one of them.
This reverts the convoluted hack from four years ago in commit be327d9822a17823a86553bb33d414ba56522fd4 and deals with the issue in
a simpler way. After that, the new dismount_steed() placement at
end of m_detach() works cleanly.
PatR [Tue, 20 Dec 2022 23:23:40 +0000 (15:23 -0800)]
sleeping vs deafness
Another one from entrez: falling asleep tried to make the hero Deaf,
but was adding a negative value to the timeout. A negative value
of bigger magnitude that the current timeout could produce weird
values when making that be negative and then stuffing it into an
unsigned field.
This applies a fix to sleep-causes-deafness bug but also disables
that, at least for the time being since nobody seemed to notice that
it wasn't working. The fix might be noticeable so needs testing.
This also adjusts You_hear() so that if Deaf and sleeping are both
active, it will still yield "You dream that your hear ..." instead
having Deaf override that.
PatR [Tue, 20 Dec 2022 22:44:19 +0000 (14:44 -0800)]
unconscious hero vs Medusa
Reported directly to devteam by entrez: a sleeping or unconscious
hero would still meet a monster's gaze attack even though those are
supposed to be eye-to-eye rather than just the monster looking at
you. Don't meet the gaze when Unaware, despite the fact that the
hero isn't blind and vision remains in operation.
Initially being Unaware also blocked Medusa's gaze being reflected
but I changed things so that that still affects her. It contradicts
the eye-to-eye aspect but is more consistent with her looking at a
blind hero who has reflection.
PatR [Fri, 16 Dec 2022 20:21:23 +0000 (12:21 -0800)]
paranoid confirmation prompt
yn() and company show the list of possible responses in square
brackets and the default response in parentheses:
|Do foo? [ynaq] (y)
but paranoid_querty() was using the punctuation chars backwards
|Do foo? (yes) [n]
or
|Do foo? (yes|no)
depending on the level of paranoid. Change those to be
|Do foo? [yes|n] (n)
(default gets used for <return> but unlike yn(), not for <space>)
and
|Do foo? [yes|no]
(with no default for the latter).
PatR [Thu, 15 Dec 2022 23:56:52 +0000 (15:56 -0800)]
role,race,&c options: environment vs config file
Due to the unorthodox values for role, race, gender, and alignment,
specifying a negated value or set of values in NETHACKOPTIONS wasn't
overriding a specific value set in the run-time config file. The
command line should take priority, then environment, then config file,
lastly builtin defaults.
This could probably use some improvement. It now treats role:!val
as if there was no val role and the entry was role:random rather than
previous role:none (affects prompting).
[I've just realized that role:!foo in environment will be combined
with role:!bar in config file rather than replacing it. I'm not sure
how to deal with that.]
PatR [Thu, 15 Dec 2022 21:48:59 +0000 (13:48 -0800)]
fix issue #949 - dropping welded iron ball
If punished and the attached iron ball was both cursed and wielded,
falling while going down stairs would drop it instead of leaving it
welded to hero's hand. ( Didn't happen for iron ball that wasn't
chained to hero's leg.)
I thought that this was going to be a one or two line fix but ball
and chain stuff is never that simple.
PatR [Wed, 14 Dec 2022 22:07:22 +0000 (14:07 -0800)]
calling objects
An earlier attempted fix was not working as intended. This
accomplishes what I was trying to do. I haven't reverted
interesting_to_discover() to static within o_init.c.
PatR [Wed, 14 Dec 2022 21:14:54 +0000 (13:14 -0800)]
revise the role, race, gender, align options
Using role:!wizard to limit which roles would be candidates for
random selection didn't work as I expected. It required a separate
option setting for role to exclude. This implements how I thought
it worked:
|OPTIONS=role:!ranger !samurai !wizard
will exclude multiple roles with a space-separated list in a single
option setting. It also adds support for
|OPTIONS=!role:ranger samurai wizard
to do the same thing. (OPTIONS=!role:!ranger isn't allowed.)
I thought 'OPTIONS=role:barbarian caveman knight' could be used to
limit random selection to those choices, but that doesn't work and
I haven't attempted to implement it.
This also renames the 'align' option to 'alignment'. That made the
truncation to 'align' become ambiguous, so it got added back as an
alias for the full name.
PatR [Wed, 14 Dec 2022 16:28:31 +0000 (08:28 -0800)]
pull request #945 - boulder vs shared shop wall
Pull request from entrez: a boulder being sold by one shop could be
pushed into another shop if they had a shared wall with a gap in it.
Treat such as being stolen from the first shop rather than becoming
for-sale in the second shop.
[I haven't done much testing of the stolen_value() changes.]
Michael Meyer [Wed, 7 Dec 2022 01:52:13 +0000 (20:52 -0500)]
Fix: billing shop boulder pushed thru shared wall
I realized that the "move the boulder billing to 'used-up items'" part
of 20392a6 didn't properly handle boulder movement from one shop to
another via a gap in a shared wall, becuase it wasn't looking at the
complete in_rooms() array (plus, it only triggered if the new spot
wasn't in any shops at all). When I tried to fix that, I realized that
stolen_value() was similarly not working reliably when passed a location
shared between two shops, and for the same reason: it was only using the
first character of the in_rooms() array.
I think this patch fixes both those things, but it would be worth
examining the change to stolen_value() carefully, to ensure getting the
roomno via the shkp won't change anything about its normal functioning.
I'm not totally sure about that -- I didn't notice any problems in some
brief tests of typical stolen_value() uses, but it seems like it
probably has some tricky edge cases.
At the very least, passing a boulder fully through a shared wall between
two shops one way, then back the other way, no longer triggers an unpaid
obj sanity check in my testing.
PatR [Wed, 14 Dec 2022 15:37:04 +0000 (07:37 -0800)]
refine PR #946 - named armor
Move the new stuff from PR #946 out of xname() into new routine
armor_simple_name().
Noticed while testing: tweak 'call object type' so that it doesn't
list instances of pre-discovered armor as likely candidates since
assigning a name to such wasn't showing up in the discoveries list.
Add "silver shield" as wishing synonym for "polished silver shield".
PatR [Wed, 14 Dec 2022 13:50:23 +0000 (05:50 -0800)]
pull request #946 - named armor
Pull request from entrez: use helm_simple_name() instead of
hard-coded "helmet", boots_simple_name() instead of "boots" and so
forth when formatting called but not yet discovered armor-class
objects for inventory, messages, &c.
Michael Meyer [Fri, 9 Dec 2022 19:41:20 +0000 (14:41 -0500)]
Use foo_simple_name for armor types in xname
This will distinguish between a hat and a helmet, shoes and boots, etc,
so that a "conical hat" doesn't turn into a "helmet called dunce" after
type-naming it, and so on. Instead, more specific names will be used
for the base type, consistent with the terms used in various messages
(so "a hat called dunce").
Some of these don't seem like necessary distinctions to make, and some
of them probably don't make a difference at all (e.g. gloves vs
gauntlets, since "gauntlets" only shows up once you've IDed the item so
the user-assigned typename isn't visible), but it probably makes sense
to be consistent in using these functions if it's done for any armor
type.
nhmall [Wed, 14 Dec 2022 00:17:00 +0000 (19:17 -0500)]
cast away a new warning
role.c: In function 'plnamesuffix':
role.c:1615:19: warning: operand of '?:' changes signedness from 'int' to 'unsigned int'
due to unsignedness of other operand [-Wsign-compare]
1615 | ? (int) (eptr - gp.plname)
^~~~~~~~~~~~~~~~~~~~~~~~
Since Strlen() (actually hacklib's Strlen_ function) returns 'unsigned' for the
second operand of the '?:', the compiler was having to change the signedness
of the first operand '(int) (eptr - gp.plname)' to 'unsigned' and issuing the
warning.
Cast the result of Strlen() to int to make both operands of the '?:' the same
('signed').
PatR [Tue, 13 Dec 2022 23:59:05 +0000 (15:59 -0800)]
more interactive role selection
This ended up combining several unrelated changes.
Add missing 'fixes' entry for curses-specific item in New Features.
When answering "Shall I pick ... for you? [ynaq]", accept \m as well
as \n and space for choosing the default of 'y', same as normal
ynaq() would. Also add '*' to '@' as not-shown potential answers;
they force 'random'.
When tty tore down any of the menus, things were reasonable if they
were short enough for corner windows, but tall ones that switch to
full screen weren't fully erased. The parts of those outside of the
map window stayed behind when the tall menu was closed and cleared.
Mainly affects picking the "~ - reset filtering" choice but also
affected the role menu on 24 line tty screens. (Didn't affect curses
because it tracks and refreshes its base window when some overlaying
window goes away.)
The role menu used 25 lines so required a second page for the case
of a 24 line screen on tty. Dealing with that is a bit ugly but it
wasn't an issue when this form of role selection was tty-only (because
the info about choices made so far was displayed on the base window
rather than in an extra menu line back then) so I added a hack for it.
If the role menu will take one more line than the screen height, the
separator between 'random' (below 'Wizard') and 'pick race first' gets
squeezed out. If the menu needs two more lines (doesn't happen now,
except by changing screen size to 23 lines for testing), a second line
gets squeezed out. (Not attempted for curses because it wouldn't
help. 'windowborders' and one or two extra separators it adds make
menus taller. I doubt if many players use curses on 24-line screens
but if they do, they'll be using something new rather than going from
something that used to fit on one page with 3.6.x.)
PatR [Tue, 13 Dec 2022 00:30:27 +0000 (16:30 -0800)]
tty-style role selection for curses
Move the tty role/race/&c selection from wintty.c to role.c and remove
its references to BASE_WINDOW. Have curses call the same routine now
so that the player has the option to choose role, race, gender, and
alignment in any order and to confirm or override random settings
prior to starting play. Also if you went through "who are you?" then
final confirmation includes an extra menu choice to rename the hero.
It still has the quirk of sometimes remembering some of the previous
aspects when you re-pick a new value for some aspect which already
been selected.
The menus pop up on top of the copyright screen and that looks a bit
strange. I don't think core code has any way to erase that base
window without erasing the entire screen so to fix the strangeness
the window ports would need to do that before calling the selection
routine. I didn't do that because the very first prompt, "Shall I
pick ... for you? [ynaq]" shows up in that window rather than in a
popup over it, and having it be all by itself on an otherwise blank
screen seemed to be even stranger.
X11 and Qt both have more sophisticated selection routines so I
haven't tried to switch either of them to use this. They both use a
fancy role-selection-specific menu with all the aspects present at
once so this wouldn't fit without more work than I care to tackle.
PatR [Mon, 12 Dec 2022 22:53:07 +0000 (14:53 -0800)]
'generic username' checking
Don't require the list of generic usernames in sysconf to need to be
ordered to guard against false substring matches. If the list was
"nethacker nethack" and the tentative character name was "nethack",
it wouldn't be recognized as generic. The old code forced the list
to be "nethack nethacker" for the matching to work correctly because
it only checked the first matching substring. Either order works now.
It also failed to recognize a generic name if the player used
|nethack -u nethack-samurai-human-male-lawful
because it checked for generic names before stripping off the role
aspects. Now that will at least recognize the name as generic and
prompt with "who are you?", but the role/race/&c info gets discarded.
nhmall [Mon, 12 Dec 2022 02:29:42 +0000 (21:29 -0500)]
odd Windows lighting in lit rooms (issue #929)
bkglyph variable gets initialized to GLYPH_UNEXPLORED so ends
up being returned by get_bk_glyph() if something more interesting
wasn't chosen in the switch statement.
The Windows win32 interface will then use the tile mapped to
GLYPH_UNEXPLORED as a background. The tile is 16x16 all black
pixels. That looked very odd.
PatR [Sun, 11 Dec 2022 02:00:44 +0000 (18:00 -0800)]
more zapping while hiding-under
The previous commit had the up/down test backward. Also the commit
log text described the old behavior incorrectly: zapping down while
hiding-under skipped the top item but zapping up hit the whole pile.
PatR [Sun, 11 Dec 2022 01:48:55 +0000 (17:48 -0800)]
fix #K3802 - sanity_check: boulder not on top
This should fix the problem of polymorphing or stone-to-fleshing a
pile of multiple boulders and having some underneath ones which get
changed resist and not get changed, producing a pile with one or more
non-boulders above one or more boulders. If that situation arises,
re-stack the pile so that boulders are moved to the top.
This also revises zapping up or down while hiding under something
(if that is even possible; the types of creatures which can hide
under things can't zap wands or cast spells; maybe there are some
exceptions?). Zapping up used to hit only the top item, but zapping
down hit the whole stack. Now up still hits only the top, but down
skips the top and hits the rest.
PatR [Fri, 9 Dec 2022 20:55:39 +0000 (12:55 -0800)]
shop sanity check of the day...
If a pet picks up a no_charge item in a shop and gets teleported out,
clear that flag. (It's already being cleared for non-pets as soon as
they pick any item up.)
PatR [Fri, 9 Dec 2022 12:18:20 +0000 (04:18 -0800)]
shopping objects, unpaid and no_charge, what else?
Revise sanity_check to acknowledge that buried objects might be unpaid
or no_charge. (For unpaid, drop shop-owned object in a gap in the
shop wall or in the free spot; for no_charge, drop something the shk
doesn't care about, or drop any hero-owned item and decline to sell.
Dig a pit. Push or drop a boulder to fill the pit.)
Change 'I' to look for unpaid objects on the floor and for buried ones
when deciding when to include 'u' in the list of candidate object
classes and pseudo-classes.
Change 'Iu' to mention buried unpaid objects as well as floor ones.
For both non-invent categories, show a combined count without cost
info.
Have sanity_check of monster inventory test for unpaid and no_charge.
When a monster (including pet) picks up an item that's marked unpaid
(so one dropped on shop boundary, not an ordinary for-sale one), take
it off hero's shopping bill. If dropped--pet behavior or monster
death--inside the shop, it will become for-sale rather than no_charge
or back on bill. [Removal from bill is needed to prevent an unpaid
object ending up outside the shop if a monster carries it out, and
current sanity_check complains about an unpaid item in mon->minvent.]