]> granicus.if.org Git - nethack/log
nethack
8 years agocursed potion of levitation
PatR [Sun, 8 May 2016 00:26:01 +0000 (17:26 -0700)]
cursed potion of levitation

Reported directly to devteam 7-Jan-2016, two issues with cursed
potion of levitation:
1) the go-up-stairs effect for cursed potion still let you choose
not to escape the dungeon if it occurred on level 1 stairs.  I've
left that as-is; perhaps there's a gate across the entrance.
2) both the go-up-stairs and bonk-head-on-ceiling effects were
skipped if the hero was already levitating.  I don't know whether
that was intentional but there was no comment explaining why, so
I've changed it to happen regardless of whether already levitating.

In the process, I changed the head-bonk case to do more damage when
a helmet is worn:
 old: no helmet 1..10 hp, any helmet 1 hp damage;
 new: no helmet 1..10 hp, soft hat 1..6 hp, hard helmet 1..3 hp.

Also, not in the report:  when you aren't already levitating you
get the "you float up" message, but for cursed potion there was
never any corresponding "you float down" message because you ended
up not levitating.  Now you'll levitate for 1 turn and float down
on the next, landing in a trap if one is present.

8 years agohack.c formatting
PatR [Sat, 7 May 2016 23:32:25 +0000 (16:32 -0700)]
hack.c formatting

Triggered by a couple of mis-formatted block comments in spoteffects.
Much of the diff is adding braces to the 'if' portion of things like
  if (test)
statement;
  else {
block-of-statements;
  }

8 years agofix #H4336 - extra space in potions boil message
PatR [Sat, 7 May 2016 23:24:17 +0000 (16:24 -0700)]
fix #H4336 - extra space in potions boil message

'Your <single-potion> boils and explodes.'
'One of your <stack-of-potions> boils and explodes.'
'Some of your <stack-of-potions> boil and explode.'
'All of your  <stack-of-potions> boil and explode.'
The last variation had an extra space in the message prefix....

In addition to removing the excess space, this adds
'Both of your <stack-of-potions> boil and explode.'
to be used for the (All == 2) case.

The bug and fix also apply to stacks of potions 'freezing and
shattering' and to stacks of scrolls 'catching fire and burning'.

8 years agotweak #overview
PatR [Thu, 5 May 2016 22:27:59 +0000 (15:27 -0700)]
tweak #overview

Show user-supplied annotations within double quotes rather than
parentheses.

Take out a 'FIXME' comment of mine that would end up giving away
information if actually implemented.

8 years agoVlad's Tower bookkeeping
PatR [Thu, 5 May 2016 22:21:22 +0000 (15:21 -0700)]
Vlad's Tower bookkeeping

The lower two levels of Vlad's Tower were got showing the wizard-mode
special level indicator '[level_abbrev]' in #overview, nor appearing
for ^O or in the level teleport menu, indicating that Is_special()
wasn't finding them.  It took a while to figure out why, but the fix
is trivial.

8 years agodisclosing genocided/extinct monsters
PatR [Thu, 5 May 2016 00:42:58 +0000 (17:42 -0700)]
disclosing genocided/extinct monsters

Make the handling of unique monsters consistent between vanquished
monsters and genocided/extinct monsters.  No visible difference to
players.

This also prevents Nazgul and erinys from being polymorphed into
some other form to reduce the chance that their kill count fails
to match the expected number when they're reported to be extinct.
[My long test game (with 3451 total dead critters as of the last
save file) used for exercising the sorting of vanquished monsters
included
 120 soldiers
 111 wolves
   9 Nazgul
   2 erinyes
and the genocided/extinct list had none genocided, those four
extinct.  No doubt the missing third erinys was alive somewhere
rather than counted as something else after getting polymorphed,
so this band-aid wouldn't have helped this particular game.]

8 years agotweak #vanquished - ESC when choosing sort order
PatR [Tue, 3 May 2016 23:23:27 +0000 (16:23 -0700)]
tweak #vanquished - ESC when choosing sort order

Skip displaying vanquished monsters if player responds with ESC
in the sort order menu instead of treating it like RET and using
default order.

8 years agofix #H4329 - building with Qt
PatR [Tue, 3 May 2016 21:01:30 +0000 (14:01 -0700)]
fix #H4329 - building with Qt

In mid-December, formatkiller() was given an additional argument
but qt_win.cpp didn't get updated to reflect that.

8 years agocomplicate #vanquished monsters processing...
PatR [Tue, 3 May 2016 08:12:32 +0000 (01:12 -0700)]
complicate #vanquished monsters processing...

...to make it more interesting.  Using #vanquished in wizard mode
or answering 'a' to the "disclose vanquished monsters?" prompt will
put up a menu to choose how the list of vanquished monsters should
be ordered.  Right now there are 6 choices:

  Traditional: by monster level, by internal index within level;
  by monster toughness, by internal index within monstr[] rating;
  alphabetically, first unique monsters, then others;
  by monster class, low to high level within class;
  by count, high to low, by internal index within tied count;
  by count, low to high, by internal index within tied count.

Two other orderings are implemented but suppressed from the menu
since they seemed uninteresting (alphabetical with uniques
intermixed with other monsters, and by-class high to low within
class).  The first two are very similar to each other and one of
them should probably be discarded too.  The by-class order(s) have
class-name separator lines between classes.

Options parsing for end of game disclosure has extended current
  +v (always show vanquished monsters)
  -v (never show vanquished monsters)
  yv (prompt about them, with default response 'y')
  nv (prompt about them, with default response 'n')
to include
  #v (always show vanquished monsters and choose the ordering)
  ?v (prompt about them, with default response 'a' to choose ordering)

The 'a' response was picked because it's easy to use ynaq()
instead of ynq(), but it can be considered to mean "ask about sort
order".  (Neither of the two new option values could be "av"; 'a'
for disclosing attributes would become ambiguous.)

