Commit Graph

148 Commits

Author SHA1 Message Date
nhmall
353417c642 Merge branch 'master' into win32-x64-working
Conflicts:
	src/mon.c
	src/options.c
	src/pickup.c
	src/zap.c

 Changes to be committed:
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   doc/fixes35.0
	modified:   include/color.h
	modified:   include/extern.h
	modified:   include/mondata.h
	modified:   src/ball.c
	modified:   src/dbridge.c
	modified:   src/dig.c
	modified:   src/display.c
	modified:   src/dokick.c
	modified:   src/dungeon.c
	modified:   src/fountain.c
	modified:   src/invent.c
	modified:   src/mkmaze.c
	modified:   src/mkobj.c
	modified:   src/mon.c
	modified:   src/monmove.c
	modified:   src/mthrowu.c
	modified:   src/options.c
	modified:   src/pickup.c
	modified:   src/sit.c
2015-04-30 06:39:44 -04:00
PatR
b4741d6206 more BUCX: union vs intersection
Fix filtering used by the 'D' command, and a few other activities that
allow both object class filtering and bless/curse state filtering, so
that when both class(es) and state(s) are specified, objects need to
match both rather than either.  D?C will present the player with cursed
scrolls to drop rather than all scrolls plus all other cursed objects.

This also fixes another instance when gold could end up with its bknown
flag set.
2015-04-27 01:22:39 -07:00
nhmall
c78d09a7d4 Merge branch 'master' into win32-x64-working
Conflicts:
	include/extern.h
	src/do.c
	src/mon.c

 Changes to be committed:
	modified:   include/extern.h
	modified:   src/ball.c
	modified:   src/do.c
	modified:   src/eat.c
	modified:   src/hack.c
	modified:   src/invent.c
	modified:   src/lock.c
	modified:   src/mon.c
	modified:   src/pickup.c
	modified:   src/pline.c
	modified:   src/save.c
	modified:   src/sp_lev.c
	modified:   src/steed.c
	modified:   src/trap.c
	modified:   src/uhitm.c
2015-04-22 08:08:50 -04:00
Pasi Kallinen
6d4aa312e6 Unify hero free hand check and msg 2015-04-22 09:02:38 +03:00
nhmall
63291b3f98 Merge branch 'master' into win32-x64-working 2015-04-17 00:34:43 -04:00
Pasi Kallinen
e77ea2ae61 Prevent segfault when looking around inside monster
A recent change by me introduced a segfault when
counting swallowed hero as a monster inventory item.
2015-04-15 17:06:44 +03:00
nhmall
2cfa05cde1 Merge branch 'master' into win32-x64-working
Conflicts:
	include/config.h
	include/extern.h
	src/do.c
	src/files.c
	src/hack.c
	src/mkobj.c
	src/mon.c
	src/objnam.c
	src/vision.c
	sys/share/pcmain.c
	win/share/other.txt
	win/share/renumtiles.pl
2015-04-12 00:15:40 -04:00
Pasi Kallinen
cc1b5de2a8 Fix warnings, unused and shadowed variables 2015-04-10 20:55:24 +03:00
Pasi Kallinen
92a7962399 Add sortloot -patch
Adds the "sortloot" compound option, with possible values
of "none", "loot", or "full".  It controls the sorting of
item pickup lists for inventory and looting.
2015-04-09 18:23:54 +03:00
Derek S. Ray
b4142b5894 Merge branch 'master' into win32-x64-working
* master: (354 commits)
  Add missing protos
  a warning bout lc_error
  Add S_poisoncloud to Guidebooks
  ...

