]> granicus.if.org Git - nethack/log
nethack
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.

17 years agoobject deletion bookkeeping
nethack.rankin [Fri, 11 May 2007 00:56:26 +0000 (00:56 +0000)]
object deletion bookkeeping

     Remove some obfree() vs dealloc_obj() confusion.

17 years agoSunsword vs shades, take II (trunk only)
nethack.rankin [Thu, 10 May 2007 03:03:46 +0000 (03:03 +0000)]
Sunsword vs shades, take II (trunk only)

     From the newsgroup:  Sunsword is ineffective against shades.  It
gets a special bonus of double damage vs undead, but since it's not made
of silver it was only doing 1 point of damage against shades.  Make the
bonus-vs-undead attribute override the silver-required criterion.  (No
comparable handling for flimsy weapons against thick-skinned critters
this time.)

17 years agoSunsword vs shades _reversal_
nethack.rankin [Thu, 10 May 2007 02:20:22 +0000 (02:20 +0000)]
Sunsword vs shades _reversal_

     Reverse the previous patch.  It made other artifacts like Fire Brand
also do full damage against shades, which wasn't inteded.  Back to the
drawing board....

17 years agoSunsword vs shades
nethack.rankin [Thu, 10 May 2007 02:14:10 +0000 (02:14 +0000)]
Sunsword vs shades

     From the newsgroup:  Sunsword is ineffective against shades.  It
gets a special bonus of double damage vs undead, but since it's not made
of silver it was only doing 1 point of damage against shades.  Make the
bonus-vs-undead attribute override the silver-required criterion.  (If
there's ever a whip or other flimsy weapon which gets a bonus against
some type(s) of thick-skinned monster, its attack will override the skin
thickness in similar fashion.)

17 years agof-iring without ammo refinement
nethack.rankin [Tue, 8 May 2007 03:45:53 +0000 (03:45 +0000)]
f-iring without ammo refinement

     A change a couple of weeks ago to have player's chosen ammo be auto-
quivered when using the 'f' command while quiver is empty was excluding
objects with quantity 1.  That was on the basis that it was in the process
of being thrown so there was no point in putting it into the quiver slot
first.  But if it was a boomerang, or Mjollnir under suitable conditions,
there was a chance for it to be available for another throw, so there is
a point to quivering it.  Also, player can hit ESC at the direction prompt
and end up not throwing it after all.  So, put even quantity 1 items into
the quiver when 'f' command is used with empty quiver.

17 years agobreaking empty wands
nethack.rankin [Tue, 8 May 2007 02:02:22 +0000 (02:02 +0000)]
breaking empty wands

     I found a copy of a news posting from 1996 which suggested that
using a[pply] to break a wand which has 0 charges should have a chance of
wresting out one extra charge, like zapping.  That way the player can't
destroy spent wands with impunity, and it makes the two wand actions be
more consistent.  Also, it's trivial to implement.  :-)

17 years agolast? singular/plural update (trunk only)
nethack.rankin [Tue, 8 May 2007 02:01:08 +0000 (02:01 +0000)]
last? singular/plural update (trunk only)

     Move some common code from makeplural & makeingular into a separate
routine.  Also, add ``candelabrum <-> candelabra''.  Wizard mode wishing
for "candelabra" now works; "Candelabra of Invocation" does not--not due
to case but because the " of " isn't preceded by 's' in the plural form.

17 years agochatting with grunting monsters
nethack.rankin [Sun, 6 May 2007 00:57:49 +0000 (00:57 +0000)]
chatting with grunting monsters

     From the newsgroup:  attempting to #chat to a gnome elicited "the
gnome grunts" (because gnomes have MS_ORC sound, and MS_ORC is just a
synonym for MS_GRUNT) even when the hero was a gnome.  This patch makes
MS_ORC (orcs, gnomes, kobolds, a couple of named demons) or MS_GRUNT
(ogres, ettins, trolls, gargoyles) behave as MS_HUMANOID when the hero
has same race.  That by itself wasn't quite enough; hostile MS_HUMANOID
monsters other than fake players wouldn't respond, so this gives those
a generic message (threatening the hero).  In a somewhat similar case,
peaceful MS_CUSS monsters wouldn't respond; now they say something too.

17 years agoenlightenment for Half_xxx_damage (trunk only)
nethack.rankin [Sat, 5 May 2007 22:44:51 +0000 (22:44 +0000)]
enlightenment for Half_xxx_damage (trunk only)

     Include Half_physical_damage and Half_spell_damage in enlightenment
feedback and end-of-game disclosure.

17 years agozhitu thinko (trunk only)
nethack.rankin [Sat, 5 May 2007 21:41:54 +0000 (21:41 +0000)]
zhitu thinko (trunk only)

     Spotted by Janet:  in the ``using #monster to breath[e] at self''
