]> granicus.if.org Git - nethack/log
nethack
17 years agoenlightenment revamp, part I (trunk only)
nethack.rankin [Mon, 21 Jan 2008 16:40:56 +0000 (16:40 +0000)]
enlightenment revamp, part I (trunk only)

     Groundwork for re-doing ^X so that it'll be more integrated with
enlightenment and display bottom line information without abbreviations
or long-line truncation.  `mode' doesn't do anything yet so may provoke
lint complaints.

17 years agosystem-wide configuration file
keni [Wed, 9 Jan 2008 01:57:41 +0000 (01:57 +0000)]
system-wide configuration file
Add options SYSCF (to add a system-wide configuration file) and SYSCF_FILE
(for a file-based implementation of SYSCF) - this allows a binary distribution
to be configured at install time.  The only option supported at this time is
WIZARDS - a list of usernames which can use -D; currently only for unix-likes
but should be extendable to anything that has a concept of multiple users.
Add mac tty multiuser config using sgid.

17 years agowin32 vs random.c
nethack.rankin [Sun, 23 Dec 2007 00:59:25 +0000 (00:59 +0000)]
win32 vs random.c

     From a bug report.
Pointer subtraction yields a result of type ptrdiff_t which can be
bigger than type long, potentially resulting in warnings about value
truncation--in these cases, when assigning to a long.

17 years agodrain energy attack (trunk only)
nethack.rankin [Thu, 20 Dec 2007 23:02:47 +0000 (23:02 +0000)]
drain energy attack (trunk only)

     During some recent newsgroup discussion, <Someone> posted an entry from
his personal bug list:  energy draining damage from ordinary attacks is
implemented even though there are no monsters with that capability and it
was not implemented for engulf attacks even though energy vortices have
the capability.  This implements energy drain engulf attacks against the
hero and also both modes of energy drain attacks for monsters and poly'd
hero against spellcasting monsters.  Since monsters don't have energy,
they lose access to their special abilities (their spells, that is) for a
few turns, same as a post-3.4.3 change done for anti-magic traps.

17 years agoremove time_t from struct you - follow up bit
nethack.allison [Wed, 19 Dec 2007 03:30:57 +0000 (03:30 +0000)]
remove time_t from struct you - follow up bit

17 years agoremove time_t from struct you (trunk only)
nethack.allison [Wed, 19 Dec 2007 03:19:25 +0000 (03:19 +0000)]
remove time_t from struct you (trunk only)

There was an issue reported where save files between different
versions of a manufacturer's compiler were incompatible because the time_t
ubirthday field was changed from 32 bits to 64 bits.

32 bit time_t implementations will break at 19:14:07 on  January 18, 2038.
64 bit time_t implementations will break at 23:59:59 on December 31, 3000.

This removes the dependency on the size of time_t from the save file.
The ubirthday field is no longer embedded in struct you.
This also adds two general purpose routines to hacklib.c, one to convert a time
value to a 14 character char representation and the other to convert that
back to time_t. Those are used by the save/restore routines.

This is a savefile breaking change, so editlevel in patchlevel.h was
incremented.

17 years agolong worm tail hit by potion thrown by monster (trunk only)
nethack.rankin [Mon, 17 Dec 2007 23:43:31 +0000 (23:43 +0000)]
long worm tail hit by potion thrown by monster (trunk only)

     From the newsgroup:  when a monster throws a potion at the hero and
it hits a long worm's tail, you'd get "The bottle|flask|&c crashes on the
long worm's _head_ and breaks into shards."  The relevant code changes
"head" to "body" when appropriate, but monster throwing wasn't setting up
`notonhead' so that alteration only kicked in for player throwing.

17 years agohints cleanup tids (trunk only)
keni [Mon, 17 Dec 2007 22:39:15 +0000 (22:39 +0000)]
hints cleanup tids (trunk only)

17 years agohints for linux X11; typo fix (trunk only)
keni [Sun, 16 Dec 2007 15:38:21 +0000 (15:38 +0000)]
hints for linux X11; typo fix (trunk only)
Add hints file for single-user linux X11.
Fix typo in macos-x11.
nethack.sh: don't run xset unless $DISPLAY is set

17 years agolinux hints file and xset bugfix (trunk only)
keni [Sun, 16 Dec 2007 02:18:22 +0000 (02:18 +0000)]
linux hints file and xset bugfix (trunk only)
Add a hints file for an ubuntu tty build and skip xset if no fonts.dir
file exists (this test will probably need another tweak, but I need a
linux x11 build first to test it).

17 years agoupdate or remove out of date config files
nethack.allison [Sat, 15 Dec 2007 14:29:21 +0000 (14:29 +0000)]
update or remove out of date config files

17 years agoupdate or remove out of date config files
nethack.allison [Sat, 15 Dec 2007 14:21:09 +0000 (14:21 +0000)]
update or remove out of date config files

17 years agoFirst pass at a hints-based build system to augment (not replace) the existing
keni [Thu, 13 Dec 2007 20:17:11 +0000 (20:17 +0000)]
First pass at a hints-based build system to augment (not replace) the existing
build system.

Anyone who wants to do a build from sys/unix and doesn't want to figure this
out just needs to do:
sh setup.sh hints/unix
instead of:
sh setup.sh
and then continue on as usual.

