nethack.rankin [Sat, 14 Aug 2010 00:31:59 +0000 (00:31 +0000)]
fix #H2161 - writing scrolls based on description (trunk only)
From a bug report, you could write scrolls
by type name ("magic mapping") if you had that type of scroll in your
discoveries list via assigning a name to an unknown scroll ("scroll
labeled FOOBIE BLETCH called foo"). Being on that list was enough to
treat the type as known when writing scrolls and books. And he fealt
that it was abusive to be able to collect and name a lot of unknown
scrolls and then write favorite ones which had good odds of being in the
collected set.
This changes it to the original intent: if your discoveries list
has FOOBIE BLETCH on it, you can write a scroll by that label (since we
decided way back when that a scroll's label was its magic, to explain how
a blind hero can read any scroll whose description is known even though
they aren't constructed in braille). If you have identified the type
("scroll of magic mapping labeled FOOBIE BLETCH") then you can write by
type or by description, but you can no longer write one by type when only
the description is known. There is a potential can-of-worms bug here:
if you walked across a "scroll labeled YUM YUM" but have not assigned it
any name, you've still learned its magic words and ought to be able to
write a scroll of YUM YUM. We don't have any mechanism to track items
which have been observed but not been put on the discoveries list. This
patch plugs one obvious hole, by scanning inventory to treat any seen
scroll labels there as an extension of the discoveries list. But the
more general case of something once seen but not named or currently held
is ignored.
This also adds writing scrolls by the user-assigned name, so if
your discoveries list has "scroll labeled FOOBIE BLETCH called foo" you
can write either foo or FOOBIE BLETCH to get the scroll. I'm not sure
the bug report advocated that--parts of it were a bit confusing, at
least to me--and I'm not completely sure that we want to have it, but it
does work. Without it, you got "no such thing as \"foo\"", which seems
counter-intuitive when "foo" is there in plain sight on your discoveries
list. The new code chooses randomly if multiple scrolls have been called
"foo". And if you've called something by an actual object name, it uses
your knowledge of that object rather than anything you've given its name
to. In other words, if you have "scroll labeled YUM YUM called magic
mapping" and try to write magic mapping, it will use your knowledge--or
lack of same--about scroll of magic mapping rather than scroll labeled
YUM YUM to decide whether you'll succeed.
There is also a minor tweak in the chance to write a completely
unknown scroll or book. Wizards almost never failed once their Luck was
5 or more; using rnl(5) instead of rnl(3) requires Luck 11 rather than
just 5 to get that ~39/40 chance of success. Non-wizards didn't change.
Lastly, this fixes an unrelated bug when writing spellbooks. The
message "the spellbook warps strangely, then turns <new description>"
works okay when <new description> is "red" or even "ragged", but not so
well when it's "vellum". A handful of book descriptions refer to the
item composition rather than the appearance of the cover, and turning
into a new composition needs different phrasing. I just tweaked it to
be "turns into vellum", which is probably suboptimal (particularly for
the book description "cloth" :-).
From the newsgroup, losing spells to amnesia always took away the
last 'N' spells after choosing a random N. That kept casting letters
sane, since letters for lost spells became invalid and those for non-lost
ones stayed the same as they were before amnesia. But 3.4.x gave the
player the ability to swap pairs of spells, so he could make his favorites
to be the first spells, and only lose them if the random number of spells
being affected was as large as the whole list. (Also, divine spellbook
gifts give preference to books for unknown spells; in theory, you could
use spell letter manipulation plus deliberate amnesia to make a particular
spell revert to unknown in order to improve the chance of getting a new
spellbook for it. A bit of cleverness by a determined player but it
makes the game and/or its patron deities seem a bit dumb in the process.)
I first implemented losing spells throughout the list, with later
spells moved forward to fill any gaps. But that results in new casting
letters for every spell past the first lost one, potentially wreaking
havoc if a player chooses a casting letter from his own memory of the
pre-amnesia list. So, instead of losing some spells entirely, either
from the end of the list or spread throughout, I've changed amnesia to
set the retention amount (of N spells from throughout the list) to zero,
the same as happens when it's been 20000 turns since the spell was last
learned. Letters for all known spells stay unchanged, and forgetting
due to amnesia becomes the same as the other way of forgetting spells.
(So now a different potential clever use of amnesia occurs; a player who's
trying to a make speed ascension could get access to expired spells--to
cast in order to become confused--without waiting for 20000 turns after
reading the first book.)
From a bug report, the entry
in data.base for towel repeated the word "down" in the quote from Douglas
Adams' _The_Hitchhiker's_Guide_to_the_Galaxy_. I double checked the book
itself to verify that the quote shouldn't say "down down".
fix #H2150 - discovering displacement when can't see its effect
From a bug report, when putting on a
cloak of displacement you discovered what it was even if you were invisible
and unable to see invisible, hence couldn't see yourself. It isn't exactly
clear what the hero sees of himself when displaced, but I think it makes
sense that you shouldn't discover the cloak when you can't see yourself,
which suggests that you shouldn't discover it when blind either.
Discovering it after regaining sight, becoming able to see your
invisible self, or losing invisibility seemed complex and likely to be
bug-prone, so this patch leaves the cloak undiscovered in that situation.
But it does become discovered when taken off (provided that you can see
yourself by then) rather than waiting all the way 'til put back on again.
Elven cloaks had a comparable issue. I assume that stealthiness can
be perceived without being able to see yourself, but it shouldn't become
discovered when you're already stealthy from some other means. (Elven
boots already behaved this way; now elven cloaks work like them.)
Rings of stealth would never be auto-discovered. Now they'll be
like elven cloaks and boots and be discovered if put on when not already
steathy or taken off and losing stealth. In both cases, the ring has to
have its description known; if picked up when blind and still not seen
yet it won't become discovered even when you notice yourself gaining or
losing stealth.
Not tested: feedback given when a worn ring or cloak gets dipped
into a potion of polymorph and changes into or away from a stealth or
displacement conferring item.
Contributed by <email deleted>, give an
alternate message when eating a corpse while hallucinating, including one
that gives homage to Tony the Tiger from old Frosted Flakes commercials
if you happen to be polymorphed into a tiger. Even players who try to
keep their characters hallucinating all the time are unlikely to ever run
into "tastes gr-r-reat!".
I rewrote the conditional expression to only test Hallucination once.
And I added the comment about omnivores, who'll never get "is delicious"
result with the current carnivore vs herbivore logic. (That behavior has
been around for quite a while, but seems somewhat suspect.)
keni [Thu, 13 May 2010 00:54:13 +0000 (00:54 +0000)]
Guidebook update and SEDUCE runtime switch
add SYSCF docs to the Guidebook because it's info needed in a binary distro
Guidebook.tex - also add some missing italics to some "NetHack" occurances
call nethack.org "official"
Guidebook.txt - didn't regenerate cleanly so no diff
add SEDUCE to SYSCF (only partly inspired by the recent email)
keni [Sat, 1 May 2010 20:57:17 +0000 (20:57 +0000)]
makedefs manpage, conditionals, and related bits
Add a man page for makedefs so mdgrep is documented better.
Add missing INSURANCE to mdgrep.h. (yes, LIFE leaks in as well)
Add makefile bits to build makedefs.txt.
Pass dungeon.def through mdgrep internally to makedefs - this will make
it possible to commit the LIFE patch and have config.h actually turn it
all the way off (by skipping bigrm-6).
nethack.rankin [Thu, 4 Mar 2010 01:45:43 +0000 (01:45 +0000)]
crowning bonus (trunk only)
Have being crowned Hand of Elbereth/Envoy of Balance/Glory of Arioch
give a minor extra benefit beyond resistances and an artifact and maybe
unlocking the artifact's skill: one extra skill credit, making it
feasible to earn 30 rather than 29. (Previously the only way to get any
was to receive one for each new experience level, so you could gain one
29 times when going from level 1 to level 30.) Added as a new feature.
nethack.rankin [Mon, 1 Mar 2010 03:27:33 +0000 (03:27 +0000)]
minor readobjnam cleanup (trunk only)
Remove some clutter from the wish handling code, mostly by taking
advantage of the fact that the wizard flag is valid even for the !WIZARD
configuration. No change to game play.
keni [Wed, 10 Feb 2010 16:08:51 +0000 (16:08 +0000)]
First batch of changes from FailSafeC
This is all tiny stuff - allow overriding WIDENED_PROTOTYPES from the hints
file, missing NO_SIGNAL conditionals, remove a GCC-ism, conditional indentation,
void return in a non-void function.
nethack.rankin [Sat, 6 Feb 2010 01:58:33 +0000 (01:58 +0000)]
fix #H2081 - named vault guard messages (trunk only)
From a bug report, assigning
a vault guard a name such as Marcel could result in messages like
|The Marcel, confused, disappears.
Many of the guard messages had article "the" hardcoded. This gets rid
of g_monnam() and uses noit_mon_nam() instead.
I haven't been able to test all the modified messages; it's a pain
trying to get some of them to occur.
nethack.rankin [Tue, 2 Feb 2010 23:10:01 +0000 (23:10 +0000)]
open/close/loot while confused or stunned (trunk only)
Fix a bug From a bug report: while stunned he tried to close
an adjacent open door and when his choice of direction got changed to
some non-door spot, no time elapsed so he could just keep repeating the
attempt until eventually getting the correct direction. Trying to open
an adjacent closed door and trying to remove the saddle from an adjacent
monster via #loot behaved similarly. Applying keys and lock-picks also
did so in 3.4.3, but had already been changed to use up time in the dev
code. There may be other actions which need fixing.
nethack.rankin [Tue, 19 Jan 2010 02:58:59 +0000 (02:58 +0000)]
unix+vms wizard mode feedback (trunk only)
The message "only user <foo> may use wizard mode" formerly given
by the Unix and VMS ports was inadvertently rendered impossible to be
delivered when authorize_wizard_mode() was added to xxxmain.c nearly
3 years ago.
keni [Mon, 18 Jan 2010 02:02:45 +0000 (02:02 +0000)]
MacOS 9 vs MacOS 10 bit
MAC is defined for MacOS 9 but not for 10 (and it shouldn't be). Add a MACOSX
define and use it in eat.c to pick up the joke meant for all Mac systems.
keni [Sun, 17 Jan 2010 19:36:16 +0000 (19:36 +0000)]
make grep's path adjustable for PANICTRACE + more bits
Mac OS X doesn't have /bin/grep, only /usr/bin/grep. Grr.
Don't try to parse PANICTRACE_GLIBC if the field doesn't exist.
keni [Sat, 16 Jan 2010 21:54:24 +0000 (21:54 +0000)]
PANICTRACE bits
Add missing check for NO_SIGNAL in PANICTRACE versionof NH_abort().
Fix indentation of pre-processing directives.
Add #endif comments to make things clearer.
keni [Fri, 15 Jan 2010 19:54:37 +0000 (19:54 +0000)]
PANICTRACE (stacktrace on panic or signal) + bits
On crash signal or panic(), use a configurable method to get a stacktrace
the user can easily report to us. Currently only for Unix/Linux and only
ifdef BETA. Hopefully ports can add additional methods.
Bits:
- linux hints file had PREFIX definition in the wrong place
- sample sysconf file used wrong delimiter for WIZARDS
- fix grammar error in support message when using sysconf.wizards
- options.c comment typo
- capitalize "Crash test" output from #panic command
keni [Fri, 15 Jan 2010 17:51:28 +0000 (17:51 +0000)]
have core ask windowport if suspend is ok
PORTS: Please make sure I've done the right thing for/to your code.
This patch adds a new winproc that lets the window port approve or cancel
the suspend request - this should take care of the Mac Qt lockup issue.
In addition, Unix suspend is restricted to accounts that can use the shell
if SYSCF is defined.
keni [Wed, 23 Dec 2009 20:02:29 +0000 (20:02 +0000)]
hints system changes and more Mac packaging
update file headers
add "#-PRE" and "#-POST" keywords (no default) so hints file can wrap Makefile.*
add make var with name of makefile (e.g. MAKEFILE_TOP) so hints file can be
conditional on the file
add skeletel Mac Qt packaging target
add missing aux file generation for Mac Term packaging
keni [Thu, 17 Dec 2009 19:26:30 +0000 (19:26 +0000)]
make nethack.sh switchable from hints file
If SHELLDIR is null, don't install nethack.sh. Also a tid in Porting
and add NHSROOT to the Makefiles which gives a path to the top of the
tree (so e.g. you can always find makedefs from a rule in a hints file).
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.]