Commit Graph

3810 Commits

Author SHA1 Message Date
nethack.rankin
b0a70e81dd stone-to-flesh vs Heart of Ahriman (trunk only)
From the newsgroup:  a player accidentally cast the stone-to-flesh
spell at himself (I don't recall whether he chose wrong spell or wrong
direction, or tried to cancel and game used last remembered direction)
and the barbarian quest artifact he was carring turned into a meatball.
Artifacts already have a high chance (95%) to resist being polymorphed
but that doesn't apply for the stone-to-flesh transformation.  This
gives stone artifacts a high chance (98%) to resist being turned into
flesh.  Non-artifacts also get a small chance (2%) to resist as well.
2010-08-28 00:15:39 +00:00
keni
beba2bec99 add a note about a useless var (from <Someone>) 2010-08-17 14:11:39 +00:00
nethack.rankin
fefeda5422 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" :-).
2010-08-14 00:31:59 +00:00
nethack.rankin
0ee120b9b5 forgetting spells due to amnesia (trunk only)
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.)
2010-07-27 03:08:04 +00:00
nethack.rankin
a950a6b368 fix #H2151 - typo in towel's lookat/whatis entry
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".
2010-07-26 01:03:11 +00:00
nethack.rankin
8aecc66204 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.
2010-07-24 03:53:52 +00:00
nethack.rankin
bda97fb3fa eating corpses while hallucinating (trunk only)
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.)
2010-07-02 01:49:51 +00:00
keni
bd1a922dae 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)
2010-05-13 00:54:13 +00:00
keni
d55db3584e followups for previous patch
Distribute makedefs.txt.  Comment out one of the MDMANCREATE lines.
(Thanks Janet)
2010-05-01 23:10:22 +00:00
keni
3d171e785c tid
add makedefs.6 to Files
2010-05-01 20:58:26 +00:00
keni
e04caf9a27 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).
2010-05-01 20:57:17 +00:00
keni
1b8c99d691 Makefile.utl bit
change the way makedefs doesn't depend on mdgrep.h so running mdgrep.pl
_will_ cause makedefs to get rebuilt.
Keni
2010-04-29 19:20:52 +00:00
keni
7ffa0780a6 typo in existing bigroom code
Nothing uses this at the moment, but it's wrong.
Keni
2010-04-29 19:19:32 +00:00
keni
55b53cc6dc replacement data.base entry for slime molds
Found while looking for a monster for the (still pending) life patch.
Keni
2010-04-29 19:18:08 +00:00
nethack.rankin
c00ade13ed 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.
2010-03-04 01:45:43 +00:00
nethack.rankin
9f7be9c4d9 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.
2010-03-01 03:27:33 +00:00
keni
cbd2a516e1 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.
2010-02-10 16:08:51 +00:00
nethack.rankin
0c0d68a631 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.
2010-02-06 01:58:33 +00:00
nethack.rankin
97c2f8ef03 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.
2010-02-02 23:10:01 +00:00
keni
84dccb47cf SYSCF wizard error display
Fix construction of error message when wizard mode declined and SYSCF.
2010-01-19 16:33:43 +00:00
nethack.rankin
7500c21b02 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.
2010-01-19 02:58:59 +00:00
keni
c367969d60 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.
2010-01-18 02:02:45 +00:00
keni
9cd309157b 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.
2010-01-17 19:36:16 +00:00
keni
efed004b64 PANICTRACE bit
Only defined PANICTRACE for supported platforms.
2010-01-16 22:02:06 +00:00
keni
89db1f9e73 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.
2010-01-16 21:54:24 +00:00
nethack.allison
edf5b1c091 more lint (trunk only)
..\src\windows.c(329) : 'boolean (__cdecl *)()' differs in parameter lists from 'boolean (__cdecl *)(void)'

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
2010-01-16 16:38:35 +00:00
nethack.rankin
2b905f9162 lint (trunk only)
Eliminate a couple of warnings that caused make to quit.
2010-01-16 00:51:42 +00:00
keni
d80fcaada4 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
2010-01-15 19:54:37 +00:00
keni
f6e40b8bf8 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.
2010-01-15 17:51:28 +00:00
keni
655adf8535 remove extraneous MAX/MIN
extralev.c defines and uses MAX/MIN macros instead of max/min from hack.h
2010-01-10 02:35:19 +00:00
keni
dbaa63c760 display.c tid
The WA_VERBOSE define was after the first use.
2010-01-10 02:18:28 +00:00
keni
9ae93d8b71 new and fixed messages
2 fixed messages and 2 new silly messages
2010-01-07 17:51:35 +00:00
keni
011323e877 enlightenment formatting
Make the enlightenment output just a little nicer.
2010-01-06 14:48:11 +00:00
keni
c3edf0dfae linux hints file updates
add missing perm values
2010-01-04 18:15:05 +00:00
keni
d4b022a5ec 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
2009-12-23 20:02:29 +00:00
keni
a8b5a39473 mac term packaging
Automated version of what I did to repackage the 3.4.3 Mac Term package.
2009-12-17 19:49:13 +00:00
keni
5c0a627ce2 makedefs internal version formatter
Add -svs so the Makefile can get "343" or "3.4.3" (etc) when automating
package builds.
2009-12-17 19:46:42 +00:00
keni
e8fe9b4505 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).
2009-12-17 19:26:30 +00:00
nethack.rankin
81e1ca40f1 #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.
2009-12-17 02:51:03 +00:00
nethack.rankin
9269642f2a 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.
2009-12-15 02:38:50 +00:00
nethack.rankin
403dd4ef95 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.
2009-12-14 23:46:30 +00:00
nethack.rankin
00093a1c8a 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.
2009-12-13 05:10:42 +00:00
keni
727bd80865 tweak to support SYSCF for single user config 2009-12-09 18:52:25 +00:00
keni
9509a94c5b Mac recover bits
add headers, typo fix
2009-10-29 00:24:05 +00:00
keni
97509efaaf 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.
2009-10-27 01:12:57 +00:00
nethack.allison
3197e22563 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

-<Someone>
2009-10-22 02:59:35 +00:00
nethack.allison
dea62334c0 bit 2009-10-22 02:36:50 +00:00
nethack.allison
19c795df8c Remove the old SCCS Id line from the files
... that were updated for dungeon_overview adjustment
2009-10-21 03:16:02 +00:00
nethack.allison
7c05c92eed 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.
2009-10-21 03:05:53 +00:00
nethack.rankin
e8ca39ff07 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.
2009-10-20 22:48:38 +00:00