patch I accidentally reversed the Half_spell_damage adjustment (to breath
only from non-breath attacks only, not by doubling instead of halving
damage :-).  Changing it to include zaps by the hero is intentional.

17 years agousing #monster to breath at self (trunk only)
nethack.rankin [Sat, 5 May 2007 04:32:19 +0000 (04:32 +0000)]
using #monster to breath at self (trunk only)

     When testing the monster-breath-at-self patch I noticed that trying
to cure green slime by having hero breathe at self didn't work.  The code
was calling buzz() with arguments that produced an attack directed against
the hero's location, but there was a chance for it to miss outright and
when it didn't, reflection would block it.  This makes breathing at
yourself with `#monster' comparable to zapping a wand or casting a spell
at yourself:  it always hits.

17 years agogreen slime vs fire breathers (trunk only)
nethack.rankin [Sat, 5 May 2007 04:10:32 +0000 (04:10 +0000)]
green slime vs fire breathers (trunk only)

     Extend defense against being turned into slime to monsters who can
breathe fire.  Other attack types which dish out fire damage didn't seem
suitable for this.

17 years agomakeplural typo (trunk only)
nethack.rankin [Sat, 5 May 2007 02:23:22 +0000 (02:23 +0000)]
makeplural typo (trunk only)

     I misspelled piranha.

17 years agomakeplural/makesingular overhaul redux (trunk only)
nethack.rankin [Sat, 5 May 2007 01:31:47 +0000 (01:31 +0000)]
makeplural/makesingular overhaul redux (trunk only)

     Move some of the singular<->plural transformations from code to data.
Also fixes one more missed singularization:  lurkers above.  A big chunk
of this is just a bit of minor reorganization:  moving otense() & vtense()
next to makeplural(), and moving the wishable subranges array from between
makeplural & makesingular to in front of the wishing code.

     I was going to redo makeplural to use the same style as makesingular
(switch from ``len >= N && !strcmpi(buf, spot-(N-1))'', with spot pointing
at final character, over to ``BSTRCMPI(bp, p-N)'' which tests p-N against
bp as the bounds check and has p pointing to the string's terinating '\0')
but have decided not to tackle that.

17 years agomore plural/singular (trunk only)
nethack.rankin [Thu, 3 May 2007 01:17:46 +0000 (01:17 +0000)]
more plural/singular (trunk only)

     Extend makeplural/makesingular case-insensitivity to vtense() and to
wizard mode wishing for dungeon features.  And the previous set of fixes
missed one:  makesingular("zombies") was producing "zomby".  Plus a bit of
groundwork for a likely second overhaul of makeplural/makesingular.

17 years agomakeplural & makesingular overhaul (trunk only)
nethack.rankin [Tue, 1 May 2007 03:59:32 +0000 (03:59 +0000)]
makeplural & makesingular overhaul (trunk only)

     I stumbled across a copy of an old newsgroup bug report which
complained that wishing for "Gauntlets of Power" didn't work.  I thought
that this was something which had already been fixed, but when I tried it
out, I discovered that you still couldn't wish for that.  It was failing
because case-sensitive makesinglar() didn't recognize that "Gauntlets"
needs special handling.  After the unwanted transformation, the case-
insensitive object matching would fail to find "gauntlet of power".

     Removing case-sensitivity for special cases like "boots" and "gloves"
would have fixed that, but this patch goes further and removes case-
sensitivity entirely for both makesingular and makeplural.  Words which
get their endings modified work when the input is upper or mixed case.
Any modified letters retain the case of the original, so the reason for
case-sensitivity--user specified fruits that aren't lower case--is covered.

     Some makeplural fixes:  the plural for dingo is dingoes (dictionary
says "-es", not "-s") and for roshi is roshi (just guessing here; most of
the Japanese names use same spelling for singular and plural, but we were
producing roshis).  Several words which makesingular leaves in plural form
(boots, gloves, &c) are now recognized by makeplural (avoiding gloveses).

     It also fixes a bunch of incorrect singularizations of plural monster
names:  foxes, *wolves, lynxes, fungi/humunculi/succubi, mumakil, wumpuses,
baluchitheria, Aleaxes, *elves, erinyes, djinn, priestesses, & valkyries.
Some non-monsters that makeplural handles correctly were also not being
singularized right:  feet, hooves, lice/mice, algae, children, nemeses.

17 years agoexplode() while engulfed (trunk only)
nethack.rankin [Mon, 30 Apr 2007 04:56:37 +0000 (04:56 +0000)]
explode() while engulfed (trunk only)

     For an explosion caused by the player while the hero is engulfed,
skip adjacent monsters.  Also, don't give "you hear a blast" when an
unseen explosion is caused by a scroll of fire (explosion is always unseen
when hero is engulfed, regardless of explosion's cause).  [Offhand I'm
not sure whether something other than the player can trigger an explosion
while the hero is engulfed.]  Lastly, round up instead of down when a
monster takes half damage, so that non-zero can't be reduced to zero.

17 years agomore data.base
nethack.rankin [Mon, 30 Apr 2007 03:32:42 +0000 (03:32 +0000)]
more data.base

Reformat a couple of older movie dialog entries to match the newer ones.

17 years agocombat, potion, archeologist data.base entries
nethack.rankin [Mon, 30 Apr 2007 03:01:22 +0000 (03:01 +0000)]
combat, potion, archeologist data.base entries

     Add second quotes for archeologist and potion, plus a silly new entry
for combat.

17 years agomonsters defending against slime (trunk only)
nethack.rankin [Mon, 30 Apr 2007 02:47:11 +0000 (02:47 +0000)]
monsters defending against slime (trunk only)

     Like their use of lizard corpses to defeat being turned into stone,
let monsters use wands of fire, fire horns, and scrolls of fire to try to
defeat being turned into slime.  If the scroll is read while confused, it
won't succeed.  Otherwise, monsters who don't resist fire will take some
damage in the process and might end up killing themselves (although with
the testing I've gone I've yet to see that happen--I guess that means
that handling for dying-in-the-process hasn't been adequately tested...).

     So far, they don't know how to jump onto adjacent fire traps, nor
will fire breathing monsters breath at themselves.  I don't know whether
I'll get around to tackling either of those.

17 years agoslime groundwork
nethack.rankin [Mon, 30 Apr 2007 02:18:03 +0000 (02:18 +0000)]
slime groundwork

     New macro slimeproof() to decide whether something is susceptible
to turning into green slime.  Most of this is just making use of existing
cached permonst values in damageum() and mdamagem() and shouldn't affect
anything.  I wanted to avoid mixing that in with the actual slime changes
which are coming.

17 years agopile_limit option - movement feedback "there are objects here" (trunk only)
nethack.rankin [Fri, 27 Apr 2007 02:05:28 +0000 (02:05 +0000)]
pile_limit option - movement feedback "there are objects here" (trunk only)

     Something that pops up in the newsgroup periodically, with <Someone>
inevitably pointing out the bit of code that the user needs to tweak,
about control of feedback when hero is walking across floor objects.
Implement new option ``pile_limit'' which allows user to set the point
at which the game switches from listing the objects to giving "there are
several/many objects here".  Default is 5, same as previous hard-coded
value (1 object gets listed via pline, 2..4 are listed in a corner popup,
5 or more objects yields a pline message instead).  Setting pile_limit
to 0 means no limit, so objects will always be listed regardless of pile
size.  Setting it to 1 effectively forces no listing since any non-empty
pile size is always at least that big, so can produce "there is an object
here" even though that's no briefer than a pline() to show one object.

17 years agofix #285 - feeling cockatrice corpse while blind (trunk only)
nethack.rankin [Thu, 26 Apr 2007 02:19:25 +0000 (02:19 +0000)]
fix #285 - feeling cockatrice corpse while blind (trunk only)

     From a bug report:  moving while blind
and gloveless onto spot containing a cockatrice corpse is fatal if there
are fewer than 5 items there, but harmless when you get the "there are
several/many objects here" result for 5 or more.  I thought that this was
something which had already been changed, but it wasn't.  Run a touch
check on the whole pile of objects even when no object-by-object feedback
is being given.

     Trunk only because it's using the trunk version of corpse_xname().

17 years agocorpse_xname tweak (trunk only)
nethack.rankin [Thu, 26 Apr 2007 02:13:17 +0000 (02:13 +0000)]
corpse_xname tweak (trunk only)

     Noticed while testing a patch for touching cockatrice corpses;
corpse_xname(,, CXN_ARTICLE) would produce "a cockatrice corpses" when the
object stack quantity was greater than 1.  (This applies to the post-3.4.3
expansion of corpse_xname() in the trunk code, so no fixes entry.)

17 years agocarry_count
nethack.rankin [Thu, 26 Apr 2007 00:51:23 +0000 (00:51 +0000)]
carry_count

     Simplify the GOLDOBJ/!GOLDOBJ handling in carry_count().  Aside from
the initial gold amount, the conditional code was all duplicated.

17 years agom_useupall
nethack.rankin [Sun, 22 Apr 2007 02:42:35 +0000 (02:42 +0000)]
m_useupall

     While updating discard_minvent I noticed that m_useupall is using
the wrong routine to get rid of a monster's weapon.  It probably doesn't
matter since I don't think monsters can use up items they're wielding or
wield items they could use up.

17 years agodiscard_minvent
nethack.rankin [Sun, 22 Apr 2007 02:38:47 +0000 (02:38 +0000)]
discard_minvent

     Genociding * to clear a level in wizard mode, or paying off a
shopkeeper to dismiss kops in any mode, could trigger the recently added
warning about deleting worn items in obfree().  mongone -> discard_minvent
wasn't bothering to unwear/unwield monster gear before deletion.

17 years agofix #H285 - hiders not hiding while hero is on another level (trunk only)
nethack.rankin [Sun, 22 Apr 2007 01:01:22 +0000 (01:01 +0000)]
fix #H285 - hiders not hiding while hero is on another level (trunk only)

     From a bug report, mimics
which were exposed at the time the hero leaves a level remain unhidden
upon return no matter how long the hero is away.  It was actually expected
behavior since the old level is stuck in stasis and hiders only hide when
it's their turn to move, but it was noticeably odd.  This makes unhidden
hiders attempt to hide when hero returns to a previous level or enters a
bones level.  I reorganized the monster handling in getlev() because the
relevant part was taking place before floor objects got restored, so
hidesunder() monsters had nothing to hide under at the time.

17 years agofix #H291 - rogue backstab anomaly (trunk only)
nethack.rankin [Sat, 21 Apr 2007 03:32:26 +0000 (03:32 +0000)]
fix #H291 - rogue backstab anomaly (trunk only)

     From a bug report:  rogue's backstab bonus
(extra damage when foe is fleeing) doesn't apply when dual-wielding but
does apply to thrown weapons--unless both conditions apply.  Having it
apply to throwing is too powerful.  Elbereth makes it trivial to get
monsters to flee and a rogue with expert dagger skill can throw up to 4
of those at a time, so a level 30 rogue could get rnd(30) bonus 4 times
in a single attack.  This makes the backstab bonus only applicable to
melee and polearm attacks.

17 years agof-iring without ammo
nethack.rankin [Sat, 21 Apr 2007 02:43:32 +0000 (02:43 +0000)]
f-iring without ammo

     There was a suggestion in the newsgroup that if you use the 'f'
command when your quiver is empty, that whatever missile you supply to the
"what do you want to throw?" prompt be automatically put into the quiver.
This implements that, and separates most of the common code from dothrow()
and dofire() into a separate routine.  A post-3.4.3 change to dothrow() to
require hands for throwing wasn't propagated to dofire().  With the common
routine, they're much less likely to get out of sync like that.

     This is going into the branch as well as the trunk because the hands
checking mismatch was added there too.

17 years agorandom initial drawbridge state (trunk only)
nethack.rankin [Sat, 21 Apr 2007 01:54:56 +0000 (01:54 +0000)]
random initial drawbridge state (trunk only)

     Suggested by <Someone>:  in the special level compiler, support
"random" in addition to "open" and "closed" for a drawbridge's inital
state.  Drawbridge shares code with door, so the necessary parsing was
already present.  This just treats random as valid for drawbridge instead
of explicitly rejecting it, and makes the special level loader process it.

     He also suggested that the two drawbridges on the bottom level of
the Valk's quest be changed from open to random, but this patch doesn't
go that far.  I think it's a good idea, but since the player can't use a
musicial instrument on those bridges, this has more impact on game play
than it might at first seem.  I don't really want to see Valkyries be
required to use magic for occasions where both bridges start out closed.

17 years agos_suffix bit
nethack.rankin [Fri, 20 Apr 2007 02:26:36 +0000 (02:26 +0000)]
s_suffix bit

     Add support for "your" as possessive form of "you" in s_suffix().

17 years agolife-saving bits (trunk only)
nethack.rankin [Fri, 20 Apr 2007 02:23:33 +0000 (02:23 +0000)]
life-saving bits (trunk only)

     A couple of things noticed when looking at the death-by-brainlessness
code.  The 3.4.3 code ran a loop while life-saving was keeping the hero
alive, which would work if someone added other sources of life-saving than
the amulet but not if they added some form which didn't get used up when
it kicked in.  Post-3.4.3, the dev code eliminated the loop but was no
longer guarding against additional forms of life-saving.  This attempts to
clear the relevant field once any form of life-saving takes effect (for
brainlessness).  It's not perfect since someone could change `Lifesaved'
to look at something other than the hero's properties, but at least it
still avoids the risk of getting stuck in a loop if someone makes a really
bad customization.

     Also, make life-saving use min(2*level,10) instead of flat 10 for
