]> granicus.if.org Git - nethack/log
nethack
15 years agoremove unused variable (trunk only)
cohrs [Sun, 22 Mar 2009 15:56:55 +0000 (15:56 +0000)]
remove unused variable (trunk only)

15 years agorole init tidbit
nethack.rankin [Sun, 22 Mar 2009 03:19:59 +0000 (03:19 +0000)]
role init tidbit

15 years agoenhanced interactive role selection (trunk only)
nethack.rankin [Sun, 22 Mar 2009 00:23:57 +0000 (00:23 +0000)]
enhanced interactive role selection (trunk only)

 [See cvs log for src/role.c for a much longer description.]

     When picking role, race, and so forth, new menu entries allow you to
pick any of the other items before the one currently being handled.  After
picking all four of race, role, gender, and alignment (or if you answered
'y' to "shall I pick for you?"), there is a followup prompt to confirm the
choices.  It's a menu which also provides a chance to rename the character.

     This has only been implemented in win/tty's player_selection(), with
some support code in the core that might be useful to other interfaces.
And so far, the chance to rename is only presented as a menu choice if
you've given an answer to "who are you?" prompt earlier during startup.
Also, ports that use pcmain.c aren't able to perform hero renaming yet.

15 years agoenhanced interactive role selection (trunk only)
nethack.rankin [Sun, 22 Mar 2009 00:22:33 +0000 (00:22 +0000)]
enhanced interactive role selection (trunk only)

 [This verbose description is being committed with role.c only;
  the dozen or so other affected files will use a much shorter one.]

     Executive summary:  using Unix (or VMS) with tty, start up via
nethack -u player
and follow the prompts.  Seeing this in action will be much clearer than
any description.  It might work as is with Mac and Be too, where you
don't need to bother with "-u player" to get "who are you?".  Only half
of it will work with other ports using tty so far, and it does nothing
for ports which don't use tty.

     I started out attempting to add an option which would let you defer
picking your character name until after you'd picked role and race and
so forth (so that you could let the game pick randomly, then use your own
role- or race- or gender-specific name for the result) but threw my ends
up in frustration.  Instead, this allows you to specify race and/or gender
and/or alignment before role when interactively choosing them (ie, after
giving 'n' to the "shall I pick for you?" prompt), by adding extra menu
entries to the role menu, with similar entries in the other menus so you
can actually bounce back and forth picking whichever of the four role/race/
gender/alignment attributes in any order.  (<Someone> has a patch to
control the order of the four prompts via option setting, but it's not as
versatile as this ended up being.)

     That works pretty well, so I added a confirmation prompt when you're
done (which can be bypassed by picking new 'a' instead 'y' at the "shall
I pick your character's role [ynaq]?" prompt).  And I introduced a chance
to rename the character during that confirmation, with a quite modest
amount of spaghetti being added into main() to support it.  Picking a new
name which matches a save file will result restoring the saved game just
as if you'd used that name from the start.  [One thing which hasn't been
resolved yet is whether anything special needs to be done when changing
name to or from "wizard", particulary for ports which allow/reject wizard
mode access based on character name rather than user name.]

     Right now, renaming is only available if you've gone through the