+v or answering 'y' for any of yv, nv, or ?v uses the most recent
sort ordering (if #vanquished has been used in wizard mode) or the
traditional one (normal mode, or #vanquished not used).  Players
will probably want to specify a default order and then use +v
rather than choose the final order from a menu.  That hasn't been
implemented here.  Count high to low might be a better default than
level high to low.

While looking through Guidebook.tex to try to determine whether
the new text needed special handling, I spotted multiple mistakes
in the existing text.  Probably all from earlier updates of mine;
this attempts to fix them.  As usual of late, Guidebook.mn has been
tested and Guidebook.tex hasn't.

8 years agosimplify #vanquished monsters processing...
PatR [Sun, 1 May 2016 20:54:08 +0000 (13:54 -0700)]
simplify #vanquished monsters processing...

...prior to making it more complicated.  Most of the diff is just
reducing the block nesting level of the kill-count formatting by
a couple of tab stops.

8 years agolong worm #stats
PatR [Sun, 1 May 2016 07:34:36 +0000 (00:34 -0700)]
long worm #stats

When #stats shows memory use for monsters, include long worm tails.

8 years agofarlook of detected objects
PatR [Sun, 1 May 2016 01:55:52 +0000 (18:55 -0700)]
farlook of detected objects

At the end of December, farlook was changed to use doname() instead
of xname() in order to give more information when looking at stuff
the player had already seen.  But it ended up giving away precise
stack size for mergable objects too, even if they hadn't been seen
up close.  Changing doname() to be vague when dknown wasn't set
only worked for items in particular classes; dknown is pre-set for
a lot of things.  So this changes mksobj()'s dknown handling to not
do that for stackable items.

The change to objclass.h is just comment formatting (for the first
part of the file only), provoked by the second line of the one for
oc_pre_discovered.

8 years agoFix wish text matcher not allowing probability 0 objects
Pasi Kallinen [Sat, 30 Apr 2016 19:41:41 +0000 (22:41 +0300)]
Fix wish text matcher not allowing probability 0 objects

8 years agounseen-monster vs pool of water
PatR [Sat, 30 Apr 2016 01:32:46 +0000 (18:32 -0700)]
unseen-monster vs pool of water

From a bug report sent directly to devteam 16-Jan-2015 (subject:
"NH343 (NAO version) - display bug"), if the hero was blind and
levitating and searched next to 'I' (text) or '?' (tiles) which
was displayed on top of a known pool and the remembered unseen
monster was no longer there, the 'I'/'?' was removed but the spot
was redrawn as floor rather than water.

8 years agoimplement #H4305 - Quivering wielded weapon
PatR [Fri, 29 Apr 2016 22:10:56 +0000 (15:10 -0700)]
implement #H4305 - Quivering wielded weapon

This ended up being more elaborate than I anticipated.  'Q' will
now accept the wielded weapon as a choice of item to quiver.  If
that item is a stack of more than one, it will offer to split N-1
into the quiver and leave 1 wielded.  If the offer is declined, or
if there is already just 1, it will require confirmation to move the
item from the weapon slot to the quiver slot.  The alternate weapon
is handled similarly, with different phrasing when in twoweapon
combat mode.

Just to be crystal clear:  a single object cannot be in more than
one weapon, alt-weapon, or quiver slot at the same time.  'Q's old
behavior of rejecting the wielded weapon was to avoid accidentally
becoming empty-handed, not anything to do with multiple worn/wield
slots.

'Q' will also accept a count when picking an inventory item, then
put 'count'-many into the quiver, leaving N-count in original stack.
Except when the chosen item is already in the quiver; it that case,
it undoes the stack split and leaves things as they were.  (That
restriction may not have been necessary but I'm not planning to
revisit it....)

8 years agocleanup up #vanquished output
PatR [Fri, 29 Apr 2016 08:48:52 +0000 (01:48 -0700)]
cleanup up #vanquished output

Tidy the output from disclosure of vanquished monsters at end of game
or from #vanquished wizard-mode command.  Instead of

Juiblex
The Wizard of Yendor (twice)
a mastodon
3 purple worms
an erinys
120 gnomes
42 grid bugs

it will line up the monster type names, yielding

    Juiblex
the Wizard of Yendor (twice)
  a mastodon
  3 purple worms
 an erinys
120 gnomes
 42 grid bugs

For short lists, the original looked ok (maybe even better...), but
for long lists at the end of a long game, aligning the names looks
better and is easier to read than left justifying everything.

8 years agocontainer simplification bit
PatR [Fri, 29 Apr 2016 08:43:03 +0000 (01:43 -0700)]
container simplification bit

Make use of the unsplitobj routine added last Fall,

8 years agoglob tweak
PatR [Fri, 29 Apr 2016 08:39:03 +0000 (01:39 -0700)]
glob tweak

Sometime back I oversimplified this bit of code to the point where
the impossible(), if ever triggered, would have been followed by a
crash.

8 years agoanother sortloot tweak - diluted potions
PatR [Tue, 26 Apr 2016 00:07:07 +0000 (17:07 -0700)]
another sortloot tweak - diluted potions

Change sort ordering of
  diluted potion of bar
  diluted potion of foo
  potion of bar
  potion of foo
  potion of fruit juice
to
  potion of bar
  diluted potion of bar
  potion of foo
  diluted potion of foo
  potion of fruit juice
so that potions of the same type are grouped together.  Bless/curse
state (when known) takes precedence over dilution, so "blessed
diluted potion of foo" will come out before "uncursed potion foo".

8 years agotty menu coloring tweak
PatR [Mon, 25 Apr 2016 21:25:52 +0000 (14:25 -0700)]
tty menu coloring tweak

Start coloring after the space which follows the selection indicator
instead of on that space.  The difference isn't noticeable when the
highlighting is just a color, but it is if that highlighting includes
inverse video or underline which visibly apply to spaces.  So for
a - entry A
the old code produced
a -########
and this revised code produces
a - #######
where '#" indicates characters subject to menu coloring.

8 years agobaalz hack fixup fix...
PatR [Mon, 25 Apr 2016 07:58:44 +0000 (00:58 -0700)]
baalz hack fixup fix...

I saw a lich in solid wall at one of the spots which gehennom.des
marks with a pool (so that baalz_fixup() can find the two spots that
need post-wallification fixup).  I could understand the special level
loader placing a swimming or flying monster there, but don't know
whether it might do that for a lich (which doesn't need to breathe)
so am not sure whether this actually fixes what I observed.

The lich was there for far too long to have been a shapechanger, but
when I went back to the save file it was no longer there, producing
another puzzle.

8 years agofix #H4317 - grave diggin'
PatR [Mon, 25 Apr 2016 07:14:48 +0000 (00:14 -0700)]
fix #H4317 - grave diggin'

Digging a grave witha a pick-axe converted the grave to floor but
did not dig a pit and unearth the grave's contents.  [Caused by a
change to maketrap() intended to prevent wizard-mode wishing for
traps on top of furniture.]  Digging a second time succeeded in
creating a pit since the location was no longer furniture.

8 years agosortloot ordering for holy/unholy water
PatR [Sat, 23 Apr 2016 22:44:26 +0000 (15:44 -0700)]
sortloot ordering for holy/unholy water

When items were sorted alphabetically, holy water ended up in the H's
and unholy water in the U's.  Force them to get placed with water in
the W's, as would happen if water wasn't given an alternate name when
blessed or cursed.

8 years agoBetter wishing text match
Pasi Kallinen [Sat, 23 Apr 2016 19:38:20 +0000 (22:38 +0300)]
Better wishing text match

Try harder to find a matching object, and if multiple objects would
match, pick one from all the matches at random.

8 years agowizard-mode enlightenment
PatR [Sat, 23 Apr 2016 18:58:20 +0000 (11:58 -0700)]
wizard-mode enlightenment

Add another 'from_what' reason for intrinsic/extrinsic attributes:
You are <whatever> intrinsically.

8 years agopiousness lint
PatR [Sat, 23 Apr 2016 18:57:14 +0000 (11:57 -0700)]
piousness lint

8 years agoUnify piousness strings
Pasi Kallinen [Sat, 23 Apr 2016 09:00:02 +0000 (12:00 +0300)]
Unify piousness strings

8 years agoSimplify the web destruction func
Pasi Kallinen [Fri, 22 Apr 2016 19:47:43 +0000 (22:47 +0300)]
Simplify the web destruction func

8 years agoFt.Ludios entrance (fort's entry, not level entry)
PatR [Fri, 22 Apr 2016 09:12:10 +0000 (02:12 -0700)]
Ft.Ludios entrance (fort's entry, not level entry)

The code to apply an automatic annotation to the knox level was looking
for a drawbridge like on the castle level, but knox doesn't have any
drawbridge.  Look for its door instead.  (It's initially a secret door,
so won't be revealed via magic mapping.  It needs to be found or
destroyed to get mapped as a door or empty doorway in order to trigger
the annotation.)

Also, give a tiny bit of variation to the knox level layout.  It used
to have both the throne and the secret door on the lower of two similar
rows and the door into the treasure vault on the upper one.  Now each
of the three can be on either of those two rows (independently of each
other), making eight possibilities.  This doesn't accomplish much,
other than to make the secret door locations not always be at the same
fixed spot.

8 years agonewcham() feedback: "A <mon> turns into it!"
PatR [Thu, 21 Apr 2016 23:45:19 +0000 (16:45 -0700)]
newcham() feedback: "A <mon> turns into it!"

Silly shapechange message if <mon> is sensed via telepathy and takes
on a mindless form.  In the case I noticed, it was a doppelganger on
the far side of a maze wall who changed from something ordinary into
a mummy while the hero was wearing an amulet of esp.

3.6.0 could deliver this message, but I think changes since then have
increased the chance for newcham() to give shapechange feedback.

8 years agoformatting fixups
PatR [Wed, 20 Apr 2016 23:43:33 +0000 (16:43 -0700)]
formatting fixups

Presence of trailing whitespace pointed out so post-reformatting
non-conformant formatting.

8 years agomore sortloot revamp fallout
PatR [Wed, 20 Apr 2016 00:01:01 +0000 (17:01 -0700)]
more sortloot revamp fallout

getobj() was caching 'invent' in 'firstobj', dating from the days
of the !GOLDOBJ configuration, and sortloot() could change the value
of invent, making firstobj end up pointing somewhere into the midst
of the inventory list.  So collecting letters of applicable items
could miss things (typically right after restoring a saved game).
Repeating the command would operate on already sorted invent, making
firstobj remain valid and things mysteriously reappear after having
been missed before.

Just get rid of 'firstobj' since it's no longer useful.

8 years agoflags.sortloot tweaks
PatR [Tue, 19 Apr 2016 21:40:59 +0000 (14:40 -0700)]
flags.sortloot tweaks

flags.sortloot was changed from boolean to xchar, but proper type
is plain char.  (Presumeably it was originally off or on, then got
changed to 'n' for off, 'l' for on, plus 'f' for super-on.)

Also, make the sortloot menu for 'O' mark the current value as
preselected when interactively setting the value.  (I've been
meaning to do this for various other options but haven't gotten
around to it.  The need to workaround PICK_ONE+MENU_SELECTED menu
behavior is a nuisance.)

8 years agofix deleting worn obj (uchain) impossibility
PatR [Tue, 19 Apr 2016 18:30:11 +0000 (11:30 -0700)]
fix deleting worn obj (uchain) impossibility

... when exploding chest trap destroys uchain without using
unpunish() to un-wear it first.  The '!carried(uball)' clause
should be applied to the uball->ox,oy test only, not to both
uchain->ox,oy and uball->ox,oy.

8 years agomenu handling for ':' when hero is swallowed
PatR [Tue, 19 Apr 2016 01:15:58 +0000 (18:15 -0700)]
menu handling for ':' when hero is swallowed

Force the menu for the look-here command when 'here' is the inside
of an engulfer to be PICK_NONE.  That way '>' won't exit the menu
by choosing the extra inventory item "> - hero".

8 years agoFix dead mon and guard sanity checking
Pasi Kallinen [Mon, 18 Apr 2016 16:52:54 +0000 (19:52 +0300)]
Fix dead mon and guard sanity checking

8 years agoinvent menu fixes (mostly menustyle:Traditional)
PatR [Sun, 17 Apr 2016 23:50:25 +0000 (16:50 -0700)]
invent menu fixes (mostly menustyle:Traditional)

For menustyle:Traditional, the object class prompt for 'D' includes
an entry choice of 'm' to request a menu.  Supplying real classes
and 'm' resulted in a menu limited to those classes, as intended,
but any of BUCX for curse/bless state and 'm' without any actual
classes resulted in a menu of entire invent.  A one-line fix once
the proper place for that fix was located.

For menustyle:Traditional or menustyle:Combination, 'A' includes an
extra choice of 'i' to examine relevant inventory prior to choosing
object classes (and object identification also offers that), but
the inventory display showed everything rather than just the items
applicable to 'A' (or to object ID).  Figuring out where to apply
the fix was trivial, but the fix itself was a bit more involved and
it exposed a latent bug in display_pickinv(): "" was supposed to be
the same as NULL when passed in as list of target inventory letters,
but it wasn't being handled correctly.

8 years agoUnify web burning or dissolving
Pasi Kallinen [Sun, 17 Apr 2016 13:54:12 +0000 (16:54 +0300)]
Unify web burning or dissolving

Also make any flaming monster burn webs.

This also fixes a bug, where a gelatinous cube monster did not
dissolve the web.

8 years ago'R' fix
PatR [Sun, 17 Apr 2016 00:25:33 +0000 (17:25 -0700)]
'R' fix

A patch in late January to suppress suits as likely candidates for
the 'R' command when wearing a cloak also unintentionally suppressed
rings when wearing non-cursed (or not yet known to be cursed) gloves.
Cloak always blocks suit removal; gloves only block ring removal if
cursed.

8 years agoextend wizard-mode '#stats' command
PatR [Sat, 16 Apr 2016 22:37:35 +0000 (15:37 -0700)]
extend wizard-mode '#stats' command

Extend #stats beyond just monsters and objects.  Have it display
memory usage for traps, engravings, light sources, timers, pending
shop wall/floor repair, regions, bones tracking, named object types,
and dungeon overview.

No doubt there are other memory consumers that I've overlooked.

8 years agoChange flag::sortloot to xchar
C.W. Betts [Thu, 14 Apr 2016 20:04:22 +0000 (14:04 -0600)]
Change flag::sortloot to xchar

When typedefed to C99's bool type, Clang complains in container_contents about "comparison of constant 108 with expression of type 'boolean' (aka 'bool') is always false".

8 years agoAdd fixes entries for recent merges
Sean Hunt [Wed, 13 Apr 2016 01:32:34 +0000 (21:32 -0400)]
Add fixes entries for recent merges

8 years agoMerge remote-tracking branch 'github/tung/shop-floor-nested-loot' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 01:32:10 +0000 (21:32 -0400)]
Merge remote-tracking branch 'github/tung/shop-floor-nested-loot' into NetHack-3.6.0

8 years agoMerge remote-tracking branch 'github/tung/tty-menu-enhancements' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 01:26:06 +0000 (21:26 -0400)]
Merge remote-tracking branch 'github/tung/tty-menu-enhancements' into NetHack-3.6.0

8 years agoMerge remote-tracking branch 'github/tung/shkp-anger-bill-fix' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 01:16:38 +0000 (21:16 -0400)]
Merge remote-tracking branch 'github/tung/shkp-anger-bill-fix' into NetHack-3.6.0

8 years agoMerge remote-tracking branch 'github/tung/randline-rng-fix' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 01:08:31 +0000 (21:08 -0400)]
Merge remote-tracking branch 'github/tung/randline-rng-fix' into NetHack-3.6.0

