Pulled out the code that handles reading spellbooks while confused into a
new function that can be called from learn() to handle the timed onset of
confusion starting while you're reading.
When reading a cursed or too-hard book that's covered in contact poison
(presumably in the too-hard case, reading it made the poison), and you die,
the book would not be in the bones. remove in_use mark while assessing
damage.
On the other hand, not From a bug report, the message in the "6" case says
the book explodes, but had a 1/3 chance of not disappearing in the normal
case, and 100% chance of remaining if cursed while reading - when the
player survives. Return a flag to allow the book to be destroyed in this
case. No work needed for the death case; in_use is set.
> I'm working on a Nethack port, and one of the header files a
> library uses has a structure with a member named "red". Since
> includes/decl.h #defines red to something, this totally loses.
>
> Attached is a patch which fixes the color defines.
Reported to the newsgroup, the code in study_book for the effect of
confusion on studying a book was never reached. The study_book code
didn't completely handle continuing to read a book when you got confused
after getting interrupted.
- Changed a cancelled chat direction to abort the chat -- it seemed odd
that the old behavior would sometimes take time, sometimes not, depending
on the previous direction.
- Documented the current spelleffects behavior of re-using the last
direction after a cancelled getdir() & added a message.
The spellcasting code stopped counting a spell class's skill
exercise once that reached expert, so the only way that it could
end up being flagged as having reached maximum in the #enhance
feedback would be if it had already received enough exercise to
reach the hypothetical level beyond expert while it was still at
skilled or less.
It also didn't count the exercise if you were restricted in
the spell class, but that wasn't necessary because becoming
unrestricted--which I don't think is even possible for spells at
present--resets the counter back to 0 to discard any exercise
achieved while ineligible.
Make a change suggested by <Someone> to have the Wizard
enter harassment mode when you perform the invocation, in case
you manage to obtain the Book of the Dead without killing him.
Instead of just initiating that periodic effect, behave as if
you have actually killed him (which also affects random monster
generation frequency, prayer timeout, and shopkeeper salutations).
The comment about Book of the Dead's taming effect working
on nearby monsters when read while swallowed was wrong. It was
only put there in the first place to avoid adding extra code to
suppress taming while swallowed when that was done for the other
methods of taming. Any need for extra code here turns out to be
unnecessary due to the cansee() check.
If you get interrupted while reading a spellbook and then
the book gets destroyed or you change levels, the object pointer
remembered for the book will be invalid and could accidentally
match one subsequently allocated to some other book. That would
result in "you continue your efforts to memorize the spell" when
starting to read that other book; it would also end up bypassing
the reading difficulty check and reuse the old book's delay counter.
I don't remember who reported this. It was quite some time
ago and I have an abandoned patch dated last March from when I
first started to fix it.
Files patched:
include/extern.h
src/save.c, shk.c, spell.c
This adds <Someone>'s lens patch.
This is probably it for me adding in any more user-contributed patches for
3.3.2 (except maybe coin flipping; does anyone object to it?)
--Ken A.