"who are you?" prompt (thereby demonstrating that you're allowed to use
an arbitrary name), since some multi-user sites may be using scripting to
force the character name for players who share an account.  There should
be a new SYSCF option to let sites explicitly allow renaming, but this
had already grown pretty big so that is deferred.  (And I haven't yet
implemented sysconf for VMS so wouldn't have been able to test it....)

     Unfortunately, role selection has been implemented in the interface
code instead of in the core--a big mistake, in my opinion, even if some
interfaces can give easy point and click control to the player--so this
has only been implemented for tty.

     Also, renaming needs to manipulate lock files in the case where the
file name is based on the character name.  I moved the file name part
into getlock() itself, removing some clutter from main().  But getlock()
handling in pcmain.c is something I won't touch with a pole of any length.
It needs to be cleaned up before the rename capability can be activated
for ports that use that main().  The rest of the rename support there is
present but bracketed by #if 0.

     Lastly, the handling of generic character names like "player" and
"games" has been moved into plnamesuffix(), again to eliminate a bit of
clutter from main().  And plnamesuffix()'s potential for uncontrolled
recursion (if player keeps giving -Role instead of Name to askname()) has
been replaced by iteration.  It could still go on forever if the player
is persistent or askname() goes haywire, but I don't think we really care.

     The interface-specific changes are limited to player_selection() and
askname(), so folks can add this to other interfaces as desired without
flailing all over the place.  But the changes to tty's player_selection()
were quite extensive.  (Fortunately, some of it is just fixing up the
indentation to match changes in block nesting.)  Like tty, win32 and gem
use build_plselection_prompt().  It now returns a string ending in "[ynaq]"
rather than just "[ynq]" so if they don't bother with these changes, they
should either fix that up or at least accept 'a' as a synonym for 'y'
during the initial "shall I pick your character's role?" prompt.

15 years agoAllocation and style errors. Thanks Pat.
keni [Fri, 20 Mar 2009 20:31:14 +0000 (20:31 +0000)]
Allocation and style errors.  Thanks Pat.

15 years agofix #H1826 - split long worm with 0 hit points
nethack.rankin [Fri, 6 Mar 2009 02:22:14 +0000 (02:22 +0000)]
fix #H1826 - split long worm with 0 hit points

     From a bug report, a long worm with 0 HP
was observed via stethoscope after cutting one or more worms in half many
times, followed by an unspecified crash.  Cutting a worm doesn't reduce
its level below 3, but if a worm is drained to level 0 by some other means
and then gets cut in half (and still has at least 2 HP left), cutworm()
would give the new level 0 worm 0d8 (hence 0) for current and max HP.
That could confuse end-of-move monster cleanup, which thinks 0 HP is a
dead monster who has been removed from the map but not yet purged from the
fmon list.  Purging it would then leave a stale monster pointer on the map.

     cutworm() should have special cased level 0 to use 1d4 for HP, but
instead I've changed it to not produce a cloned worm if the source one is
lower than level 3.

16 years agooffshoot of #H1820 - priests/minions vs opposite alignment (trunk only)
nethack.rankin [Sun, 1 Mar 2009 03:49:54 +0000 (03:49 +0000)]
offshoot of #H1820 - priests/minions vs opposite alignment (trunk only)

     In #H1820, <email deleted> reported that helms
of opposite alignment didn't work for monsters.  There's never been
any attempt to implement that, and it wasn't omitted by accident, so
I wouldn't classify it as a bug.  But it does seem buggy that temple
priests and minions of <deity> would be willing to put such helms on
and risk changing allegiance to another deity.  This lets other types
of monsters still wear helms of opposite alignment as ordinary head
protection, but the explicity aligned creatures won't do so anymore.

16 years agowhip fixes bit (trunk only)
nethack.rankin [Mon, 23 Feb 2009 23:54:22 +0000 (23:54 +0000)]
whip fixes bit (trunk only)

     use_whip() prompts with getdir(), which doesn't prevent the player
from deliberately pointing off the edge of the map, so the bullwhip bug
was more general than yesterday's fixes entry.  Being confused or stunned
could trigger a problem but one could happen without them.

16 years agofix #H1816 - polearm/grapnel/whip fixes (trunk only)
nethack.rankin [Mon, 23 Feb 2009 01:20:32 +0000 (01:20 +0000)]
fix #H1816 - polearm/grapnel/whip fixes (trunk only)

     From a bug report, applying a polearm to make a
short-range ranged attack didn't scuff any engraving you were standing on,
unlike ordinary melee and throwing/shooting attacks.  Grappling hooks had
the same omission.  Fixing it led to several other minor bugs.  Attempting
to target an unseen monster's spot with polearm or grapnel would yield some
permutation of "wait, there's something there" but draw the 'I' glyph at
the wrong spot.  It used <u.ux+u.dx,u.uy+u.dy> instead of the actual target,
so put the 'I' one step in front of your most recent move (or throw or zap
or whatever last set u.dx and u.dy).  Giving ESC when prompted for target
spot failed to use up a turn even when the polearm or grappling hook had
just been auto-wielded for use.  Neither use_pole() nor use_grapple() set
`notonhead' for hmon() (called via thitmonst() in their cases; this was
academic since plain physical damage attacks don't actually care about it).
[The bad 'I' placement was a post-3.4.3 bug.]

     Applying a bullwhip to attack an adjacent monster didn't have any of
those issues but did have the possibility of targetting off the edge of
the map when standing at that edge while confused or stunned.

     Applying a polearm to target an 'I' would yield "nothing happens" if
the unseen monster wasn't there anymore, and it didn't bother to remove
that 'I' from the map.  After changing it to do so, the phrasing no longer
made any sense.  This led to a slightly bigger change than I intended:
since statues are now shown as gray monsters (does that work for tiles?)
instead of as chunks of stone, they are likely to be intentional targets
sometimes, so polearm attacks now handle them differently from other
non-monster locations.  [I hope that other attack forms don't need
similar handling.  Melee certainly doesn't, since walking onto the spot
is enough to distinguish statues from monsters.  Having the missile pass
right through a statue's location probably suffices for ranged attacks.]

16 years agomimics as doors on rogue level
nethack.rankin [Sun, 22 Feb 2009 01:37:09 +0000 (01:37 +0000)]
mimics as doors on rogue level

     From a bug report.5 years ago? and again today:
mimics appear on the rogue level even though they're lowercase letter
monsters.  <Someone> notes that during level generation, mimics pretending to
be closed doors are sometimes substituted for trapped actual doors.  That
should be avoided on the rogue level both because its doorways are always
empty (enforced after the fact in extralev.c code rather than in the door
making code) and because mimics aren't uppercase letter monsters (so
should only ever appear there if they've travelled from another level).

16 years agosmall mimic grabbing bug (trunk only)
nethack.rankin [Wed, 18 Feb 2009 01:13:24 +0000 (01:13 +0000)]
small mimic grabbing bug (trunk only)

     Noticed while testing the patch for monster ranged attacks when hero
is hidden.  Using #monster while in small mimic form would hide you, as
intended, but the first monster (or last monster?) who hit you hand-to-hand
would be grabbed ("It gets stuck on you.").  Unlike large and giant mimics,
small ones lack such a grab attack so when you eventually returned to
normal form, u.ustuck would remain set and you would end up being stuck
to an arbitrary monster instead of releasing it from your grasp.

16 years agofix #1812 - ranged targetting of hidden hero (trunk only)
nethack.rankin [Wed, 18 Feb 2009 00:50:20 +0000 (00:50 +0000)]
fix #1812 - ranged targetting of hidden hero (trunk only)

     From a bug report, a hero who had
eaten a mimic corpse and was stuck mimicking gold was hit by an approaching
dragon's breath attack.  Make monsters usually fail to notice that you're
lined up for their ranged attack when/if you're hidden from them.

16 years agodigging prompt: > vs < (trunk only)
nethack.rankin [Tue, 3 Feb 2009 03:03:16 +0000 (03:03 +0000)]
digging prompt: > vs < (trunk only)

     The intersection of a couple of recent patches:  noticed when
updating movement as a grid bug, and accentuated when fixing the attempt
to move down while levitating.  If you can't reach the floor due to
levitation, don't show '>' in the list of likely candidate directions for
the prompt when digging.  It was always included so that the list could
never be empty, but it's a poor suggestion to the player when levitating.
Use '<' instead in that situation; also a poor suggestion, but silly
rather than unintentional.  :-)

     This only affects the bracketted part of the "In what direction?"
prompt, not the actual digging (and player can pick any direction whether
it's shown in the prompt or not, so the digging code is already prepared
to handle attempts to dig up as well as down anyway).

16 years agoyet more monpolycontrol (trunk only)
nethack.rankin [Tue, 3 Feb 2009 01:45:05 +0000 (01:45 +0000)]
yet more monpolycontrol (trunk only)

     Factor out a few lines of common code instead of duplicating them.

16 years agomonpolycontrol typo (trunk only)
nethack.rankin [Tue, 3 Feb 2009 00:28:06 +0000 (00:28 +0000)]
monpolycontrol typo (trunk only)

16 years agoobject save/restore (trunk only)
nethack.rankin [Sun, 1 Feb 2009 02:16:47 +0000 (02:16 +0000)]
object save/restore (trunk only)

     Make the same simplification to save and restore of obj->oextra as
was done yesterday for monst->mextra:  no need for a set of all 0 sizes
when the whole thing is null.  Bumps EDITLEVEL again.

16 years agofix #H1803 - levitating at floor level...
nethack.rankin [Sun, 1 Feb 2009 00:56:50 +0000 (00:56 +0000)]
fix #H1803 - levitating at floor level...

     From a bug report, being stuck in the
floor or in lava and trying to move downwards while levitating gave "you
are floating high above the floor/lava" which contradicts being stuck.
Now you'll get "you are trapped in the floor/lava" in that situation.
I thought about letting it fall through to the chance to autodig with
wielded pick, but decided to go with just the alternate message.  (Being
tethered to a buried iron ball still lets you "float high above the floor",
so this doesn't check for being trapped that way.)

16 years agomimic statues & 2009 startup banner (trunk only)
nethack.rankin [Sat, 31 Jan 2009 08:03:41 +0000 (08:03 +0000)]
mimic statues & 2009 startup banner (trunk only)

     A mimic posing as a statue was displayed as a tengu statue (and
recognizeable as such now that statues are displayed as the corresponding
monster rather than rock-class back tick), but the lookat code described
it as a giant ant statue (since there was no obj->corpsenm available to
indicate the monster type, it defaulted to 0).  This adds monst->mextra
field `mcorpsenm' so that mimics have a place to remember what sort of
statue or corpse they are mimicking.  And it picks a random monster type
when they take such forms so that the old tengu hack becomes irrelevant.

     newmextra() and newoextra() initialized pointers via memset(...,0)
which is not portable; switch to explicit assignments.  The wizard mode
code to display memory used for monsters and objects added in amounts
for the miscellaneous things pointed to by monst->mextra and obj->oextra
structs but didn't include memory for those structs themselves; add it.
Simplify monster save/restore slightly; there's no need for extra zeroes
to represent monst->mextra->X sizes when monst->mextra is null.

     Update the startup banner for 2009.  I should have done this with a
separate patch but I'm taking a shortcut.  :-]

16 years agoprobing shapechangers and mimics (trunk only)
nethack.rankin [Fri, 30 Jan 2009 01:44:53 +0000 (01:44 +0000)]
probing shapechangers and mimics (trunk only)

     Mentioned in the newsgroup recently:  stethoscope didn't reveal
when a monster was actually a chameleon, even though that's the sort of
inside information you might expect.  This adds "shapechanger" to the
other miscellaneous attributes shown.  I initially had "(a chameleon)" or
"(a vampire lord)" but decided that that was too specific, particularly
for the latter where you might expect/hope that the vampire bat next to
you is just an ordinary vampire rather than a lord.

     I had a pet eat a mimic corpse and take on the shape of a pyramidal
amulet.  Probing described it as "mimicing a pyramidal".  Many of the
names and descriptions in objects[] are only partial, so aren't suitable
for supplying feedback like this (and "mimicking" was misspelled...).
Switch to simple_typename(), although in the case of undiscovered amulet
it yields just "an amulet" rather than "a pyramidal amulet".  This also
extends probing feedback for mimicry to include all monsters mimicking
something, not just those who are in the midst of eating.  [That's
post-3.4.3 code and is only applicable for wands of probing.  Using a
stethoscope or hitting with Magicbane will unhide a mimic before giving
extra info about it.]

16 years agogrid bugs vs diagonal movement (trunk only)
nethack.rankin [Thu, 29 Jan 2009 00:46:01 +0000 (00:46 +0000)]
grid bugs vs diagonal movement (trunk only)

     From a bug report, attempting to move
diagonally when poly'd into grid bug form doesn't give any useful
feedback in the general case, and in the specific case of using 'u' to
try to move northeast with vi-style keys, it performs #untrap instead.
Diagonal directions were being classified as non-movement when in grid
bug form, so the feedback was usually just "unknown command".  But 'u'
is bound to untrap as a a convenience to players who use num_pad-style
movement keys.  (Move commands don't actually reach the assigned key
part of command handling, so for forms other than grid bug, !num_pad 'u'
moves NE despite the untrap function given to that key.)

     Split the diagonal handling out from movement command recognition.
It now gives "you can't get there from here..." if player tries to move
diagonally as a grid bug.  For direction prompts, it now gives "you can't
orient yourself that direction" instead of popping up the command assist
display.  (In the prompt string showing likely candidate directions for
digging, diagonal handling for grid bugs is academic because they aren't
strong enough to wield pick-axes.)

16 years agomonpolycontrol tweak (trunk only)
nethack.rankin [Tue, 27 Jan 2009 02:07:31 +0000 (02:07 +0000)]
monpolycontrol tweak (trunk only)

I) When testing the shopkeeper polymorph fix a couple of days ago, I
tried to pick a form without a head (which is now rejected for shk) by
specifying "trapper" via #monpolycontrol.  It worked, in the sense that
the shopkeeper didn't take that form, but it also retried with "lurker
above".  After trapper was rejected, it matched "trapper or lurker above"
for monster class and picked at random from that class (and in this case,
the second try was rejected for being headless too).  The code I added
(a couple of years ago?) to prevent picking invalid forms for vampire
shapeshifting was a bit sloppy with its retry attempts.