8 years agoMerge remote-tracking branch 'github/UniQP/trap' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 00:53:30 +0000 (20:53 -0400)]
Merge remote-tracking branch 'github/UniQP/trap' into NetHack-3.6.0

Also update fixes file

8 years agoMerge remote-tracking branch 'github/UniQP/break' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 00:52:13 +0000 (20:52 -0400)]
Merge remote-tracking branch 'github/UniQP/break' into NetHack-3.6.0

8 years agoMerge remote-tracking branch 'github/UniQP/rcnt' into NetHack-3.6.0
Sean Hunt [Wed, 13 Apr 2016 00:51:28 +0000 (20:51 -0400)]
Merge remote-tracking branch 'github/UniQP/rcnt' into NetHack-3.6.0

8 years agofix #H4301 - tribute typo: The Last Hero
PatR [Mon, 11 Apr 2016 02:24:27 +0000 (19:24 -0700)]
fix #H4301 - tribute typo: The Last Hero

8 years agogetobj() ? fix
PatR [Sun, 10 Apr 2016 23:16:07 +0000 (16:16 -0700)]
getobj() ? fix

The "sortloot revamp" patch six or seven weeks ago broke filtering
for '?' menu in display_pickinv() called by getobj().  The old code
handled 'lets' when building an array of object pointers to be
sorted.  The revamp code did away with that to sort the linked list
instead, but neglected to put 'lets' handling into the subsequent
menu creation loop which is now operating on full invent rather
than the filtered subset.