New files:
sys/unix/NewInstall.unx - the new directions
sys/unix/hints/* - the hints files.  There will be more later.
sys/unix/mkmkfile.sh - helper for setup.sh

Summary of changes:
see NewInstall.unx for info on the new build system
introduction of various preprocessor symbols to turn options off that
 are defaulted on historically
comment out nethackrc (and similar) entries that still use the old symbol
 syntax.
commenting out of Makefile.* lines that now come from hints/unix
GAMEDIR is replaced with HACKDIR so the Makefiles and the C source agree.
  Note that I have NOT changed the docs and/or Makefiles for be, msdos, os2,
  vms, or winnt.  If port maintainers don't then I will, but I can't test
  those ports.
nethack.sh now handles the font path automatically

17 years agoobj sanity bit (trunk only)
nethack.rankin [Mon, 3 Dec 2007 21:16:46 +0000 (21:16 +0000)]
obj sanity bit (trunk only)

     Remove some redundant declarations from recently revised code.

17 years agofix suicidal panic
nethack.rankin [Mon, 3 Dec 2007 21:13:58 +0000 (21:13 +0000)]
fix suicidal panic

     Some post-3.4.3 code in done() cleans up thrownobj and kickobj to
plug a potential memory leak (unnoticeable one since the game is over),
but they have to be free objects rather than on any list.  toss_up() was
leaving thrownobj defined after putting the thrown object on the floor,
leading to "obj not free" panic from dealloc_obj() if threw you an object
upward and it dealt fatal damage when it fell back down.  (For non-fatal
damage, toss_up()'s caller cleaned things up later.)

17 years agojetison old warning code
nethack.rankin [Sat, 1 Dec 2007 21:07:23 +0000 (21:07 +0000)]
jetison old warning code

     Get rid of most of the vestiges of the old warning code that was
replaced over 7 years ago.  I left the list of colors which were used for
warning flashes.

17 years agofix recent gold drop fix (trunk only)
nethack.rankin [Fri, 30 Nov 2007 07:11:59 +0000 (07:11 +0000)]
fix recent gold drop fix (trunk only)

     A recent change to prevent dropping 2**32 gold from producing an
object with quanity 0 also prevented dropping all your gold when omitting
a count.

17 years agofix recent gold pickup fix
nethack.rankin [Fri, 30 Nov 2007 07:10:49 +0000 (07:10 +0000)]
fix recent gold pickup fix

     A recent change to delete the floor object sooner when picking up
gold resulted in accessing that object after it had been freed.

17 years agoendgame portal detection (trunk only)
nethack.rankin [Sun, 25 Nov 2007 23:03:47 +0000 (23:03 +0000)]
endgame portal detection (trunk only)

     In the newsgroup about three weeks ago someone described trying to
use the Bell of Opening to find the magic portal on the Plane of Water
and not succeeding.  It's supposed to work like a wand of secret door
detection to mark nearby traps as known.  And does, but it turns out
that the wand wasn't working as expected there either.  They both require
line of sight, and since the water outside of the bubbles blocks that
they only found the portal if it was within the same bubble as the hero.
(Clouds on the Plane of Air posed a similar problem, although monster
activity usually reveals the portal on that level so this wasn't much of
an issue there.)  Since the detection magic doesn't require the hero to
see the traps--wand and Bell both work while blind--this patch overrides
the line of sight requirement on the Planes of Water and Air.  As long as
hero is within the detection magic's range, the portals on those levels
will get marked as having been seen and when the hero gets into the right
bubble or out of the clouds the portal traps will be shown on the map.

     The line-of-sight override code is simple-minded and lets players
find traps through boulders when/if those are present (but the found
traps won't be seen yet since vision still controls the map display).
Also, it assumes that only water/air/cloud terrain is present so could
potentially yield strange results if any other terrain gets introduced on
either of those two levels.

17 years agoshop gold vs hangup
nethack.rankin [Sun, 18 Nov 2007 19:52:44 +0000 (19:52 +0000)]
shop gold vs hangup

     From the newsgroup:  hangup save while picking up gold from the
floor in a shop would duplicate that gold in the save file.  First the
gold amount was being added to hero's gold, then two messages were given
[pline() or prinv() about pickup followed by one from costly_gold() about
shop credit], and lastly the floor gold would be removed.  The second
message could trigger --More-- and provide a controllable interruption
point between giving the gold to the hero and removing it from the floor.
Change this to do the removal step before feedback.

17 years agoopen/close while blind (trunk only)
nethack.rankin [Fri, 16 Nov 2007 06:53:23 +0000 (06:53 +0000)]
open/close while blind (trunk only)

     From a bug report, attempting to open or close
a door while blind didn't always update the map display after telling the
player that a remembered-closed door was already open or a remembered-open
door was already closed.  And in the cases where it did update the map to
reflect a change in door state, it didn't use up a turn.  Now always update
the display and use up a turn when 'o' or 'c' reveals any new information.

17 years agofix #H1419 - missing object sanity checks for nested containers (trunk only)
nethack.rankin [Tue, 13 Nov 2007 21:48:01 +0000 (21:48 +0000)]
fix #H1419 - missing object sanity checks for nested containers (trunk only)

     From a bug report, wizard mode's sanity_check
option has a check for container contents but wasn't using it recursively
for nested containers, so the contents of the latter weren't checked.
This fixes that, and also adds a check for objects carried by migrating
monsters.  And it now formats objects and monsters fully even if the hero
happens to be blind or hallucinating at the time.

     Tested by using a debugger to poke in various bits of invalid data.

17 years ago0 gold pieces (trunk only)
nethack.rankin [Thu, 1 Nov 2007 19:24:19 +0000 (19:24 +0000)]
0 gold pieces (trunk only)

     Newsgroup discussion about the devnull tournament which started
today has pointed out that ``d4294967296$'' would cause getobj() to create
a gold piece object with quantity 0 which then got dropped to the floor.
(It's specific to gold; other types of objects don't behave that way.)
Also, wrapping which went past negative and zero all the way to positive
again (like 429496729*10+7, yielding 1) wasn't detected.

17 years agoshapechanger's inventory (trunk only)
nethack.rankin [Wed, 31 Oct 2007 09:02:31 +0000 (09:02 +0000)]
shapechanger's inventory (trunk only)

     Newsgroup discussion points out that a chameleon which starts out
in nymph form also starts out with nymph's inventory (50% chance each for
mirror and potion of object detection).  That's not right; shapechanging
shouldn't manufacture items.  Also, the post-3.4.3 code to initialize
vampires was overly complicated in order to preserve chameleon behavior,
but the old chameleon initialization which used rndmonst() instead of
selecting a preferred shape was just that way by accident (says the
person who implemented preferred shapes however long ago and completely
overlooked that at the time...).

     This is tricky to test; ^G these days forces a created shapechanger
to start out in its natural form.  That's a bit odd to begin with (a side-
effect of transforming requests for uniques and other special monsters
into doggelgangers), but downright strange when monpolycontrol is enabled;
a prompt to pick monster shape is issued, then the player's choice gets
overridden.  I'm not sure which aspect, if any, of all this should be
changed to fix a wizard mode quirk.

17 years agomore vms file access
nethack.rankin [Wed, 31 Oct 2007 00:04:32 +0000 (00:04 +0000)]
more vms file access

     The fix for #H1409 a couple of days ago included updates for
sys/vms/Makefile.* but not vmsbuild.com.  I thought the latter didn't
need any, but was mistaken; vmsfiles.c needs to be compiled early in
order for vmsfiles.obj to be present in the object library when makedefs
gets linked.

17 years agovms file access
nethack.rankin [Sun, 28 Oct 2007 09:37:56 +0000 (09:37 +0000)]
vms file access

     Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)

17 years agoenlightenment feedback for sight-based properties (trunk only)
nethack.rankin [Fri, 26 Oct 2007 02:24:22 +0000 (02:24 +0000)]
enlightenment feedback for sight-based properties (trunk only)

     "You can see invisible" is misleading when you can't see anything,
so use alternate phrasing for See_invisible when blind.  Also, add extra
wizard mode feedback when blindness is overridden by the monk's Eyes
artifact, when invisibility is blocked by worn mummy wrapping, and when
clairvoyance is blocked by worn cornuthaum.  And fix end-of-game disclosure
for blindness; it was only being shown if/when caused by worn blindfold.

17 years agoinvisibility vs blindness
nethack.rankin [Fri, 26 Oct 2007 02:00:43 +0000 (02:00 +0000)]
invisibility vs blindness

     Reported a month ago by <email deleted>, putting on
a cloak of invisibility while blind and then using ';' or '/' to examine
yourself revealed that you had become invisible.  This fix just changes
the lookat() output when you can't see that you can't see yourself.  :-)
Probing and stethoscope still reveal invisibility, as will any message
which uses x_monnam() to identify the hero.  (First part is intentional;
last part seems not worth bothering about--I'm not even sure that the
player can arrange to trigger it.)

17 years agowizard mode typo
nethack.rankin [Fri, 28 Sep 2007 01:17:24 +0000 (01:17 +0000)]
wizard mode typo

Minor copy+paste carelessness for wizard mode wishing from 7 months ago.

17 years agoupdate tool shopkeeper names list (trunk only)
nethack.rankin [Sat, 15 Sep 2007 01:56:06 +0000 (01:56 +0000)]
update tool shopkeeper names list (trunk only)

     shknam.c had the same comment typo as the one just fixed in do_name.c.
In the process of fixing it, I noticed that the prefix usage for Janet's
name didn't match that comment.  And in the process of fixing _that_, I
promoted several names from being port-specific to general and added a few
missing ones.  There was no attempt to be comprehensive; I'm sure that lots
of port team members' names are still missing.

17 years agocomment typo (trunk only)
nethack.rankin [Sat, 15 Sep 2007 01:06:04 +0000 (01:06 +0000)]
comment typo (trunk only)

17 years agocovetous mons vs temple priests (trunk only)
nethack.rankin [Thu, 13 Sep 2007 01:00:05 +0000 (01:00 +0000)]
covetous mons vs temple priests (trunk only)

     Prevent monsters who kill other monsters to obtain the Amulet from
targetting a priest inside his temple.  Blocks players from just staying
on the Sanctum stairs while a teleporting arch-lich or Asmodeus fetchs the
Amulet from Moloch's high priest for them.  A previous post-3.4.3 change
prevented monsters from targetting the Wizard; this extends that (and
assumes that we can ignore the possibility of other temple priests ever
handling the Amulet).  The earlier patch went into the branch code, but
inhistemple() isn't available there so this one is trunk only.

17 years agofix #H1378 - vault guard interaction while swallowed
nethack.rankin [Sat, 1 Sep 2007 01:12:34 +0000 (01:12 +0000)]
fix #H1378 - vault guard interaction while swallowed

     From a bug report, if you're swallowed
while in a vault and the guard arrives, he'll ask your name even though
you're hidden within the engulfer.  This makes him give a message and
then leave, as is already done if you're mimicking an object or unable to
speak.

     This also suppresses his repeated "Move along!" message if you're
swallowed or held since it's silly to keep telling you to move when you
obviously can't.

17 years agofeedback from exploding potions of acid (trunk only)
nethack.rankin [Sat, 25 Aug 2007 00:32:10 +0000 (00:32 +0000)]
feedback from exploding potions of acid (trunk only)

     water_damage() gave "A potion explodes!" when destroying potions of
acid even when it was a stack of multiple potions exploding.  The vague
fixes entry "grammar, spelling and other typos" covers this one....

17 years agocomment bit
nethack.rankin [Thu, 23 Aug 2007 22:56:05 +0000 (22:56 +0000)]
comment bit

     Full moon and Friday the 13th affect Luck's equilibrium point, but
not its range (which is always -10 to +10 for natural luck, -13 to +13
when extended by luck-conferring objects).  The water_damage() comment
implying that max Luck could be 14 during a full moon was incorrect.

17 years agofix pet feeding feedback (trunk only)
nethack.rankin [Mon, 20 Aug 2007 23:32:42 +0000 (23:32 +0000)]
fix pet feeding feedback (trunk only)

     From a bug report, unseen pet sensed by
telepathy was referred to as "it" in the message given when it ate food.
This code is subtly convoluted and has now been changed at least four or
five times over the years.  This patch changes the terse comment to try to
spell out the intent.  Whether or not the new code actually matches that
intent remains to be seen....

17 years agore-fix #H1371 - dead monster fleeing
nethack.rankin [Mon, 20 Aug 2007 00:05:24 +0000 (00:05 +0000)]
re-fix #H1371 - dead monster fleeing

     From a bug report, a monster which
died by moving into a trap which was next to the hero standing on Elbereth
resulted in "The <mon> is killed!  The <mon> turns to flee!".  An earlier
change made monflee() return if it's given a dead monster, so the fleeing
message is no longer given.  This fixes the place where monflee() was
inappropriately being called for a dead monster in the reported situation.

17 years agotin access (trunk only)
nethack.rankin [Thu, 9 Aug 2007 03:20:24 +0000 (03:20 +0000)]
tin access (trunk only)

     From the newsgroup:
The tin opens like magic!
<some interruption occurs>
You stop opening the tin.
Either it opens immediately or it doesn't, so the "opens like magic"
message is inaccurate.  Rather than simply changing the phrasing, this
gives blessed tins a 50% chance to really open immediately so that their
contents are available for eating on the same turn, and 50% to behave as
before but with a message which is suitable for the single turn delay.
Hero poly'd into a metalivore always gets the same-turn case when eating
any tin.  Use of a tin opener has a chance to do so (always when blessed,
50/50 for same-turn vs 1 turn delay when uncursed, 33/33/33 same-turn or
1 or 2 turn delay when cursed).

     Overall, blessed tins are better than they used to be, since half
of the time you'll save a turn, but they're still not reliable to eat in
the midst of combat since sometimes you'll need another turn and will be
likely to get interrupted in that situation.  Uncursed tin openers still
give the same behavior as opening blessed tins, so are also better than
they used to be.  Blessed tin openers are now superior, and cursed ones
are slightly inferior in addition to being welded to hero's weapon hand.

17 years agodrawbridge feedback (trunk only)
nethack.rankin [Fri, 3 Aug 2007 01:49:33 +0000 (01:49 +0000)]
drawbridge feedback (trunk only)

     The open and close commands had some feedback when player attempted
to use them on a drawbridge, but they didn't handle all the permutations.

17 years agofix #H1232 - hole in ice is described as moat [2 of 2] (trunk only)
nethack.rankin [Fri, 3 Aug 2007 01:09:13 +0000 (01:09 +0000)]
fix #H1232 - hole in ice is described as moat [2 of 2] (trunk only)

     Adding an extra parse rule changes yacc's tables and has produced a
large diff for a small update.

17 years agofix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
nethack.rankin [Fri, 3 Aug 2007 01:05:50 +0000 (01:05 +0000)]
fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)

     From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.

17 years agorogue level display symbols (trunk only)
nethack.rankin [Tue, 31 Jul 2007 03:00:41 +0000 (03:00 +0000)]
rogue level display symbols (trunk only)

     Michael pointed out what needed to be fixed in order to change gold
on rogue level from regular "$" back to intended "*".  This was post-3.4.3
code so no fixes entry needed.

17 years agofix segfault from splitting 1hp long worm
nethack.rankin [Sat, 28 Jul 2007 03:26:45 +0000 (03:26 +0000)]
fix segfault from splitting 1hp long worm

     Fix the crash From a bug report, where
having the hit that cuts a long worm into two also take the original down
to 1 HP would result in clone_mon() returning null and nethack crashing due
to a segmentation fault or access violation.  The same thing could happen
if there's been enough long worms created to get them flagged as extinct.

     This bug was only present in 3.4.3.  Prior to that, cut_worm() did
its own monster creation inline instead of calling clone_mon(), ignoring
extinction and too-low hit points.

17 years agomore F move (trunk only)
nethack.rankin [Thu, 19 Jul 2007 08:20:20 +0000 (08:20 +0000)]
more F move (trunk only)

     Using F prefix when trying to move into a wall or closed door yielded
"you attack thin air".  Like the recently fixed F-vs-boulder case, give
more appropriate feedback.  Also like F-vs-boulder, initiate digging if
wielding a pick-axe.  (Also handles axes versus trees and closed doors).

     One thing which isn't handled but possibly should be:  F vs closed
door when not wielding a pick or other axe might attempt to force the door.
(Right now it gives "you harmlessly attack the door".)

17 years agotreasure drop drop (trunk only)
nethack.rankin [Thu, 19 Jul 2007 07:02:46 +0000 (07:02 +0000)]
treasure drop drop (trunk only)

     From the newsgroup:  objects created when killing a monster over
water weren't being affected by falling into the water.  The objects were
being created directly on the floor instead of being dropped as if they'd
been in the monster's inventory.  This fixes the random "treasure drop"
item, but special items--like dragon scales and the miscellaneous golem
remains--produced by make_corpse() are still put directly onto the floor.

     The check to prevent small monsters from dropping big objects was
overly complex, possibly due to the 3.1.x weight threshold bug which was
just recently fixed.  Food rations and leashes pass the weight test so
don't need to be special cased; spears, polearms, and morning stars fail
the weight test.  (Javelins are an exception; they pass the weight test
so are allowed to be dropped by small monsters now since spears aren't
special cased any more.)

17 years agomore fighting boulders (trunk only)
nethack.rankin [Tue, 17 Jul 2007 13:52:27 +0000 (13:52 +0000)]
more fighting boulders (trunk only)

     Followup to yesterday's "you attack thin air" fix for when there's a
boulder at the target location:  if wielding a pick-axe or mattock and you
use F to explicitly try to attack a boulder, dig the boulder to break it.
Also, treat statues like boulders:  F at them gets "you harmlessly attack
a statue" for non-pick weapon, or digs/breaks statue when wielding a pick.
Classified as a new feature in the fixes file.

17 years agominimal_xname() fix (trunk only)
nethack.rankin [Tue, 17 Jul 2007 13:35:54 +0000 (13:35 +0000)]
minimal_xname() fix (trunk only)

     ansimpleoname() and siblings always reported statue and figurine
type to be "of a giant ant" because the corpsenm field was left as 0.
Explicitly set it to -1 in the minimal object and teach xname() to leave
off the monster type in that situation, yielding just "a statue" or "a
figurine".  [It's tempting to classify this as an xname() bug since other
object types which use corpsenm do so in doname().]  No fixes entry; this
is post-3.4.3 code.

17 years agoextremely porous boulders (trunk only)
nethack.rankin [Tue, 17 Jul 2007 01:07:37 +0000 (01:07 +0000)]
extremely porous boulders (trunk only)

     This is another item from "#Q397: List of Bugs from #nethack" sent
in Janurary by <email deleted> and containing a list
of things collected from the IRC channel associated with nethack.alt.org's
public server.  Using F prefix and moving toward a boulder would give
"You attack thin air."  Now that'll be "You harmlessly attack a boulder."

17 years agocrossing long worms' tails (trunk only)
nethack.rankin [Tue, 17 Jul 2007 00:29:44 +0000 (00:29 +0000)]
crossing long worms' tails (trunk only)

     This is one of the items from "#Q397: List of Bugs from #nethack" sent
in Janurary by <email deleted> and containing a list
of things collected from the IRC channel associated with nethack.alt.org's
public server.  Moving diagonally between segments of a worm tail is
conceptually passing right through the worm's body.  This patch prevents
moving in such a fashion for both the hero and monsters (it's still
possible to fight in that position though).  It only applies when the two
tail segments are consecutive.

|......  In the diagram here, where tail segments are represented by
|.w1?..  digits indicating relative sequence number, the @ can still
|..@2..  move between segments 2 and 5 to reach !, but can no longer
|.65!3.  move between 1 and 2 to reach ?.  [However, if there is a
|...4..  monster at the ? spot, it can still hit @ and vice versa.]

     Missiles and wand zaps still pass through such diagonals without
noticing or affecting the worm.  I'm not sure whether this ought to be
extended to change that--it might get pretty messy since it would need
to be considered during monsters' targetting as well as during the path
traversal itself.

17 years agoseeing a monster make itself invisible
nethack.rankin [Mon, 16 Jul 2007 06:44:57 +0000 (06:44 +0000)]
seeing a monster make itself invisible

     From the newsgroup:  you could get "suddenly you cannot see the <mon>"
even though it remained visible.  Cited case was for an orc who drank a
potion of invisibility while being observed by a hero wielding Sting, which
causes orcs to be displayed even when they're invisible.  But it could also
happen when non-blind telepathy or extended monster detection is in effect.

17 years ago"fix" #H894 - reading mail violates illiterate conduct (trunk only)
nethack.rankin [Sat, 14 Jul 2007 00:37:51 +0000 (00:37 +0000)]
"fix" #H894 - reading mail violates illiterate conduct (trunk only)

     From a bug report, reading a scroll
of mail violates illiterate conduct and he requests that it not do so.
I didn't go that far, since unlike needing to read the Book of the Dead
to be able to finish the game, reading scrolls of mail is completely
voluntary and someone attempting voluntary challanges can choose not to
do it.  Instead, this issues a prompt to require confirmation if reading
such a scroll will be the first violation of that conduct.  Ordinary
players can answer no and then use '!' to read mail from a shell.  I'm not
sure what'll happen to players on public servers who aren't given access
to a shell.  Usually they wouldn't be able to get mail either, so more
elaborate servers like the one at nethack.alt.org which allow players to
use mail to communicate with each other will have to come up with their
own solution (perhaps by providing a mail-reader-only shell).

17 years agodisplacing grid bugs (trunk only)
nethack.rankin [Fri, 13 Jul 2007 23:40:43 +0000 (23:40 +0000)]
displacing grid bugs (trunk only)

     From a bug report, you could swap places with a pet grid bug when
you're making a diagonal move.  Now you can't.  [Completely ignored:  it
is possible to swap places with pets which are incapable of movement....]

     This imposes the same restriction on the astral Riders when they're
exchanging places with monsters in their way.

17 years agodrawbridge tuning
nethack.rankin [Mon, 9 Jul 2007 00:53:59 +0000 (00:53 +0000)]
drawbridge tuning

     Reported recently by <email deleted>:  opening or
closing the castle drawbridge by playing the tune wasn't using up a turn.

17 years agocrop rotation (trunk only)
nethack.rankin [Sun, 8 Jul 2007 23:51:17 +0000 (23:51 +0000)]
crop rotation (trunk only)

     More tuning to throttle pudding farming (plus endgame Rider farming).
Earlier changes made cloned black puddings less likely to leave corpses,
to cut down on sacrifice fodder a bit, and cloned anything less likely to
drop random items when killed; this one makes killing cloned or revived
monsters be worth less experience as the number killed goes up, to cut
down on final score inflation.  [With several boulders and magic missile
or a polearm, it's possible to kill any of the Riders repeatedly with
virtually no risk of even getting hit, much less of getting killed.  Now
if you kill Pestilence 240 times it will be worth 62720 points instead of
297840 (not including doubling bonus for ascension), with an additional
19 points per kill instead of 1241 after that, requiring a couple orders
more magnitude of abuse--excuse me, superhuman "patience"--to get the
score to reach the overflow threshold.]

     While testing this, I got "The Famine's corpse glows iridescently."
This fixes that too.  Also, previously unused kill count for experience()
had an off by one error; was including ``+ 1'' even though mvitals[].died
has already been incremented by the time that that code uses it.

17 years agofix #H620 - dangerous/disruptive strings in bones data
nethack.rankin [Fri, 29 Jun 2007 01:18:51 +0000 (01:18 +0000)]
fix #H620 - dangerous/disruptive strings in bones data

     It's possible for the player to put escape sequences into strings via
dogname/catname/fruit options (or probably interactively by using "\233"
instead of "\033["--the two character 7-bit version wouldn't work because
its leading ESC gets treated as player's request to abort current input,
but the 8-bit version probably works, I just can't test it because I don't
know how to type such things with this terminal emulator).  Such sequences
can do funny things like clear the screen and say "game over" (or worse
with creative abuse of some terminals' "answer back" capability--when
reproducing the reported situation, I kept things simple and had my dog's
name underlined and fruit name blinking; they displayed correctly but
nethack was confused about how long they were since it doesn't expect to
be given characters which don't advance the cursor).  This fix still lets
users experiment with such stuff during their own games, but it replaces
suspect characters while loading bones data, so if one player creates a
bones file with suspect strings in it, another can--I hope--be able to
use that file safely.

     Monster and object names, engravings, and named fruits are handled.
For the last, if uncensored string matches one already present then it
leaves that alone, so bones data created with same OPTIONS=fruit:whatever
as being used in the current game will continue to keep the same value.

17 years agocouple of DUNGEON_OVERVIEW fixes (trunk only)
nethack.rankin [Tue, 26 Jun 2007 03:10:39 +0000 (03:10 +0000)]
couple of DUNGEON_OVERVIEW fixes (trunk only)

     New hero would remember part of old one's terrain discoveries (such
as presence of fountains) for bones levels.  Also, some topology changes
(such as fountain destruction) can be detected by touch while blinded but
dungeon overview continued to remember the old feature.  Post-3.4.3 code.

17 years agoAmulet-covetting monsters attack Wizard
nethack.rankin [Thu, 21 Jun 2007 02:35:30 +0000 (02:35 +0000)]
Amulet-covetting monsters attack Wizard

     Another entry in $cvsroot/shared/bugs/buglist, this one reported by
<email deleted>:  if the Wizard had the Amulet and used
his "double trouble" spell, his clone would attack him in order to try to
get the Amulet.  This prevents any monster who's after the Amulet from
attacking the Wizard to get it.

17 years agovery old death drop bug
nethack.rankin [Thu, 21 Jun 2007 02:15:26 +0000 (02:15 +0000)]
very old death drop bug

     From an entry in $cvsroot/shared/bugs/buglist From a bug report:
when item weights were all scaled up by a factor of 10 for 3.1.0, the
code controlling random item drops by monsters still limited small ones
to dropping things of 3 weight units of less.  Scale that up to 30.

17 years agomore precise dipping prompt (trunk only)
nethack.rankin [Thu, 21 Jun 2007 01:32:41 +0000 (01:32 +0000)]
more precise dipping prompt (trunk only)

     Someone in the newsgroup accidentally dipped the wrong item into a
fountain and wants the second prompt to be "Dip <obj> into the fountain?"
instead of just "Dip _it_ into the fountain?", hoping that he would have
noticed that he had selected the wrong object.  I think he's fooling
himself there, but this gives a brief object name for fountain, pool, and
potion prompts.

17 years agodrowned in a moat on the Plane of Water (trunk only)
nethack.rankin [Tue, 19 Jun 2007 03:58:36 +0000 (03:58 +0000)]
drowned in a moat on the Plane of Water (trunk only)

     From the newsgroup:  drowning on the Plane of Water gave cause of
death as "drowned in a moat".  There was already some post-3.4.3 code to
handle naming of moat on Juiblex level as "swamp", but it wasn't used for
drowning's cause of death and we were still getting "drowned in a moat"
there too.  Now the Plane of Water yields "drowned in deep water" and
Juiblex's level yields "drowned in a swamp".

17 years agoWIZKIT overflow tweak (trunk only)
nethack.rankin [Tue, 19 Jun 2007 03:13:20 +0000 (03:13 +0000)]
WIZKIT overflow tweak (trunk only)

     Redo the $WIZKIT overflow handling from a few days ago.  Instead of
having two migration codes which both mean "with the hero", combine them
and add a mask flag to control scattering at the destination to be able to
get the alternate behavior.

17 years agoWIZKIT inventory overflow (trunk only)
nethack.rankin [Sat, 16 Jun 2007 04:18:14 +0000 (04:18 +0000)]
WIZKIT inventory overflow (trunk only)

     Wizard mode's $WIZKIT can specify an unlimited number of items to
add to starting inventory and they'd be put there without regard to the
number of slots in use, potentially resulting in an arbitrary number of
'#' slot items.  Cap at 52 slots, same as when picking up, and put any
excess items at the hero's feet.  It's slightly tricky because the level
hasn't been created yet at the time the wizkit gets processed.

17 years agoGOLDOBJ pickup handling (trunk only)
nethack.rankin [Sat, 16 Jun 2007 02:22:01 +0000 (02:22 +0000)]
GOLDOBJ pickup handling (trunk only)

     For GOLDOBJ configuration, relax the 52 object limit for inventory
when gold uses the special $ slot instead of a letter.  Takes care of an
old buglist entry from the beta testers.  [It will need to be revisited
if we ever implement multiple coin types that can't all fit in one slot.]

     Also for GOLDOBJ, prevents nymphs and monkeys from stealing coins,
since allowing that made their steal-item attack be a complete superset
of leprechaun's steal-gold attack.

17 years agofixes35.0 typo (trunk only)
nethack.rankin [Sun, 10 Jun 2007 03:25:06 +0000 (03:25 +0000)]
fixes35.0 typo (trunk only)

17 years agofix #H348 - "you trip over it" after non-"it" message (trunk only)
nethack.rankin [Sun, 10 Jun 2007 03:01:31 +0000 (03:01 +0000)]
fix #H348 - "you trip over it" after non-"it" message (trunk only)

     Reported to us by <email deleted>:
  'You are beginning to feel hungry.  You trip over it.'
and also recently in the newsgroup by "<Someone>":
  There is ice here.  *You see here an electric eel corpse.*
  Bib hits the electric eel.  Bib misses the electric eel.
  Bib misses the electric eel.  The electric eel misses Bib.
  The electric eel misses Bib.  *You trip over it.*

     slip_or_trip() was oversimplifying things by assuming that if there
is one object at the hero's location, a message about what that object is
has just been given.  Any timeout message which precedes Fumbling (lots
of candiates besides hunger) could intervene, as could monster activity
between the hero's move and timeout handling.  Aside from the reported
cases, that code hadn't been updated to account for the new pile_limit
option which could be set to 1 and force a popup display instead of the
usual "you see <an item> here".  This fix adds a flag that can be used
to track the most recent message.  It is cleared by pline for every
message, so pline's caller sets it _after_ the message of interest has
been displayed.

17 years agomonster polearm usage (trunk only)
nethack.rankin [Sat, 9 Jun 2007 02:18:44 +0000 (02:18 +0000)]
monster polearm usage (trunk only)

     From newsgroup discussion, reproduced with current dev code (the
missing capitalization is a post-3.4.3 buglet):

  The orc tries to wield a halberd.
  the orc's bow is welded to her hand!
  The orc thrusts a halberd.  You are almost hit by a halberd.

Caused by overloading polearm attacks with throwing.  The monster throwing
code didn't enforce that a polearm must be successfully wielded.

17 years ago#adjust bounds bug
nethack.rankin [Tue, 5 Jun 2007 02:45:09 +0000 (02:45 +0000)]
#adjust bounds bug

     Noticed while looking at something else:  doorganize() goes out of
array bounds for alphabet[] when inventory contains something in the '#'
slot, or in the '$' slot for GOLDOBJ config.  Both # and $ pass the
(let <= 'Z') test, then produce a negative result for (let - 'A' + 26).
In my case, it was harmlessly clobbering the tail end of buf[] but it
could potentially be a lot worse.

17 years agoigniting unpaid potions of oil (trunk only)
nethack.rankin [Sun, 3 Jun 2007 02:33:34 +0000 (02:33 +0000)]
igniting unpaid potions of oil (trunk only)

     From another many year old news posting:  if you picked up a stack
of potions of oil in a shop and then applied them, one potion was split
off and started burning but you were forced to pay for all of them.
Split the to-be-lit one off first so that the remainder of the stack
stays as ordinary unpaid shop goods.

     This also fixes an old bug with bill_dummy_object sometimes charging
a different price than the player got quoted when an object was picked up.

17 years agoHeart of Ahriman hack (trunk only)
nethack.rankin [Sun, 3 Jun 2007 01:05:43 +0000 (01:05 +0000)]
Heart of Ahriman hack (trunk only)

     From a four year old news posting:  hero was levitating via #invoke
on the Heart of Ahriman, then dropping that artifact yielded:
  You drop a gray stone named The Heart of Ahriman.
  You float gently to the floor.
  A gray stone named The Heart of Ahriman hits the floor.
That might be strictly correct, assuming that both hero and stone fall at
the same speed; if the stone was dropped from perhaps waist height then
the hero's feet would touch first.  But it looks strange, like a cartoon
where something hangs in midair until someone notices that it should fall.

     Removing the artifact from inventory causes the #invoke property to
toggle off.  Unfortunately it has to be done here before the object can
be placed at its destination.  Modifying message order seemed unviable;
this fix fiddles with the Levitation property in order to defer hero's
descent until after object handling is finished.  Now same setup gives:
  You drop a gray stone named The Heart of Ahriman.
  A gray stone named The Heart of Ahriman hits the floor.
  You float gently to the floor.
  You see here a gray stone named The Heart of Ahriman.

17 years agoastral high priests revisited (trunk only)
nethack.rankin [Sat, 2 Jun 2007 23:30:57 +0000 (23:30 +0000)]
astral high priests revisited (trunk only)

     Prevent remote ID of the three high priests on the Astral Plane via
wand of probing or via their own actions (observing "high priest of Foo
drinks a potion of speed" and so forth).  When not immediately adjacent,
you'll get "the high priestess" instead of "the high priestess of Foo".

17 years agopunctuation tidbit
nethack.rankin [Sat, 2 Jun 2007 23:18:56 +0000 (23:18 +0000)]
punctuation tidbit

     The prompt to a hero with lycanthropy and polymorph control about
whether to change into beast form had an extra space between the question
and the [yn] answer choices.

17 years agomonst vs steed tidbit
nethack.rankin [Sat, 2 Jun 2007 22:00:29 +0000 (22:00 +0000)]
monst vs steed tidbit

     I came across an old bug report which stated that steeds missed out
on their chance to counterattack if the hero had just taken some action
other than moving.
        [1: monster attacks steed instead of hero ]
        [2: if monster died while attacking, return 1 ]
        if (i & MM_DEF_DIED || u.ux != u.ux0 || u.uy != u.uy0)
                return (0);
        [4: otherwise, steed counterattacks monster ]
Sometime since whatever version the 2001 report was for, but before the
current cvs repository was set up someone addressed this by changing it
to be
        if (i & MM_DEF_DIED || !u.umoved)
                return (0);
but I think that fixed the wrong thing.  I believe that the original code
was attempting to make sure that the steed was still in position to be
able to counterattack.  There's no reason to care about the hero's most
recent action; he had to have done something that caused time to elapse
in order for the other monster to have initiated an attack in the first.
(The new range check is actually redundant; mattackm() also enforces it.)

17 years agofix #H363 - reviving corpses of hiding monsters (trunk only)
nethack.rankin [Thu, 31 May 2007 01:42:48 +0000 (01:42 +0000)]
fix #H363 - reviving corpses of hiding monsters (trunk only)

     From a bug report, reviving a snake corpse
produced a snake monster which was hidden under nothing--it hid under its
own corpse and wasn't revealed when that corpse got used up.  Rather than
fiddling with sequencing to remove the corpse before making the monster,
force any monster who revives in hidden state to unhide.

17 years agounicorn horn vs sustain ability (trunk only)
nethack.rankin [Tue, 29 May 2007 03:52:02 +0000 (03:52 +0000)]
unicorn horn vs sustain ability (trunk only)

     Forwarded from newsgroup by <Someone> in February, 2005:  non-cursed
unicorn horn fixes lost Str/Con/&c stats even when ring of sustain ability
is supposedly locking those at current value.  This makes unicorn horn
honor the Fixed_abil intrinsic.  The potion and spell of restore ability
still override that, so they now have potential for use even after player
has acquired a unihorn.  Prayer also continues to override Fixed_abil.
Major prayer result to heal crippled strength now attempts to uncurse a
ring of sustain ability (or gloves or weapon covering it up--similar
situation as with cursed levitation).  Minor prayer result to fix lost
stats resets those without attempting to do anything about Fixed_abil.

17 years agodull spellbook (trunk only)
nethack.rankin [Tue, 29 May 2007 02:51:47 +0000 (02:51 +0000)]
dull spellbook (trunk only)

      Something else <Someone> forwarded from the newsgroup long time ago:
attempting to read a dull spellbook ought to have a chance of making the
hero fall asleep.

17 years agoHallucination vs gaze attacks (trunk only)
nethack.rankin [Tue, 29 May 2007 02:00:25 +0000 (02:00 +0000)]
Hallucination vs gaze attacks (trunk only)

     Suggested by <Someone> in March, 2005 based on newsgroup discussion
at the time:  hallucination protects against touch of death attack by
disrupting how the hero's brain reacts, so why not against gaze attacks
too?  This gives hallucinating hero 75% chance of being unaffected by
gazes.  If unaffected or if the gazer has been cancelled, the gaze will
fail with some feedback.  Previously, all cancelled gazes failed but only
Medusa's gave feedback.

     This will give players another way to defeat Medusa, but since it
isn't foolproof and there are several sure fire ways already, I don't
think it'll hurt play balance there.  It may be useful to avoid getting
repeatedly stunned by Archons though.

17 years agodestroy_mitem message tidbit (trunk only)
nethack.rankin [Mon, 28 May 2007 03:38:12 +0000 (03:38 +0000)]
destroy_mitem message tidbit (trunk only)

     "the kobold's potion of healing boils and explodes!"
Should be capitalized.  Post-3.4.3 code; branch isn't using yname() here.

17 years agomakeplural/makesingular vtense fix (trunk only)
nethack.rankin [Mon, 28 May 2007 03:30:26 +0000 (03:30 +0000)]
makeplural/makesingular vtense fix (trunk only)

     "The death ray hit it."  Changes to vtense() during the makeplural
makesingular overhaul four weeks ago contained a typo, or rather a set of
matching thinkos.

17 years agoengulfing at dangerous location (trunk only)
nethack.rankin [Mon, 28 May 2007 01:35:25 +0000 (01:35 +0000)]
engulfing at dangerous location (trunk only)

     From a bug report, 2005:
engulfers affected by conflict might swallow and kill monsters in pools
(not mentioned:  or lava or traps) and move to that spot, then not drown
til next move.  Make drowning and trap checks when engulf attack succeeds
instead of waiting for next turn.

     [This was #2 of the 3 minor bugs; the others have already been fixed.
They were:  (1) placing and exploding a land mine on a lowered drawbridge
would leave a pit instead of destroying the bridge; and (3) cause of death
string "killed by Mr. Izchak, the shopkeeper" should omit "Mr.".]

17 years agoconfirmation for polearm attacks (trunk only)
nethack.rankin [Mon, 28 May 2007 00:20:43 +0000 (00:20 +0000)]
confirmation for polearm attacks (trunk only)

     From a bug report, 2005:  applying a
polearm towards a monster ignores the `confirm' option.  It's a wielded
weapon attack but is handled internally as a throw since it's also a
ranged attack.  The report included a small patch for use_pole() but I'm
calling the regular attack confirmation routine instead.

     Also, move the penalty for samurai attacking peaceful monsters into
the same routine that handles knight attacking defenseless monsters so
that they're more consistent.

17 years agodigging/chopping a drawbridge
cohrs [Sun, 27 May 2007 22:56:02 +0000 (22:56 +0000)]
digging/chopping a drawbridge
<Someone> mentioned this back in 12/05.  Digging a closed drawbridge would
result in a "This wall is too hard..." message.

17 years agofix C343-22 - #untrap while levitating (trunk only)
nethack.rankin [Sun, 27 May 2007 03:07:24 +0000 (03:07 +0000)]
fix C343-22 - #untrap while levitating (trunk only)

     Revise untrap() to handle being unable to reach the floor.  That
whole routine is a mess and should probably be rewritten.

     Included at no extra charge:  #untrap didn't check whether player
picked a spot off the edge of the map so could go out of array bounds.

17 years agokick/joust monster positioning (trunk only)
nethack.rankin [Sat, 26 May 2007 05:56:26 +0000 (05:56 +0000)]
kick/joust monster positioning (trunk only)

     From a 7.5 year old news posting (with a reply by Kevin Hugo speaking
on behalf of slash'em...):  when a monster "nimbly jumps to evade" hero's
kick, it can pass through walls and grid bugs can jump off their grid.
Likewise when a joust or staggering blow knocks a monster back, it could
move grid bugs diagonally.  This fixes both cases.

     Offhand I can't think of any other non-standard movement situations
which might need similar handling, but it wouldn't surprise me if there
are some.  Leashed movement is close but I don't think maybe_mnexto helps.

17 years agolatex Guidebook [2 of 2] (trunk only)
nethack.rankin [Sat, 26 May 2007 02:36:38 +0000 (02:36 +0000)]
latex Guidebook [2 of 2] (trunk only)

     The documentation for symset also changed Guidebook.tex to use the
hyperref package, which the old DECUS TeX distribution I'm using doesn't
have.  I can't remember any discussion about inserting URLs into the
Guidebook and using LaTeX to generate html output.  If there was, no
comments to that effect made it into the .tex file or the cvs log text.
So I'm guessing that \usepackage{hyperref} was a work-around for the
font issue (below) and that the latter was a side-effect of converting
from deprecated \documentstyle{} to recommended \documentclass{}.

     I tried installing hyperref after tracking it down, but using it
generated complaints about several other packages either being too old
or missing entirely.  Coping with them would be too much hassle.  I also
tried just commenting it out, but that results in a font warning that I
assume isn't present when it gets used.  I managed to cobble together
a fix for that, but since hyperref.sty isn't actually needed by our
Guidebook, it was simpler to revert to the way things were done back in
the old days....

17 years agolatex Guidebook [1 of 2] (trunk only)
nethack.rankin [Sat, 26 May 2007 02:35:50 +0000 (02:35 +0000)]
latex Guidebook [1 of 2] (trunk only)

     Last fall when Michael added the symset stuff to supersede the old
handling for IBMgraphics and DECgraphics, Guidebook.tex was changed to
support multi-page tables in the output.  But that requires that the
input be processed twice, because it requires feedback stored in
Guidebook.aux and the first pass can't rely on that file being present
or up to date.  This updates the Unix, VMS, and OS/2 makefiles to do
two-pass processing.  (I didn't see latex usage anywhere else, and the
branch version doesn't include the formatting change which needs this.)

17 years agoC/#name followup too (trunk only)
nethack.rankin [Fri, 25 May 2007 03:26:56 +0000 (03:26 +0000)]
C/#name followup too (trunk only)

     Rephrase "a type of object" to "the type of an object" in the menu.
#name
  What do you want to name?
  a - a monster
  b - a particular object in inventory
  c - the type of an object in inventory
  d - the type of an object on discoveries list

17 years agoC/#name followup (trunk only)
nethack.rankin [Fri, 25 May 2007 02:47:29 +0000 (02:47 +0000)]
C/#name followup (trunk only)

     Update #name's description for extended command help, `# ?'.

17 years agoC/#name menu, calling old discoveries [2 of 2] (trunk only)
nethack.rankin [Fri, 25 May 2007 02:02:44 +0000 (02:02 +0000)]
C/#name menu, calling old discoveries [2 of 2] (trunk only)

     Implement <Someone>'s menu-mode for #name, primarily because it
is the natural place to add [re]naming entries in the discoveries list,
something that was requested in the newsgroup ten or so years ago.  The
latter allows changing the type name of something which has previously
been named and is no longer being carried.

     This also makes the C command become a synonym for #name or vice
versa; one or the other could now be reassigned to something else.

17 years agoC/#name menu, calling old discoveries [1 of 2] (trunk only)
nethack.rankin [Fri, 25 May 2007 02:01:54 +0000 (02:01 +0000)]
C/#name menu, calling old discoveries [1 of 2] (trunk only)

     Implement <Someone>'s menu-mode for #name, primarily because it
is the natural place to add [re]naming entries in the discoveries list,
something that was requested in the newsgroup ten or so years ago.  The
latter allows changing the type name of something which has previously
been named and is no longer being carried.

     This also makes the C command become a synonym for #name or vice
versa; one or the other could now be reassigned to something else.

#name
  What do you want to name?
  a - a monster
  b - a particular object in inventory
  c - a type of object in inventory
  d - a type of object on discoveries list

Menu group accelerators provide unseen alternate choices:  C for monster,
y for individual object, n for object type (and d for discoveries, but
that's only interesting if inventory is empty so that usual b & c are
omitted and discoveries entry moves up to b).  These alternates allow
`#name y' and `#name n' to work the same as before, for users who have
trouble retraining their fingers.  Using C to name a monster now takes an
extra keystroke, but using `C C' for it could make that be less annoying.

17 years agorehumanize bit (trunk only)
nethack.rankin [Tue, 22 May 2007 01:00:57 +0000 (01:00 +0000)]
rehumanize bit (trunk only)

     Something else from a copy of an old news message:
  You return to human form!
  Do you want your possessions identified?
I don't think that this can actually happen any more because the pieces
of code which subtract hit points should all be polyself aware now, so I
didn't bother with a fixes entry for it.

17 years agogem probabilities (trunk only)
nethack.rankin [Tue, 22 May 2007 00:53:36 +0000 (00:53 +0000)]
gem probabilities (trunk only)

     This is probably on <Someone>'s bug list, but I don't remember where
that lives.  I found a copy of an old news message by him which pointed
out that gem probabilities are set for a given dungeon level at the time
it is being created, but they don't get reset when an existing level is
revisited.  So giants' inventory creation and any monsters' death drops
generate gems using values from the level most recently made rather than
from their/hero's current location.  That can lead to high level gems in
the main dungeon after entering the mines.

17 years agoanmesia of last discovery (trunk only)
nethack.rankin [Tue, 22 May 2007 00:41:12 +0000 (00:41 +0000)]
anmesia of last discovery (trunk only)

     While testing something, I noticed that my last remaining discovery
would never be forgotten.  The formula
  count = ((count * percent) + 50) / 100
always yields 0 with count==1 and percent==25 (the value used for mind
flayer attacks).  Not likely to come up in actual play very often....

17 years agofix #H333 - boulder theft
nethack.rankin [Sat, 19 May 2007 04:09:01 +0000 (04:09 +0000)]
fix #H333 - boulder theft

     From a bug report:  nymphs could steal
boulders even though they aren't allowed to pick those up.  It happened
becuase can_carry() is only called for monkeys (consequently, they don't
have this problem), not for nymphs.

17 years agofix #332 - strangulation affects headless monsters (trunk only)
nethack.rankin [Fri, 18 May 2007 02:10:39 +0000 (02:10 +0000)]
fix #332 - strangulation affects headless monsters (trunk only)

     From a bug report:  amulet of strangulation
continues to kill hero if he polymorphs into a creature which doesn't
need to breathe or doesn't have a head or even a circulatory system.
Currently, the messages are different when the hero doesn't need to
breathe, but that doesn't seem good enough.  This makes strangulation
stop when you polymorph into something which shouldn't be vulnerable and
restart if you poly into something vulnerable while still wearing the
bad amulet.

     can_be_strangled() is doing more checks that necessary, in case the
strangulation property ever gets conferred by something other than an
amulet.  Its criteria for protection from strangling might need tweaking.

17 years agodefunct tame engulfer
nethack.rankin [Thu, 17 May 2007 06:30:18 +0000 (06:30 +0000)]
defunct tame engulfer

     From the newsgroup:  Conflict caused tame engulfer to swallow hero.
To try to get out, player hit it (with Magicbane, but that's not relevant
other than to provide an alternate "you hit it" message).

  The magic-absorbing blade probes the invisible Audrey!
  You get regurgitated!
  placing defunct monster onto map?
  Program in disorder, &c
  [some look_here() feedback]
  You kill poor invisible Audrey!

The problem was caused by hmon_hitmon():  it subtracted damage from the
target's hit points, did some bookkeeping and message delivery, then
called killed().  One bit of bookkeeping was to call abuse_pet() and
monflee() when the target is tame, regardless of whether the damage was
fatal.  monflee() -> release_hero() -> expels() puts the hero and the
engulfer back onto the map, and that warning was triggered because the
former engulfer had no hit points left.

17 years agofix #H331 - kicking at empty takes no time
nethack.rankin [Thu, 17 May 2007 03:12:32 +0000 (03:12 +0000)]
fix #H331 - kicking at empty takes no time

     From a bug report, getting the "you kick at
empty space" result doesn't use any turns but can have side-effects like
waking up monsters and negatively exercising hero's stats.  It should take
a turn even though nothing gets kicked.

17 years ago#vanquished (trunk only)
nethack.rankin [Sun, 13 May 2007 02:39:25 +0000 (02:39 +0000)]
#vanquished (trunk only)

      Add #vanquished command to show the vanquished monsters list during
play.  At present it's only available in wizard mode.  Slash'em has it as
a regular mode command, and I found it handy sometimes:  when I managed to
kill an unfamiliar monster, I could immediately get an idea of how the game
ranked its difficulty compared to other monsters.  But having this command
available might encourage extinctionism.  On the other hand, it might stop
some existing extinctionists from cycles of save+copy+restore+quit to view
disclosure data for their current game.

     This also makes merging the wizard mode extended commands into other
extended commands be more robust.  It will panic instead of going out of
array bounds if someone adds entries to debug_extcmdlist[] without also
expanding extcmdlist[] to make room.

17 years agomirror fixes (trunk only)
nethack.rankin [Sat, 12 May 2007 02:01:18 +0000 (02:01 +0000)]
mirror fixes (trunk only)

     From some notes I made prior to release of 3.4.3, about applying a
carried mirror in the direction of a monster:

 invisible player applying mirror toward monster which can't see invisible
   should have no effect (monster can't see hero's equipment);
 similarly when inside engulfer regardless of whether it can see invisible;
 applying mirror at worm tail shouldn't work but does;
 applying mirror toward unseen monster that can see invisible (so should be
   able to see its own image) doesn't work because bhit() won't target it;
 mirror shouldn't work when target is only visible via infravision.

The fourth one is iffy since it assumes that invisible monsters produce
invisible reflections rather than no reflections.  The reverse of that is
probably more reasonable but isn't as interesting.  The fifth one may be
contradictory; it fails to extend that logic to "infravisible monsters
produce infravisible reflections."

17 years agohowmonseen - monster visibility (trunk only)
nethack.rankin [Sat, 12 May 2007 01:30:00 +0000 (01:30 +0000)]
howmonseen - monster visibility (trunk only)

     Pull some code out of lookat() so that it can be used elsewhere.
howmonseen(mon) returns a bitmask of the ways that hero can see mon.

17 years agosplattered oil fix
nethack.rankin [Fri, 11 May 2007 02:25:55 +0000 (02:25 +0000)]
splattered oil fix

     splatter_burning_oil() is called when a lit potion of oil gets
broken, and it can dish out fatal damage to the hero.  An earlier fix
to prevent a light-source panic (thrown item is not on any of the object
lists) during bones creation didn't address leaving that lit potion
intact if it was on the floor (which can happen if the breakage is caused
by striking or force bolt rather than its being thrown or kicked).  Use
the existing obj->in_use mechanism as a more general fix, after teaching
bones code that it applies to other things besides the hero's inventory.