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.]
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.]