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.
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.
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.
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".
Catch the LaTex Guidebook up with the nroff one for the role, race,
gender, and alignment options.
For both formats, comment out the decription of 'altmeta' on Amiga.
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.
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.
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).
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.
Closes#609
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
be327d9822 and deals with the issue in
a simpler way. After that, the new dismount_steed() placement at
end of m_detach() works cleanly.
Pull request from entrez: in TeX version of Guidebook, the #repeat
command was formatted differently from other extended commands.
(The recent changes to role, race, gender, and alignment options in
Guidebook.mn still haven't made it into Guidebook.tex.)
Closes#951
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.
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.
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).
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.]
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.
Fixes#949
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.
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.
Guidebook.tex is lagging; I'm burned out.
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.]
Fixes#945
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.
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".
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.
Closes#946
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.
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').
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.)
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.
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.
The unlink call wasn't operating the same on a makedefs built
on mingw, and dat/mdXXXX files were being left behind post-build.
Provide an alternative way of doing the temporary files if
MD_USE_TMPFILE_S is defined during the compile of makedefs.c
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.
Treat GLYPH_UNEXPLORED as an out-of-range value.
Closes#929
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.
Still not adequately tested.
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.
Caveat: not adquately tested.