Finally apply the patch sent by <Someone> in 11/2003 for slashem-Bugs-799278,
updated to match the current code and handle additional cases. The fix
is brute force: always ensure nomovemsg is set when nomul is called with
a negative value. I also scanned the code for places manually setting
multi negative, they all set nomovemsg. It would be nice to have a function
that did the right thing, but there are several special cases and I was
not feeling creative.
From the newsgroup: player offered the Amulet with a pet adjacent
to his character, and instead of getting "You and Fido ascended" he got
"Fido is still eating" followed by "You ascended". Make all adjacent pets
eligible to accompany an ascension even when they're in circumstances where
they'd be prevented from coming along on a normal level change.
When testing drawbridge stuff recently I ended up with an unseen
monster who evidently cast the aggravation spell repeatedly, yielding a
steady stream of "you feel that monsters are aware of your presence"
messages. This patch makes monsters tend to avoid repeating that spell
once everyone on the level has already been woken up. It also extends
the spell effect so that it will wake monsters like quest nemesis and the
Wizard who ordinarily wait until you get close before they become active.
Fix a buglist entry: fracturing a boulder or statue owned by a shop
was ignored by the shopkeeper. The existing vague fixes entry of "some
shop thefts weren't charged" covers this.
<Someone> reported: You kill it! A potion of invisibility shatters!
Change the rule in hero_breaks() to avoid giving info for things out of
sight, except when from_invent is set, to preserve desired behavior.
Several places were not using safe_qbuf or anything equivalent to avoid
overflowing a QBUFSZ buffer. Add more uses plus one special case. For
the current max lengths returned by xname(), I think this is
sufficient. This addresses a reported buffer overflow for a
"thoroughly rusty thoroughly corroded helm of opposite alignment", plus more.
As From a bug report, twice. Change max_passive_dmg to multiply the
result by the number of direct attacks the aggressor can make. This way, a
tame mind flayer, for example, will avoid pounding on a spotted jelly and
dying as a result of the Nth passive response.
Suppress "Mr" or "Ms" title for shopkeepers when they're going by a
first name rather than a surname. The bug report was for Izchak, but it
would have happened with the two last resort names (which I've never seen
in actual use) and for the "hippie names" used in post-3.4.x health food
shops. I have not attempted to specify gender for those, just flagged
them as first names. This prepends a prefix character to the name string
(see comment in shknam.c) to specify gender and/or first name vs surname.
Allow health food stores to carry eggs and tins of veggy contents in
their stock. The tins will almost always contain spinach because random
tins containing meat are converted into that.
Also, allow health food stores to be placed with the level compiler
(not tested) and to be forcibly placed in wizard mode via SHOPTYPE setting
of "V". Increments EDITLEVEL in patchlevel.h because lighting store in
Minetown got renumbered and the special level for it needs to be rebuilt.
Groundwork for having health food shops carry tins as part of their
stock. (That part isn't finished yet.) The choice of which types of tin
preparation might be sold as health food is rather arbitrary. Tweak if
needed--but keep in mind that just because something is marketed as health
food doesn't necessary mean that it's actually healthy; vice versa as well.
Tin handling could be simplified if tin->spe for spinach was changed
from 1 to -1. Then checks for spinach could compare against SPINACH_TIN
instead of a magic number, and with non-spinach tin->spe would be a direct
index rather than needing negating and offsetting.
Shop items stolen or destroyed without being in inventory were handled
inconsistently compared to simply picking up unpaid items because different
criteria got used to decide whether the shk cares about something. Last
December a hack to deal with this for container contents was introduced but
that left the problem for ordinary items. This patch attempts to address
it by using a common check for theft and for pickup's add-to-bill.
It hasn't had nearly enough testing and I won't be very surprised if
one or more new obscure shop bugs have now come into being, but perhaps
they'll at least be consistent bugs as far as shop billing is concerned....
I didn't remember a new shop type of "health food store" being added.
While trying to test some shop changes, it sure threw me for a loop when
a shopkeeper who sold lots of food refused to buy any. This patch teaches
such shks to buy vegetarian food. (No fixes entry included since the
relevant code hasn't been released yet.)
Shouldn't such shops sometimes carry tins and eggs in their initial
stock? They currently don't because those items fail the material==VEGGY
test. Adding eggs would be easy; tins are messier since you can't decide
whether they're vegetarian until after they've been created.
Neither nymphs nor monkeys can steal a ring worn underneath gloves
since they can't see them. If such rings are randomly targetted, try to
take gloves instead.
Succubi trying to take worn ring of adornment will attempt to take
off worn gloves first. (Presumeably they can sense magic rings hidden
beneath gloves better than nymphs can; they're about to try to take all
worn armor off anyway....) If the glove removal fails, ring theft will
too. Likewise for incubi, remove gloves before trying to force the hero
to put on ring of adornment.
At the moment succubi and incubi can't remove gloves which are
blocked by a welded weapon, but they can manipulate rings then if there
aren't any gloves involved. I don't think that's right. The latter is
nymph-like and could be attributed to magic, but if that's the case why
aren't they able to remove gloves from under cursed weapons too?
Prevent monkeys from stealing any ring which the hero can't remove due
to it being stuck inside the grip of a cursed weapon. Nymphs can still do
so though. From a bug report.
Revert mostly to <Someone>'s original approach for keeping track of whether
a container being applied or looted had been destroyed by the operation.
askchain() now knows not to attempt to re-merge an item that has been
destroyed (a theorhetical action since no stackable items can trigger a
magic bag explosion) like the earlier change to menu_loot(). Also have
use_container() clean up after itself so that current_container never has
an old pointer value left around.
My simpler fix for dealing with stale pointers caused by magic bag
explosion didn't handle menu_loot() checking whether to merge a destroyed
object with a stack it had been split from (the case <Someone> didn't attempt to
address either). That only needs a one-line change, but this also removes
the illusiion of generality that menu_loot() tried to maintain. It always
operates on current_container and relies on calling in_container() and
out_container() which do the same, so passing a container argument to it
was not useful. If that had been taken out first, <Someone>'s method of fixing
the original problem would have been simpler than mine but I'm not planning
to back out the earlier change.
Also fix a minor post-3.4.3 bug with a container-contents-known flag
being set incorrectly.
Fix the two problems that <Someone> reported about stale pointer use
after a bag of holding has exploded. use_container() passed the wrong
variable for quantity when calling useupf(), and doapply() had no way to
tell if the object being used had been destroyed so could use an invalid
pointer when checking for speaking artifact. The fix for the latter is
much simpler than what <Someone> suggested.
Newsgroup discussion has pointed out that after performing the
invocation ritual to gain access to the bottom level, it is possible to
skip almost all of Moloch's Sanctum by level teleporting in (and back out
to retry if necessary) directly to the high priest's temple. This fix
doesn't prevent entering that level via teleport or make you end up at
the stairs, it just forces arrival to be on the right side so that you'll
need to slog through the morgue room and the big chamber surrounding the
temple. Since there isn't much before the morgue aside from a few small
rooms with a secret door or two, it's no longer a very worthwhile shortcut.
Someone in the newsgroup mentioned that there is no warning from blessed
food detection if you attempt to eat a tin of Medusa meat. touch_petrifies()
isn't enough to catch that. A warning was given about Medusa's corpse, but
only if you lacked poison resistance. Eating a tainted Medusa corpse had a
similar problem; the check to override food poisoning so that petrification
takes effect missed it. This makes the petrification checks be consistent,
including hypothetical case of Medusa egg.
When a wish request for "<foo> armor" fails to match anything, check
whether it matches "<foo> mail" before resorting to selecting a random piece
of armor. Most of the suits are named "mail", and while I don't think many
people will ask for "ring armor", I do think that "crystal plate armor" and
"gray dragon scale armor" are sometimes tried.
This also greatly simplifies the handling for spelling variant "armour"
by rewriting it to "armor". Unfortunately "grey" vs "gray" can't be handled
the same way since both spellings are used by the program.
A user recently complained that he started an activity such as
searching and specified a repeat count, right after getting--and not
realizing the significance of--the first message in the countdown
sequence for turning into stone. He suggested that subsequent messages
interrupt multi-turn activity so that the player has a chance to do
something to prevent imminent death. This implements that, with the
added wrinkle that it won't interrupt if the activity is something that
might save the character's life: attempting to eat a tin that is either
sure to help (if ID'd as food that cures stoning) or a desparate gamble
(if unID'd). Some hooks for similar behavior for other conditions like
turning into slime are included, although no tins can help for anything
other than petrification so far.
Shouldn't fatal illness have an end-is-near countdown too?
Implement a user suggestion that tame humanoids should avoid eating
corpses of their own species. Prevent them--except for kobolds, orcs, and
ogres--from doing so unless starving. Arbitrary: tame elves won't eat
other elves even when starving. A polymorphed character will incur the
effects of cannibalism when eating either his/her underlying race _or_
the current one (player orcs and cavemen aren't affected though).
o Add support for zlib compression via ZLIB_COMP in config.h (ZLIB_COMP
and COMPRESS are mutually exclusive).
o rlecomp and zerocomp are run time options available if RLECOMP and
ZEROCOMP are defined, but not turned on by default if either COMPRESS
or ZLIB_COMP are defined.
o Add information to the save file about internal compression options
used when writing the save file, particularly rlecomp and zerocomp
support.
o Automatically adjust rlecomp and zerocomp (if support compiled in)
when reading in an existing savefile that was saved with those options
turned on. Still allows writing out of savefile in preferred format.
o In order to support zlib and not conflict with compress and uncompress
routines there, the NetHack internal functions were changed to
nh_uncompress and nh_compress as done in the zlib contribution received
in 1999 from <Someone>.
I tagged the sources NETHACK_3_5_0_PREZLIB prior to applying these
changes.
As reported, you'd get the "float gently to the ground" message even while
riding a flying steed. Rearranged the code and added a new case for this.
I found it odd that Hallucination protected you from falling out of the
saddle due to the Sokoban air currents. The message implied otherwise, so
I've made the sokoban_trap code apply in both cases.
<Someone> reported that if you polymorph into a flying monster while in a
pit, you must take u.utrap turns to first climb out before you can fly. Of
course, once you're out, you can swoop down into the pit to pick things up
w/o delay. Rather that have you automatically fly out (e.g. like quaffing
a potion of levitation), I thought it was better to take a turn to fly out,
so that's what I've implemented.
The code to deal with exiting a pit is moved to a new climb_pit function
and the "up" command now lets you climb from a pit too (something I've
found non-intuitive in the past).
Finally, I noticed that non-moving monsters could still go up/down even
though they couldn't move around. Added non-moving checks in doup/dodown.
move the message so it's before the mintrap test. newsym's are needed
to ensure the display is correct if a --More-- prompt results. I left the
"frighten" message alone, except for tense. As per Pat's suggestion, I
changed the wording to future-proof the message.