amulet or 8*level for explore/wizard survival when it saves someone whose
max HP have been clobbered somehow.  Other places assume that 1 HP per
level is the lowest the hero will have; saved-life gives a modest bit more.

     Lastly, some post-3.4.3 code to make ghosts/shades immune to brain
sucking was using mon_nam() to start a sentence; Monnam() is needed there.

17 years agocharging rings
nethack.rankin [Fri, 20 Apr 2007 01:43:42 +0000 (01:43 +0000)]
charging rings

     Reported--more or less--by <email deleted>:
chargeable rings don't show up as likely candidates in the "what do you
want to charge?" prompt.  They're supposed to be there once the type has
been discovered but it was using the wrong field so basing that on whether
the player had assigned a name to the type instead.  (Picking a chargeable
ring's letter even though it wasn't listed did work correctly though.)

17 years agolosing saddle while riding
nethack.rankin [Tue, 17 Apr 2007 03:43:17 +0000 (03:43 +0000)]
losing saddle while riding

     Noticed while looking at something else:  zapping a wand of opening
or spell of knock downwards while riding causes your steed's saddle to
fall off, which in turn causes the hero to fall and take some damage.
If that damage was fatal, the saddle would be left worn in bones data.
This reorganizes mdrop_obj() to defer until last the part that ultimately
makes the hero fall off, and changes bhitm() to call that instead of
handling saddle removal inline, also gives new saddle-off feedback there.

