Commit Graph

1339 Commits

Author SHA1 Message Date
cohrs
5e7e8a5e5f avoid more QBUFSZ buffer overflows
Several places were not using safe_qbuf or anything equivalent to avoid
overflowing a QBUFSZ buffer.  Add more uses plus one special case.  For
the current max lengths returned by xname(), I think this is
sufficient.  This addresses a reported buffer overflow for a
"thoroughly rusty thoroughly corroded helm of opposite alignment", plus more.
2005-03-18 03:46:20 +00:00
nethack.rankin
acb416abcc land mine vs drawbridge
Fix the reported problem that having a land mine explode on an open
drawbridge or under its portcullis did not cause the bridge to be destroyed.
2005-03-17 05:20:34 +00:00
cohrs
59cc0d221b sliming ghosts
From a bug report.  Green slime would slime noncorporeals.
Added missing checks.
2005-03-14 16:27:35 +00:00
cohrs
f1bf488367 passive damage
As From a bug report, twice.  Change max_passive_dmg to multiply the
result by the number of direct attacks the aggressor can make.  This way, a
tame mind flayer, for example, will avoid pounding on a spotted jelly and
dying as a result of the Nth passive response.
2005-03-14 15:27:53 +00:00
nethack.rankin
4e8880d4fb Mr. Izchak
Suppress "Mr" or "Ms" title for shopkeepers when they're going by a
first name rather than a surname.  The bug report was for Izchak, but it
would have happened with the two last resort names (which I've never seen
in actual use) and for the "hippie names" used in post-3.4.x health food
shops.  I have not attempted to specify gender for those, just flagged
them as first names.  This prepends a prefix character to the name string
(see comment in shknam.c) to specify gender and/or first name vs surname.
2005-03-13 06:48:35 +00:00
nethack.rankin
2799e8f617 digging holes
If you manage to escape a hole and then dig down with a pick-axe at
that location, finish on the first move instead of after the usual N turns.
2005-03-10 05:18:28 +00:00
nethack.rankin
5d25ed46aa theft detection
Shop items stolen or destroyed without being in inventory were handled
inconsistently compared to simply picking up unpaid items because different
criteria got used to decide whether the shk cares about something.  Last
December a hack to deal with this for container contents was introduced but
that left the problem for ordinary items.  This patch attempts to address
it by using a common check for theft and for pickup's add-to-bill.

     It hasn't had nearly enough testing and I won't be very surprised if
one or more new obscure shop bugs have now come into being, but perhaps
they'll at least be consistent bugs as far as shop billing is concerned....
2005-03-06 06:58:46 +00:00
cohrs
a0cc33a8fd copy/paste error in horse_parts: foreclaw vs forehoof
When horse_parts were separated from animal_parts, one "forehoof" was missed
2005-02-15 00:25:23 +00:00
nethack.rankin
4a4fc8f4fa more ring theft
Neither nymphs nor monkeys can steal a ring worn underneath gloves
since they can't see them.  If such rings are randomly targetted, try to
take gloves instead.

     Succubi trying to take worn ring of adornment will attempt to take
off worn gloves first.  (Presumeably they can sense magic rings hidden
beneath gloves better than nymphs can; they're about to try to take all
worn armor off anyway....)  If the glove removal fails, ring theft will
too.  Likewise for incubi, remove gloves before trying to force the hero
to put on ring of adornment.

     At the moment succubi and incubi can't remove gloves which are
blocked by a welded weapon, but they can manipulate rings then if there
aren't any gloves involved.  I don't think that's right.  The latter is
nymph-like and could be attributed to magic, but if that's the case why
aren't they able to remove gloves from under cursed weapons too?
2005-02-10 05:54:34 +00:00
nethack.rankin
847e3358c7 ring theft
Prevent monkeys from stealing any ring which the hero can't remove due
to it being stuck inside the grip of a cursed weapon.  Nymphs can still do
so though.  From a bug report.
2005-02-10 04:25:29 +00:00
nethack.rankin
8414b5214f exploding magic pointers
Fix the two problems that <Someone> reported about stale pointer use
after a bag of holding has exploded.  use_container() passed the wrong
variable for quantity when calling useupf(), and doapply() had no way to
tell if the object being used had been destroyed so could use an invalid
pointer when checking for speaking artifact.  The fix for the latter is
much simpler than what <Someone> suggested.
2005-02-06 03:25:04 +00:00
nethack.rankin
2b62b81fe4 medusa meat
Someone in the newsgroup mentioned that there is no warning from blessed
food detection if you attempt to eat a tin of Medusa meat.  touch_petrifies()
isn't enough to catch that.  A warning was given about Medusa's corpse, but
only if you lacked poison resistance.  Eating a tainted Medusa corpse had a
similar problem; the check to override food poisoning so that petrification
takes effect missed it.  This makes the petrification checks be consistent,
including hypothetical case of Medusa egg.
2005-02-03 04:12:28 +00:00
nethack.rankin
2886b276ea wishing tweaks
When a wish request for "<foo> armor" fails to match anything, check
whether it matches "<foo> mail" before resorting to selecting a random piece
of armor.  Most of the suits are named "mail", and while I don't think many
people will ask for "ring armor", I do think that "crystal plate armor" and
"gray dragon scale armor" are sometimes tried.

     This also greatly simplifies the handling for spelling variant "armour"
