Commit Graph

3614 Commits

Author SHA1 Message Date
nethack.rankin
c0b85902a8 'R' behavior for rings (trunk only)
A bug in some post-3.4.3 code made attempting to remove a worn ring
when wearing two skip inventory the selection and give "you don't have
anything else to remove" if you were wearing gloves and weren't wearing
an amulet or blindfold.  The intent was that rings wouldn't be included
as likely candidates in the list of inventory letters to choose from if
you were wearing cursed gloves, but had a copy+paste mistake in the
argument controlling whether to consider the gloves curse state and was
in the wrong section of getobj()'s "ugly hacks".  Also, it makes more
sense to require that the player know that those gloves are cursed, so
inaccessibe_equipment() got changed too.  [Not knowing that the gloves
are cursed leaves rings listed as candidates; picking a ring will get
removal failure feedback later and mark the gloves as known cursed then.]
2008-01-25 02:54:51 +00:00
nethack.rankin
5ac69ac845 buried ball enhancement (trunk only)
Make being tethered to a buried iron ball be a bit more interesting
than just being stuck in the floor.  You can now move within a shortened
chain radius (1 step from the ball's burial location rather than normal 2
that applies when it's on the floor).  This has only been modestly tested,
and the message gets to be annoying if you move around a bit while monster
attack and object pickup/drop messages are being delivered.  There ought
to be some better way to override Norep.

     This would work nicer if the chain was actually visible at the ball's
location instead of becoming implicit at the time of burial.  But I don't
want to try to figure out all the ramifications of having an object on
the floor which can't be moved--perhaps uchain handling already suffices,
but I suspect that there's a can of worms waiting to have its lid opened.
2008-01-23 03:32:09 +00:00
nethack.rankin
e5df144bf6 moving while trapped (trunk only)
Pull the u.trap portion of domove() into a separate routine.  The
only significant change is to the wording of a couple of TT_BURIEDBALL
messages.  Like with enlightenment, say "you are <steed> are chained to
a buried ball" instead of "<steed> is chained to a buried ball" if you
try to move while mounted and punished and attached ball has been buried.
Unlike floor trap activation, punishment doesn't directly affect steed.
2008-01-22 22:28:09 +00:00
nethack.rankin
37947ab7ce enlightenment tweak (trunk only)
Yesterday's changes made it possible to use ^X to recognize an
unknown ring as one of sustain ability by checking whether wearing the
ring blocks display of base/peak/maximum characteristics when those are
considered to be interesting.  This limits that to cases where the ring
is cursed, so using ^X to figure out the type will leave an undesireable
ring stuck on your finger.  (Both before and after are unnoticeable in
wizard mode, where items which block access to base strength, dex, &c
are overridden by magical disclosure.)
2008-01-22 21:28:27 +00:00
nethack.rankin
3d1772a13b fix #1586 - stale alignment record after changing alignment type (trunk only)
From a bug report, putting on a helm of opposite
alignment wipes out divine protection (regardless of which god originally
bestored it) but leaves piety level towards the old god in place for the
new one.  Reset alignment record to 0 when changing alignment type.  Yes,
that means that the helm can now be used to clear a negative alignment,
which I think is in keeping with having subtle positive uses for bad items.

     Permanent alignment change did try to tweak alignment record, but
I'm not sure that it worked as intended.  Lawfuls changing away from law
got a bonus for their new alignment, neutrals retained their old record,
and chaotics changing away from chaos took a penalty to their record, all
without regard to what the new alignment became.  The magnitude of the
bonus or penalty was half the record limit (which gradually increases with
turn count) so could be very big, but I don't think it made much sense.
Reset alignment record to 0 for permanent conversion same as for temporary
conversion.  It's simpler and reflects the fact that you haven't yet done
anything to bolster or weaken your new alignment.
2008-01-22 05:31:19 +00:00
nethack.rankin
bef9b86e0a enlightenment revamp, part III (trunk only)
Replace the old ^X output with integrated enlightenment feedback.
Expands enlightenment output into four sections:  Background and
Characteristics in addtion to previous Status and Attributes.  Final
disclosure and ^X in wizard or explore modes show all four; potion/wand
of enlightenment and throne insight show the last two to give traditional
enlightenment, near enough; and ^X in normal mode shows the first three,
encompassing the 3.4.x ^X display in streamlined form plus providing
details about bottom line information.

     I think I'm done with enlightenment for the time being, except for
the desire to move it (plus associated conduct feedback) to end.c or
perhaps its own file.  It has grown very long and doesn't particularly
fit in cmd.c; I don't think it ever belonged there at all unless wizard
mode ^X predates potion of enlightenment.
2008-01-22 04:42:29 +00:00
nethack.rankin
926d9833d3 enlightenment revamp, part II (trunk only)
Split enlightenment output into two sections:  Status and Attributes.
Status began life as the set of bottom line status conditions and steadily
grew to include many things which ought to be such conditions but aren't
because of lack of space there.  It also adds a few missing enlightenment
entries for Underwater (separate from magical breathing), Punished,
trapped, and stuck to cursed saddle.  Most of the lesser status conditions
with bottom line tags (Confusion, Hallucination, &c) used to be shown only
for end-of-game disclosure but now get included all the time.  They aren't
necessarily redundant if/when a very long bottom line is being truncated.

     The ^X changes are still to come.
2008-01-21 19:07:33 +00:00
nethack.rankin
33c14ba523 enlightenment revamp, part I (trunk only)
Groundwork for re-doing ^X so that it'll be more integrated with
enlightenment and display bottom line information without abbreviations
or long-line truncation.  `mode' doesn't do anything yet so may provoke
lint complaints.
2008-01-21 16:40:56 +00:00
keni
f2d37bac2e system-wide configuration file
Add options SYSCF (to add a system-wide configuration file) and SYSCF_FILE
(for a file-based implementation of SYSCF) - this allows a binary distribution
to be configured at install time.  The only option supported at this time is
WIZARDS - a list of usernames which can use -D; currently only for unix-likes
but should be extendable to anything that has a concept of multiple users.
Add mac tty multiuser config using sgid.
2008-01-09 01:57:41 +00:00
nethack.rankin
9c3f6f78b9 win32 vs random.c
From a bug report.
Pointer subtraction yields a result of type ptrdiff_t which can be
bigger than type long, potentially resulting in warnings about value
truncation--in these cases, when assigning to a long.
2007-12-23 00:59:25 +00:00
nethack.rankin
d0a7d15023 drain energy attack (trunk only)
During some recent newsgroup discussion, <Someone> posted an entry from
his personal bug list:  energy draining damage from ordinary attacks is
implemented even though there are no monsters with that capability and it
was not implemented for engulf attacks even though energy vortices have
the capability.  This implements energy drain engulf attacks against the
hero and also both modes of energy drain attacks for monsters and poly'd
hero against spellcasting monsters.  Since monsters don't have energy,
they lose access to their special abilities (their spells, that is) for a
few turns, same as a post-3.4.3 change done for anti-magic traps.
2007-12-20 23:02:47 +00:00
nethack.allison
67d5fb1481 remove time_t from struct you - follow up bit 2007-12-19 03:30:57 +00:00
nethack.allison
d430db0718 remove time_t from struct you (trunk only)
There was an issue reported where save files between different
versions of a manufacturer's compiler were incompatible because the time_t
ubirthday field was changed from 32 bits to 64 bits.

32 bit time_t implementations will break at 19:14:07 on  January 18, 2038.
64 bit time_t implementations will break at 23:59:59 on December 31, 3000.

This removes the dependency on the size of time_t from the save file.
The ubirthday field is no longer embedded in struct you.
This also adds two general purpose routines to hacklib.c, one to convert a time
value to a 14 character char representation and the other to convert that
back to time_t. Those are used by the save/restore routines.

This is a savefile breaking change, so editlevel in patchlevel.h was
incremented.
2007-12-19 03:19:25 +00:00
nethack.rankin
faa3543063 long worm tail hit by potion thrown by monster (trunk only)
From the newsgroup:  when a monster throws a potion at the hero and
it hits a long worm's tail, you'd get "The bottle|flask|&c crashes on the
long worm's _head_ and breaks into shards."  The relevant code changes
"head" to "body" when appropriate, but monster throwing wasn't setting up
`notonhead' so that alteration only kicked in for player throwing.
2007-12-17 23:43:31 +00:00
keni
d454ca0d6e hints cleanup tids (trunk only) 2007-12-17 22:39:15 +00:00
keni
f0abeacb41 hints for linux X11; typo fix (trunk only)
Add hints file for single-user linux X11.
Fix typo in macos-x11.
nethack.sh: don't run xset unless $DISPLAY is set
2007-12-16 15:38:21 +00:00
keni
bd0d01b73d linux hints file and xset bugfix (trunk only)
Add a hints file for an ubuntu tty build and skip xset if no fonts.dir
file exists (this test will probably need another tweak, but I need a
linux x11 build first to test it).
2007-12-16 02:18:22 +00:00
nethack.allison
eb422e65c7 update or remove out of date config files 2007-12-15 14:29:21 +00:00
nethack.allison
671c199be9 update or remove out of date config files 2007-12-15 14:21:09 +00:00
keni
59e64a1d40 First pass at a hints-based build system to augment (not replace) the existing
build system.

Anyone who wants to do a build from sys/unix and doesn't want to figure this
out just needs to do:
	sh setup.sh hints/unix
instead of:
	sh setup.sh
and then continue on as usual.

New files:
sys/unix/NewInstall.unx - the new directions
sys/unix/hints/* - the hints files.  There will be more later.
sys/unix/mkmkfile.sh - helper for setup.sh

Summary of changes:
see NewInstall.unx for info on the new build system
introduction of various preprocessor symbols to turn options off that
 are defaulted on historically
comment out nethackrc (and similar) entries that still use the old symbol
 syntax.
commenting out of Makefile.* lines that now come from hints/unix
GAMEDIR is replaced with HACKDIR so the Makefiles and the C source agree.
  Note that I have NOT changed the docs and/or Makefiles for be, msdos, os2,
  vms, or winnt.  If port maintainers don't then I will, but I can't test
  those ports.
nethack.sh now handles the font path automatically
2007-12-13 20:17:11 +00:00
nethack.rankin
6e41d8e973 obj sanity bit (trunk only)
Remove some redundant declarations from recently revised code.
2007-12-03 21:16:46 +00:00
nethack.rankin
3e42f76244 fix suicidal panic
Some post-3.4.3 code in done() cleans up thrownobj and kickobj to
plug a potential memory leak (unnoticeable one since the game is over),
but they have to be free objects rather than on any list.  toss_up() was
leaving thrownobj defined after putting the thrown object on the floor,
leading to "obj not free" panic from dealloc_obj() if threw you an object
upward and it dealt fatal damage when it fell back down.  (For non-fatal
damage, toss_up()'s caller cleaned things up later.)
2007-12-03 21:13:58 +00:00
nethack.rankin
19d9b34374 jetison old warning code
Get rid of most of the vestiges of the old warning code that was
replaced over 7 years ago.  I left the list of colors which were used for
warning flashes.
2007-12-01 21:07:23 +00:00
nethack.rankin
53d22badf6 fix recent gold drop fix (trunk only)
A recent change to prevent dropping 2**32 gold from producing an
object with quanity 0 also prevented dropping all your gold when omitting
a count.
2007-11-30 07:11:59 +00:00
nethack.rankin
c06c7bbf5e fix recent gold pickup fix
A recent change to delete the floor object sooner when picking up
gold resulted in accessing that object after it had been freed.
2007-11-30 07:10:49 +00:00
nethack.rankin
e2eba2ae9a endgame portal detection (trunk only)
In the newsgroup about three weeks ago someone described trying to
use the Bell of Opening to find the magic portal on the Plane of Water
and not succeeding.  It's supposed to work like a wand of secret door
detection to mark nearby traps as known.  And does, but it turns out
that the wand wasn't working as expected there either.  They both require
line of sight, and since the water outside of the bubbles blocks that
they only found the portal if it was within the same bubble as the hero.
(Clouds on the Plane of Air posed a similar problem, although monster
activity usually reveals the portal on that level so this wasn't much of
an issue there.)  Since the detection magic doesn't require the hero to
see the traps--wand and Bell both work while blind--this patch overrides
the line of sight requirement on the Planes of Water and Air.  As long as
hero is within the detection magic's range, the portals on those levels
will get marked as having been seen and when the hero gets into the right
bubble or out of the clouds the portal traps will be shown on the map.

     The line-of-sight override code is simple-minded and lets players
find traps through boulders when/if those are present (but the found
traps won't be seen yet since vision still controls the map display).
Also, it assumes that only water/air/cloud terrain is present so could
potentially yield strange results if any other terrain gets introduced on
either of those two levels.
2007-11-25 23:03:47 +00:00
nethack.rankin
645461d750 shop gold vs hangup
From the newsgroup:  hangup save while picking up gold from the
floor in a shop would duplicate that gold in the save file.  First the
gold amount was being added to hero's gold, then two messages were given
[pline() or prinv() about pickup followed by one from costly_gold() about
shop credit], and lastly the floor gold would be removed.  The second
message could trigger --More-- and provide a controllable interruption
point between giving the gold to the hero and removing it from the floor.
Change this to do the removal step before feedback.
2007-11-18 19:52:44 +00:00
nethack.rankin
44c1677ac1 open/close while blind (trunk only)
From a bug report, attempting to open or close
a door while blind didn't always update the map display after telling the
player that a remembered-closed door was already open or a remembered-open
door was already closed.  And in the cases where it did update the map to
reflect a change in door state, it didn't use up a turn.  Now always update
the display and use up a turn when 'o' or 'c' reveals any new information.
2007-11-16 06:53:23 +00:00
nethack.rankin
44a7f87c08 fix #H1419 - missing object sanity checks for nested containers (trunk only)
From a bug report, wizard mode's sanity_check
option has a check for container contents but wasn't using it recursively
for nested containers, so the contents of the latter weren't checked.
This fixes that, and also adds a check for objects carried by migrating
monsters.  And it now formats objects and monsters fully even if the hero
happens to be blind or hallucinating at the time.

     Tested by using a debugger to poke in various bits of invalid data.
2007-11-13 21:48:01 +00:00
nethack.rankin
7c860335c1 0 gold pieces (trunk only)
Newsgroup discussion about the devnull tournament which started
today has pointed out that ``d4294967296$'' would cause getobj() to create
a gold piece object with quantity 0 which then got dropped to the floor.
(It's specific to gold; other types of objects don't behave that way.)
Also, wrapping which went past negative and zero all the way to positive
again (like 429496729*10+7, yielding 1) wasn't detected.
2007-11-01 19:24:19 +00:00
nethack.rankin
408a36bc5f shapechanger's inventory (trunk only)
Newsgroup discussion points out that a chameleon which starts out
in nymph form also starts out with nymph's inventory (50% chance each for
mirror and potion of object detection).  That's not right; shapechanging
shouldn't manufacture items.  Also, the post-3.4.3 code to initialize
vampires was overly complicated in order to preserve chameleon behavior,
but the old chameleon initialization which used rndmonst() instead of
selecting a preferred shape was just that way by accident (says the
person who implemented preferred shapes however long ago and completely
overlooked that at the time...).

     This is tricky to test; ^G these days forces a created shapechanger
to start out in its natural form.  That's a bit odd to begin with (a side-
effect of transforming requests for uniques and other special monsters
into doggelgangers), but downright strange when monpolycontrol is enabled;
a prompt to pick monster shape is issued, then the player's choice gets
overridden.  I'm not sure which aspect, if any, of all this should be
changed to fix a wizard mode quirk.
2007-10-31 09:02:31 +00:00
nethack.rankin
96247e7fd9 more vms file access
The fix for #H1409 a couple of days ago included updates for
sys/vms/Makefile.* but not vmsbuild.com.  I thought the latter didn't
need any, but was mistaken; vmsfiles.c needs to be compiled early in
order for vmsfiles.obj to be present in the object library when makedefs
gets linked.
2007-10-31 00:04:32 +00:00
nethack.rankin
a675cc6ed7 vms file access
Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)
2007-10-28 09:37:56 +00:00
nethack.rankin
cac2dd4d33 enlightenment feedback for sight-based properties (trunk only)
"You can see invisible" is misleading when you can't see anything,
so use alternate phrasing for See_invisible when blind.  Also, add extra
wizard mode feedback when blindness is overridden by the monk's Eyes
artifact, when invisibility is blocked by worn mummy wrapping, and when
clairvoyance is blocked by worn cornuthaum.  And fix end-of-game disclosure
for blindness; it was only being shown if/when caused by worn blindfold.
2007-10-26 02:24:22 +00:00
nethack.rankin
bdb0930316 invisibility vs blindness
Reported a month ago by <email deleted>, putting on
a cloak of invisibility while blind and then using ';' or '/' to examine
yourself revealed that you had become invisible.  This fix just changes
the lookat() output when you can't see that you can't see yourself.  :-)
Probing and stethoscope still reveal invisibility, as will any message
which uses x_monnam() to identify the hero.  (First part is intentional;
last part seems not worth bothering about--I'm not even sure that the
player can arrange to trigger it.)
2007-10-26 02:00:43 +00:00
nethack.rankin
aec623602f wizard mode typo
Minor copy+paste carelessness for wizard mode wishing from 7 months ago.
2007-09-28 01:17:24 +00:00
nethack.rankin
24a736684c update tool shopkeeper names list (trunk only)
shknam.c had the same comment typo as the one just fixed in do_name.c.
In the process of fixing it, I noticed that the prefix usage for Janet's
name didn't match that comment.  And in the process of fixing _that_, I
promoted several names from being port-specific to general and added a few
missing ones.  There was no attempt to be comprehensive; I'm sure that lots
of port team members' names are still missing.
2007-09-15 01:56:06 +00:00
nethack.rankin
017888886c comment typo (trunk only) 2007-09-15 01:06:04 +00:00
nethack.rankin
9df113a973 covetous mons vs temple priests (trunk only)
Prevent monsters who kill other monsters to obtain the Amulet from
targetting a priest inside his temple.  Blocks players from just staying
on the Sanctum stairs while a teleporting arch-lich or Asmodeus fetchs the
Amulet from Moloch's high priest for them.  A previous post-3.4.3 change
prevented monsters from targetting the Wizard; this extends that (and
assumes that we can ignore the possibility of other temple priests ever
handling the Amulet).  The earlier patch went into the branch code, but
inhistemple() isn't available there so this one is trunk only.
2007-09-13 01:00:05 +00:00
nethack.rankin
01f954a855 fix #H1378 - vault guard interaction while swallowed
From a bug report, if you're swallowed
while in a vault and the guard arrives, he'll ask your name even though
you're hidden within the engulfer.  This makes him give a message and
then leave, as is already done if you're mimicking an object or unable to
speak.

     This also suppresses his repeated "Move along!" message if you're
swallowed or held since it's silly to keep telling you to move when you
obviously can't.
2007-09-01 01:12:34 +00:00
nethack.rankin
eca287ab89 feedback from exploding potions of acid (trunk only)
water_damage() gave "A potion explodes!" when destroying potions of
acid even when it was a stack of multiple potions exploding.  The vague
fixes entry "grammar, spelling and other typos" covers this one....
2007-08-25 00:32:10 +00:00
nethack.rankin
bd6e98e092 comment bit
Full moon and Friday the 13th affect Luck's equilibrium point, but
not its range (which is always -10 to +10 for natural luck, -13 to +13
when extended by luck-conferring objects).  The water_damage() comment
implying that max Luck could be 14 during a full moon was incorrect.
2007-08-23 22:56:05 +00:00
nethack.rankin
47c9aa0ff6 fix pet feeding feedback (trunk only)
From a bug report, unseen pet sensed by
telepathy was referred to as "it" in the message given when it ate food.
This code is subtly convoluted and has now been changed at least four or
five times over the years.  This patch changes the terse comment to try to
spell out the intent.  Whether or not the new code actually matches that
intent remains to be seen....
2007-08-20 23:32:42 +00:00
nethack.rankin
86fccb4e1a re-fix #H1371 - dead monster fleeing
From a bug report, a monster which
died by moving into a trap which was next to the hero standing on Elbereth
resulted in "The <mon> is killed!  The <mon> turns to flee!".  An earlier
change made monflee() return if it's given a dead monster, so the fleeing
message is no longer given.  This fixes the place where monflee() was
inappropriately being called for a dead monster in the reported situation.
2007-08-20 00:05:24 +00:00
nethack.rankin
6bf7c5a1eb tin access (trunk only)
From the newsgroup:
	The tin opens like magic!
	<some interruption occurs>
	You stop opening the tin.
Either it opens immediately or it doesn't, so the "opens like magic"
message is inaccurate.  Rather than simply changing the phrasing, this
gives blessed tins a 50% chance to really open immediately so that their
contents are available for eating on the same turn, and 50% to behave as
before but with a message which is suitable for the single turn delay.
Hero poly'd into a metalivore always gets the same-turn case when eating
any tin.  Use of a tin opener has a chance to do so (always when blessed,
50/50 for same-turn vs 1 turn delay when uncursed, 33/33/33 same-turn or
1 or 2 turn delay when cursed).

     Overall, blessed tins are better than they used to be, since half
of the time you'll save a turn, but they're still not reliable to eat in
the midst of combat since sometimes you'll need another turn and will be
likely to get interrupted in that situation.  Uncursed tin openers still
give the same behavior as opening blessed tins, so are also better than
they used to be.  Blessed tin openers are now superior, and cursed ones
are slightly inferior in addition to being welded to hero's weapon hand.
2007-08-09 03:20:24 +00:00
nethack.rankin
1c545eb678 drawbridge feedback (trunk only)
The open and close commands had some feedback when player attempted
to use them on a drawbridge, but they didn't handle all the permutations.
2007-08-03 01:49:33 +00:00
nethack.rankin
4e8bf12014 fix #H1232 - hole in ice is described as moat [2 of 2] (trunk only)
Adding an extra parse rule changes yacc's tables and has produced a
large diff for a small update.
2007-08-03 01:09:13 +00:00
nethack.rankin
4c83db0294 fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.
2007-08-03 01:05:50 +00:00
nethack.rankin
1a1373c3d7 rogue level display symbols (trunk only)
Michael pointed out what needed to be fixed in order to change gold
on rogue level from regular "$" back to intended "*".  This was post-3.4.3
code so no fixes entry needed.
2007-07-31 03:00:41 +00:00
nethack.rankin
03eb70acab fix segfault from splitting 1hp long worm
Fix the crash From a bug report, where
having the hit that cuts a long worm into two also take the original down
to 1 HP would result in clone_mon() returning null and nethack crashing due
to a segmentation fault or access violation.  The same thing could happen
if there's been enough long worms created to get them flagged as extinct.

     This bug was only present in 3.4.3.  Prior to that, cut_worm() did
its own monster creation inline instead of calling clone_mon(), ignoring
extinction and too-low hit points.
2007-07-28 03:26:45 +00:00