17 years agofix water handling in the #H260 lava fix
nethack.rankin [Tue, 17 Apr 2007 03:13:08 +0000 (03:13 +0000)]
fix water handling in the #H260 lava fix

     The patch made a month ago to handle remaining at a lava or pool
location without moving had a problem with being in pools of water.  It
was yielding "But you don't drown.  You touch bottom." if you had magical
breathing and took actions other than moves.  I think it's fixed now.

[New bug, or rather newly noticed old bug:  slowly sinking while being
stuck in lava doesn't notice if you lose fire resistance and ought to be
burned up immediately.  Also, fully sinking into lava doesn't appear to
burn up equipment--unless it's done in the bones handling--the way that
falling directly in without fire resistance does.]

17 years agomsummon,nasty result counts (trunk only)
nethack.rankin [Mon, 16 Apr 2007 03:58:30 +0000 (03:58 +0000)]
msummon,nasty result counts (trunk only)

     Reported in Dec'04 by <email deleted>, the
monster spell "summon nasties" could mistakenly give a message of "a
monster appears" instead of "monsters appear" when more that one monster
gets summoned.  Some of the candidate monsters for nasty() can produce a
group from makemon(), as can ones for msummon() which nasty() sometimes
calls in Gehennom.  Compare the number of monsters before and after the
creation attempt(s) instead of assuming makemon() creates one at a time.

     I don't know whether other routines face the same mis-count issue,