8 years agofix #H4296 - grease no checked for passive damage
PatR [Sun, 10 Apr 2016 01:51:28 +0000 (18:51 -0700)]
fix #H4296 - grease no checked for passive damage

Hitting a rust monster with a greased weapon would rust the weapon
instead of removing the grease.  Likewise for monsters with passive
acid or corrosion damage.  passive_obj() was ignoring grease.

8 years agowizard mode enlightenment for "very fast"
PatR [Sat, 9 Apr 2016 22:48:41 +0000 (15:48 -0700)]
wizard mode enlightenment for "very fast"

Fast and Very_fast share the same property index, but from_what()
didn't handle that.  Enlightenment for a Very_fast hero--which
can only happen via worn equipment (speed boots) or timed effect
(potion of speed or spell of haste self)--would be erroneously
described as "very fast innately" for roles who get intrinsic
speed at level 1, or "very fast because of experience" when high
enough level for roles who get intrinsic speed later.

8 years ago'fix' #H4295 - weapon shattering
PatR [Fri, 8 Apr 2016 08:12:53 +0000 (01:12 -0700)]
'fix' #H4295 - weapon shattering

When hero with two-handed weapon, or samurai with katana and without
shield, hits a monster which is wielding a weapon, there is a chance
for defender's weapon to be destroyed via shattering.  The chance is
reduced--by increasing the chance to resist--if the hero's weapon is
rusty or otherwise eroded.  That works as intended.  This changes
things to make the chance be increased--by reducing the chance to
resist--if defender's weapon is rusty or otherwise eroded.

8 years agonew symbol set: "plain"
PatR [Thu, 7 Apr 2016 00:32:58 +0000 (17:32 -0700)]
new symbol set: "plain"

This set is the same as the default ascii symbols except that corner
walls are represented with '+' instead of '-' or '|' so that wall
joins are clearer.  The baalz level looks a little better this way,
although not a lot.  Unfortunately, most levels look a bit cluttered
with this, so I imagine it won't get a lot of use.  At least it
serves as an example of being able to use "'c'" instead of "\123".

Originally I specified every terrain symbol explicitly, which was
how I noticed that S_darkroom and S_vibrating_square weren't being
handled.  This has cut it down to just the wall symbols, serving as
explicit example of accepting default symbols for unspecified ones.

8 years agosymset parsing
PatR [Thu, 7 Apr 2016 00:06:33 +0000 (17:06 -0700)]
symset parsing

Add support for character enclosed within single quotes.  Single
character without quotes would work for most characters, but not
'#' and possibly not '^' or '\\'.  All the values in dat/symbols
are specified via backslash+digits so it isn't obvious that some
other form of value is allowed.