Conflicts:
	.gitattributes
	dat/.gitattributes
	doc/.gitattributes
	doc/Guidebook.mn
	include/config.h
	include/decl.h
	include/extern.h
	include/flag.h
	include/hack.h
	include/ntconf.h
	include/sys.h
	include/wceconf.h
	src/apply.c
	src/attrib.c
	src/bones.c
	src/botl.c
	src/dbridge.c
	src/dig.c
	src/do.c
	src/do_name.c
	src/dog.c
	src/dungeon.c
	src/eat.c
	src/end.c
	src/files.c
	src/fountain.c
	src/hack.c
	src/invent.c
	src/light.c
	src/makemon.c
	src/mhitu.c
	src/mklev.c
	src/mkmaze.c
	src/mkobj.c
	src/mkroom.c
	src/mon.c
	src/objnam.c
	src/options.c
	src/pager.c
	src/pickup.c
	src/potion.c
	src/pray.c
	src/questpgr.c
	src/read.c
	src/restore.c
	src/rnd.c
	src/role.c
	src/rumors.c
	src/save.c
	src/shk.c
	src/sit.c
	src/sp_lev.c
	src/sys.c
	src/teleport.c
	src/trap.c
	src/u_init.c
	src/uhitm.c
	src/wield.c
	src/worn.c
	src/zap.c
	sys/amiga/.gitattributes
	sys/mac/.gitattributes
	sys/msdos/.gitattributes
	sys/msdos/pctiles.c
	sys/msdos/vidvga.c
	sys/os2/.gitattributes
	sys/share/.gitattributes
	sys/share/pcmain.c
	sys/unix/.gitattributes
	sys/unix/hints/.gitattributes
	sys/unix/sysconf
	sys/unix/unixmain.c
	sys/vms/.gitattributes
	sys/wince/.gitattributes
	sys/wince/mhstatus.c
	sys/winnt/.gitattributes
	sys/winnt/Makefile.msc
	sys/winnt/nhsetup.bat
	util/lev_comp.l
	util/makedefs.c
	win/X11/winmenu.c
	win/X11/winstat.c
	win/gnome/gnstatus.c
	win/share/tilemap.c
	win/tty/termcap.c
	win/tty/topl.c
	win/tty/wintty.c