but I suspect there may be several.

17 years agoMUSE of green slime, anti-stoning tins (trunk only)
nethack.rankin [Mon, 16 Apr 2007 03:04:54 +0000 (03:04 +0000)]
MUSE of green slime, anti-stoning tins (trunk only)

     Reported in Dec'04 by <email deleted>,
salamanders are capable of using items and of eating green slime corpses
without being transformed into slime, but would not pick up nor eat such
corpses to recover from being turned into stone.  Now they will.  Also,
monsters who are able to open tins (mainly via carrying a dagger or knife)
will pick up tins of lizard and of acidic monsters in order to use those
to be cured from stoning.  The latter is already covered by this new
feature entry in fixes35.0 which previously applied only to nymphs:
"some monsters can eat tins in addition to corpses to cure some ailments".

17 years agokicker kicking
nethack.rankin [Mon, 16 Apr 2007 03:03:08 +0000 (03:03 +0000)]
kicker kicking

     Reported in Dec'04 by <email deleted>, an
unpoly'd hero or a hero poly'd into monster form which lacks a kick
attack both get bonus from rings of increase damage when kicking, but
a hero poly'd into monster form which has a kick attack did not.

17 years agolast #U1233 - doppelganger shapes (trunk only)
nethack.rankin [Sat, 14 Apr 2007 02:38:56 +0000 (02:38 +0000)]
last #U1233 - doppelganger shapes (trunk only)

     My last fix from the Dec'04 report sent by <email deleted>.  Many of its remaining observations/complaints are
about things which aren't bugs.  This implements the suggestion that
doppelgangers should take on humanoid form, although it doesn't take away
the 1/7 chance for pick_nasty() and it can still fall back to arbitrary
shapes when it doesn't pick a humanoid within 5 tries.  This also allows
doppelgangers to take on the shape of the various quest guardian monsters
[mostly the quest leaders' attendants, although there is at least one
extra foe (ninja)].  It excludes the quest guardian for the player's own
role, and I don't think there are any cases where it can yield unexpected
quest guardian behavior.

     This also allows specifying monster class (via description or letter)
when #monpolycontrol asks for type of monster to give to a polymorphing/
shapechanging monster.

17 years agomore #U1233 - taming feedback (trunk only)
nethack.rankin [Thu, 12 Apr 2007 05:31:25 +0000 (05:31 +0000)]
more #U1233 - taming feedback (trunk only)

     One of the complaints included in the Dec'04 report from <email deleted> was that spell of charm monster doesn't give