I think this parsing accepts all valid values.  It doesn't reject
all invalid ones:  opening quote followed by valid escape sequence
followed by junk followed by closing quote will ignore the junk.
I don't think there's any pressing need to worry about that.

8 years agosymset S_darkroom, S_vibrating_sqaure
PatR [Wed, 6 Apr 2016 23:52:06 +0000 (16:52 -0700)]
symset S_darkroom, S_vibrating_sqaure

Symbol set parsing rejected S_darkroom and S_vibrating_square.
Now it will accept them.

The fact that this bug wasn't noticed indicates that none of the
3.6.0 symbol sets (other than "Default symbols") is specifying a
value for either of these symbols.

This also changes the default vibrating square value from yellow
'^' (caret) to purple '~' (tilde).  I don't think there's any risk
of mistaking it for a long worm tail (brown '~') and it emphasizes
that it isn't really a trap.

8 years agocouple of formatting tweaks
PatR [Mon, 4 Apr 2016 21:05:31 +0000 (14:05 -0700)]
couple of formatting tweaks

8 years agorevamp baalz level
PatR [Mon, 4 Apr 2016 20:59:23 +0000 (13:59 -0700)]
revamp baalz level

Quite a bit of special case code for something so inconsequential.
Tweak the baalz level layout a little to make it be a bit more
interesting, and perform custom wallification on it so that the
beetle layout becomes clearly visible.  It looks great with
DECgraphics (and presumably IBMgraphics).  It's recognizeable but
not as interesting with ordinary ascii because corner walls use
'-' or '|' so don't join up nicely.  It looks a little weird
with tiles; the square aspect ratio of individual tiles makes it
end up being very elongated compared to character cell map it was
designed for.

As far as the level layout goes, the pair of secret doors into
Baalzebub's chamber have been give a random alternative.  The two
right-most accessible columns were diggable--I don't know whether
that was intentional; it's been reduced to one right-most column.
The middle pair of legs were asymmetrical; this fixes that.  The
beetle also now has eyes and an entry door in its mouth.

8 years agoUse rn2() instead of Rand() for selection_do_randline()
Tung Nguyen [Fri, 1 Apr 2016 04:15:50 +0000 (15:15 +1100)]
Use rn2() instead of Rand() for selection_do_randline()

That is, use NetHack's RNG instead of the direct system RNG.  This fixes
maps generated with randlines to interact correctly with potential
future RNG system changes e.g. switching PRNG algorithms, supporting
NAO343's RNG reseeding, and even supporting replays like NetHack 4.

Based on DynaHack commit e464f63 (lev_comp: Fix system RNG use in
randline) by me.

8 years agofix #H4287 - inconsistent handling of CPPFLAGS
PatR [Fri, 1 Apr 2016 23:49:49 +0000 (16:49 -0700)]
fix #H4287 - inconsistent handling of CPPFLAGS

[Subject should mention Unix, but would exceed 50 characters.]

Explicit build rules ignore $(CPPFLAGS), but the implicit C rule
(at least in GNU make) specifies it.  If user has a value for this
in the environment, that value would apply to building some source
files but not others.  This patch gives it an explicit empty value,
so building via implicit rule should expand it to nothing and match
the fact that it's omitted from explicit rules.

There was one C++ file which relied on the implicit C++ rule.  I've
added it to the files processed by 'make depend' and re-run that.
It now will get built via an explicit rule.

Also, a small amount of reformatting for HACKCSRC.

8 years agofixes36.1 catch up
PatR [Fri, 1 Apr 2016 22:26:40 +0000 (15:26 -0700)]
fixes36.1 catch up

8 years agoREPRODUCIBLE_BUILD, part 2
PatR [Fri, 1 Apr 2016 01:09:59 +0000 (18:09 -0700)]
REPRODUCIBLE_BUILD, part 2

Other half of the Debian reproducible-builds patch.  For Unix
Makefile.top, explicitly set locale to generic 'C' when running
'dlb' during install, so that wildcard expansion will yield a
predictable ordering regardless of collation order specified by
the local enviroenment.  Otherwise contents of the 'nhdat'
container might be different--when viewed as a single data file
itself--during subsequent rebuild even when no changes to source
or data have been made and each module inside remains the same.

This assumes that locale doesn't matter during generation of any
of the data files (whether destined for dlb or not).  I don't
think the utility programs attempt any sorting on the fly or
other locale-dependent output but wouldn't swear to that....

8 years agoREPRODUCIBLE_BUILD
PatR [Fri, 1 Apr 2016 00:56:11 +0000 (17:56 -0700)]
REPRODUCIBLE_BUILD

Take the 4-5 line Debian patch and turn it into six dozen lines of
new code.  The submitted patch introduces use of several C library
routines that aren't presently in use, so would need testing by all
functional or nearly-functional ports to verify that it wouldn't
break anything.  It also switched the formatted build date+time
from localtime to UTC.  This makes the code conditional so it can
be ignored by anybody and avoid the risk of breakage.  And a lot of
the increase in size is comments attempting to explain what the new
conditional is for:  when REPRODUCIBLE_BUILD is defined, makedefs
will use getenv("SOURCE_DATE_EPOCH") (whose value is an integer
representing seconds since 1-Jan-1970) instead of current date+time
when generating date.h.  The purpose is to be able to rebuild at a
later date and produce an identical program, which doesn't happen
when compile time gets incorporated into the binary.

I've added some sanity checking to try to make sure the getenv()
value obtained isn't bogus.  And the version string put into date.h
will be slightly different, allowing someone who sees date.h or 'v'
output to tell whether SOURCE_DATE_EPOCH was involved:  showing
"<port> NetHack <version> last revision <date>" instead of the
usual "... last build <date>".

To test, checkout a new branch for building, make any local edits
to unixconf.h and config.h, including enabling REPRODUCIBLE_BUILD,
git add+commit them, then use
  SOURCE_DATE_EPOCH=`git log -1 --pretty=%ct` make install
Other ports will need a bit more work to set up the environment,
but can still use git to track file dates and supply the latest.
Building with alternate configurations could be accomplished by
using tags instead of 'log -1' or by using distinct build branches
where nothing is commited/merged/rebased after completed build.

Unresolved issue:  BUILD_DATE, VERSION_ID, and COPYRIGHT_BANNER_C
contain formatted date+time but omit timezone.  SOURCE_DATE_EPOCH
is assumed to be UTC but the formatted values don't say so, so it
might appear to be incorrect when compared with local time.  We
definitely don't want to start mucking about with timezones within
nethack, so I think we just live with this.  It's not an issue for
default configruation where REPRODUCIBLE_BUILD is left disabled.

