nethack.rankin [Thu, 17 Dec 2009 02:51:03 +0000 (02:51 +0000)]
#fix #H2061 - ESC at music prompts (trunk only)
From a bug report, attempting to respond with ESC when playing an instrument
just continued with the playing sequence. This adds a q choice to the
"Improvise? [yn]" and "Play passtune? [yn]" prompts, and also checks
for ESC as the 5-note tune when not improvising, yielding "Never mind"
and not using up a turn if the player opts not to play any music.
I put the fixes entry in the new features section since the old
behavior wasn't much of a bug.
nethack.rankin [Tue, 15 Dec 2009 02:38:50 +0000 (02:38 +0000)]
fix #H2060 - objects blanked by water while hero is blind
From a bug report, if you entered water
while blind and any spellbooks got blanked, you would know they became
"plain spellbooks" iff their original description was known. The same
situation applied to scrolls and potions; if they had been previously
seen you'd learn they'd become blank or clear. This fix resets the
obj->dknown flag during transformation so that altered objects are only
known by their class when blind, never their description, the same as
when they hadn't been seen before being blanked. (When sighted, the
dknown flag gets set again the next time the object's name is formatted,
so the player shouldn't be able to notice that any reset took place.)
Unpaid objects which get blanked should be treated as used up for
shop billing purposes (force the hero to buy), but there aren't any pools
in shops so aside from the added comment I'm going to pretend I didn't
notice that that isn't being done....
Potions seen before becoming blind which become diluted while blind
will be known to be diluted since there's no way to know the description
without also knowing the dilution. I don't think that's important enough
to track known-dilution separately, although I suppose we could overload
the cknown (contents-known) flag for that if necessary.
This also removes an inaccurate comment about the effects of Luck.
Its maximum is always 13 regardless of whether the moon is full, so 5%
for the lowest chance of blanking via submersion was impossible.
nethack.rankin [Mon, 14 Dec 2009 23:46:30 +0000 (23:46 +0000)]
fix #H2059 - writing spellbooks while blind
From a bug report, you could write a
spellbook with a magic marker while blind and were told the description
(often a color) of the resulting book. This prevents books from being
written while blind, just as they can't be read in that situation, and
it adds an extra test when attempting to write scrolls while blind.
(When you succeed in writing a scroll while blind, you're just told that
the result is ``x - a scroll'' as it's moved to its new inventory slot.)
This also removes a couple of overly hyper exclamations when writing
fails. Someday somebody ought to go through the whole program and decide
which messages actually warrant exclamation points, but I doubt that
that'll ever happen.
nethack.rankin [Sun, 13 Dec 2009 05:10:42 +0000 (05:10 +0000)]
unix player name handling (trunk only)
Fix a couple of post-3.4.3 bugs. MacOSX was unconditionally copying
"player" into plname[] after processing options, clobbering any
name:Somebody value there. (It took place before command line processing,
so -u Somebody worked ok.) This removes that, since we're intending to
accomplish the same thing in a different manner.
The revised handling for names "player" and "games" didn't work right when
dash and role were appended to the name in order to try to keep dashes in
usernames intact. It resulted in first prompting for role selection, then
asking "who are you?" afterwards.
Unfixed bug: unixmain's appending dash and role to username in order to
preserve usernames with dashes in them doesn't work anymore. I think the
role/race/gender/alignment stuff introduced way back in 3.3.0 broke it and
apparently no one has noticed....
Miscellaneous: clean up some complaints from gcc about comparing signed
and unsigned ints.
keni [Tue, 27 Oct 2009 01:12:57 +0000 (01:12 +0000)]
bits to allow GUI to run recover under MacOS X
Will require additional work for 3.5 (shouldn't blindly remove perm_lock
without asking the user; update comments; add standard headers) but I don't
want to lose this code.
nethack.allison [Thu, 22 Oct 2009 02:59:35 +0000 (02:59 +0000)]
Windows CE port fixes/enhancements (from <Someone>)
A few other fixes:
- bug: text window does not scroll left on left arrow
- pcmain.c: fix warning: _fileno() returns void* in Windows CE SDK
3.5.0 only:
- files.c: compile error: don't include <signal.h> if NO_SIGNAL is defined. WinMo does not support POSIX signals
- version.c: compile error: append_port_id() is undeclared
- link error: mktime() is unsupported -> define it in celib.c
nethack.allison [Wed, 21 Oct 2009 03:05:53 +0000 (03:05 +0000)]
dungeon_overview adjustment
The dungeon_overview bits in the rm structure were being
clobbered by a run-length encoding save/restore because
they weren't taken into consideration.
This patch pulls that data out of the rm structure completely.
It also adjusts the run-length encoding checks to take the
candig bit into consideration and adds a comment to rm.h
reminding people to make run-length encoding adjustments
in save.c for any new bits that get added.
nethack.rankin [Tue, 20 Oct 2009 22:48:38 +0000 (22:48 +0000)]
meta access to several extended commands (trunk only)
Someone in the newsgroup has a keyboard where typing '#' is difficult
or impossible to do, and mentioned that he could use Alt+r to get #rub but
was playing a knight and had no way to get #ride. Turns out that there
are several normal-mode extended commands that lacked a meta shortcut.
Since meta chars are case sensitive, I've added Alt+R for #ride, plus
M-A for #annotate, M-O for #overview, M-C for #conduct, and M-T for #tip.
Unfortunately, I've been unable to test them. It turns out that
nethack mode in PuTTY doesn't change the Alt key into a meta shift, it
causes the digits on the number pad to send vi-style movement letters
(with support for shift+digit and ctrl+digit to send modified letters).
That seems relatively useless to me, and I haven't figured out how to
force on high bit for arbitrary characters so can't activate nethack's
meta-key shortcuts.
The Guidebook has been updated via copy+paste and is untested too.
nethack.rankin [Sun, 18 Oct 2009 23:52:39 +0000 (23:52 +0000)]
pickup_burden typo/thinko
From the newsgroup: the 'O' command's menu for setting pickup_burden
shows "Unencumbered" for the 'u' choice but the Guidebook and the in-game
options help show "Unburdened". (For config file processing, the program
only examines the first letter so accepts either value.) This changes the
documentation to match the game.
nethack.allison [Sat, 10 Oct 2009 14:39:53 +0000 (14:39 +0000)]
Windows CE changes (from <Someone>)
The changes did not apply to the main trunk as easily as I wouuld have
hoped, so I attempted a number of manual applications. I hope <Someone>
can tell me if there is a problem.
Changelist:
- bugfix: help text windows close immediately after open (unhandled WM_KEYDOWN in mhtext.c)
- bugfix: action button uses hero coordinates instead of cursor position
- pocketpc: bugfix: menu window closes on up/down keys from first/last position
- smartphone: do not translate input when command helper is hidden (fixes Motorola Q keyboard bug)
- smartphone: new keypad layouts
- smartphone: wizard mode command layout
- smartphone: option to feed arbitrary text as a command to nethack core
- wrap/unwrap text option for text windows
- hardware keyboard detection
- hide keypad when hardware keyboard is present
- backport message window highlighting from winnt port
- new icon with recommended image sizes
nethack.rankin [Sat, 22 Aug 2009 01:14:48 +0000 (01:14 +0000)]
fix #H2010 - quaffing wielded potion of polymorph
From a bug report, drinking a potion of
polymorph which is wielded would trigger an "object lost" panic if hero
took on a form that was forced to drop its weapon. Once weapon/potion
got dropped, subsequent useup() of the potion was no longer operating on
an inventory object.
Unwield the potion at start of drinking, so that dropping doesn't
come into play. (If we ever introduce a monster form incapable of
holding inventory so drops everything, this will have to be revisited.)
nethack.rankin [Sat, 22 Aug 2009 00:02:09 +0000 (00:02 +0000)]
fix #H1996 - digging message for missing boulder
From a bug report, it was possible to get
|You hit the with all your might. You stop digging.
if a boulder went away--in his case, it was picked up by a giant--while
you were occupied trying to break it with a pick-axe. The code explicitly
used "" to fill in the message when dig_target had an unexpected value.
This just avoids giving the message in a case like this. Possibly
extra stop_occupation() calls should be done instead, but I didn't want
to try to figure out how many would be needed (monster picks up object,
monster zaps wand of striking, others?).
nethack.rankin [Tue, 30 Jun 2009 08:22:40 +0000 (08:22 +0000)]
missile vs engulfer (trunk only)
Noticed while testing the "<obj> is no longer poisoned" fix; killing
an engulfer via "the poison was deadly..." led to an "obj not free" panic.
It was due to post-3.4.3 changes, so no fixes entry.
nethack.rankin [Tue, 30 Jun 2009 02:45:46 +0000 (02:45 +0000)]
still held by monster after it moves away (trunk only)
From a bug report, a stunned monster
moved away from the hero, but remained holding him. That behavior was
still present in the dev code, although the hero was free to move and
would become unstuck as soon as he did so. I don't know how many fixes
for this sort of thing have been made, but they evidently haven't been
made in the proper place. [Perhaps it really ought to be done as a
monster is placed somewhere on the map?]
nethack.rankin [Sat, 13 Jun 2009 02:10:21 +0000 (02:10 +0000)]
poly'd hero mimic hiding vs polymorph
From a bug report, if you were a mimic
who was hiding (via #monster, becoming a strange object) and polymorphed
into some other monster type, you retained the hidden/object form. That
didn't happen when reverting to normal form, or when polymorphing into a
monster while involuntarily mimicking gold, but handling for the latter
inadvertently blocked dealing with the hiding-voluntarily case.
nethack.rankin [Thu, 11 Jun 2009 03:17:25 +0000 (03:17 +0000)]
UNICODE_WIDEWINPORT in tty/topl.c (trunk only)
Hide most of the Unicode support in tty's top line manipulation.
The new code is somewhat fragile, but the clutter from the many instances
of #if UNICODE_WIDEWINPORT was making it difficult to work on some other
changes.
From a bug report, black dragon breath
destroys closed doors didn't acknowledge hitting secret doors. bhit()
reveals secret doors, but zap_over_floor() (called by buzz() for ray-type
wands and spells, and for breath attacks) didn't check for hitting those.
When testing the fix, I noticed that feedback for an explosion caused
by breaking a wand was worded oddly for zaps like magic missile which don't
damage doors. "The door absorbs your bolt" didn't make much sense; what
bolt? That was first changed to "absords your blast", which still sounded
weird, then to "absorbs the blast", which seemed better but was inaccurate.
Next was "absorbs some of the blast" since the explosion continues to hit
adjacent spots, but since it still has full strength that wasn't accurate
either. It's finally become "The door remains intact." Unlike with zaps,
there is no additional range being lost, so no reference to absorption.
nethack.rankin [Wed, 27 May 2009 09:19:11 +0000 (09:19 +0000)]
spell_damage_bonus (trunk only)
From the newsgroup: player saw "The spell hits the <monster>?"
where the question mark punctuation reflected negative damage occurring.
Another player diagnosed it as a 2 point force bolt (from 2d12 dice role)
modified by -3 penalty for hero who has Int less than 10. This changes
spell_damage_bonus() to avoid reducing damage below 1 point.
nethack.rankin [Mon, 11 May 2009 22:55:56 +0000 (22:55 +0000)]
Files bit (trunk only)
Add entries describing the source files generated by yacc and lex.
And strip some trailing whitespace. (Trunk-only solely because it won't
apply as-is to the branch copy of Files.)
nethack.rankin [Mon, 11 May 2009 22:53:51 +0000 (22:53 +0000)]
sync sys/share/{dgn,lev}_{lex,yacc}.c, take two (trunk only)
cvs admin -ko sys/share/*_*.c to suppress $Date$ and $Revision$ expansion,
reverting to the text checked a few days ago.
cvs commit -f sys/share/*_*.c to trigger this mail; you'll need cvs update
to get the actual text.
keni [Sun, 3 May 2009 14:08:15 +0000 (14:08 +0000)]
Add recordfile control to SYSCF.
Add sys/unix/sysconf, a sample sysconf file.
Move defines from topten.c to config.h so they can be seen globally.
Add persmax, pers_is_uid, entrymax, and pointsmin to struct sysopt, use
in topten.c, populate in files.c
Warning cleanup in files.c.
BUGFIX: don't crash in unixmain.c if WIZARDS left unspecified.
hints/macosx10.5: don't hardcode "keni"; install sample sysconf; install
sample ~/nethackrc
makedefs: add "system configuration" to compiled-with options list.
BUGFIX: if a game doesn't meet the criteria for making the record file it's
shown to the user as having zero points because t1->points is set to zero
to indicate that it doesn't get written back; display u.urexp instead.
"Astral plane" is a place name so should be fully capitalized. Some
of the variations used ("through the elemental planes to the astral",
"plane of the astral", "planes of the elements") aren't as clear cut, but
I capitalized all of those I found.
From the newsgroup: someone using <Someone>'s level-flip patch
(to transpose special levels left-to-right or top-to-bottom or both in
order to get more variety from them) ended up in solid rock. When
climbing the stairs up from the Valley to the Castle, goto_level() was
hardcoded to find a spot in the extreme lower right corner. If the level
is turned upside down, solid rock from an unused row at the top edge of
the map ends up at the bottom, and the placement code could put the hero
there. That code only checked for walls and monsters being in the way,
not rock. Also, if the level is flipped side-to-side than hero ends up
in same area as the upstairs rather than on opposite side of the Castle.
This switches to the same teleport-region code used for other level
changes which don't arrive on stairs; such regions get flipped along with
map by that patch (I hope). Even though no such fix is currently needed
for unmodified nethack, this change gets rid of the special case Castle
placement code entirely, simplifying both goto_level() and u_on_sstairs()
in the process.
The Castle's existing from-below region covers the rightmost half-
dozen or so columns across all rows, so offers a bigger landing zone than
just the bottom corner. That could be tweaked within castle.des but I
don't think it needs to be.
Add questpgr formatting codes to support pronouns for leader,
nemesis, deity, and artifact.
%lh -> "he" or "she" for leader; %nh for nemesis; %dh for hero's god;
%li -> "him" or "her"; likewise %ni, %di;
%lj -> "his" or "her"; and %nj, %dj;
H, I, and J modifiers yield capitalized form of same.
%oh -> "it" or "they" for artifact (Eyes of the Overworld is plural);
%oi -> "it" or "them";
%oj -> "its" or "their"; plus capitalization with uppercase modifiers.
Also, %O yields shortened artifact name ("the Foo" in place of "the Foo
of Bar"). These provide support for terser summary lines, but can also
be used in the regular quest text passages.
A couple of nemeses don't specify gender. The random choices need
to be made early so that the leaders' messages can get them right. This
chooses during role initialization and then uses that result once the
corresponding monster is eventually created. It does the same for leader
even though no current leader needs it, and for deity too.
Add support to makedefs and the core for including a line of summary
text with quest messages that don't use pline() delivery. The multi-line
record structure of quest.txt begins each entry with %C and ends with %E.
makedefs now examines the %E lines looking for "[anything]" and adds that
to quest.dat where deliver_by_window() can find it. The square brackets
are required in the input and intentionally carried along to the output.
putmsghistory() is used to put the summary text into the message history
buffer for use by ^P, without being displayed first. (So this is a no-op
for interfaces which haven't implemented putmsghistory yet. Maybe
genl_putmsghistory() should pass such text to pline() as a quick hack?)
This adds a few summary lines to quest.txt so that the feature can
be tested. Most of them were written by <Someone> nearly three years
ago. I'm planning to add a couple of new control codes that'll allow some
of them to expand into shorter text. (The one where the Archeologist
leader tells you that the nemesis stole the artifact so your mission is
to find the goal level, defeat the nemesis, and return with the artifact
ends up being roughly 160 characters long.)
Add another argument to putmsghistory() so that it can tell whether
it's processing multiple messages for restore (which should be treated as
being older than any current messages) or a single message to stuff into
history (which should be treated as the most recent message even though
it hasn't been displayed in the message window).
The post-3.4.3 hangup changes broke the post-3.4.3 message history
save/restore for tty (and maybe Win32, if it supports hangup handling;
other interfaces haven't implemented message history save/restore yet)
during hangup saves by preventing interface-specific getmsghistory() from
being called. Relatively benign; hangup save just behaved as if message
history was empty, so restore had no old messages to put back. Naturally
post-hangup restore is when players would be most interested in reviewing
the previous session's messages, so benign failure isn't acceptable. Fix
is to leave getmsghistory() intact when replacing windowprocs with the
I/O-free routines. [I can't trigger real hangups for testing, but can
call hangup() from within the debugger to force an approximation of one.]
Recent newsgroup discussion complained about a pearl ring becoming
rusty. That has no effect on game play but does feel weird. Rings which
are described by their gems specify a material based on the gem rather
than on the band, so making pearl rings be made out of iron didn't fit.
The substance pearls are made of is the same as in the shells of the
oysters or whatever critters excrete them. The closest matches available
seem to be mineral and bone; I've gone with bone here.
nethack.rankin [Sat, 28 Mar 2009 01:36:12 +0000 (01:36 +0000)]
dropping unpaid items vs containers (trunk only)
From a bug report, the 'D'
command would list 'u' as an item category choice if you were carrying
unpaid items inside a container, but if those were the only unpaid items
then nothing would happen once the dropping stage was reached. Applied
to all menustyles (except partial, which bypasses categories and goes
straight to a menu listing all items). There were two alternatives for
the fix: suppress 'u' as an applicable category when it only applies
to container contents, or include the container among the drop candidates
even though it isn't an unpaid item itself. I went with the latter; it's
simpler to implement and also feels a little more intuitive than behaving
like there aren't any unpaid items present.
nethack.rankin [Tue, 24 Mar 2009 00:31:01 +0000 (00:31 +0000)]
role selection typo (trunk only)
tty's role confirmation menu was always showing "dwarven" as the
chosen race. I don't know how many times I saw it without ever realizing.
``races[FACE]'' in the code eventually stood out enough to be noticed. :-)
nethack.rankin [Mon, 23 Mar 2009 00:29:56 +0000 (00:29 +0000)]
another main() bit (trunk only)
It always struck me as odd that x_maze_max and y_maze_max were
initialized in main(). They're only needed when making new levels, so
don't have to come before saved game restoration. They could easily have
gone into init_dungeon() (although they make well predate that), or even
mklev() (reinitializing them for each new level wouldn't have been a big
deal). That's all moot, though, since it's trivial to initialize them at
compile time.
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.
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.
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.
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.
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.
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.]
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).
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.
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.
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).
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.
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.)
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. :-]
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.]
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.)
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.]
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.
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.
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.
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().
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).
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.
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.)
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.
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.
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.
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.
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.)
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.
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.
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.
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.
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.
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.
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.