any feedback.  This makes that spell, and scroll of taming, always give a
message.  And the scroll will become discovered if a visible or sensed
monster gets converted from hostile or peaceful to tame, or from hostile
to peaceful.

     Scroll of taming/spell of charm monster didn't hit steed when hero
is mounted; now it does.  I don't know whether that matters though.  You
can saddle a non-tame monster, but you can't ride one even in wizard mode.
However, I'm not sure whether a tame steed you're already riding can
become untame, let alone if it can do so without throwing you.  If latter
is possible then re-taming while still mounted has now become feasible.

17 years ago^G (trunk only)
nethack.rankin [Tue, 10 Apr 2007 04:24:17 +0000 (04:24 +0000)]
^G (trunk only)

     Change controlled monster creation to support specifying monster
by class name in addition to by class letter and the usual type name.

17 years agomore #U1233 - specifying mon class instead type for polyself (trunk only)
nethack.rankin [Tue, 10 Apr 2007 03:39:52 +0000 (03:39 +0000)]
more #U1233 - specifying mon class instead type for polyself (trunk only)

     Another item from the Dec'04 report sent in by <email deleted>.  When prompted for a type of monster to polymorph
into, giving a monster class description like "dog or other canine" (or
single letter like 'd'), triggered "I've never heard of such monsters".
Instead of adjusting the message, this chooses a member from the class.

     I put this into the fixes file as a new feature.

17 years agogenocide bit (trunk only)
nethack.rankin [Tue, 10 Apr 2007 02:27:22 +0000 (02:27 +0000)]
genocide bit (trunk only)

     Simplify a recent change.

17 years agofixes typo (trunk only)
nethack.rankin [Sun, 8 Apr 2007 04:40:12 +0000 (04:40 +0000)]
fixes typo (trunk only)

17 years agoname_to_monclass (trunk only)
nethack.rankin [Sun, 8 Apr 2007 04:35:19 +0000 (04:35 +0000)]
name_to_monclass (trunk only)

     Move the code for determining monster class from user's input string
out of do_class_genocide() and into new routine name_to_monclass().  I'm
planning to use it when name_to_mon fails to match anything for controlled
polymorph (not ready for prime time yet).

     Also, avoid getting stuck in a loop if hangup occurs while prompting
player for class of monster to genocide.  ESC, whether deliberate or fake
input after hangup, will now be the same as specifying "none", throwing
away the genocide opportunity.

17 years agofix #U1233 - controlled polymorph by hero with lycanthropy (trunk only)
nethack.rankin [Sun, 8 Apr 2007 01:51:57 +0000 (01:51 +0000)]
fix #U1233 - controlled polymorph by hero with lycanthropy (trunk only)

     <email deleted> reported a long list
of inconsistencies and suggestions.  This attempts to address the ones
about werecritters and vampires.

> Polymorphed player does not get werecreature changes. (intentional?)
> Player in were form does not turn into werehuman form, ever.  (Previous
> bugged behavior was that player turned into a plain human)
> Player afflicted with a were cannot polymorph into werecreature or
> werehuman form.

     The first guess is right; being polymorphed blocks lycanthropy state
changes.  The second is not a bug either; hero is either a <werecritter>
when in beast form or a <role> when in human form, never human werecritter
monster.  The last one feels more like a bug though; it happened because
all lycanthrope monster entries are marked NOPOLY.  This patch extends
an earlier post-3.4.3 change to allow player with polymorph control to
explicitly specify werecritter when in role form or human werecritter when
in beast form to toggle shape.  It also allows closely related monsters
to toggle from role to beast (ie, "giant rat" yields wererat).

> Vampire or Werecreature changing form may change sex.

     Now the three semi-controlled changes--becoming a dragon due to armor,
toggling were form, and vampire into various critters--are prevented from
having the 10% chance of sex change kick in.  For monsters, lycanthropy
didn't apply (sex never toggles) and vampire shifting is now covered but
turning into a dragon due to scales/mail remains susceptible to sex change.

     Also, post-3.4.3 code made polymorphing into a vampire enable the
#monster command but neglected to tell the player.

17 years agofix #H174 - ice effects on corpses are miscalculated
nethack.rankin [Thu, 5 Apr 2007 02:47:43 +0000 (02:47 +0000)]
fix #H174 - ice effects on corpses are miscalculated

     Reported in August by <email deleted>, the code that handles
slower rotting for corpses on top of or buried under ice is misusing its
ROT_ICE_ADJUSTMENT factor such that a value other than the current 2 would
produce incorrect results.  Instead of multiplying by 1/N it needs to use
(N-1)/N, which happens to be the same when N is 2.  In a second message he
asked about why putting a corpse on ice starts out by subtracting from its
age to make it older, and it took me a while to decide that that is correct
behavior.

     No effect on game play since ROT_ICE_ADJUSTMENT remains set to 2.