8 years agomakedefs lint
PatR [Tue, 29 Mar 2016 00:23:00 +0000 (17:23 -0700)]
makedefs lint

The Makefile race condition report included a link to a log file
of the build attempt, and it contained this:

makedefs.c: In function 'do_grep_control':
makedefs.c:611:26: warning: suggest parentheses around operand of '!'
 or change '|' to '||' or '!' to '~' [-Wparentheses]
 #define ST_LD(old, opp) (!!(old) | (!!(opp) << 1))
                          ^
makedefs.c:722:37: note: in expansion of macro 'ST_LD'
 grep_stack[++grep_sp] = ST_LD(grep_writing, !isif);
                         ^
They're using a more recent version of gcc than I am, because my
CFLAGS includes -Wparentheses (via -Wall) and I don't get that.

It's a little confusing, but I think it's whining that we might
have meant   !!((old) | (!!(opp) << 1))
rather than  (!!(old)) | (!!(opp) << 1).
The latter is what we get (and what we intended--no bug here).

I changed it to something that more directly reflects the intent
since it's not bit twiddling within some crucial innermost loop.

8 years agoMacOS 10.11.3 now requires the exec bits to be set on macosx.sh
Haoyang Wang [Mon, 28 Mar 2016 09:36:43 +0000 (02:36 -0700)]
MacOS 10.11.3 now requires the exec bits to be set on macosx.sh

8 years agofix #H4286 - race condition during Unix build
PatR [Sun, 27 Mar 2016 23:50:38 +0000 (16:50 -0700)]
fix #H4286 - race condition during Unix build

Update sys/unix/Makefile.src to force it to build monst.o and
objects.o before attempting to build makedefs, so that building
the latter doesn't use the rules for those two object files in
Makefile.utl.  Prior to this, if 'make' was building multiple
targets in parallel monst.o and/or objects.o might be clobbered
when a process using util/Makefile tries to build them while its
parent is also building them via src/Makefile.

This includes a bit of reformatting which wasn't present in
yesterday's email attachment.

8 years agozeromonst
PatR [Sat, 26 Mar 2016 23:42:24 +0000 (16:42 -0700)]
zeromonst

Make 'zeromonst' global instead of local to makemon.c.  Its address
isn't used as a special value like &zeroobj, but it is useful to
have available for initializing various pseudo-monsters.

modified:
  include/decl.h
  src/decl.c, makemon.c, mkobj.c, mplayer.c, teleport.c

8 years agomore recovered bits
PatR [Sat, 26 Mar 2016 00:26:37 +0000 (17:26 -0700)]
more recovered bits

Some worthwhile stuff from abandoned 'git stash':
 is_plural() macro wasn't comprehensive;
 a couple of return values where writing with a magic marker was
   causing time to elapse even though nothing happened;
 comment formatting for saddle being left in shop by dying steed.

8 years agoshapechanger polymorph bit
PatR [Fri, 25 Mar 2016 23:49:01 +0000 (16:49 -0700)]
shapechanger polymorph bit

Rescuing an old revision from bit rot:  If one of fog clouds or
vampire bats has been genocided and you try to polymorph a vampire
disguised as the other, it won't change form because the shape it's
currently in is the only candidate shape left for vampshifting.
This makes shapechangers who fail to take on a new shape when
polymorphed try again, specifying original form on the second try.
It's unlikely to affect chameleons, but disguised vampires will
sometimes become undisguised instead of seeming to be immune from
polymorph.

8 years agomplayer.c formatting
PatR [Fri, 25 Mar 2016 23:45:26 +0000 (16:45 -0700)]
mplayer.c formatting

Some formatting cleanup for file that escaped the umpteen earlier
rounds of such.

8 years agofix #H4139 - commands missing in help menu
PatR [Fri, 25 Mar 2016 00:31:35 +0000 (17:31 -0700)]
fix #H4139 - commands missing in help menu

The meta keystroke commands which use an uppercase letter were all
missing from dat/hh:
 M-A annotate level
 M-C show conduct
 M-N name something (synonym for M-n, which is a synonyn for 'C'all)
 M-O display dungeon overview
 M-R ride/unride steed
 M-T tip a container

(All meta keystroke command shortcuts are missing from dat/help.)

8 years agoRevert "Omit accel and select char from menu colors"
Tung Nguyen [Wed, 23 Mar 2016 08:33:42 +0000 (19:33 +1100)]
Revert "Omit accel and select char from menu colors"

This reverts commit 2ff96797a8a52d0917529f68f1a3e38dca2668e8.

Since this pull request was made to the DevTeam, a commit has appeared
in the official repo's NetHack-3.6.0 branch which effectively does the
same thing: NetHack commit 98b5f58 (tty menu coloring) by PatR.

8 years ago'O' for regexp options
PatR [Wed, 23 Mar 2016 01:22:39 +0000 (18:22 -0700)]
'O' for regexp options

Noticed when testing tty menucolor changes recently, using the 'O'
command to interactively add a new entry would accept one and then
quit, unlike remove which accepts multiple at a time and then goes
back to the menu where you could choose 'remove' all over again.
Adding is still done one entry at a time, but instead of finishing,
it goes back to the menu where you can choose to add another.

8 years agomore fixes for revised 'sortloot'
PatR [Tue, 22 Mar 2016 08:19:27 +0000 (01:19 -0700)]
more fixes for revised 'sortloot'

After some permutation of commands which displayed items, the 'd'
command presented a prompt with the list of letters scrambled (in
loot order or pack order rather than invlet order), so explicitly
sort when getobj operates.  Done for ggetobj too.

For menustyle:Traditional, ',' followed by 'm' presented a pickup
list in pile order even when sortloot was 'l' or 'f'.  That was an
unintentional change during the 'revamp'.

8 years agotty menu coloring
PatR [Tue, 22 Mar 2016 01:26:48 +0000 (18:26 -0700)]
tty menu coloring

There was a report during beta testing that menu lines which were
displayed in color showed the whole line in color, unless/until an
item was selected or unselected, in which case the '-', '+', or '#'
was rendered in monochrome.  The suggestion then was to redraw the
selection character in color, but I went the other way.  Menu
entries will render the selector letter and selection indicator in
monochrome all the time, and only the text of the menu entry will
honor menucolors.

8 years agofix "object lost" panic after query_objlist
PatR [Sun, 20 Mar 2016 20:01:56 +0000 (13:01 -0700)]
fix "object lost" panic after query_objlist

