The prior fix for this was a bit flawed. It was only considering
the length of the last field, but what it really needed to do was
consider the placement of the last character of the last field
on the row relative to the placement of the last character of
the last field on the row previously.
If the new placement of that last character of the last field
is left of the previous placement, some clearing must be done.
Fix the situation of Flying hero failing to untrap a bear trap that
was resulting in the trap becoming hidden. Previous fix prevented
hero from moving onto the trap's location so that the reason for
hiding it didn't occur. This moves the hero and forces the trap,
so it will become unhidden again before there's any chance to notice
that it had been hidden.
Status 'Flying' conflicts with being trapped at floor level, but that
is a separate, known issue. I'll have to resurrect my unfinished fix
for that sooner rather than later.
For the searching capability offered by '# ?', use ':' instead of 's'
to activate it. Otherwise, if the player typed ':', menu processing
would handle that and would search the few menu entries (for selectors
'a', 's'--now ':', and maybe 'z') when we're interested in searching
the data displayed via many separator lines.
I left 's' as the selector for "show all, clear search" once a search
has been performed, but perhaps that ought to be switched to ':' too.
Demote #monpolycontrol and #wizdebug_traveldisplay from commands to
simple boolean options. The former has the same name, the latter
is called travel_debug. Rename #wizdebug_bury to #wizbury; it
shouldn't matter that it goes away when compiled without DEBUG.
There are now five wizard-mode boolean options: monpolycontrol,
sanity_check, and wizweight are documented in the Guidebook;
menu_tab_sep and travel_debug are commented out there.
Guidebook.mn has been tested; Guidebook.tex has not.
The pointer could go out of bounds when decremented if it was pointing
at the start of the status_vals[BL_HUNGER] (empty string).
Also, guard tty_status_update() from an out of range index being
passed to it (botl shouldn't do that, but...).
The legal 1st parameter values for tty_status_update() in 3.6.2 are
BL_RESET (-2)
BL_FLUSH (-1)
BL_TITLE ( 0)
...though to...
BL_CONDITION (22)
count MAXBLSTATS = (BL_CONDITION + 1)
There's a BL_CHARACTERISTIC (-3) defined in the botl.h header file,
but it is not used in wintty.c and is now screened out along with
everything lower and everything MAXBLSTATS and above.
closes#142fixes#141
Description for use when an item hasn't been seen up close yet falls
back to real name if there is no separate description, but was doing
so before real name substitution for samurai.
actualn = foo;
dn = description ? description : actualn;
if (Samurai)
actualn = bar;
So player saw a flail (via 'dn') until dknown bit got set, then
nunchaku (via 'actualn' after it got set to samurai-specific value).
Wait until after substitution of Japanese real names before falling
back to real name when there's no description.
Iron bars can be destroyed in some circumstances (hit by yellow
dragon breath or thrown potion of acid, being eaten by rust monser
or black pudding, or by poly'd hero in those forms) and should act
like walls for diggable/non-diggable purposes. But they aren't
walls, so the non-diggable flag was not being set for them by the
special level loader. Even once that was changed, they weren't
being handled consistently. Some places checked for non-diggable
directly (zap_over_floor of acid breath, potion of acid hitting bars)
and started working as intended, others used may_dig() to check
non-diggable (poly'd hero attempting to eat iron bars) but it doesn't
handle iron bars, and still others didn't check at all (bars-eating
monster who moved onto bars location in expectation of eating those
next).
Reorganize the logic for showing or suppressing an extended command
to avoid a slightly hairy 'foo || bar && quux' expression.
When searching and not finding anything, report "no matches" rather
just waiting for another menu selection.
Plus miscellaneous reformatting.
Get rid of bold/non-bold distinction in #wizidentify inventory menu
by only showing items which aren't yet fully identified instead of
full inventory with bold for unID'd. Support for bold text might
be lacking.
I was considering this even before the report that X11 menus ignore
attribute. The "_ - (use ^I for all)" menu entry is still present,
but it could be discarded in favor of '.' to pick everything via
ordinary menu selection.
Most shop messages accurately identify the shopkeeper even when he
or she can't be seen, but some also include a pronoun reference that
ended up as "it" or "its" when not seen. Extend pronoun selection
so that visibility can be ignored: noit_mhe(mon), noit_mhim(mon),
and noit_mhis(mon). Note that despite being called noit_foo(),
those will still return "it" if mon is neuter.
"Accurately identify shopkeeper" is misleading if the hero is
hallucinating; a random shopkeeper name is used then. noit_foo()
yields the pronoun applicable to the actual shopkeeper and might
not match the gender of a hallucinatory name. That could be fixed
in a couple of ways (add shk_mhe()/shk_mhim()/shk_mhis() and either
pass them the randomly chosen name so that they can figure out the
appropriate gender, or just have them use a random gender whenever
hallucinating) but I don't think that's worth bothering with.
A bunch of shop messages needed noit_foo(); only a couple of those
have actually been tested. A bunch more were using shkname() at
the beginning of a sentence where Shknam() should be used instead.
(All the existing shk names are already capitalized so there's no
noticeable difference.)
The three places outside shk.c and vault.c which directly use
pronoun_gender() have been successfully tested.
mondead() -> m_detach() -> m_unleash() suppresses
the m_unleash() slack message, so deliver it in
the caller explmm() in those circumstances.
(The issue of whether it should be possible to leash light
is side-stepped.)
bug H7406, 1548
The original report stated:
"I located a bear trap as a human and just ignored it
for the time. I polymporphed into a Vampire Lord, then
went to #untrap the bear trap. On the first attempt,
I stood beside the trap and attempted to #untrap. I
received the 'Whoops!' message and automatically moved
onto the trap square as a result. The bear trap vanished!
I obviously wasn't trapped since I'm polymorphed into a
flying monster, but the trap glyph was no longer present.
The glyph looked like regular floor - as if I had
untrapped the bear trap and taken the trap with me."
The trap was actually still there but became hidden intentionally
for other valid scenarios, but was an unintended side-effect for
this scenario.
Fix it by failing the #untrap operation for a Flyer earlier on,
and in a more benign manner, since the Flyer ultimately doesn't
end up in the trap anyway. You'll still get the "Whoops!",
followed by a message, but that's as far as the "failed" #untrap
attempt will go under the circumstances.
Address a drum of earthquake inconsistency reported 2017-03-23:
"Drum of earthquake does not make you deaf. Leather drum or depleted
drum of earthquake does."
bug 1099
Like BL_FLUSH, only send BL_RESET if the window port has
indicated it wants them via setting the appropriate WC2
bits in its window_procs structure. Update documentation.
Fixing rnd_otyp_by_namedesc() for use by get_shiny() broke its use
by readobjnam(). Make the chance for 0% generation objects to have
non-zero chance of being selected be a parameter.
Fixes#134
An invisible hero (who can't see invisible and doesn't have autopickup
enabled) going down stairs to an object which fell down those stairs
will see the stairs instead of the object on them. Missing newsym()
in obj_delivery() when objects aren't being passed through scatter().
The wishing code uses 'oc_prob + 1' so that probability 0 (never
random) objects are eligible to be selected if their name matches
a wish; collecting 'shiny' objects shouldn't do that. (No effect
on play since there aren't any shiny objects with 0% random chance.)
rn2() takes int, and total oc_prob for entire objects[] array is
15000, so don't accumulate the target probability in a long.
The original report complained that gremlins seemed impervious to
Sunsword's light yet a flash from a camera caused them to cry out in pain
despite "The long sword named Sunsword begins to shine brilliantly!"
This commit does two things:
1. A dmg bonus is applied against gremlins using a lit Sunsword.
2. Gremlins will generally avoid the light emitted by Sunsword.
There's a few minor flavor bits thrown in also.
It is understood that this effectively makes Sunsword provide
"gremlin-proofing", but the gremlin myth and Sunsword's characteristic
feature pretty much demand it.
bug 42
With the code as it stood, receipt of BL_CHARACTERISTICS would
trigger a flush of output which may not have been the
intention.
Ensure the flush code is only on BL_FLUSH (or BL_RESET).
This outstanding bug was complicated slightly because the same
code was used for a sleeping mon as for a paralyzed mon so
message phrasing was called into question.
Just flip the phrasing to be about what you are able to discern
under those circumstances, which is very little, and don't have
the sleeping or paralyzed monster react to the mirror.