17 years agoice timeout (trunk only)
nethack.rankin [Wed, 4 Apr 2007 02:31:14 +0000 (02:31 +0000)]
ice timeout (trunk only)

      Zapping cold at an ice location which has a melt timer would set
new timeout to a random value which could actually cause that ice to melt
sooner.  Make sure the new value is always at least as big as the old one.
Also, MAX_ICE_TIMEOUT wasn't actually the maximum ice timeout; now it
is--if the generated value is higher, omit the timer so that that ice is
permanent.  No fixes35.0 entries necessary; this is post-3.4.3 code.

17 years agofix #Q431 - water elemental caught in beartrap (trunk only)
nethack.rankin [Tue, 3 Apr 2007 05:11:44 +0000 (05:11 +0000)]
fix #Q431 - water elemental caught in beartrap (trunk only)

     Reported two months ago by <email deleted>,
having a water elemental become trapped in a bear trap seems pretty
strange.  Fixed by marking water elementals as M1_UNSOLID (like air and
fire elementals), which has a side-effect of making them immune to webs
as well.  Tweaked some unused digging code which checks unsolid(), added
unsolid() to the types allowed to bar through iron bars, and brought the
check for whether a monster is willing to enter a bear trap location up
to date.  That code also needed an update to reflect the change made to
anti-magic traps last year.  Lastly, there was another report which
suggested that being hit by a bear trap should dish out some damage
(along with a suggestion that wand of opening should work to escape such
traps, which has already been done).  This makes bear trap do 2d4 damage
(on entry, not when trying to pull out after becoming stuck).

17 years agoBARGETHROUGH tweaks (trunk only)
nethack.rankin [Tue, 3 Apr 2007 03:46:14 +0000 (03:46 +0000)]
BARGETHROUGH tweaks (trunk only)

     Prevent monster with barge-through capability--currently only the
astral Riders--from swapping places with another monster which has that
same capability.  Otherwise, if the target one moves after the barger,
it might just repeat the maneuver, undoing the first swap.  If there's
no room to move anywhere else--maybe they've barged through a crowd into
a narrow spot--they could get stuck swapping and re-swapping every turn.

     I've also allowed swapping with baby long worms and with adult ones
which lack a tail.  When testing that, something strange happened and
the displacer was drawn on the map as a long worm tail.  mdisplacem()'s
place_worm_seg() must have been responsible, but I don't understand how
the bit of code involved could kick in for a worm without tail segments.
I've reorganized mdisplacem() to avoid this occurrence, I hope....

     Also, barge-through swapping with a mimic exposes it as a mimic;
swapping with an eating pet causes the meal to end.  No fixes entries;
this is post-3.4.3 code.

17 years agofix #H165 - sokoban "flaw" (trunk only)
nethack.rankin [Tue, 3 Apr 2007 03:20:27 +0000 (03:20 +0000)]
fix #H165 - sokoban "flaw" (trunk only)

     Back in <email deleted> complained
that randomly generated giants in Sokoban would drop boulders when killed,
interfering with the puzzle solution.  He suggested that giants either
be disallowed or be generated without inventory in that dungeon branch.
This doesn't go that far; it just rejects giants on the first pass during
random monster selection, making them much less likely to appear there
but still allowing them if giant is chosen two times in a row.  (Existing
boulders aren't an issue here; giants can't pick them up in Sokoban.)

17 years ago2007
nethack.allison [Sun, 1 Apr 2007 06:39:50 +0000 (06:39 +0000)]
2007