Reported directly to devteam for recent git code, the "sortloot
revamp" patch could trigger an object lost panic after calling
query_objlist() when menustyle was full or partial and player
picked up a subset of available items.  Modified head-of-list was
not being propagated to its source in pickup().  Use an extra layer
of indirection.

8 years agofix scatter feedback
PatR [Sat, 19 Mar 2016 22:46:33 +0000 (15:46 -0700)]
fix scatter feedback

Reported directly to devteam (for 3.4.3 but still present in 3.6.0):
an unseen landmine explosion which caused scatter() to break a
boulder or statue would give feedback as if the hero could see the
boulder or statue being destroyed.

Also, a couple of landmine explosion messages didn't take deafness
into account.

8 years agofix #4279 - kicked daggers are lost
PatR [Sat, 19 Mar 2016 21:47:36 +0000 (14:47 -0700)]
fix #4279 - kicked daggers are lost

A kicked object which hits a monster wasn't placed back on map,
removing it from play.

8 years agotuning: succubi
PatR [Fri, 18 Mar 2016 22:50:13 +0000 (15:50 -0700)]
tuning: succubi

This one had been intended for longer than several years, but I
hadn't gotten around to it.  When consorting with succubi and
incubi, very high Cha+Int no longer guarantees that a positive
outcome will occur.

Chance of positive outcome is still quite high and most of the
negative outcomes are pretty easy to repair, so this isn't likely
to make a significant impact.  However, the possibility of losing
spell power will matter for some players....

8 years agotuning: thrones
PatR [Fri, 18 Mar 2016 22:46:11 +0000 (15:46 -0700)]
tuning: thrones

This was sitting around for several years.  When positive luck
lessens a negative effect from sitting on a throne, reduce luck so
that repeated occurances will eventually get the intended result.

8 years agoStop `>` from closing TTY menus on the last page
Tung Nguyen [Thu, 17 Mar 2016 03:46:59 +0000 (14:46 +1100)]
Stop `>` from closing TTY menus on the last page

Pages can now be freely and safely scrolled with the `<` and `>` keys.
Space still dismisses menus if it's used on the last page.

8 years agoOmit accel and select char from menu colors
Tung Nguyen [Thu, 17 Mar 2016 03:20:17 +0000 (14:20 +1100)]
Omit accel and select char from menu colors

e.g. When there's "a - whatever", color the "whatever" part and leave
the "a - " part unformatted.  This matches the behavior of menu colors
in NAO343.

8 years agofix #H4274 - monster growing up changes gender
PatR [Wed, 16 Mar 2016 22:03:37 +0000 (15:03 -0700)]
fix #H4274 - monster growing up changes gender

Most of the humanoid species have Lords and several have Kings,
but none of them have Ladies or Queens.  When a female grows up
to reach that level of monster, she changes into male.  This fix
gives an alternate message acknowledging that change rather than
prevent taking on the stronger form.  A better fix would be to
add ogre ladies and dwarf queens as separate monsters, but doing
so will break 3.6.0 save file compatibility.

(I started out with an alternate fix, adding mons[].fname for the
dozen or so creatures which warrant an alternate name for females.
But that requires statues, figurines, corpses, tins, and maybe
even eggs to track gender [some statues already do, and corpses
and statues with attached mtraits also implicitly do] and to not
stack with equivalent ones of the opposite gender.  Plus glyphs
to track them, and new tiles.  It was becoming too complicated
for such a relatively unimportant feature.  Separate monsters is
the way to go, deferred until save file format changes again.)

8 years agofix #H4275 - blinded, stunned, confused timers
PatR [Tue, 15 Mar 2016 08:00:36 +0000 (01:00 -0700)]
fix #H4275 - blinded, stunned, confused timers

Blindness due to face covered by pie was ignored for several cases
of magically curing blindness--cleaning the face seems better than
adjusting timeout to account for u.ucreamed for those cases.  A few
instances of taking stun or confusion damage overrode existing stun
or confusion rather than increasing it.  Plus a copy/paste mistake
for dual stun+confusion when casting an expired spell.

There was also a suggestion that vomiting when already nauseated
should decrement the timer instead of increasing it.  But there is a
negative effect for as long as it's in effect, so I left that as is.

8 years agomonster sanity checking
PatR [Mon, 14 Mar 2016 22:42:03 +0000 (15:42 -0700)]
monster sanity checking

Add some more checks for monsters when the sanity_check option
is enabled.

8 years agomonst.h formatting
PatR [Mon, 14 Mar 2016 22:39:18 +0000 (15:39 -0700)]
monst.h formatting

Clean up the formatting in monst.h.  Provoked by the M_AP_NOTHING
absurdity.

8 years agosortloot fixes
PatR [Mon, 14 Mar 2016 22:32:17 +0000 (15:32 -0700)]
sortloot fixes

Fix some typos in the sort-by-invlet code and a logic error in the
lately added subclass sorting for sort-by-pack.  Regular inventory
display only works correctly for the latter if invlet is the tie-
breaker within object classes.  When helmet/gloves/boots/&c and
ammo/launcher/missile/&c sub-categories already break ties for armor
and weapon classes, inventory ended up out of alphabetical order.

8 years agolooting gold
PatR [Mon, 14 Mar 2016 00:45:18 +0000 (17:45 -0700)]
looting gold

When removing items from a container via menu, list gold as '$'
instead of 'a' when it is the first item.  Requested during beta
testing last year....

When gold isn't first ('sortpack' false, or custom 'inv_order[]'),
it uses the next letter in sequence instead of '$', otherwise it
would be the only item out of sequence.

8 years ago'sortloot' revamp
PatR [Sun, 13 Mar 2016 23:23:38 +0000 (16:23 -0700)]
'sortloot' revamp

Change the sortloot option to use qsort() instead of naive insertion
sort.  After sorting, it reorders the linked list into the sorted
order, so might have some subtle change(s) in behavior since that
wasn't done before.

pickup.c includes some formatting cleanup.

modified:
  include/extern.h, hack.h, obj.h
  src/do.c, do_wear.c, end.c, invent.c, pickup.c

8 years agoFix paid object on bill when angering another shopkeeper
Tung Nguyen [Tue, 8 Mar 2016 13:48:52 +0000 (00:48 +1100)]
Fix paid object on bill when angering another shopkeeper

