I moved some stuff around after testing the changes in
58583cacf8 before committing it. It
accidentally ended up with 'gold' always being Null at the first
place it gets used (to vary the feedback when stealing everything
except gold).
Nymphs won't steal gold from the hero (so that their steal-item damage
isn't a superset of lerprechaun's steal-gold damage; straightforward
back when gold wasn't kept in inventory), but hero poly'd into a nymph
would steal gold from monsters.
Fixes#204
3.6.2's attempts to fix turning off SEDUCE in 'sysconf' introduced
an unintentional change in behavior for hero poly'd into nymph form:
theft attack always angered the target. The actual change was
intentional but its ramifications were unexpected.
Fixes#200
The Guidebook claims that there's no symbol for 'S_strange_object'
which is literally true, but there is one for S_strange_obj. It has
been in place longer than the paragraph claiming that there's no way
to customize that symbol. I'm not sure why variant spelling was used.
Also, files.c doesn't use loadsyms[], it calls a routine which returns
a pointer to a specific element in that array.
would describe it as trapped if you could see its location, but if
the trap was unseen that trap would remain unseen, at least in some
circumstances. Mark the trap as seen.
Wizard mode ^E and any mode spell of detect unseen or wand of secret
door detection failed to find mon->mundetected monsters if they were
hiding under objects, and failed to find those or other hiders or
mimics when the hidden monster was at a trap location. The fix for
the latter initially only worked if the trap was known, so took two
tries when a monster hid at the location of an unseen trap. So this
makes the additional change to find both things at the same time; it
isn't manual searching that stops as soon as something is found.
For ^X and final disclosure, report external issues that affect game
play: midnight, other night, new or full moon, and Friday the 13th.
The 'new feature' entry in the fixes file rambles a bit but if it
heads off even one spurious bug report, it'll have been worth it.
When kicking an altar, trigger divine wrath (minor: luck or alignment
loss) before deciding whether hero has hurt himself in the process.
Add some variation to the wrath penalty so that it can't be used to
precisely control Luck.
When mklev() is called multiple times, previous state stored in the
xxstairs_room pointers can be mistakenly used when making decisions about
the new level being constructed. This caused non-deterministic level
creation behavior when replaying from a snapshot.
Fixes#202
When swallowed, you can take things from the engulfer's inventory, if
there are any, via pickup. Items might be worn by the engulfer and
when "picked up" those weren't being unworn before being added to
hero's inventory. Then they would be formatted as "(being worn)" and
could trigger warnings or worse.
Conceptually they should be worn on the outside and not be accessible
from the inside, so I've made attempts to pick up worn items fail
rather than fix up the unwearing.
Using ':' when swallowed to look at the engulfer's inventory describes
that inventory as "contents of <mon>'s stomach". That's weird for any
worn items, but the situation is so rare I haven't made any attempt to
deal with it.
Rescue some old code from bit rot. It may be useful if the shop
side of things ever gets fixed. (Itemized billing reveals container
contents. I'm sure that it's in the bugzilla list but can't find it.)
If a player names an object with a name that ends in '\\', drops
that object on the floor nearby and does a look at nearby objects,
then the game will crash. This is caused by stack corruption when
the decode loop skips over the decode string terminator.
Extend support for highlight rules that specify percentages from HP
and spell power to experience level and experience points. For both
of those, the percentage is based on progress from the start of the
current Xp level to the start of the next Xp level. 100% isn't
possible so is used to enable highlighting a special case: 1 point
shy of next level, most likely to occur after losing a level.
This is something I had in mind a long time ago and then forgot all
about until fiddling with the final disclosure of experience points
recently. It turned out to be trickier than expected because it needs
to check whether Xp should have a status update when it hasn't changed
but Exp has gone up. The latter might hit a percentage threshold that
switches to another highlight rule. Fortunately changes to Exp, at
least that aren't part of level gain or loss (which always trigger
status updating), are all funnelled through a single place (I hope).
If you ask for help when wishing, don't leave "help" in the buffer
for EDIT_GETLIN to use as default answer on next retry. It does still
leave anything rejected as unknown so that the player has a change to
review the spelling and conceivably add and/or remove from the end
witout having to retype everything.
Wizard mode shows the number of points needed to reach the next level
(unless already maxxed out at 30) for ^X and end of game disclosure.
Do it in normal play for the latter too. (I think it would ok to do
that for ^X too but haven't gone that far.)
Even when it was wizard mode only, the phrasing for past tense had a
minor grammar bug, and it could make the line a little too long for
tty and curses (not sure about others) when level was high, resulting
in wrapped text. That looked bad for tty, which first tries removing
indentation (just 1 space in this case), making that line outdented
as well as wrapped. So change the phrasing slightly when experience
level is 'too high'. I had a version which formatted, measured, and
re-formatted if necessary but that was overkill; simple hardcoded
rephrasing suffices particularly when measuring was against assumed
display width (80) rather than actual width.
A recent fix for #wizidentify showing "Not carrying anything" after
listing inventory items still showed "Not carrying anything" after
"(all items are already identified)". Fix is easy.
Trickier bug was that ^I performs object ID on selected items while
the inventory routine is still in progress (but after it has processed
every item) and the ID routine will call update_inventory() which
will call the inventory routine to reformat invent. So the inventory
display routine was called recursively without having returned to
wizidentify where iflags.override_ID gets cleared to revert to normal
inventory. The nested call was unintentionally narrowing the contents
of persistent inventory window to whatever items were still unIDed.
(Any inventory update, including ^R, restored it to full inventory.)
So no one on Unix or Unix-like ever builds without tty support?
options.c:694:11: warning: unused variable 'opts' [-Wunused-variable]
Noticed when producing a curses-only binary to verify that erase_char
and kill_char weren't relying on tty being present.
Another one which has been around for a while. When merging two
globs, the result is partly eaten if either (or both) of them was
partly eaten, not just when the one that's going to stick around as
the combined glob already was.
Something I've had sitting around for quite a while. Add a sanity
check to mpickobj(). (It will need tweaking if b&c are changed to be
in engulfer's inventory.)
Also, include more information in the feedback when a nymph steals
attached iron ball: "Nymph removed your chain and stole a heavy iron
ball".
And don't set the avenge-ok flag if uball is the item stolen since
thief was doing hero a favor, or for anything when the thief is under
the influence of Conflict.
A check for bad restoration (ball without chain or vice versa) issued
a warning but then left the problem around to trip up other code.
'Fix' the problem by clearing those owornmask slots and their pointers.
Doesn't try to recover memory if the one that's found is OBJ_FREE.
Also some formatting.
The persistent inventory window wasn't being updated if you toggled
the 'sortpack' option interactively. (The new setting was honored
once something else triggered a 'perm_invent' update.)
The logic for toggling 'fixinv' seemed backwards. I hope this "fix"
for that hasn't actually broken it.
savebones() sets all the fruit indices negative, then resets to the
normal positive value for each fruit it actually writes into the bones
file. But if 'perm_invent' is enabled and something triggers an
update_inventory() while bones saving is in progress, object formatting
for the inventory display won't be able to find any fruits, resulting
in impossible "Bad fruit #N". Fix is to turn off 'perm_invent' when
the game ends, so it won't be On when bones are written. Disclosure
uses a popup for inventory so persistent window is obsolete by then
anyway.
[I don't know what is triggering update_inventory() while savebones()
is executing. Also, I don't see where the fruits whose index stayed
negative--because there aren't any on level being saved--get purged.
Maybe when those bones are loaded by another game?]
If a punished player picks up the iron ball, gets engulfed and
saves, then the saved game will have missed saving the dangling
chain since it was not on the floor or in the inventory. Upon
restoring the saved game, the game will be in a bad state since
the ball will be worn but the chain will be missing.
random_dir() for picking a spot to put a segment of a long worm's tail
(when it is being placed on the map, perhaps after teleport, not when
movement allows it to grow) had mistakes in three of the four compass
directions. The one for the top of the map was benign; it just
neglected to use the top row (#0). But it could pick a value off the
edge of the map for bottom and right or both.
This doesn't explain a couple of long worm [segment] oddities on the
Astral level because that level doesn't go all the way to the edge.
A couple changes dealing with overcrowded levels. So many monsters
are moving from the Plane of Water to the Astral Plane that the
latter can start out completely full.
Give monsters who trigger the endgame portals a 6/7 chance to not go
through ('home' elementals or any monster carrying the Amulet already
wouldn't go through). They should learn about magic portal trap in
the process and not voluntarily step on that afterward.
When the Wizard or other covetous monster tries to teleport next to
the hero and fails, he was being sent to limbo. There's no need for
that; he's already on the map and can just stay where he is. That
doesn't actually help with the endgame population issue, it just
fixes a couple of uses of mnearto().
I have significant changes for mnearto() and elemental_clog() that
also help with this but will test those more before committing.
when carrying things. The fuzzer toggled on 'perm_invent' and after
interrupting it I used ^I. Having 'perm_invent' enabled makes the
inventory code avoid having a totally empty inventory display (by
supplying "Not carrying anything" instead--in the menu rather than
via normal pline) so that interface code will see a change and know
that an update is needed. But to decide whether the menu was empty,
the inventory code was testing union 'any' field 'a_char' to check
whether some item had used the union (implying that something had
been passed to add_menu()), but wizidentify (^I) uses field 'a_obj'
instead. Apparently the a_char bits stayed 0 because the menu ended
up with "Not carrying anything" after a list of inventory items.
Switch to a separate variable to track whether anything has been put
into the menu instead of trying to rely on the union.
Unrelated but noticed when checking other "Not carrying anything"
instances, the #adjust command ends early when there's no inventory
but it was asking for a letter to adjust even when the only thing in
inventory was gold in '$' slot, which isn't allowed to be adjusted
away from that slot. Treat gold-only like no-invent.
Express the logic of various early returns more consistently.
clone_mon() wasn't handling mon->isminion correctly. I'm not sure
whether it is actually possible to clone a minion (maybe after
polymorphing it into a gremlin or blue jelly?). When it wasn't tame,
which is the case for every minion other than the guardian angel on
Astral, the emin structure wasn't being allocated for the clone but
its isminion flag was left set.
Also, clones inherited mon->mtrack[] so would unnecessarily avoid
moving onto spots the original had recently moved across.
Cloned pets are inheriting various pet-specific fields that they
probably should be starting with a clean slate on but I haven't made
any attempt to address that.
Observed on a text file with crlf endings on Linux, where the
so-called blank lines weren't being ignored as they should
have been, despite there being a line to remove \r from the
end.
A pointer was being pre-decremented before the check for a
matching whitespace character.
and receiving a random amulet instead of an "amulet of <foo>".
Although the failure to produce the 'right' amulet wasn't a regression
compared to earlier versions as the report indicated, supporting that
wish is straightforward.
Even though it isn't using verbalize() to make a specific statement,
don't let a demon ask the hero for a bribe when the hero is deaf.
Also, give alternate setup messages in a couple of places where a
divine voice is overriding deafness.
Recent commit 5d59b288c9 changed monster
zapping a fire horn at self to cure sliming to not use the wand-zap
feedback routine, but inadvertently did for zaps of wands of fire too.
Use the zap routine for wand and play-instrument routine for horn.
Recent fuzzer tweak had an unintended side-effect: NUL character is
used to indicate a mouse click and we weren't setting up fake value
for one of those. Go back to avoiding NUL when obtaining a random
value for user's keystroke.
A recent change to make_slimed() overlooked a different recent change
in how mon->m_ap_type and youmonst.m_ap_type are referenced. In this
case it had no impact; fix on general principles.
Prevent the fuzzer from randomly toggling the 'silent' option. If
you use the default value of True then this eliminates most--but not
all--of the beeping that happens when it is running. I'm not sure
where the remaining beeps are coming from.
Modify the random keystroke selection to implement some bias towards
direction keys that I thought had already been there, plus a higher
chance to entering digits to initiate number responses.
Like #annotate, #name monster, #name individual object, and #name
object type are places where it makes some sense to have an existing
name be the default for the new name, in case taking off from the end
and/or adding to the end is more convenient than retyping everything.
When there is an existing name used as default, clearing that default
and hitting <return> is not enough to remove the name, you still need
to 'assign a new name' of <space> to do that.
For wizard mode 'monpolycontrol', the getlin() answer buffer for the
"Change <monster> @ <x,y> into what kind of monster?" prompt is also
used to format the coordinate portion of that prompt, so when
EDIT_GETLIN is enabled getlin() was inadvertently given "<x,y>" to use
as default response. Clear it after the prompt is formatted instead
of via an initializer. Also, shorten the prompt on the first try:
"Change <monster> @ <x,y> into what?", expanding to the old prompt if
retry is needed.
This also allows specifying 'chameleon' when <monster> is a chameleon,
'doppelganger' when it's a doppelganger, and 'sandestin' when it's one
of those (but not 'doppelganger' when it's a chameleon or sandestin,
and so forth), instead of blanket refusal to accept any non-vampire
shapechanger as the choice.