2015-04-05 23:42:15 -04:00
Pasi Kallinen
411ee58593 Add more explicit helpless reasons
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"
2015-03-29 22:12:19 +03:00
Pasi Kallinen
b17ecb149b Use existing function to count containers 2015-03-28 16:24:25 +02:00
Pasi Kallinen
f41c51aef0 Show object symbols in menu headings
... in menus where those object symbols act as menu accelerators.
Toggleable via "menu_objsyms" boolean option, defaults to off.
2015-03-25 22:13:28 +02:00
Pasi Kallinen
debdf7ca48 Move some hard-coded string arrays into data files.
Random epitaphs, engravings and hallucinatory monsters now
live in text data files.
2015-03-18 22:05:10 +02:00
PatR
ad03a7fb7a some lint cleanup 2015-03-16 19:22:49 -07:00
PatR
14525ed0c6 DEBUG/debugpline() fixup
* Replace variadic debugpline() with fixed argument debugpline0(str),
   debugpline1(fmt,arg), and so on so that C99 support isn't required;
 * showdebug() becomes a function rather than a macro and handles a
   bit more;
 * two debugpline() calls in light.c have been changed to impossible();
 * DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES
   setting in !SYSCF configuration (I hope that's temporary).
2015-03-15 18:02:26 -07:00
Pasi Kallinen
c0a5b49e62 Use a menu to loot multiple containers
When looting a location with multiple containers, show a menu for user
to pick the containers to loot instead of asking a yes/no question for
each container.
2015-03-09 21:08:42 +02:00
keni
6fd30ab1ce Manually fix botched NHDT-Branch expansions. 2015-03-01 20:32:28 -05:00
Derek S. Ray
b1a7bbbbdb pull in the recent unconditionals merge from master 2015-02-27 21:25:00 -05:00
Derek S. Ray
4dddb97301 remove and transfer INVISIBLE_OBJECTS to branch 2015-02-27 19:34:32 -05:00
Sean Hunt
74e741bbbc Make AUTOPICKUP_EXCEPTIONS unconditional. 2015-02-27 19:33:50 -05:00
Pasi Kallinen
612852f7de Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.
Move debugging output into couple preprocessor defines, which
    are no-op without DEBUG.  To show debugging output from a
    certain source files, use sysconf:

    DEBUGFILES=dungeon.c questpgr.c

    Also fix couple debug lines which did not compile.

This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
2015-02-27 19:33:45 -05:00
Sean Hunt
ac108cd365 Make GOLDOBJ unconditional. 2015-02-27 19:33:40 -05:00
Sean Hunt
9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
b94f26a8c8 some lint bits (trunk only) 2012-02-16 03:01:38 +00:00
keni
86e9b65d20 again, looking for that failure condition: pager.c pickup.c 2011-12-30 23:58:48 +00:00
nethack.rankin
d592b9c4ae sokoban completion (trunk only)
Something I've had in mind for a long time and finally gotten around
to implementing:  when you fill in the last pit or hole of a sokoban level,
it's considered to be completed so luck penalties for unsokobanish things
(breaking a boulder, dropping everything and squeezing onto a boulder's
spot, reading a scroll of earth) stop being assessed and most Sokoban-
specific movement restrictions (against pushing boulders diagonally,
squeezing diagonally between boulders, floating over a pit or hole without
falling in, digging of new holes by monsters) are lifted.  Teleporting,
level teleporting, and phasing through walls are still prohibited when in
the sokoban branch of the dungeon.  (Keeping the non-phasing one in place
prevents taking a shortcut to the final prize in order to bypass the
treasure zoo monsters.)

     This adds level.flags.sokoban_rules, defines Sokoban macro to access
it, and replaces most In_sokoban(&u.uz) tests to check it instead.  It
gets set when a sokoban level is pre-mapped at the end of level creation,
and if it is set then whenever a trap is deleted, the flag gets cleared
if there are no more pits or holes present on the level.
2011-08-30 22:13:27 +00:00
nethack.rankin
3e44a5fcdc fix #2236 - bag of holding weight
From a bug report, the weight of a non-cursed bag
of holding would be off by 1 when the weight of contents was a multiple
of 2 (for uncursed) or of 4 (for blessed), since the round off handling
added 1 when it shouldn't in those cases.  Mainly noticeable when empty;
the extra 1 unit made it be twice as heavy as it should have been.

     Probably never noticed in actual play.  He has implemented a patch
which shows weights as part of an object's formatted description, making
this stand out.  Supposedly the Vulture's Eye interface also added a
patch like that a farily long time ago; I wonder why nobody using it ever
noticed.  (Maybe the weight was suppressed for bags of holding there?)
2011-04-09 00:30:59 +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
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
1ab038dca5 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.
2009-03-28 01:36:12 +00:00
nethack.rankin
6202d5971e fix #1727 - offering Rider corpses (trunk only)
The report that killing a Rider on an altar allowed you to sacrifice
its corpse was a wizard mode-only phenomenon in 3.4.3 (because you needed
to use an altar at some location other than the Astral Plane, hence also
needed to use ^G to get the Rider there), so not really a bug.  But a
post-3.4.3 change has made it possible to offer corpses from the floor on
the astral level, unintentionally making it possible to sacrifice Rider
corpses.  This makdes #offer check specifically for them and trigger their
revival if the attempt is made, same as done by pickup.
2008-10-09 23:55:43 +00:00
nethack.rankin
9f2322b1f8 tweak probing while swallowed (trunk only)
Follow up to the patch that adds a fake inventory entry for the
swallowed hero when probing an engulfer.  Make the header for the hero
be plural to match those of object classes, and prefix the hero entry
itself with a/an to reflect its count of 1.
| Swallowed Creature              ->  Swallowed Creatures
| > - elven ranger called wizard  ->  > - an elven ranger called wizard
2008-03-22 17:32:10 +00:00
nethack.rankin
17f63949bc probing while swallowed (trunk only)
Reported recently by <Someone>:  probing feedback while engulfed
shouldn't claim that the monster is not carrying anything when the hero
is inside of it.  The simple case where it's not carrying anything else
was a trivial one line change; handling inventory plus hero was trickier
and I wouldn't have bothered if I'd realized what it was going to take.
But it's done now; trivial case
        The purple worm is not carrying anything besides you.
and harder case
        The purple worm's possessions:
        Weapons
        a - an uncursed dagger
        Swallowed Creature
        > - human archeologist called wizard
2008-03-21 03:12:14 +00:00
nethack.rankin
da172c5773 identify_pack (trunk only)
Three years ago <email deleted> reported that
stepping off the end of inventory via typing space to go to the next menu
page wasted his identify scroll.  He suggested that some people might do
that because they don't know how to back up in a multi-page menu.  I
pointed out the Guidebook section that describes < and ^ to go back one
page or back to start and left things at that.  However, traditional mode
reprompts if you step through all of inventory without choosing something,
so this changes identify-via-menu to do likewise.  You can dismiss the
menu with ESC to really avoid choosing anything.

     This also makes identification of N items when you're carrying N or
fewer unID'd things behave the same as identify all:  identify everything
without any prompting.
2008-02-16 02:31:34 +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
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
2ad3afee05 GOLDOBJ pickup handling (trunk only)
For GOLDOBJ configuration, relax the 52 object limit for inventory
when gold uses the special $ slot instead of a letter.  Takes care of an
old buglist entry from the beta testers.  [It will need to be revisited
if we ever implement multiple coin types that can't all fit in one slot.]

     Also for GOLDOBJ, prevents nymphs and monkeys from stealing coins,
since allowing that made their steal-item attack be a complete superset
of leprechaun's steal-gold attack.
2007-06-16 02:22:01 +00:00
nethack.rankin
4f380c3128 carry_count
Simplify the GOLDOBJ/!GOLDOBJ handling in carry_count().  Aside from
the initial gold amount, the conditional code was all duplicated.
2007-04-26 00:51:23 +00:00
nethack.rankin
dd66bff416 couple of #tipping bits (trunk only)
Adjust some post-3.4.3 code.  Give feedback if you try to use #tip
on a statue--since it's a form of container, simple "nothing happens"
seems inappropriate.  (Unfortunately, the alternative used here isn't
much better.)  Also, you can use #tip to empty an inventory container
while swallowed; it was giving inappropriate levitation and drop-on-altar
behavior in that situation.
2007-02-22 05:16:58 +00:00
nethack.rankin
7abf238f1b probing vs Schroedinger's Cat (trunk only)
Someone in the newsgroup complained about zapping probing at a large
box dropped by a quantum mechanic and being told that it was empty rather
than that it held a corpse or live cat.  This sidesteps the issue by
reporting "the box seems empty" instead of "the box is empty", and not
setting its contents-known flag.  (That message is the main difference
between probing and the assorted other methods of observation [telepathy
and monster detection and possibly Warning for live cat, object detection
and food detection for dead cat's corpse] which might be expected to
trigger the cat's fate but don't.)  This also makes probing of self and
of monsters set the contents-known and locking-known flags for containers
in inventory, same as is done for probing which hits objects.  (Display of
container contents still only occurs for loose objects, not in inventory.)
2007-02-18 02:20:59 +00:00
nethack.rankin
0bd89ff28d Confused #loot (trunk only)
Attempting to loot while suffering from confusion and not on top
of a container will drop gold if hero is carrying some, but it behaved
differently for GOLDOBJ config (gold dropped over a hole or down stairs
always stayed on current level) than for !GOLDOBJ (gold had a chance to
fall to lower level) when done at some location other than a throne.
This makes GOLDOBJ use dropx() instead of dropy(), same as !GOLDOBJ.

     And with access to a throne it can be used to repeatedly summon
monsters until they're extinct.  This makes it check for confusion before
finding containers, but the chest/exchequer code doesn't always kick in
so can't be attempted as many times before confusion expires, throttling
summoning a little.  Also, when placing hero's gold into a chest, it now
clears the contents-known flag and relocks the chest.
2007-01-25 05:01:01 +00:00
nethack.rankin
b6778e36cf !GOLDOBJ gold in inventory during save/restore (trunk only)
Simplify the save/restore handling the !GOLDOBJ config does for gold
to maintain save/bones file compatibility with the GOLDOBJ config.
2007-01-12 04:18:40 +00:00
nethack.rankin
21caf64b86 !GOLDOBJ gold in inventory (trunk only)
Simplify the insertion into and removal from of gold in inventory for
the !GOLDOBJ configuration.  If GOLDOBJ ever becomes unconditional this
will be superfluous, but in the mean time it unclutters the container and
drop code.  Also, tweak a recent getobj() hack so that its purpose might
be a bit clearer.
2007-01-06 04:53:56 +00:00
nethack.rankin
f919f69251 container message tweaks (trunk only)
"You carefully open the <container>..." is rather tedious after
you've opened that container multiple times, so omit "carefully" once the
contents and lock-status are both known.  (I don't think it's possible
for a container to still be trapped in such circumstances, but even if it
is, you'll now stop being careful....)

     "<The container> is empty." becomes "<The container> is now empty."
if it just released Schroedinger's Cat.  Do the same if a cursed bag of
holding just destroyed the last of its contents.  Also, there's no need
to count the number of items inside a container; that dates to before the
container-and-contents overhaul done for 3.1.0.

     And for the loot menu, change "q - do nothing" to "q - done" if some
prior action (prodding the Cat into life or death, loss of any cursed bag
contents, or using ':' to look inside when contents aren't yet known) has
been enough to cause this container access to use up a turn.  I haven't
bothered to do the same in the help text for non-menu looting, which seems
like more trouble than it'd be worth.
2007-01-06 02:18:49 +00:00
nethack.rankin
448b7cc7b6 streamlined container interface (trunk only)
Reduce the number of questions issued when applying or looting a
container, and offer the opportunity to put things inside before taking
things out.  Instead of "Do you want to take something out?  [:ynq]",
followed by "Do you want to put something in? [ynq]", this gives just one
prompt; the result is similar to menustyle:full where you start out by
choosing between out, in, and both.  There are now two additional choices:
reversed, for both in the opposite order, and stash, to put a single item
inside.  Prompt phrasing is rather clumsy; I wanted to keep it short:
"Do what with <the container>? [:oibrsq or ?]", where picking '?' pops
up a brief help window.  Inappropriate choices (like 'o'and 'b' when
container is empty) are suppressed from the prompt but still acceptable as
input; " or ?" is suppressed if the cmdassist option has been toggled off,
but entering '?' still works to get help.

     Menu mode wouldn't allow 'b' when inventory was empty, despite the
fact that first taking things out might change that.  Now 'b' is a viable
choice if the container isn't empty, and the new 'r' is a vialble choice
when inventory isn't empty even if the container is.
2007-01-04 06:15:25 +00:00
nethack.rankin
c45ce7a999 container groundwork / splitting welded weapons (trunk only)
Some miscellaneous changes preparatory to enhancing the container
interface.  This also fixes a minor inconsistency in object manipulation:
askchain() wouldn't let you split a stack of welded weapons but getobj()
would, so you couldn't get rid of part of the stack using 'D' or #loot,
but you could with 'd' (and post-3.4.3, with #adjust).  Now getobj() will
behave like askchain(); if you have 3 cursed daggers welded to your hand,
you won't be able to drop 1 or 2 of them anymore.
2007-01-04 05:46:14 +00:00
nethack.rankin
1354b380b5 couple of container bits (trunk only)
Don't use the phrase "seems to be locked" when you discover that a
container is indeed locked.  Also, using an alternate naming routine is
a simpler way to avoid redundant "the empty <container> is empty" than
suppressing the contents-known handling for xname.
2006-12-28 03:18:51 +00:00
nethack.rankin
f8f5642d3a #tipping shop containers (trunk only)
Using #tip (post-3.4.3 code) on a container that's on a shop floor
didn't handle ownership correctly.  Bag of tricks could be emptied for
free, and contents of other containers were being sold to the shop even
when the shop already owned them.  This fixes bag of tricks and makes a
first cut at doing so for regular containers.

     Message handling when #tipping any bag of tricks was also suboptimal
since the decision about message delivery was made again as each charge
released something instead of waiting until the whole bag was emptied.
So you could get inappropriate "nothing seems to happen" before or after
a monster visibily popped up if something unseen was also produced.
2006-11-09 06:36:36 +00:00