To test:

 1. Get a level layout with two shops facing each other, e.g. minetn-4.
 2. Sell a fragile object to one of the shops.
 3. Dig a pit in the other shop's door space so its shopkeeper stays out
    of the way.
 4. Pick up an object in that other shop so it appears on your bill.
 5. Zap a wand of striking at the first shop to break the fragile
    object.
 6. 'p'ay for the object picked up.

Expected result: Object gets the standard prompt to pay for it.

Actual result: "Paid object on bill??" followed by "Program in disorder
perhaps you'd better #quit." followed by the object being given to the
player for free.

The cause?  This comment going all the way back to 2002:

> /* FIXME: object handling should be limited to
>    items which are on this particular shk's bill */

Originally reported by PaRaD0xx in FreeNode's #NetHack IRC channel
whilst playing NAO343.

Based on DynaHack commit d995ed1 (Fix paid object on bill when angering
another shkp) by me.

8 years agoFix & instead of && in onbill()
Tung Nguyen [Tue, 8 Mar 2016 13:26:57 +0000 (00:26 +1100)]
Fix & instead of && in onbill()

It's obviously supposed to be the latter and not the former.

Interesting note: This same bug was found and fixed in NitroHack commit
4973ce4 (static checker day: fixes for scan-build and PVS warnings).

8 years agoFix billing/credit when hero nests their containers on a shop floor
Tung Nguyen [Wed, 9 Mar 2016 04:18:15 +0000 (15:18 +1100)]
Fix billing/credit when hero nests their containers on a shop floor

This fixes a bug where the hero could accidentally donate the contents
of their bag to a shopkeeper if they put it in another bag on the shop
floor that also belonged to the hero.  To reproduce:

 1. Drop a sack on the floor, but don't sell it.
 2. Get another sack and put in hero-owned objects.
 3. Put the sack with objects into the sack on the shop floor.
 4. Take out the sack with the objects from the sack on the shop floor.

The shopkeeper will claim you owe them for the objects in the sack, and
view the contents of the sack will show them as belonging to the
shopkeeper.

This fix is what those previous fixes for `SELL_DONTSELL` were for.

Based on DynaHack commit f91ce0b (Fix billing/credit when hero nests
their containers on a shop floor) by me.

8 years agoCredit/debit gold in containers even in sellobj_state SELL_DONTSELL
Tung Nguyen [Wed, 9 Mar 2016 03:55:02 +0000 (14:55 +1100)]
Credit/debit gold in containers even in sellobj_state SELL_DONTSELL

There's no capacity for the shop logic to handle gold without also
changing the credit/debit within it, so gold must always be handled in
`sellobj()`, even when the state of it is set to `SELL_DONTSELL`.

This is needed for an upcoming bug fix.

Based on DynaHack commit b0784c5 (Credit/debit gold in containers even
in sellobj_state SELL_DONTSELL) by me.

8 years agoDon't shop-donate non-empty bags dropped in sellobj_state SELL_DONTSELL
Tung Nguyen [Wed, 9 Mar 2016 03:20:58 +0000 (14:20 +1100)]
Don't shop-donate non-empty bags dropped in sellobj_state SELL_DONTSELL

For a shop to NOT charge for an object, two conditions apply:

 1. The object's `no_charge` flag must be set.
 2. That `no_charge` flag must be set regardless of whether or not the
    shop typically sells the object in question.

There are two places in `sellobj()` which ignore the second condition,
thus transferring object ownership from the player to the shop without
the player's consent:

 1. A container is dropped in a shop that typically sells such
    containers and `sellobj_state` is `SELL_DONTSELL`.
 2. A zero-cost container holding nothing but gold is dropped in a shop
    that typically sells such containers.

Neither occurs currently in NetHack: the latter because NetHack has no
zero-cost containers, but the former is needed for an upcoming bug fix.

This may be related to SC343-21: "Accounting is incorrect for containers
dropped in a shop that does not sell them."

Based on DynaHack commit 4e79b6a (Don't shop-donate non-empty bags
dropped in sellobj_state SELL_DONTSELL) by me.

8 years ago^G enhancement
PatR [Fri, 11 Mar 2016 01:50:09 +0000 (17:50 -0800)]
^G enhancement

Accept "male" or "female" when specifying monster type for ^G.
Groundwork for testing and hopefully eventually fixing "female
gnome" grows up into "gnome lord" and becomes male.

8 years agofix #H4272 - "you turn into a Elvenking"
PatR [Thu, 10 Mar 2016 01:15:32 +0000 (17:15 -0800)]
fix #H4272 - "you turn into a Elvenking"

Polyself with gender change into a creature with fixed gender
would deliver a message containing "a <creature>" regardless of
whether "an" was warranted.

(Into any creature which supports both genders it yielded
"a male <creature>" or "a female <creature>" so "an" was never
needed.  And when no gender change was involved, it used an()
so got "a <creature>" or "an <creature>" as applicable.)

8 years agofix #H4057 - rusting amulets
PatR [Thu, 10 Mar 2016 00:37:43 +0000 (16:37 -0800)]
fix #H4057 - rusting amulets

There have been two or three reports on getting feedback about
amulets rusting.  Object formatting doesn't display erosion for
them, so being told about damage then not seeing that damage
feels like a bug.  Even if damage was displayed, it has no effect
on them so would still feel somewhat strange.  It does display
erosion for wands and rings, which is strange too.

This limits erosion damage--and its feedback--to items which are
actually impacted by erosion:  armor, weapons and weapon-tools;
also heavy iron balls and iron chains since they've traditionally
shown rust even though it has little effect.

A side-effect of this change is that flammable items (other than
armor and weapons) which don't burn up immediately will no longer
become burnt, then very burnt, thorougly burnt, and finally be
destroyed.  Since the player couldn't see or possibly repair the
erosion state, it seemed incomplete.  It could be reinstated by
making other flammable items be subject to erosion and displayed
as such by xname() & co.

Wishing now avoids applying erosion and erosion-proofing to items
that aren't affected by it, regardless of material.  It also now
allows wishing for "rusty rustproof <iron-object>" which used to
suppress "rusty" in that combination and triggered a couple of
old bug reports.

Heavy iron balls and iron chains can have rust repaired and can
be made rustproof by wielding, then reading enchant weapon while
confused, as if they were weapons.

8 years agoRemove unreachable break statements.
Sebastian Buchwald [Wed, 9 Mar 2016 10:38:46 +0000 (11:38 +0100)]
Remove unreachable break statements.

8 years agoReturn computed result instead of constant.
Sebastian Buchwald [Wed, 9 Mar 2016 10:05:28 +0000 (11:05 +0100)]
Return computed result instead of constant.