17 years agooption order
nethack.rankin [Sun, 1 Apr 2007 04:33:50 +0000 (04:33 +0000)]
option order

     From a bug report, the `splash_screen' boolean
option was out of alphabetical order.

17 years agocouple of comments
nethack.rankin [Sun, 1 Apr 2007 04:23:47 +0000 (04:23 +0000)]
couple of comments

17 years agostone-to-flesh vs golem statues and figurines
nethack.rankin [Sun, 1 Apr 2007 03:36:30 +0000 (03:36 +0000)]
stone-to-flesh vs golem statues and figurines

     Back port the trunk fix that prevents stone-to-flesh on self when
wielding a figurine from leaving stale worn object pointer and eventually
triggering a panic or crash.  Branch only except for fixes34.4 update.

17 years agostone-to-flesh vs golem statues and figurines (trunk only)
nethack.rankin [Sun, 1 Apr 2007 03:32:53 +0000 (03:32 +0000)]
stone-to-flesh vs golem statues and figurines (trunk only)

     Back in <email deleted> in #U1216
suggested that statues of stone golems which are hit by stone-to-flesh
spell should leave flesh golem corpses instead of meatballs.  But they
should actually have revived as flesh golems.  Stone-to-flesh revival of
golem statues and golem figurines didn't work as intended because golems
other than flesh or leather were considered to be vegan/vegatarian, which
caused them to produce meat rather than living monsters.  Also, S-to-F of
a leather golem statue worked as intended and created a flesh golem, but
S-to-F of a leather golem firugine created a leather golem out of stone
object.  This fixes it so that any type of golem statue or golem figurine
revives as a flesh golem.

     Two other bugs noticed and fixed:  (1) S-to-F cast on self while a
figurine of a non-veggy monster was "worn" in one of the three weapon
slots triggered an "extract_nobj: object lost" panic similar to several
similar cases which were recently fixed (that was 3.4.3; for development
code, it gave "obfree: deleting worn obj" warning instead).  (2) S-to-F
activating a shop-owned figurine didn't charge for it.

17 years agorevived unicorn horns (trunk only)
nethack.rankin [Sun, 1 Apr 2007 01:20:57 +0000 (01:20 +0000)]
revived unicorn horns (trunk only)

     Back in Nov'04, <Someone> pointed out that even with only 5%
chance for dropping a horn upon the death of a unicorn which has been
revived from corpse, it's still possible to produce a nearly unlimited
number of them for polypile fodder.  This bumps the chance for a horn up
to 50%, but flags the horn as coming from a revived corpse and makes such
horns be treated by polymoprh as if they're non-magic (which practically
guarantees that they'll poly into mundane tools instead of magic ones).

17 years agofix #H261 - bias in Bresenham's algorithm in walk_path
nethack.rankin [Thu, 29 Mar 2007 04:03:35 +0000 (04:03 +0000)]
fix #H261 - bias in Bresenham's algorithm in walk_path

     From a bug report, walk_path() was
favoring orthogonal steps at beginning of the path and diagonal ones at
end, when intermixing diagonal and orthoganal produced a more accurate
representation of the real path.  Only mattered for long distance jumps
3x2 or 3x1 steps away; hurtling always moves in a straight line and short
(2x1 knight) jumps aren't affected by the patch supplied with the report.

17 years agofix #H172 - inconsistent damage calculation for negative AC
nethack.rankin [Tue, 27 Mar 2007 04:30:01 +0000 (04:30 +0000)]
fix #H172 - inconsistent damage calculation for negative AC

     Reported last August by <email deleted>:  the code
that decided whether hero poly'd into a pudding would be split when being
hit by an iron weapon always reduced damage by u.uac if armor class is
negative, whereas the normal amount is -rnd(-u.uac).  So player pudding
with good armor always got maximum reduction.  Probably had little actual
effect on game play; puddings can't wear armor so would need to be using
rings and/or spell of protection and/or have eaten rings of protection
while in some previous metallivoric form in order to get good enough AC
for this to matter.

17 years agokicking shop food to tame dog (trunk only)
nethack.rankin [Tue, 27 Mar 2007 03:35:31 +0000 (03:35 +0000)]
kicking shop food to tame dog (trunk only)

     From a bug report, kicking unpaid
food in a shop at a tameable monster resulting in taming the monster
without charging for the used-up food.  This forces kicked objects that
are owned by shops to be put on the shop bill and flagged as unpaid, which
is normally reserved for carried items but makes kicked ones behave like
thrown ones.  (If they land inside the shop without breaking, they're
removed from the bill.)  So kicking food to make a pet now results in the
item being moved from the shop's unpaid bill to its used-up bill, same as
for thrown food.  Although the latter kept billing consistent, it lacked
shop billing feedback; this fixes that too.

17 years agokicking vs throwing vs polearms (trunk only)
nethack.rankin [Sun, 25 Mar 2007 05:31:13 +0000 (05:31 +0000)]
kicking vs throwing vs polearms (trunk only)

     Wielding a bow while kicking arrows gave a shooting bonus.  Also,
From a bug report:  applying a
polearm to hit at range never caused a pudding to split because the attack
gets treated as throwing.  Likewise, confuse monster effect (hands glowing
red) didn't kick in for applied polearms.

17 years agofixes bit for poly'd quest leader
nethack.rankin [Sat, 24 Mar 2007 05:19:54 +0000 (05:19 +0000)]
fixes bit for poly'd quest leader

17 years agopolymorphed quest leader
nethack.rankin [Sat, 24 Mar 2007 04:45:24 +0000 (04:45 +0000)]
polymorphed quest leader

     From the newsgroup:  player chatted with leader and was ejected for
not being high enough level, then when he came back later there was no
leader to be found, but there was a polymorph trap on quest home level.
This makes quest leaders and nemesis be aware of all trap types--rather
than just having leaders be aware of magic portals--so they'll be able to
avoid polymorph traps.  It also makes chatting with a polymorphed leader
work as long as the new form is able to speak (use same criteria as with
poly'd shopkeepers:  can't be in a form that's limited to animal sounds).