II) I also noticed that monpolycontrol would let you pick forms that
newcham subsequently rejected, like placeholder monster "giant", so that
select_newcham_form got called again, resulting in a new prompt from
monpolycontrol to choose a form without seeing any explanation why the
first try was ignored.  Now you'll get the same "it can't become that"
feedback and immediate reprompt as for an invalid monster, instead of
returning newcham a form that it won't accept.

III) The change in shopkeeper polymorph was rejecting forms without hands.
That was way too restrictive; the notake() filter is sufficient.

     This is all modification of post-3.4.3 stuff, so no fixes entry.
[Not 100% true.  newcham() doesn't explicitly reject humans anymore,
relying on polyok() test instead.  Kops are the only humans who pass it.
If they're not supposed too, they need M2_NOPOLY in their definition.]

16 years agofix #H1798 - limbless shopkeepers shouldn't take possessions (trunk only)
nethack.rankin [Sat, 24 Jan 2009 22:59:53 +0000 (22:59 +0000)]
fix #H1798 - limbless shopkeepers shouldn't take possessions (trunk only)

     From a bug report, a shopkeeper who's been
polymorphed into a limbless creature shouldn't be able to come take your
possessions when you die since you can't pick up items when in that shape.
Rather than add new special case handling for shopkeepers, prevent them
from taking on shapes that render them unable to behave like shopkeepers
so that they can continue to catch thrown pick-axes and assorted other
things that would otherwise need a lot of extra checking introduced.
Ditto for temple priests, vault guards, and quest leaders.  Restriction
also applies to wizard mode use of #monpolycontrol, the only place where
players can actually notice this.

     It could--perhaps should--restrict them even further, forcing forms
that retain speech capability, but I didn't go that far.

16 years agoSunsword redux (trunk only)
nethack.rankin [Sat, 24 Jan 2009 01:44:29 +0000 (01:44 +0000)]
Sunsword redux (trunk only)

     This started out as a one line change.  After I saw someone in the
newsgroup mention that Sunsword's light was inferior to that of a lamp,
I decided to make it work better (than in 3.4.3, that is, becoming the
same brightness as a lamp) when blessed and worse when cursed (useless to
hero but still visible if wielded by a monster).  But then it needed to
change light radius when its curse/bless state changed, and it needed
message feedback when doing so, and that got kind of complicated.  I
wouldn't have bothered if I'd known what I was getting into, but I don't
want to throw it away now that I've done all this work....

     Sunsword now gives a light radius of 3 when blessed (same as a lit
lamp), radius of 2 when uncursed (same as a lit candle and as it has been
providing since added in 3.4.0), and a radius of 1 when cursed (nearly
but not completely useless, as mentioned above).  Also, it now "shines"
rather than "glows" since we usually use the latter for temporary effects.

16 years agoblessing/cursing via potion (trunk only)
nethack.rankin [Fri, 23 Jan 2009 00:05:14 +0000 (00:05 +0000)]
blessing/cursing via potion (trunk only)

     Allow potions thrown straight down while hero is mounted to target
steed instead of always hitting the floor.  There's already a fixes35.0
entry for potions hitting worn saddle instead of the creature wearing it,
but that only happened when thrown at a nearby saddled monster, not when
the hero was stuck mounted on a steed with cursed saddle.

     Eight separate "the <obj> glows <color>" messages were too many...
(four for dipping an item in holy/unholy water, four more for throwing
either of those potions at a saddled monster).  Replace the repetitive
code, leaving just two such messages.  Setting of bknown flag for the
dipped object is the only intentional change here.  That used to be done
unconditionally but now requires that the hero see the glow color.

16 years agofatal explosion feedback (trunk only)
nethack.rankin [Mon, 5 Jan 2009 00:35:39 +0000 (00:35 +0000)]
fatal explosion feedback (trunk only)

From the newsgroup:
    As you read the scroll, it disappears.
    The scroll erupts in a tower of flame!
    Your spellbook of force bolt catches fire and burns!
    [...]
    Your potion of paralysis boils and explodes!
    Something seems to be holding you.
    Do you want your possessions idenified?
This character survived the burning and boiling objects then succumbed
to the initial flame explosion.

     A fatal explosion calls done() without any explanation.  Or rather,
it dated to the time where it would immediately follow "the scroll erupts
in flame" (or "you are caught in <some kind of> explosion") without the
chance for intervening messages.  Then when item destruction was moved
sooner (for bones file purposes), message sequencing was left dangling.
This patch adds a new "it was fatal" message in front of done().

16 years agoFix a few build issues seen by various compilers
nethack.allison [Tue, 30 Dec 2008 22:02:31 +0000 (22:02 +0000)]
Fix a few build issues seen by various compilers
 that I have on my system but haven't used for a while
(a couple of warnings and a couple of errors)

16 years agoexerchk fix (trunk only)
nethack.rankin [Tue, 30 Dec 2008 21:45:41 +0000 (21:45 +0000)]
exerchk fix (trunk only)

     Post-3.4.3 problem noticed by Michael:  some code which was supposed
to be inside the end of a loop got placed in front of the wrong closing
brace, ending up beyond that loop.  As a result, decay of old attribute
exercise wasn't working as intended, and out of bounds array modification
was occurring (clobbering u.abon.a[0], which probably messed up resetting
strength when taking off rings of gain strength which were worn during an
exercise check).

16 years agolifesaved steed (trunk only)
nethack.rankin [Mon, 24 Nov 2008 23:35:33 +0000 (23:35 +0000)]
lifesaved steed (trunk only)

     From the newsgroup:  hero's steed can become untame if killed while
it is wearing an amulet of life saving, leaving the hero still mounted
and resulting in repeated "placing steed onto map?" warnings when the
steed tries to move.  Force the hero to be thrown off the mount in that
situation.

16 years agofix #H1755 - feedback for clerical summoning when blind (trunk only)
nethack.rankin [Sat, 15 Nov 2008 20:38:02 +0000 (20:38 +0000)]
fix #H1755 - feedback for clerical summoning when blind (trunk only)

     From a bug report, the feedback
you get when a monster summons insects or snakes is the same when blind
as when you can see.  A comment in the code stated as much, but fixing
it is relatively straightforward.  (Or not; there are actually a lot of
cases to be handled; this covers enough of them, I hope.)

16 years agofix #H1733 - fainting doesn't behave like falling (trunk only)
nethack.rankin [Fri, 14 Nov 2008 00:38:28 +0000 (00:38 +0000)]
fix #H1733 - fainting doesn't behave like falling (trunk only)

     Suggested by <Someone> <email deleted>, fainting from lack
of food while wielding a cockatrice corpse should fall on that corpse
and be fatal, like triggering a pit or moving down stairs while too
heavily encumbered.  I put the fixes entry in the new features section
even though it probably qualifies as a bug.

16 years agofix #H1745 - enlightenment about number of times killed
nethack.rankin [Fri, 14 Nov 2008 00:08:32 +0000 (00:08 +0000)]
fix #H1745 - enlightenment about number of times killed

     From a bug report, code that always
produced plural feedback (used only for values of N greater than 3) was
unnecessarily handling plural vs singular.  No change in game behavior;
just one less function call in the code.

16 years agofix #H1749 - kick that misses didn't reveal concealed mimic
nethack.rankin [Thu, 13 Nov 2008 23:24:00 +0000 (23:24 +0000)]
fix #H1749 - kick that misses didn't reveal concealed mimic

     From a bug report, getting "your
clumsy kick does no damage" when attempting to kick the location of a
concealed mimic or hidden monster didn't bring the target out of hiding.

16 years ago[part of] #H1743 - sleeping victim of theft (trunk only)
nethack.rankin [Sun, 2 Nov 2008 23:12:21 +0000 (23:12 +0000)]
[part of] #H1743 - sleeping victim of theft (trunk only)

     Mentioned by <email deleted> in his report about
sound anomalies, it was possible for a sleeping hero to "gladly start
removing armor" when attacked by a nymph or succubus.  The code
explicitly wakes up the hero if he has fainted from lack of food because
"can't charm without waking you" (according to the existing comment),
but it didn't handle other forms of sleep and paralysis.  You could get
 |You fall asleep.
 |The wood nymph charms you.  You gladly start removing your armor.
 |The combat awakens you.
Now in the same situation you'll get
 |You fall asleep.
 |You wake up.
 |The wood nymph charms you.  You gladly start removing your armor.

16 years agohand slip when naming objects (trunk only)
nethack.rankin [Sun, 2 Nov 2008 22:26:56 +0000 (22:26 +0000)]
hand slip when naming objects (trunk only)

     From a bug report, the text change applied
when you try to give an artifact's name to am item of that artifact's type
would choose a letter from 'a' through 'y' when replacing the randomly
selected target letter.  Rather than fixing the off by one bug which
prevented 'z' from being chosen, this switches to the existing routine
used for mangling engravings.  (Unfortunately the fix is not as simple as
first expected, because wipeout_text() doesn't guarantee to change text
which has spaces in it and all the quest artifact names have those.)

16 years agomonsters eating green slime corpses (trunk only)
nethack.rankin [Sat, 25 Oct 2008 01:04:04 +0000 (01:04 +0000)]
monsters eating green slime corpses (trunk only)

     From a bug report, pets able to eat
acidic and poisonous corpses (black naga was the case cited) would eat
green slime corpses without turning into green slime, unlike the hero.
This prevents such monsters from eating green slime unless they're
starving, implements transformation into green slime for the case where
it does get eaten, and prevents non-pet gelatinous cubes from devouring
such corpses.  meatobj() is reorganized to hopefully become clearer, and
it removes the assumption that the object eater is a g.cube in case we
ever adopt slash'em's "tasmanian devil" monster.

     Monsters with digestion attacks who swallow green slime monsters
are turned into green slime, but ones who swallow hero poly'd into green
slime are not.  This doesn't address that.

16 years ago'[' vs embedded dragon scales (trunk only)
nethack.rankin [Mon, 20 Oct 2008 05:18:31 +0000 (05:18 +0000)]
'[' vs embedded dragon scales (trunk only)

     When dragon scales or dragon scale mail becomes embedded in poly'd
hero's skin, the '[' command would report "you are not wearing any armor"
but the '*' command showed "a set of <color> dragon scales (embedded in
your skin)".  The '[' feedback is more accurate but the '*' feedback is
probably more useful.  This changes '[' to be more specific when lack of
worn armor is accompanied by embedded dragon scales/scale mail.

     I put the fixes entry in the new features section since the old
behavior wasn't a bug.

16 years agomore breaking wands (trunk only)
nethack.rankin [Mon, 20 Oct 2008 04:07:40 +0000 (04:07 +0000)]
more breaking wands (trunk only)

     If breaking a wand of polymorph uses up any floor objects, give a
"you feel shuddering vibrations" message like happens when zapping.

16 years agobreaking wands (trunk only)
nethack.rankin [Mon, 20 Oct 2008 00:57:16 +0000 (00:57 +0000)]
breaking wands (trunk only)

     From a bug report, polymorph of self due to
breaking a wand also polymorphed various items that were dropped in the
process, unlike the case of zapping polymorph at monsters which excludes
dropped items from being poly'd.  This polymorphs the pile at the hero's
feet before polymorphing the hero.  I first tried to handle it using
obj->bypass like with monsters, but that didn't work.  Post-3.4.3, the
bypass handling is also used for polyself (by retouch_equipment()) and
it was getting reset at an inconvenient time.

     He also complained that he failed to get "you feel shuddering
vibrations" when some polymorphed objects got destroyed.  That message
is issued by weffects() which do_break_wand() doesn't call.  It ought to
be fixed, but this patch doesn't address it.

     Lastly, add code to prevent objects guarded against polymorph via
obj->bypass from getting used up when creating polypile golems.

16 years agocomment tidbit (trunk only)
nethack.rankin [Sun, 19 Oct 2008 22:54:01 +0000 (22:54 +0000)]
comment tidbit (trunk only)

     Noticed when fixing branch code.

16 years agomisplaced C variable declaration in current code
nethack.allison [Sat, 18 Oct 2008 12:40:06 +0000 (12:40 +0000)]
misplaced C variable declaration in current code

options.c
..\src\options.c(4072) : error C2275: 'boolean' :
illegal use of this type as an expression
        c:\personal\nhdev\350\test\include\global.h(56) :
see declaration of 'boolean'
..\src\options.c(4072) : error C2146: syntax error :
missing ';' before identifier 'found'
..\src\options.c(4072) : error C2065: 'found' : undeclared identifier
..\src\options.c(4072) : error C2065: 'numeric' : undeclared identifier
..\src\options.c(4077) : error C2065: 'found' : undeclared identifier
..\src\options.c(4088) : error C2065: 'numeric' : undeclared identifier
..\src\options.c(4090) : error C2065: 'found' : undeclared identifier
..\src\options.c(4090) : error C2065: 'numeric' : undeclared identifier

16 years agofix #1727 - offering Rider corpses (trunk only)
nethack.rankin [Thu, 9 Oct 2008 23:55:43 +0000 (23:55 +0000)]
fix #1727 - offering Rider corpses (trunk only)

     The report that killing a Rider on an altar allowed you to sacrifice
its corpse was a wizard mode-only phenomenon in 3.4.3 (because you needed
to use an altar at some location other than the Astral Plane, hence also
needed to use ^G to get the Rider there), so not really a bug.  But a
post-3.4.3 change has made it possible to offer corpses from the floor on
the astral level, unintentionally making it possible to sacrifice Rider
corpses.  This makdes #offer check specifically for them and trigger their
revival if the attempt is made, same as done by pickup.

16 years agoloose objects at game end
nethack.rankin [Thu, 4 Sep 2008 20:47:04 +0000 (20:47 +0000)]
loose objects at game end

     Some post-3.4.3 code to clean up thrown or kicked objects which were
in transit at the end of a game didn't work correctly for kicked objects,
leading to an "obj not free" panic if you kicked an object at some point
and didn't kick anything else before the game was over.  Unlike thrownobj,
kickobj wasn't being cleared after use.

16 years agomonsters putting on shirts
nethack.rankin [Thu, 4 Sep 2008 20:21:06 +0000 (20:21 +0000)]
monsters putting on shirts

     From the newsgroup:  code intended to prevent a monster who's wearing
a suit from putting on a shirt didn't work due to faulty logic.

16 years agoDr.Who graphiti (trunk only)
nethack.rankin [Thu, 28 Aug 2008 22:48:58 +0000 (22:48 +0000)]
Dr.Who graphiti (trunk only)

     Add an entry to the set of randomly placed engravings.  The revival
of Doctor Who, which seems to be referred to as Series 1 through Series 4
ignoring umpteen years of earlier versions, showed graphiti of "BAD WOLF"
intermittently throughout season two and brought it back for the finale
of season four.  As far as I noticed, it was always written in all caps.

16 years agomakesingular vs compound phrases (trunk only)
nethack.rankin [Sun, 24 Aug 2008 22:39:22 +0000 (22:39 +0000)]
makesingular vs compound phrases (trunk only)

     When testing singularizing of fruit names I noticed that "bunches of
grapes" became "bunche of grapes".  makesingular() had a comment about
not recognizing "es" and suggesting that recursion could solve it.  But
makeplural() already handled things like that without resorting to
recursion, and it also recognized more compounds than just "foo of bar"
and "*man-at-arms" (such as "pie a la mode" and "soup du jour").  This
moves the compound phrase recognition into a separate routine so that
both makesingular() and makeplural() will handle the same stuff, and it
modifies makesingular() to do as well as makeplural() when processing the
front half of compound phrases (the "foo" part in "foo of bar").

     Also, a minor plurization tweak:  algae was recognized as already
plural but larvae and several similar words weren't.

16 years agoforce fruit name to be singular (trunk only)
nethack.rankin [Sat, 23 Aug 2008 01:17:41 +0000 (01:17 +0000)]
force fruit name to be singular (trunk only)

     Inventory formatting for a single slime mold object would be strange
if the user entered a plural word or phrase for fruit name.  Forcing the
user-specified value to be singular as it's being set up as current fruit
avoids that.  [Something like <Someone>'s "bunch of grapes" is unaffected;
it's already singular and correctly handled as such by makesingular().]
This may have a side-effect of limiting the creativity of some players
who try to trick others via bones files gimickery, but I think the extra
consistency in object naming during ordinary play is worth it.

     According to the cvs log info, this issue was actually mentioned in
a patch I made ("fix M203...") in October, 2005.  I have no recollection
of that at all....

16 years agomore fruitadd() (trunk only)
nethack.rankin [Tue, 22 Jul 2008 21:11:39 +0000 (21:11 +0000)]
more fruitadd() (trunk only)

     Each time save and restore is performed, the ffruit list gets
reversed.  Since additions can be made when it is in backwards order or
in original order depending upon whether an odd or even number of save/
restore cycles have taken place, the numeric sequence of its entries is
ultimately arbitrary.  So there's no point using extra code to force new
ones to be added at the end of the list; just put them at the beginning.

16 years agocurrent_fruit (trunk only)
nethack.rankin [Mon, 21 Jul 2008 00:03:41 +0000 (00:03 +0000)]
current_fruit (trunk only)

     I almost abandoned this when Michael beat me to it, but besides
handling the fruit rename bug it also moves `current_fruit' into the
context structure to eliminate separate save/restore for that.

16 years agochange of fruit name
nethack.allison [Sat, 19 Jul 2008 22:56:37 +0000 (22:56 +0000)]
change of fruit name

From a bug report:
The following steps do not yield the expected fruit:
  1) start nethack in explore mode (with a wand of wishing)
  2) change fruit name to "tomato"
  3) save/restore
  4) change fruit name back to "slime mold"
  5) save/restore
  6) wish for a fruit; you get a tomato
  7) check options; fruit name is set to "slime mold"

If you specified a fruit name that already existed in the list,
fruitadd() always set current_fruit to the fruit with
the highest fid encountered in the list to that point, instead
of the fid of the matching entry.

16 years agosome updates to make nethack.6 less dated.
keni [Thu, 10 Jul 2008 11:08:59 +0000 (11:08 +0000)]
some updates to make nethack.6 less dated.

16 years agofirst divine gift artifact (trunk only)
nethack.rankin [Mon, 7 Jul 2008 03:01:30 +0000 (03:01 +0000)]
first divine gift artifact (trunk only)

     From the newsgroup:  if no co-aligned artifacts are available when
attempting to give the first divine gift for an offered corpse, nothing
would be given.  Since the gift counter stayed at 0, subsequent attempts
to select one would still treat it as first gift and always fail again.

     The first divine gift from offering corpses must match the hero's
alignment; after that, nonaligned artifacts (Frost Brand, Giant Slayer, &c)
are added to the pool of choices for further divine gifts.  It's pretty
easy for a chaotic character to use up the co-aligned artifacts before
getting any divine gift.  There aren't many chaotic ones and some are
inelgible due to being race-specific items.  Wishing for Stormbringer--or
loading a bones file which contains it--and creating Sting and Orcrist
via naming will do the trick for an elven hero.

     This patch expands the pool of candidates to include nonaligned
artifacts during first gift selection if no co-aligned ones are available.

16 years agofirst conditionalized docs (TRUNK ONLY)
keni [Thu, 26 Jun 2008 15:08:54 +0000 (15:08 +0000)]
first conditionalized docs (TRUNK ONLY)
plus various related missing bits and tids

16 years agoregenerate mdgrep.h (TRUNK ONLY)
keni [Wed, 25 Jun 2008 19:04:38 +0000 (19:04 +0000)]
regenerate mdgrep.h (TRUNK ONLY)
now that this should have the right version numbers in it, save the new file

16 years agomdgrep.pl tids (TRUNK ONLY)
keni [Wed, 25 Jun 2008 19:02:38 +0000 (19:02 +0000)]
mdgrep.pl tids (TRUNK ONLY)
aka "try again before the wireless drains my laptop battery"

16 years agomakedefs --grep prep, misc cleanup (TRUNK ONLY)
keni [Wed, 25 Jun 2008 18:56:47 +0000 (18:56 +0000)]
makedefs --grep prep, misc cleanup (TRUNK ONLY)
use makedefs --grep in Makefile.doc
call make clean in doc from make clean in top
add commented out rule to produce mdgrep.h from mdgrep.pl
macosx1.5: don't chown/chgrp for single-user install
unixmain.c: work around C90 warning for Mac-specific code, fix last fix
makedefs.c: temporarily disallow blank after control introducer until docs
 catch up
mdgrep.pl: add ALLDOCS, clean up generated file's header

16 years agofollowup (trunk only)
keni [Sun, 15 Jun 2008 00:23:56 +0000 (00:23 +0000)]
followup (trunk only)
Finally found a flag combination that will complain about declarations mixed in
with other code: -ansi -pedantic.
Clean up the violations of that I just introduced and add that flag to the
Mac 10.5 hints file.  (Note that there is one warning left in unixmain.c -
it's in Mac-specific code.)

16 years agoSHELLERS for SYSCF, MacOS 10.5 hints file (trunk only)
keni [Sat, 14 Jun 2008 20:57:21 +0000 (20:57 +0000)]
SHELLERS for SYSCF, MacOS 10.5 hints file (trunk only)
Add SHELLERS - people allowed to use ! command with same syntax as WIZARDS.
Add new hints file for 10.5, since the rules and commands for groups changed
(new commands introduced in 10.4, old ones removed in 10.5; creating a new
user under 10.4 gave you a matching group, in 10.5 it doesn't).  Also move
shared build into roughly right place in file system when being installed
for root - don't use ~root.
Makefile.top - don't remove ./-p unless it exists (that's always annoyed me).
fix error invoking macosx.sh

16 years agorestful sleep bit (trunk only)
nethack.rankin [Tue, 27 May 2008 04:49:43 +0000 (04:49 +0000)]
restful sleep bit (trunk only)

     A change yesterday made putting on an amulet of restful sleep avoid
clobbering the timeout from having already eaten one, only replace it if
the new timeout is shorter.  This does the inverse; when eating one, if
you're already sleepy from also wearing that type of amulet, only replace
the timeout if new one is shorter.  And don't clobber the other intrinsic
bits with FROMOUTSIDE, just add it to whatever ones might already be set.
Neither should have any observable effect on game play, so no fixes entry.

16 years agofix #H1662 - temporary vs permanent sleepiness (trunk only)
nethack.rankin [Mon, 26 May 2008 05:46:21 +0000 (05:46 +0000)]
fix #H1662 - temporary vs permanent sleepiness (trunk only)

     From a bug report, wearing
(or removing) an amulet of restful sleep was overriding permanent
sleepiness which had been obtained previously via eating another amulet.
The setting of timeout clobbered the non-timeout bits for that intrinsic.

     This also adds the timeout counter for sleepiness to enlightenment
feedback in wizard mode.  Unrelated:  rephrase enlightenment feedback for
adornment to more accurately describe what that does.

16 years agomakedefs build on non-C99 compilers follow up
nethack.allison [Wed, 21 May 2008 02:15:09 +0000 (02:15 +0000)]
makedefs build on non-C99 compilers follow up

Pat Rankin wrote:
>      That patch looks incorrect.  `CONSUME' increments argv,
> so now a different value is being passed to the function when
> initializing that variable than was passed before.

16 years agomakedefs build on non-C99 compilers
nethack.allison [Tue, 13 May 2008 11:38:46 +0000 (11:38 +0000)]
makedefs build on non-C99 compilers

..\util\makedefs.c(426) : error C2143: syntax error : missing ';' before 'type'
..\util\makedefs.c(427) : error C2065: 'p' : undeclared identifier
..\util\makedefs.c(428) : error C2065: 'p' : undeclared identifier

16 years agoinitial sling skill
nethack.rankin [Thu, 8 May 2008 03:50:44 +0000 (03:50 +0000)]
initial sling skill

     From a bug report, archeologists were
inadvertently starting out at basic skill level in sling because of their
carried touchstone, which is flagged as being sling ammo.

16 years agolex sync (trunk only)
nethack.rankin [Thu, 8 May 2008 02:18:55 +0000 (02:18 +0000)]
lex sync (trunk only)

     Propagate recent util/*_comp.l changes to sys/share/*_lex.c.

16 years agomdgrep.pl tid
keni [Wed, 23 Apr 2008 10:48:04 +0000 (10:48 +0000)]
mdgrep.pl tid
Use the right name for the output file in all places.
Thanks Pat.

16 years agomore warning cleanup, makedefs grep bits (trunk only)
keni [Tue, 22 Apr 2008 23:20:44 +0000 (23:20 +0000)]
more warning cleanup, makedefs grep bits (trunk only)
drop -Wcast-qual
warning cleanup (lev_comp)
comment bits
makedefs grep cleanup: drop magic constant, add --grep-define, --grep-undef,
 #ifdef out code not needed yet, update mdgrep.h, mdgrep.pl

16 years agomore warning cleanup (trunk only)
keni [Fri, 18 Apr 2008 17:37:33 +0000 (17:37 +0000)]
more warning cleanup (trunk only)
More warning bits that never got committed.
More appropriate compiler flags for warning checks (macosx only for the moment).
The changes in dgn*[lc] just rename line_number to nh_line_number to avoid a
clash, so no need to regenerate the lex output.

16 years agomacosx hints file consolidation (trunk only)
keni [Tue, 8 Apr 2008 23:17:39 +0000 (23:17 +0000)]
macosx hints file consolidation (trunk only)
get macosx down to one hints file (default tty, single user) for
 tty, x11, qt and single or multiple users
preliminary bits that might allow a macosx qt build

16 years agoadd MAXPLAYERS to SYSCF (trunk only)
keni [Mon, 7 Apr 2008 22:27:18 +0000 (22:27 +0000)]
add MAXPLAYERS to SYSCF (trunk only)
Add MAXPLAYERS to SYSCF config file; deprecate (but continue to support)
 MAX_NR_OF_PLAYERS in nethack.sh since it is trivially overridden in many
 (all?) cases and isn't useful for ports that don't use nethack.sh.

16 years agomakefile bit for makedefs grep (trunk only)
keni [Sun, 6 Apr 2008 00:58:13 +0000 (00:58 +0000)]
makefile bit for makedefs grep (trunk only)
add dependency for mdgrep.h

16 years agomakedefs conditional grep (trunk only)
keni [Sun, 6 Apr 2008 00:48:40 +0000 (00:48 +0000)]
makedefs conditional grep (trunk only)
This code (except for some of the argument parsing changes) is not used yet.
mdgrep.pl generates mdgrep.h; like the lex and yacc files we ship mdgrep.h
 pre-generated; there is no need for perl on end-user/end-compiler systems.
 (In fact mdgrep.h is so simple mdgrep.pl is probably overkill.)
mdgrep.h creates an array reflecting the compiler options in effect
The changes to makedefs break the Mac OS9 compile; if necessary the fix is
 simple and documented (but I think that port is permanently dead).
With that port out of the way, makedefs can be allowed to take real options;
 none of the current options have been changed.  Instead, a second sub-main
 routine has been added to handle options starting with two hyphens and all
 the new options start with two hyphens:
--input specifies the input file (- is stdin)
--output specifies the output file (- is stdout)
--grep causes the input file to be filtered into the output file
--grep-showvars dumps the info from the array in mdgrep.h
--grep-trace turns on tracing of the grep filtering
Docs for the filtering language are in the source.

16 years agotweak probing while swallowed (trunk only)
nethack.rankin [Sat, 22 Mar 2008 17:32:10 +0000 (17:32 +0000)]
tweak probing while swallowed (trunk only)

     Follow up to the patch that adds a fake inventory entry for the
swallowed hero when probing an engulfer.  Make the header for the hero
be plural to match those of object classes, and prefix the hero entry
itself with a/an to reflect its count of 1.
| Swallowed Creature              ->  Swallowed Creatures
| > - elven ranger called wizard  ->  > - an elven ranger called wizard

16 years agoprobing while swallowed (trunk only)
nethack.rankin [Fri, 21 Mar 2008 03:12:14 +0000 (03:12 +0000)]
probing while swallowed (trunk only)

     Reported recently by <Someone>:  probing feedback while engulfed
shouldn't claim that the monster is not carrying anything when the hero
is inside of it.  The simple case where it's not carrying anything else
was a trivial one line change; handling inventory plus hero was trickier
and I wouldn't have bothered if I'd realized what it was going to take.
But it's done now; trivial case
        The purple worm is not carrying anything besides you.
and harder case
        The purple worm's possessions:
        Weapons
        a - an uncursed dagger
        Swallowed Creature
        > - human archeologist called wizard

16 years agopost-3.4.3 obj not free panic
nethack.rankin [Fri, 21 Mar 2008 03:09:37 +0000 (03:09 +0000)]
post-3.4.3 obj not free panic

     Throwing an object while engulfed and then quitting triggers a panic
when the end-of-game code tries to clean up the thrown object.  Throwing
code wasn't reflecting the fact that adding the missile to the engulfer's
inventory already handles the thrown object.  3.4.3 wasn't affected; it
didn't bother trying to clean up `thrownobj' in done().

16 years agobuild error message tid
keni [Tue, 18 Mar 2008 23:11:28 +0000 (23:11 +0000)]
build error message tid
Don't call impossible() if there are no window types  - we just core after
being told to #quit when it's too early to do so.

16 years agoaborting key/pick usage (trunk only)
nethack.rankin [Sat, 8 Mar 2008 03:45:26 +0000 (03:45 +0000)]
aborting key/pick usage (trunk only)

     From the newsgroup:  applying a key and then using ESC at direction
choosing prompt was using up a move even though hero didn't do anything.

16 years agowand engraving bit (trunk only)
nethack.rankin [Fri, 7 Mar 2008 03:01:51 +0000 (03:01 +0000)]
wand engraving bit (trunk only)

     Readability tweak; use `WAND_BACKFIRE_CHANCE'.  This code for giving
cursed wand a chance to explode when engraving is in the branch too, but
the macro wasn't added there.

17 years agodisplay/map glitch in C quest temple
nethack.rankin [Sat, 1 Mar 2008 08:10:53 +0000 (08:10 +0000)]
display/map glitch in C quest temple

     From a bug report:  in the irregularly
shaped temple on the C quest home level (the room where the leader is
located), the lit south wall contained a dark spot where a secret door
is located.  It stayed blank until you got right next to it rather than
just until you got to a good angle facing it.  (Magic mapping hides the
problem by showing that spot as a wall instead of leaving it as unseen;
you have to walk or teleport to that room in order to see the problem.)
The code that lights walls and doors which border lit rooms neglected
temporary walls produced by secret doors.

17 years agovitamin deficiency (trunk only)
nethack.rankin [Fri, 22 Feb 2008 01:44:57 +0000 (01:44 +0000)]
vitamin deficiency (trunk only)

     Implement something <Someone> suggested a long time ago:  eating a
disenchanter corpse has a chance to remove an intrinsic.  Uses the same
routine as nighttime gremlin attacks, which chooses an intrinsic randomly
and attempts to remove it, so has no effect if it chooses one the hero
lacks.  This can be used to remove "aggravate monster" but is much more
likely to target something the player wants to keep.  [By the way, a lot
of potential candidates are missing:  sleep, shock, and disintegration
resistance and teleport control come immediately to mind.]

     Also, it has been bugging me that you can get both strength and
fire/cold/shock resistance from the same fire/frost/storm giant corpse.
The code prevents mind flayer corpses from conferring both intelligence
and telepathy, so strength handling was inconsistent (even though it
predated mind flayers...).  This causes strength boosting to be treated
as an extra candidate when selecting an intrinsic to confer, so you'll
either get strength or resistance (which might be a no-op) but not both
from those giants.  And it special cases the other giants to have the
same 50% chance for boosting strength, even though the alternative in
their case is to do nothing instead of trying to confer something else.
Lastly, it now gives a message when you succeed in gaining strength.

17 years agofix #M57 - alchemical potion explosion fails to wake monsters
nethack.rankin [Thu, 21 Feb 2008 06:18:08 +0000 (06:18 +0000)]
fix #M57 - alchemical potion explosion fails to wake monsters

     From a bug report,
the message when dipping one stack of potions into another triggers an
explosion says "BOOM" yet nearby sleeping monsters remained undisturbed.

17 years agoeel hiding behavior (trunk only)
nethack.rankin [Thu, 21 Feb 2008 05:52:08 +0000 (05:52 +0000)]
eel hiding behavior (trunk only)

     From a bug report:  an exposed eel in an isolated
pool--swamp rooms sometimes produce those--would never re-hide no matter
how long you left its vicinity.  Re-hiding is part of post-move handling
and an eel with no adjacent water to move into would never reach that bit
of code since it didn't move anywhere.  The code used to re-hide monsters
when you return to a previous level was ignoring eels altogether.  Give
unhidden eels a chance to hide earlier during monster movement and also
when the hero returns to their level.

     Also a really minor bit to slow down hit point loss of eels out of
water.  I don't think anybody reverse genocides krakens to get experience
any more since they don't provide a big bonus when they're out of water,
so this change won't have much of an affect.

17 years agoshow source of bits of makefiles (trunk only)
keni [Thu, 21 Feb 2008 01:16:41 +0000 (01:16 +0000)]
show source of bits of makefiles (trunk only)
Mark the generated makefiles as generated and mark the source of each section
to aid debugging.

17 years agomore lint (trunk only)
nethack.rankin [Wed, 20 Feb 2008 01:26:13 +0000 (01:26 +0000)]
more lint (trunk only)

     The one `anything any' that was triggering a warning was shadowing
another `anything any' in the same function; no need to rename it, just
remove the unnecessary declaration.  Also, mark the couple of arrays with
initializers that I'd noticed as static instead of letting them default
to auto.  The abil_to_spfx()::abil2spfx[] one might need to be redone in
code as a switch if some compilers/linkers have trouble initializing it.

17 years agoWindow type not recognized tid (trunk only)
keni [Wed, 20 Feb 2008 00:30:15 +0000 (00:30 +0000)]
Window type not recognized tid (trunk only)
Fix the grammar error that results when a binary with one window system
compiled in is explicitly told to use another.

17 years agowarnings cleanup (trunk only)
keni [Wed, 20 Feb 2008 00:27:56 +0000 (00:27 +0000)]
warnings cleanup (trunk only)
This covers the warning cleanup bits no one objected to.

17 years agoPlaceholder for Amiga large disks (untested)
keni [Sun, 17 Feb 2008 23:49:47 +0000 (23:49 +0000)]
Placeholder for Amiga large disks (untested)
placeholder so we don't lose large disk fix, but I can't test it

17 years agoidentify_pack (trunk only)
nethack.rankin [Sat, 16 Feb 2008 02:31:34 +0000 (02:31 +0000)]
identify_pack (trunk only)

     Three years ago <email deleted> reported that
stepping off the end of inventory via typing space to go to the next menu
page wasted his identify scroll.  He suggested that some people might do
that because they don't know how to back up in a multi-page menu.  I
pointed out the Guidebook section that describes < and ^ to go back one
page or back to start and left things at that.  However, traditional mode
reprompts if you step through all of inventory without choosing something,
so this changes identify-via-menu to do likewise.  You can dismiss the
menu with ESC to really avoid choosing anything.

     This also makes identification of N items when you're carrying N or
fewer unID'd things behave the same as identify all:  identify everything
without any prompting.

17 years agomore ^X (trunk only)
nethack.rankin [Wed, 13 Feb 2008 00:12:42 +0000 (00:12 +0000)]
more ^X (trunk only)

     The characteristics display checked for cursed rings of sustain
ability but neglected to check for uncursed ones locked in place by
cursed gloves or weapon.  And the half-hearted attempt to check for
future items conferring Fixed_abil couldn't handle an uncursed thing
covered by something cursed either, so just get rid of it.

17 years ago^X refinement (trunk only)
nethack.rankin [Tue, 12 Feb 2008 01:32:15 +0000 (01:32 +0000)]
^X refinement (trunk only)

     Use sentences for the characteristics (instead of "Strength = 15") to
match the rest of the enlightenment display.  When showing ATTRMAX, phrase
as "limit" rather than "maximum" since magical ajdustments can exceed max.
And be more selective about which alternate attribute numbers to show:
 Your strength is 14 (current; base:13).  => +1 ring of gain strength
 Your strength is 13 (current; peak:14).  => lost a point to poison or abuse
 Your strength is 14 (current; base:13, peak:14).  => combo of both of those
 Your strength is 14 (current; limit=18/50).  => you're a gnome
instead of always showing all of base & peak & limit when any of the three
are interesting.  During play, a limit which is different from normal human
(18 or 18/100) is considered to be interesting; for end of game disclosure,
it's interesting iff the final value hasn't reached maximum, regardless of
what that max is.

17 years agoimitation spelling (trunk only)
nethack.rankin [Mon, 11 Feb 2008 00:23:06 +0000 (00:23 +0000)]
imitation spelling (trunk only)

     I'm not a contender to win any spelling bees.  (Mimicker does't
seem to even be a real word; I'm not sure if it ought to end in "or"
instead of "er".  But changing it to "mime" would be too weird.)

17 years agodone_in_by shapechanger (trunk only)
nethack.rankin [Sun, 10 Feb 2008 02:54:53 +0000 (02:54 +0000)]
done_in_by shapechanger (trunk only)

     Augment killer reason when slain by a shapechanged creature:
"killed by a foo" becomes "killed by a chameleon immitating a foo" or
"killed by a vampire in foo form" or "killed by the Wizard of Yendor
disguised as a foo" (after double-trouble, when the clone starts out
mimicking something).

     I put the fixes entry in the new features section.

17 years ago#monpolycontrol of unseen monsters and of vampires (trunk only)
nethack.rankin [Fri, 8 Feb 2008 03:19:09 +0000 (03:19 +0000)]
#monpolycontrol of unseen monsters and of vampires (trunk only)

     I was testing something with #monpolycontrol enabled and got a
series of "Change it into what kind of monster? [type the name]" prompts
when I went to a new level.  It was asking about monsters that were being
created (in this case, multiple vampires for top level of Vlad's Tower)
and naturally I couldn't see them since the level wasn't finished yet.
This switches to noit_mon_nam() to at least be informed about the type
of creature you're being asked to specify a shape for, and adds the map
coordinates so that it doesn't appear to be reprompting for the same
monster over and over when multiple similar ones are being created.

     In the process I discovered that #monpolycontrol would let you give
any type of monster for the shape of vampires.  Unlike chameleons, they
don't change into arbitrary shapes so that was inappropriate.  [And
trying to test the fix for this is what led to the previous ^G patch.]

17 years agowizard mode ^G of shapechangers (trunk only)
nethack.rankin [Fri, 8 Feb 2008 02:21:21 +0000 (02:21 +0000)]
wizard mode ^G of shapechangers (trunk only)

     A while back there was a change in how the initial shape for a
shapechanging monster gets chosen during monster creation, and a side-
effect of that lets/makes you choose the shape when #monpolycontrol is
enabled.  But ^G was overriding your choice by forcing the shapechanger
to start out looking like the type of monster that you specified (to ^G,
not to subsequent #monpolycontrol prompting), hence always in its natural
shape.  The intent for ^G was that if asked for a unique monster but got
a doppelganger instead, it would initially look like the requested unique
monster.  Post-3.4.3 code, so no fixes entry needed.

17 years agoexercise/abuse while polyd (trunk only)
nethack.rankin [Sun, 3 Feb 2008 06:42:25 +0000 (06:42 +0000)]
exercise/abuse while polyd (trunk only)

     Three years ago <Someone> reported that even though exercise of
attributes other than wisdom is suppressed while the hero is polymorphed,
attribute gains or losses due to pre-existing exercise can still take
place in that situation.  Since it's an entirely different set of attrs
which will be replaced upon rehumanizing, there's not much point.  (The
same is actually true for wisdom, but I didn't change how exercise works
for it.)  Adopt his one-liner fix:  old exercise won't cause attribute
changes while polymorphed; it will silently fade as it does when its
magnitude is insufficient to trigger a change.

     While checking that out, I noticed that exerchk() was using `/= 2'
to fade out old exercise/abuse.  That will produce platform-dependent
results for negative values (ie, for the abuse case) since C's integer
division doesn't specify whether to truncate towards zero or towards
negative infinity.  In particular, -1 / 2 could yield -1 rather than 0
as the code expected.  (Its impact on play was negligible though.)

     This reduces the code for displaying the messages which accompany
attribute gain/loss.  A few were repharsed in order to simplify that.

17 years agobuild fix (trunk only)
nethack.rankin [Sun, 3 Feb 2008 06:20:05 +0000 (06:20 +0000)]
build fix (trunk only)

     The recent SYSCF patch introduced a build problem even though I
haven't attempt to use that new stuff yet.  My compiler complained that
`out' in build_english_list() was used without being initialized, which
in turn caused make to quit.  The compiler was right; only the words==1
case actually set up the output buffer.  Once that buffer was fixed, the
routine to copy a single word was overwriting it on each call instead of
building up via appending as intended.

     I changed the 3 or more case to yield "A, B, or C" like Keni wrote
in his description rather than the "A, B or C" which was being produced.
I'm pretty sure that both forms are considered acceptible; I've always
used the first one with an extra comma in front of and/or.

17 years agomore SYSCF and related bits - cleanup and features
keni [Thu, 31 Jan 2008 00:56:59 +0000 (00:56 +0000)]
more SYSCF and related bits - cleanup and features
infrastructure for "system options" - things currently specified at build
 time that should be changeable at install time or run time but not really
 under user control
generalize contact info so it can be localized and it doesn't have to be
 an email address
move recently introduced WIZARDS into sysopt
drop bogus OPTIONS=wizards possibility
new function build_english_list() to comma-ize and add 'or' from a whitespace separated list: A.  A or B.  A, B, or C.
syscf file now handles: WIZARDS SUPPORT RECOVER
 SUPPORT specifies local support information
 RECOVER will eventually supply port-specific and/or localized info on how
  to run recover (or get it run for you).
Note: in sys/msdos I changed sys.o (generated from pcsys.c) to pcsys.o
Note: sys/msdos/Makefile.GCC has 2 rules for sys.o (now pcsys.o)

17 years agoring discovery (trunk only)
nethack.rankin [Tue, 29 Jan 2008 04:17:03 +0000 (04:17 +0000)]
ring discovery (trunk only)

     Picking up and putting on a +1 ring of protection while blind
resulted in having a "+1 ring (on {left|right} hand)" in inventory and
having ring of protection show up in the discoveries list.  The problem
is the same as the one for wands which has been previously addressed
(but not 100% fixed...):  when using an item whose effect is observable,
the item's type became discovered based upon that observation even if the
item itself had never been seen.

     The code for removing ring of protection lacked its break statement
and fell into the case for removing ring of protection from shapechangers,
but didn't cause any noticeable problem.

17 years agoblindfolds and more (trunk only)
nethack.rankin [Mon, 28 Jan 2008 02:39:32 +0000 (02:39 +0000)]
blindfolds and more (trunk only)

1) the change yesterday to mark inventory as seen when recovering from
   blindness neglected to handle blindfold removal;
2) fix grammar when using 'R' or 'a' to try to remove cursed lenses
   (now "they are cursed" instead of "it is cursed");
3) attempting to put on a wielded or quivered blindfold, amulet, or ring
   and failing because of already wearing one (or two in the case of
   rings, where cursed gloves and ESC at "which ring-finger?" prompt got
   similar result) unwielded/unquivered item rather than leave it as is.

17 years agoinventory after regaining sight typo (trunk only)
nethack.rankin [Sun, 27 Jan 2008 02:54:52 +0000 (02:54 +0000)]
inventory after regaining sight typo (trunk only)

     Out of date diff last time.

17 years agoinventory display after regaining sight (trunk only)
nethack.rankin [Sun, 27 Jan 2008 02:06:18 +0000 (02:06 +0000)]
inventory display after regaining sight (trunk only)

     I suspect--but have no way to test--that there is a subtle difference
in game play between perm_invent and !perm_invent involving object merging
or other activity that depends on whether or not object->dknown is set.
For objects pickup up while blind, where object->dknown is left as is,
the perm_invent config would have such items marked as seen sooner (since
there are umpteen places that call update_inventory() which will end up
setting the seen bit while formatting objects).  Non-perm_invent wouldn't
have that done until the user examines invent (or asks to see a list of
objects at the "which object?" prompt for various commands).  This patch
effectively examines inventory whenever blindness ends, so both modes get
dknown set as soon as possible.  And if we ever add an "effect known" flag
for unseen objects which are used while blind, this would be a suitable
place to perform deferred object discovery.

17 years agoinitoptions warning following its split (trunk only)
nethack.allison [Sat, 26 Jan 2008 17:00:18 +0000 (17:00 +0000)]
initoptions warning following its split (trunk only)

..\src\options.c(565) : warning C4101: 'opts' : unreferenced local variable
The code in initoptions_init() that uses opts seems to now be isolated to
UNIX and VMS.