by rewriting it to "armor".  Unfortunately "grey" vs "gray" can't be handled
the same way since both spellings are used by the program.
2005-02-01 05:35:34 +00:00
nethack.rankin
191db348ec stop occupation during problem countdown
A user recently complained that he started an activity such as
searching and specified a repeat count, right after getting--and not
realizing the significance of--the first message in the countdown
sequence for turning into stone.  He suggested that subsequent messages
interrupt multi-turn activity so that the player has a chance to do
something to prevent imminent death.  This implements that, with the
added wrinkle that it won't interrupt if the activity is something that
might save the character's life:  attempting to eat a tin that is either
sure to help (if ID'd as food that cures stoning) or a desparate gamble
(if unID'd).  Some hooks for similar behavior for other conditions like
turning into slime are included, although no tins can help for anything
other than petrification so far.

     Shouldn't fatal illness have an end-is-near countdown too?
2005-02-01 03:46:31 +00:00
nethack.rankin
d1732e1e8c intelligent pets vs cannibalism (trunk only)
Implement a user suggestion that tame humanoids should avoid eating
corpses of their own species.  Prevent them--except for kobolds, orcs, and
ogres--from doing so unless starving.  Arbitrary:  tame elves won't eat
other elves even when starving.  A polymorphed character will incur the
effects of cannibalism when eating either his/her underlying race _or_
the current one (player orcs and cavemen aren't affected though).
2005-01-30 04:19:01 +00:00
cohrs
ce1bf539ac U1270 - monster evading kick produces a teleport message in Sokoban
This time, it was just the message that was incorrect.  Added a
!level.flags.noteleport check before displaying "teleports".
2005-01-27 17:21:33 +00:00
nethack.allison
fd205fc1db followup to compression changes 2005-01-23 14:34:29 +00:00
nethack.allison
ab1872b928 zlib support; also internal compression changes
o Add support for zlib compression via ZLIB_COMP in config.h (ZLIB_COMP
  and COMPRESS are mutually exclusive).
o rlecomp and zerocomp are run time options available if RLECOMP and
  ZEROCOMP are defined, but not turned on by default if either COMPRESS
  or ZLIB_COMP are defined.
o Add information to the save file about internal compression options
  used when writing the save file, particularly rlecomp and zerocomp
  support.
o Automatically adjust rlecomp and zerocomp (if support compiled in)
  when reading in an existing savefile that was saved with those options
  turned on.  Still allows writing out of savefile in preferred format.
o In order to support zlib and not conflict with compress and uncompress
  routines there, the NetHack internal functions were changed to
  nh_uncompress and nh_compress as done in the zlib contribution received
  in 1999 from <Someone>.

I tagged the sources NETHACK_3_5_0_PREZLIB prior to applying these
changes.
2005-01-22 15:28:15 +00:00
cohrs
c40d876c3b U1258 - removing ring of levitation while riding a flying steed
As reported, you'd get the "float gently to the ground" message even while
riding a flying steed.  Rearranged the code and added a new case for this.
I found it odd that Hallucination protected you from falling out of the
saddle due to the Sokoban air currents.  The message implied otherwise, so
I've made the sokoban_trap code apply in both cases.
2005-01-21 22:27:19 +00:00
cohrs
c90746c670 polymorphing into a flyer while in a pit
<Someone> reported that if you polymorph into a flying monster while in a
pit, you must take u.utrap turns to first climb out before you can fly.  Of
course, once you're out, you can swoop down into the pit to pick things up
w/o delay.  Rather that have you automatically fly out (e.g. like quaffing
a potion of levitation), I thought it was better to take a turn to fly out,
so that's what I've implemented.

The code to deal with exiting a pit is moved to a new climb_pit function
and the "up" command now lets you climb from a pit too (something I've
found non-intuitive in the past).

Finally, I noticed that non-moving monsters could still go up/down even
though they couldn't move around.  Added non-moving checks in doup/dodown.
2005-01-18 16:17:27 +00:00
cohrs
c9b11cf989 U1231 - messages ordering when displacing a pet into a trap
move the message so it's before the mintrap test.  newsym's are needed
to ensure the display is correct if a --More-- prompt results.  I left the
"frighten" message alone, except for tense.  As per Pat's suggestion, I
changed the wording to future-proof the message.
2005-01-18 15:23:47 +00:00
cohrs
d0a1a6e5b6 experience calculation
fix the bug <Someone> noticed WRT experience calculation for nonphysical damage.
2005-01-18 15:01:10 +00:00
nethack.allison
9fe716c8db Guidebook update 2005-01-16 03:57:39 +00:00
nethack.allison
4c3a3d1d0c fixes35.0 update 2005-01-15 14:12:23 +00:00
cohrs
546add5359 missing copyright
<Someone>, I think, noticed there was no copyright on the window.doc.
Add one.  I don't recall when I originally wrote it, but I last changed
it in 2003, so that's the year I'm putting in.  Anyone else that wants to
share the blame, please add your name and update the year as needed.
2005-01-13 00:34:35 +00:00
nethack.allison
ee7064746f AltGr-4 and alternate tiles in menus - trunk only (from <Someone>)
On Mon, 03 Jan 2005 12:04:29 +0000, <email deleted> wrote:
> Dear NetHack win32 developers,
>
> This bug does not affect the win32 binaries that you distribute but it
> does affect NetHack 3.4.3 if I build it from source. The difference may
> be due to different compilers or whatever. I'm using mingw32-gcc v3.2
>
> I don't quite understand what's going on (I never was much good at
> win32 programming), but it appears that the WM_KEYDOWN message for
> AltGr-4 is being translated into a WM_CHAR message with a wParam of
> 128. I don't understand why that should be, but anyway. The problem
> then occurs when NetHack casts wParam to char which, since char is
> signed, gives -128. onListChar() then passes -128 to isdigit() which
> causes the crash. The fix appears to be to simply drop the cast:

Also
> <email deleted>
> Newsgroups: rec.games.roguelike.nethack
> Subject: Changing tile set for item list?
> Date: 1 Jan 2005 20:03:08 -0800
> <email deleted>
>
> I'm using the windows interface for Nethack 3.4, and I've successfully
> changed the tileset used by changing defaults.nh.  The only problem is,
> the item list (i.e. The list that comes up when I press "i") still uses
> the old tiles.  Is there any way to change the list so it uses the new
> tiles?  I've searched the guidebook to no avail.  I'm debating if it is
> even possible.
>
> Thanks for the help,
> -Zmann

trunk patch:
- menu: display custom tiles if map is not ASCII
- menu: display '-'/'+'/'#' in place of a tile if map is ASCII
- fix isdigit() crash on AltGr-4 with mingw


It looks kinda weird with huge tiles (e.g. absurd96) but that could
be just me. Comments/suggestions are welcome.

-<Someone>
2005-01-09 23:35:52 +00:00
nethack.allison
055781aaf2 selectsaved follow-up bit (trunk only) 2005-01-09 21:58:43 +00:00
nethack.allison
15ae774a78 selectsaved option (trunk only)
- always write plname into save file, no longer conditional
- add 'selectsaved' wincap option to control the display of
  a menu of save files for ports/platforms that support it.
- add support for win32 tty using normal nethack menus.
- the win/tty/wintty code is generalized enough that any
  tty port could support the option if the appropriate port-specific
  code hooks for wildcard file lookups are added to src/file.c
  specifically in the get_saved_games() routine. There is posix
  code in there from Warwick already, and there is findfirst/findnext
  code in there from win32. Warwick has the posix code only
  enabled for Qt at present, but with wintty support, that could be expanded
  to other Unix environments quite easily I would think.

Here is what the tty support looks like:

    NetHack, Copyright 1985-2005
         By Stichting Mathematisch Centrum and M. Stephenson.
         See license for details.

    Select one of your saved games
    a - Bob
    b - Fred
    c - June
    d - mine3
    e - Sirius
    f - Start a new character
    (end)

The following files existed in the NetHack SAVEDIR directory
at the time:
    ALLISONMI-Bob.NetHack-saved-game
    ALLISONMI-Fred.NetHack-saved-game
    ALLISONMI-June.NetHack-saved-game
    ALLISONMI-mine3.NetHack-saved-game
    ALLISONMI-Sirius.NetHack-saved-game
Note that despite the file names, the actual character name
is drawn from the savefile.

The WIN32CON support passes
    USER-*.NetHack-saved-game
to findfirst/findnext where USER is your login name of course.
2005-01-09 21:40:24 +00:00
nethack.allison
9a3022800b filled trap doors on castle can be re-dug 2005-01-08 14:37:36 +00:00
nethack.allison
66cdbb6f0d housekeeping: mark trunk sources 3.5 (doc) 2005-01-02 17:10:47 +00:00
nethack.allison
10e8c11c0a region player_flags follow-up correction [trunk only] 2005-01-02 13:04:56 +00:00
nethack.allison
c3f2bbf5e5 add May 2004 trunk patch to the branch
Bug Report:
>> Status of the doppelganger (neutral): Level 13 HP 1433(1433) AC 5.
>> [See the HPs!! ]

Michael:
> I used a debugger and traced this massive hit point growth
> to this line in mon.c, function newcham(). (I watched the mhp
> jump from 58 to 567 with this one calculation!
>> Ah, I see that this problem is fixed in the trunk but still present in
>> the branch. This seems serious/abusive enough to warrant the fix to be
>> applied to the branch too, doesn't it?

Pat:
>      I don't think it's all that important but you're welcome to
> extract and adapt the patch if you like.
2004-12-24 23:18:51 +00:00
nethack.rankin
3f2aa875bb fix monster summoning message
From a bug report:
> If the Summon Nasties monster spell gates in two minions instead of one,
> the message still says "A monster appears from nowhere!"

The code wasn't counting any summoned monsters who had an opposite alignment
to the summoner.  It also assumed that the 10% chance for demon summoning
in Gehennom always yielded exactly one monster even though that can produce
zero or more than one.
2004-12-21 04:27:34 +00:00
nethack.allison
38f9ba9a91 candelabrum wording
On Sat, 18 Dec 2004 14:07:14 +1300, <email deleted> wrote:
> Adding one of several candles to a candelabrum which already has six
> gives an ungrammatical message.
2004-12-20 23:57:02 +00:00
nethack.allison
0a2eec1e6c statue trap triggered by Blind searching
<Someone> wrote:
> Blind, s)earching unknown territory...
>
>   "You find something posing as a statue."
>
> Shouldn't this map_invisible()?
2004-12-17 01:53:35 +00:00
nethack.allison
1c326a95e1 monster order rules
<Someone> wrote:
> From the mkclass() comments:
>
> /*      Assumption #2:  monsters of a given class are presented in ascending
> *                      order of strength.
> */
>
> And monst.c:
>
>  *      Rule #2:        monsters of a given class are presented in ascending
>  *                      order of strength.
>
>  *      Rule #4:        monster subclasses (e.g. giants) should be kept
>  *                      together, unless it violates Rule 2.  NOGEN monsters
>  *                      won't violate Rule 2.
>
> Inspecting my monster-difficulty spoiler, I see the following places
> that these precepts are violated: do they cause potential problems?
> (Insofar as occasionally incorrectly miscalculating the probabilities
> for monster generation is a "problem", that is...)
>
> SPECIES                DIF
> ~~~~~~~~~~~~~~~~~~~~~~ ~~~
> d                  dog   5
> d            large dog   7
> d                dingo   5
>
> d                 warg   8
> d      winter wolf cub   7
> d          winter wolf   9
>
> u        white unicorn   6
> u         gray unicorn   6
> u        black unicorn   6
> u                 pony   4
>
> H          frost giant  13
> H          storm giant  19
> H                ettin  13
>
> P        black pudding  12
> P          green slime   8
>
> S            pit viper   9
> S               python   8
> S                cobra  10
>
> Z         giant zombie   9
> Z                ghoul   5
>
> @                nurse  13
> @              soldier   8
> @             sergeant  10
>
> &         horned devil   9
> &             succubus   8
>
> &               balrog  20
> &            sandestin  15
>
> (I've just realised that these may have already been fixed, and
> waiting on a file-compatibility-breaking release; if so, ignore me :-)
2004-12-17 01:32:59 +00:00
nethack.allison
0843550e37 coaligned unicorn in bones
<Someone> wrote:
>> If the previous character was non-neutral, the unicorn would have
>> started off as hostile.  When a bones file is loaded, I don't think
>> hostiles are made non-hostile, although the reverse is certainly true
>> (pets of the deceased are usually hostile).
>
>  In the general case, they are, or rather their hostility is
>  re-evaluated with respect to the new character; see the peace_minded()
>  call in getlev(). However, co-aligned unicorns always being created
>  peaceful is a special case in makemon(), _not_ part of peace_minded(),
>  so they'd just have the usual chance of being made peaceful or not
>  depending on alignment strength, as for any other co-aligned monster
>  not explicitly declared always peaceful or always hostile.
2004-12-17 00:56:35 +00:00
nethack.allison
422a6f8145 Master of Thieves
<Someone>  wrote:
> The "/* Fix up the quest nemesis */" code in role_init()
> adds M3_WAITFORU but _doesn't_ remove M3_CLOSE;
> since the Master of Thieves as the Rogue Quest Leader is
> defined with that flag, he keeps it when acting as the Tourist
> Quest Nemesis. Thus, when STRAT_WAITFORU
> is cleared by your actions, STRAT_CLOSE may stay in
> place making him stay meditating when another Nemesis
> wouldn't.
2004-12-17 00:33:05 +00:00
nethack.allison
6ecd84f031 shrieking monster failed to wake others
<email deleted> wrote on Friday, December 10, 2004:
> I was in a barracks with the soldiers sleeping.  I started fighting one soldier
> and threw a potion of acid on him.  I got the "The soldier shrieks in pain!"
> message, but none of the other soldiers in the barracks woke up.
2004-12-16 01:58:20 +00:00
nethack.allison
5a433fe0e0 new container flags
[Attention: This patch increments EDITLEVEL in patchlevel.h, rendering all
 previous save and bones files obsolete.]

Here's the first cut at the two recommended flags lknown and cknown.
I've attempted to stay close to Pat's recommendations:
   "Containers ought to have two new flags:  lknown for lock status known,
    and cknown for contents known (ie, `secret').  Formatted box and chest
    descriptions should include locked/unlocked/broken when that is known
    and empty/nonempty (or something like "holds N items") when contents
    are known. The contents indicator would also apply to nonlockable
    containers."

I probably overlooked a place where a flag should be adjusted, but this
should give us a good starting point.

I wasn't sure what to do with the case of the auditory feedback for
magical locking "Click" and "Clunk". The question that came to my mind
was: Should those reveal the locked or unlocked status of a box?
I suppose if you knew the type of wand you were zapping or the spell
you were casting, you could argue that they should.

In the end, I opted for setting lknown right off the zap/cast effect
for anyone playing a Wizard role, and not setting it for anyone else,
thus advancing class differentiation a little bit too.

I haven't checked the cknown results under all flags.menu_style options
at this point, only MENU_FULL.
2004-12-15 23:50:18 +00:00
nethack.allison
10b227e242 upper case correction
Fix for first issue reported in this bug report:

<email deleted>
Sent: Thursday, December 09, 2004 7:13 AM
Subject: Two wrong messages

I would like to report two cosmetic issues:

1. "its gaze is reflected by the invisible [pet]'s shield."
Wrong capitalization.

2. The message given when decapicating an ettin {,zombie} with the Vorpal
Blade fails to mention the second head.  This could be pretty tricky to
fix, but, per <Someone>'s suggestion, the easiest explanation would be
to say that the blade's wielder cuts off both heads at once.
The patch would look similar to:
                         *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER;
>                        if(mdef->data==&mons[PM_ETTIN]
>                          ||mdef->data==&mons[PM_ETTIN_ZOMBIE)
>                                pline("%s goes through both necks of %s at once like butter!",
>                                      wepdesc, mon_nam(mdef));
>                        else
                         pline(behead_msg[rn2(SIZE(behead_msg))],
                               wepdesc, mon_nam(mdef));
                         otmp->dknown = TRUE;
(and the same for youdefend)
2004-12-09 15:47:45 +00:00
nethack.rankin
39f3bba86d stinking cloud feedback
Add the extra feedback suggested by <Someone> so that being blinded
by moving into a stinking cloud is explicitly pointed out to the user.  It
makes things more verbose but seems reasonable.  You get blinded for 1 turn
with every step, so the message gets repeated each time too, but since you
also get a choking or coughing message on each step it's only a modest
increase in the overall verbosity.
2004-12-04 02:54:02 +00:00
nethack.rankin
b4be660c0a avoid hallucinatory effect on black light as it explodes
From a bug report:  when a black light explodes and triggers
hallucination, its own monster symbol--or warning marker for same--could
be seen changing.  Since nothing is left after it explodes, you shouldn't
hallucinate anything at its location.  Fix by killing it off (so removing
it from the map) before initiating Hallucination.
2004-11-30 04:32:01 +00:00
cohrs
2abfb12144 U1182 - Can drink from sink while engulfed
The same occurred for fountains and drinking surrounding water while
underwater.
I also added a !Levitation check for sinks, like already exists for
fountains.  I cannot believe sinks are taller than an altar, and if you
can't pick up stuff from an alter while levitation, it stands to reason you
cannot drink from a sink then either.
2004-11-29 19:01:31 +00:00
nethack.rankin
384628da9a fix steed eating feedback
<Someone> reported that riding a steed into a magic portal can
give "steed is still eating" message, feedback normally used to explain why
you can't go down stairs.  Rather than preventing portals from activating
in that situation, just force the meal to be finished in order to suppress
the message.  Proper fix is probably to prevent all steed movement while
eating, but that would most likely result in no one ever riding again.
2004-11-27 03:06:21 +00:00
nethack.rankin
00dcc2ae4c fix #U1206 - Quest artifact in WIZKIT file aborts program
Fix the wizard mode crash From a bug report.  Move the WIZKIT
message suppression to a lower level instead of trying to guard against
present and future pline() calls in the wishing code.  The way that was
being handling wasn't suitable for dealing with quest feedback.

     This also includes a couple of additional wishing synonyms.
2004-11-24 02:50:32 +00:00
nethack.rankin
0600cf70ca tastes like chicken...
Someone in the newsgroup expressed surprise that he didn't get any
special message after surviving the eating of a cockatrice corpse.  Combine
the cliche that unconventional meat inevitably tastes like chicken with
the mythology that cockatrices are a bizarre hybrid of chicken and reptile
(or whatever).  This will give a message about tasting like chicken for
corpses or smelling like chicken for tins when the hero has petrification
resistance (poly'd into a xorn, for instance) or is hallucinating.
2004-11-20 02:39:18 +00:00
nethack.rankin
6336dbbb65 fix #U1202 - shop robbery oversights
A user reported that when breaking potions inside a box in a shop, he
wasn't charged for them.  The code was calling stolen_value() as intended,
but that routine only charged for types of items which the shop normally
carries.  That meant that breaking the contents of a box in a general
store would charge for them but doing so in a tool shop would, not even
though the tool shopkeeper would gladly sell such things when you picked
them up instead of causing them to go away.

     When fixing this, I noticed that stolen_value() was only charging
for single items.  Most of the time that was right, because throwing and
kicking things always split one off, but there are cases (such as zapping
a wand of teleportation at shop goods) where an entire stack gets stolen
as a group.  This makes stolen_value() handle all quantities.
2004-11-20 01:41:01 +00:00
nethack.rankin
05923e795f cockatrice eggs vs gravity
Eggs thrown straight up which don't splatter on the ceiling yield
"you've got it all over your face", so wearing a helmet shouldn't protect
against petrification from cockatrice eggs in that situation.  This was
part of my delayed helm vs hat stuff; I can't remember whether it was done
before or after this same issue came up in the newsgroup.
2004-11-13 04:14:14 +00:00
nethack.rankin
7672a2c60b hats vs helms
Something from <Someone>'s list:  some messages have hardcoded references
to "helmet" which sound strange when the character is wearing a hat or cap.
helm_simple_name() is comparable to the existing cloak_simple_name().  It
returns "helm" or "hat" depending upon whether the helmet provides the
same protection that yields the assorted repetitions of "fortunately,
you are wearing a hard helmet".  This choice ends up categorizing elven
leather helm as a hat (which I think is ok given that its undiscovered
description is "leather hat"), contrary to <Someone>'s suggestion that the
distinction be made based on whether the helmet was made of cloth.

     I started on this a year and a half ago but didn't commit it.
Unfortunately I don't remember why and haven't done any significant
additional work now--just recovered from some intervening bit rot and
confirmed that the patch as is seems to be working ok (in the trunk; the
branch side has not been tested).  I suspect that I meant to look for
additional helmet messages which could benefit from conditional headgear
description.  (Those "hard helmet" ones don't need it, although they
should perhaps be moved into a common routine instead of being replicated.)
2004-11-13 04:00:52 +00:00