Commit Graph

59 Commits

Author SHA1 Message Date
nethack.rankin
6218a0eee2 overview disclosure (trunk only)
Add 'o' to "i a v g c" disclosure set, to display final dungeon
overview at end of game.  It lists all levels visited rather than just
those that #overview considers to be interesting, but it doesn't reveal
any undiscovered aspects of those levels except for the presence of bones.
(I think revealing shops and altars and such would be worthwhile, but the
data for that isn't handy at the time.)  If the game ends due to death,
the bones section of the current level will have "you, <reason you died>"
(before any real bones entries for that level).  That occurs before bones
file creation so it doesn't give away whether bones are being saved.

     end.c includes some unrelated lint cleanup.

     Guidebook.{mn,tex} updates the section for autopickup_exceptions as
well as for disclose.  It had some odd looking indentation due to various
explicit paragraph breaks.  I took "experimental" out of its description
since it was moved out of the experimental section of config.h long ago.
The revised Guidebook.tex is untested.
2012-04-09 02:56:37 +00:00
arromdee
2a2e2b299e I haven't been active in the past decade, but here's a small patch. Main
branch only.  This adds a check when setting a new fruit so that if no fruits
have been created since the last time the option has been set, the current
fruit is overwritten.  Result: the user cannot repeatedly set the fruit
option and overflow the maximum fruit number.
2011-12-11 18:11:29 +00:00
nethack.rankin
e055b2820e hangup vs u.uinwater again (trunk only)
Redo the fix that prevents hangup from putting hero on top of water
if it occurs during magic mapping or object/gold/trap detection.  Instead
of copying u.uinwater into another field in struct u so that it can be
reset during restore, copy it into a new field in struct iflags and reset
it during save so that no fixup upon restore is needed.
2011-11-30 18:52:28 +00:00
nethack.rankin
171721adda fix W343-7 - strange topten output on Windows
Using the two Windows binaries, starting a game with the tty
interface (nethack.exe) and saving, then restoring and finishing with
the win32 interface (nethackW.exe) would display the topten output as a
series of popup windows displaying one line at a time.  The win32 binary
forces the toptenwin option to 1, but when restoring a saved game that
would get overridden by data from the save file and could end up 0.

     This change keeps the toptenwin option out of save files, like color
and other display-oriented features that might not be applicable when
restoring on something with different capabilities.  Separate binaries
for alternate interfaces aren't quite the same situation, but close enough.
The toptenwin option can still be toggled interactively with 'O', but the
new value will disappear if you save rather than finish.  Setting it once
via config file or environment variable is the preferred way to go if you
want to override the default behavior.

     Both trunk and branch get iflags.toptenwin added.  For the trunk,
flags.toptenwin is simply deleted and patchlevel.h's EDITLEVEL is bumped.
For the branch, flags.toptenwin is renamed and becomes unused, while
EDITLEVEL is left alone.  Leaving a dummy field in the old toptenwin slot
of struct flags preserves save file compatability with 3.4.3.
2011-09-19 03:08:39 +00:00
nethack.rankin
8a66aa38df additional paranoia (trunk only)
A couple of extensions to the paranoid_confirmation option:

1) add paranoid_confirmation:Confirm -- setting this means that any
prompt where the other paranoid_confirm flags have been set to require
a yes response instead of y to confirm also require explicit no rather
than arbitrary non-yes to reject.  It will reprompt if you don't answer
"yes" or "no" (unless you use ESC, which is treated the same as "no").

2) add paranoid_confirmation:bones -- control whether the "save bones?"
prompt in wizard mode requires yes instead of just y.  The original user-
developed paranoid_confirm patch required yes unconditionally here, and
I left that out thinking it was undesireable.  But after testing the
"your body rises from the dead as <undead>..." fix a couple of days ago,
where you now get an extra message and consequent --More-- prompt just
before "save bones?", I've changed my mind about its usefulness, provided
that it's settable rather than unconditional.

     Handling paranoid_confirmation:bones outside of wizard mode is a
bit tricky.  Right now, it can still be seen via 'O' if it has been set
in NETHACKOPTIONS, but it won't show up in the menu if you use 'O' to
interactively change the value of paranoid_confirmation.  I'm not sure
whether that's the right way to go; it might be better to let non-wizard
users uselessly toggle it on and off rather than only partially hide it.
Or maybe it should be hidden from the current value even when it's set.
Or decline to set it in first place, despite external option settings.
2011-04-25 03:29:49 +00:00
nethack.rankin
2f1813cdd8 altmeta Alt key hack, mainly for unix (trunk only)
Some time ago we received a patch submission which attempted to
handle the Alt key for terminals or emulators which transmit two char
sequence "ESC c" when Alt+c is pressed, but I can't find it.  I don't
remember the details but recall that it had at least once significant
problem (perhaps just that it was unconditional, although it may have
been implemented in a way which interferred with using ESC to cancel).

     This patch reimplements the desired fix, making the new behavior be
conditional on a boolean option:  altmeta.  That option already exists
for the Amiga port, where it deals with low-level keyboard handling but
essentially affects the same thing:  whether Alt+key can be used as a
shortcut for various extended commands.  This one affects how the core
processes commands, and is only available if ALTMETA is defined at
compile time.  I've defined that for Unix and VMS; other ports don't
seem to need it.  (I'm not sure whether "options" created by makedefs
ought to mention it.  So far, it doesn't since this isn't something
users are expected to tweak.  The setting of the non-Amiga altmeta
option doesn't get saved and restored, so won't affect saved data if
someone does toggle ALTMETA and then rebuild.)

     When [non-Amiga] altmeta is set, nethack's core will give special
handling to ESC, but only during top level command processing.  If ESC
is seen while reading a command, it will be consumed and then the next
character seen will have its meta bit set.  This introduces a potential
problem:  typing ESC as a command will result in waiting for another
character instead of reporting that that isn't a valid command.  Since it
isn't a valid command, this shouldn't be a big deal, but starting a count
intended to prefix your next command and then typing ESC after deciding
to abort that count runs into the same situation:  nethack will wait for
another character to complete the two character sequence expected for
"ESC c".  There's not much that can be done with this, other than have
the Guidebook mention that an extra ESC is needed to cancel the pending
count, because digits followed by ESC could actually be a numeric prefix
for Alt+something rather than an attempt to abort the count.
2011-04-19 02:02:11 +00:00
nethack.rankin
fa6098bfd4 paranoid_confirmation [expanded user patch] (trunk only; 1 of 2)
[Long writeup committed with flag.h and options.c only.]

     This is a reworking of a user contributed patch available in Pasi
Kallinen's NetHack Patch Database at http://bilious.homelinux.org under
the name "Paranoid_Quit".  It was created by David Damerell and extended
by several others, and I haven't attempted to preserve attribution.

     Their patch added three new boolean run-time options (this one
doesn't; details below):

paranoid_quit: if true, change the "really quit?" prompt to require an
  answer of yes rather than just y to quit, presumeably for players who
  type faster than they read and think (been there, done that...).  It
  also applies to the "do you want to enter explore mode?" prompt.  The
  changed prompt shows yes and no rather than yn as possible answers.
  After having used it a few times, I find it easily noticeable that
  "yes"<return> is expected instead of just single keystroke 'y', and
  if you mess up somehow you can just reissue the #quit or X command
  with no harm done.  (And the default setting is off; the game still
  issues the original yn prompt.)

paranoid_hit: if true, make a similar change for the "really attack <the
  peaceful monster>?" prompt.  Definitely helpful if you bump into a
  monster while in the midst of using 'y' to move diagonally upper left.
  Note that this just changes the expected/required answer to an existing
  prompt; it doesn't change interaction between the hero and monsters.

paranoid_remove: if true, the 'R' and 'T' commands will prompt the player
  to select an appropriate item from inventory even when there's only one
  applicable item (instead of simply removing or taking off that only
  item).  Helpful if you think you've got more than one thing on and
  intend to take off something other than the last one (which might be a
  ring of levitation keeping you from dropping into lava or a blindfold
  and you're trying to play the whole game blinded).

Their patch also made two other changes which weren't controllable via
options:  when dipping, after picking what to dip, mention it in the
second prompt for what to dip into; and require yes instead of y at the
wizard mode "save bones?" prompt.  We've had the enhanced dipping prompt
for a while, and "unknown" installed a fix-up (which wasn't needed with
their version) for it recently.  I've left our bones prompt alone, the
original yn query.  Anyone who saves bones by accident can remove them,
if not externally they by using wizard mode to revisit the same dungeon
depth, load the bones, and unlink them.

#####
     That's a summary of the contributed patch.  Now for the implemented
one....  Instead of separate booleans, this adds a single compound option
called "paranoid_confirmation" that takes a string argument of space
separated words:  "quit die attack pray Remove".  And it puts the actual
yes vs y querying into a new routine instead of duplicating it at each
affected prompting location.

paranoid_confirm:quit - as above, if true then require yes instead of y
  to answer the "really quit?" and "do you want to enter explore mode?"
  prompts.  Can also be supplied as paranoid_confirm:explore or even
  "quit explore" but that's just redundant; it's a single flag which
  controls prompting for both game-ending or game-altering commands.

paranoid_confirm:die - applicable only for explore and wizard modes but
  visible/settable during option viewing/changing in normal play.  If
  true then require yes instead of y at the "die?" prompt.  This wasn't
  part of their original patch, but should have been since the effect
  of accidental y is just as drastic as unintentionally quitting.

paranoid_confirm:attack - as above, yes vs y for "really attack <the
  peaceful monster?".  Can also be supplied as paranoid_confirm:hit.

paranoid_confirm:pray - supersedes the existing prayconfirm boolean.
  That option is still accepted and honored duing config file processing,
  but option viewing/changing with 'O' only handles the new variant.
  This does not control "yes" vs 'y', but rather whether there's a prompt
  first or prayer simply starts.  When used, the prompt itself is the
  same yn one already being asked with prayconfirm.  Presumably config
  file support for prayconfirm will go away in some future version.
  Unlike the other paranoid settings, this one defaults to 'on' in order
  to match the 3.3.0 through 3.4.3 behavior controlled by prayconfirm,
  whose default was on (but maybe should have been off...).

paranoid_confirm:Remove - as above, causes the 'R' and 'T' commands to
  use a "what do you want to remove?" or "what do you want to takeoff?"
  inventory selection prompt even when only one accessory or piece of
  armor is worn.  Player can pick the inventory letter and remove/takeoff
  the item, use ? or * to see what the candidate item is, or cancel with
  ESC.  Can be supplied as paranoid_confirm:takeoff or "remove takeoff",
  but like with "quit explore", a single flag controls the behavior of
  both 'R' and 'T'.

Option file processing accepts two other settings, paranoid_confirm:none
and paranoid_confirm:all, but those are not available (nor needed) when
using the 'O' command.  "none" is useful because it's the value shown to
the player by 'O' when none of the paranoia flags are set, and it's a
way to turn off paranoid_confirm:pray without turning on any of the other
choices.  "all" probably isn't very useful but was trivial to tack on.

     This is an example of the menu that 'O' puts up after picking option
paranoid_confirmation from the main list.  I've shifted everything left
to reduce whitespace here; it appears on the right side of the screen for
tty menuing.

  Actions requiring extra confirmation:

  q - yes vs y to quit or to enter explore mode
  d - yes vs y to die (explore mode or debug mode)
  a - yes vs y to attack a peaceful monster
  p + y to pray (supersedes old "prayconfirm" option)
  R - always pick from inventory for Remove and Takeoff
  (end)

Currently set paranoia features are marked as preselected and can be
toggled off along with toggling any others on as desired.  I've just
realized that this menu relies on showing entries marked via preselection
rather than explicitly annotating each one as [on] or [off]; that seemed
perfectly natural during testing so I think I'll leave it this way, at
least for the time being.
2011-03-05 10:08:38 +00:00
keni
df20791e59 Add RCS version lines 2009-05-06 10:45:32 +00:00
nethack.rankin
44cc716fe4 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.
2009-03-22 00:23:57 +00:00
nethack.rankin
b12d8522c5 Sunsword redux (trunk only)
This started out as a one line change.  After I saw someone in the
newsgroup mention that Sunsword's light was inferior to that of a lamp,
I decided to make it work better (than in 3.4.3, that is, becoming the
same brightness as a lamp) when blessed and worse when cursed (useless to
hero but still visible if wielded by a monster).  But then it needed to
change light radius when its curse/bless state changed, and it needed
message feedback when doing so, and that got kind of complicated.  I
wouldn't have bothered if I'd known what I was getting into, but I don't
want to throw it away now that I've done all this work....

     Sunsword now gives a light radius of 3 when blessed (same as a lit
lamp), radius of 2 when uncursed (same as a lit candle and as it has been
providing since added in 3.4.0), and a radius of 1 when cursed (nearly
but not completely useless, as mentioned above).  Also, it now "shines"
rather than "glows" since we usually use the latter for temporary effects.
2009-01-24 01:44:29 +00:00
nethack.rankin
8c90e9ae7b fatal explosion feedback (trunk only)
From the newsgroup:
    As you read the scroll, it disappears.
    The scroll erupts in a tower of flame!
    Your spellbook of force bolt catches fire and burns!
    [...]
    Your potion of paralysis boils and explodes!
    Something seems to be holding you.
    Do you want your possessions idenified?
This character survived the burning and boiling objects then succumbed
to the initial flame explosion.

     A fatal explosion calls done() without any explanation.  Or rather,
it dated to the time where it would immediately follow "the scroll erupts
in flame" (or "you are caught in <some kind of> explosion") without the
chance for intervening messages.  Then when item destruction was moved
sooner (for bones file purposes), message sequencing was left dangling.
This patch adds a new "it was fatal" message in front of done().
2009-01-05 00:35:39 +00:00
nethack.rankin
283b681072 fix #H348 - "you trip over it" after non-"it" message (trunk only)
Reported to us by <email deleted>:
  'You are beginning to feel hungry.  You trip over it.'
and also recently in the newsgroup by "<Someone>":
  There is ice here.  *You see here an electric eel corpse.*
  Bib hits the electric eel.  Bib misses the electric eel.
  Bib misses the electric eel.  The electric eel misses Bib.
  The electric eel misses Bib.  *You trip over it.*

     slip_or_trip() was oversimplifying things by assuming that if there
is one object at the hero's location, a message about what that object is
has just been given.  Any timeout message which precedes Fumbling (lots
of candiates besides hunger) could intervene, as could monster activity
between the hero's move and timeout handling.  Aside from the reported
cases, that code hadn't been updated to account for the new pile_limit
option which could be set to 1 and force a popup display instead of the
usual "you see <an item> here".  This fix adds a flag that can be used
to track the most recent message.  It is cleared by pline for every
message, so pline's caller sets it _after_ the message of interest has
been displayed.
2007-06-10 03:01:31 +00:00
nethack.rankin
94327317c2 pile_limit option - movement feedback "there are objects here" (trunk only)
Something that pops up in the newsgroup periodically, with <Someone>
inevitably pointing out the bit of code that the user needs to tweak,
about control of feedback when hero is walking across floor objects.
Implement new option ``pile_limit'' which allows user to set the point
at which the game switches from listing the objects to giving "there are
several/many objects here".  Default is 5, same as previous hard-coded
value (1 object gets listed via pline, 2..4 are listed in a corner popup,
5 or more objects yields a pline message instead).  Setting pile_limit
to 0 means no limit, so objects will always be listed regardless of pile
size.  Setting it to 1 effectively forces no listing since any non-empty
pile size is always at least that big, so can produce "there is an object
here" even though that's no briefer than a pline() to show one object.
2007-04-27 02:05:28 +00:00
nethack.rankin
0ceebfc4b5 nethack -X vs normal game (trunk only)
Reported to the beta-testers list by <Someone> last April:
restoring a normal game save file in explore mode let you keep the file,
then after exploring and quitting without saving, you could restore it
again in normal mode and take advantage of whatever information you'd
gained.  This makes nethack -X (or playmode:explore) defer the switch to
explore mode when used while restoring a normal mode save file.  It now
performs a normal restore (with save file deletion) and then acts as if
the user had given the 'X' command interactively, requiring confirmation
to actually switch into explore mode.
2007-02-17 05:43:18 +00:00
nethack.rankin
bc9f91fce5 unpaid shop goods in inventory (trunk only)
Inventory display adds "(unpaid, N zorkmids)" to carried unpaid
items, but it didn't show anything comparable for indirect unpaid ones
(hero-owned containers holding shop-owned objects).  Now it will include
"(contents, N zorkmids)" in such cases.
2006-11-04 07:49:49 +00:00
nethack.allison
7f0f43e6f9 add some unicode support (trunk only)
This patch attempts to add some levels of unicode support
to NetHack.

The master on/off switch for any Unicode support is
defining UNICODE_SUPPORT in config.h. Currently
there is code support for two subsets of unicode support:

UNICODE_DRAWING

If UNICODE_DRAWING is defined, then the data
structures used to house drawing symbols are expanded
to the size of wchar_t, big enough to hold unicode characters.
A typdef called `nhsym' is involved and if UNICODE_DRAWING
is defined, it is wchar_t, otherwise it is uchar.

UNICODE_WIDEWINPORT

If UNICODE_WIDEWINPORT is defined, then the data
structures inside the window port are expanded to the size of
wchar_t, big enough to hold unicode characters.  Both map
symbols and text within the window port are expanded, in order
for potential support for displaying multinational characters some
day, but this patch only provides viewing of map symbols.
A typdef called `nhwchar' is involved and if UNICODE_WIDEWINPORT
is defined, it is wchar_t, otherwise it is char.

The only window port with code support for UNICODE_WIDEWINPORT
currently is the TTY port.  Don't enable UNICODE_WIDEWINPORT
unless:
- it is a TTY port
- the underlying platform specific routines can
handle the larger data structures.

Don't enable UNICODE_SUPPORT unless:
- your compiler can handle wchar_t.
- your compiler can accept L'a' characters.
- your compiler can accept L"wide" strings.

Note that if your compiler can handle the above, you could
enable the larger data structures (currently if TTY) even if your
platform can't actually display unicode or UTF-8, by messing
with u_putch() in win/tty/wintty.c to only deal regular chars.
That should be the only function that actually pushes wide characters
out to the display.

If you enable UNICODE_SUPPORT, and your platform is capable
you will need to turn on the unicode run-time option to be able to
load unicode character sets from the symbol file, to be able to
push unicode characters to the display. You'll also want to load
a unicode symbol set once the unicode option is toggled on. In
a config file you would do that via these two lines:
OPTIONS=unicode
OPTIONS=symset:Unicode_non_US

The repository was stamped with NETHACK_PRE_UNICODE
prior to applying this patch, and stamped with
NETHACK_POST_UNICODE afterwards. The code differences
between those two tagged versions are this patch.
2006-10-17 23:55:42 +00:00
nethack.allison
253bf359af drawing overhaul (trunk only)
This is an overhaul to the NetHack drawing mechanism.

- eliminates the need to have separate lists in drawing.c
for the things and their associated explanations by grouping
those thing together on the same inializer in a struct.

- replaces all of these options: IBMgraphics, DECgraphics, MACgraphics,
graphics, monsters, objects, boulder, traps, effects

- drawing.c contains only the set of NetHack standard symbols for
the main game and a set of NetHack standard symbols for the
roguelevel.

- introduces a symbols file that contains named sets of
symbols that can be loaded at run time making it extensible
for situations like multinational code pages like those reported
by <Someone>, without hardcoding additional sets into the game code.

- symbols file uses names for the symbols, so offsets will not break
when new things are introduced into the game, the way the older
config file uchar load routines did.

- symbols file only contains exceptions to the standard NetHack
set, not entire sets so they are much less verbose than all of
the g_FILLER() entries that were previously in drawing.c

- 'symset' and 'roguesymset' config file options for
preselecting a symbol set from the file called 'symbols'
at startup time. The name of the symbols file is not under the
users control, only the symbol set name desired from within the
symbols file is.

- 'symset' config file option loads a desired symbol set for
everything but the rogue level.

- 'roguesymset' config file option loads a desired symbol set
for the rogue level.

- 'SYMBOLS' config file option allows the user to specify replacement
symbols on a per symbol basis. You can specify as many or as few symbols
as you wish. The symbols are identified by a name:value pair, and line
continuation is supported. Multiple symbol assignments can be made on
the same line if each name:value pair is separated by a comma.
For example:
SYMBOLS = S_bars:\xf0, S_tree: \xf1, S_room:\xfa \
	  S_fountain:\xf4 \
	  S_boulder:0

- 'symbols' file has the following structure:
start: DECgraphics
	Handling: DEC
	S_vwall: \xf8			# meta-x, vertical rule
	S_hwall: \xf1			# meta-q, horizontal rule
finish
start: IBMgraphics
	Handling: IBM
	S_vwall: \xb3			# meta-3, vertical rule
	S_hwall: \xc4			# meta-D, horizontal rule
finish

- 'symbols' file added to the source tree in the dat directory

- Port Makefiles/scripts will need to be adjusted to move them into
HACKDIR destination
2006-09-21 01:46:15 +00:00
nethack.rankin
9151db8aaf add pickup_thrown option (trunk only)
This patch by <email deleted> was released
when 3.4.1 was current and has been incorporated into slash'em.  It is
extremely useful while using ranged weapons.  When both autopickup and
pickup_thrown are enabled, walking across previously thrown objects will
pick them up even if they don't match the current pickup_types list.
[See cvs log for patchlevel.h for longer description.]
2006-05-13 04:57:52 +00:00
nethack.allison
70b04bfb6e wiz_identify change (trunk only)
This patch alters wiz_identify so that it displays an
inventory menu with all items shown identified
without actually identifying them.

You can just press ^I (or whatever the wiz_identify command
is) a second time, while the menu is displayed to actually identify
them (tested with TTY menus only).
2006-01-14 17:02:22 +00:00
nethack.rankin
aa98091bfa in_lava_effects (trunk only)
The in_lava_effects flag should never be saved and restored; putting
it into the context struct was a mistake.  Move it to the iflags struct
(where the branch code already has it).  I haven't bumped the EDITLEVEL
setting.  Save and bones files from more that a few days ago were breifly
invalid but should be viable again.  Save and bones files from the past
couple of days are now no good; sorry about that.
2005-12-11 03:09:05 +00:00
nethack.rankin
0076d5fc00 number_pad:3,4,-1 (trunk only)
Add support requested by a user for number_pad:3 to use a phone-style
keypad layout where 1,2,3 are on the top row and 7,8,9 on the bottom,
opposite of the adding machine layout adopted by computer keyboards.  Also
number_pad:4 combines that with the number_pad:2 hack to give different
behavior for the 5 key (also meta-5 and meta-0).  And number_pad:-1 is a
rather absurd way to support German keyboards which have y and z keys
swapped, avoiding the need to add a new option for that.  With it, z moves
upper-left and y zaps wands, with corresponding swap of the upper case,
control, and meta variations of those two letters.  (There is a "German
keyboard patch" for this floating around the net, but it implements a
compile time configuration setting which results in hard-coded behavior
for those keys.  This implementation lets it be toggled on or off at will.)

     There's more here, intended to ultimately simplify rhack() quite a
bit.  Most of that isn't finished yet.  However, the part that is done
should produce same run-time behavior as before.  I hope....

     iflags.num_pad and iflags.num_pad_mode should now be viewed as opaque
items used for communicating dynamically updated option settings to the
core only.  Ports and/or interfaces which feel inclined to peek at them
should switch to Cmd.num_pad,&c instead.  (I've made that switch for a
couple of places which would have stopped compiling due to sdir and ndir
going away, and for vms+tty where I could directly test the change(s),
possibly plus one or two places which got heldover over from my earlier
attempt that did try to update all of them.  Ports which haven't made the
change yet ought to continue to work as-is though.)

     Eventually ports/interfaces which implement alternate ways to invoke
commands (pull down menus or extra keyboard buttons or whatever) should be
able to scan Cmd.commands[] to figure out which input characters trigger
which nethack functions.  The ones that currently use hardcoded key lists
will probably need to migrate before any dynamic key binding functionality
gets implemented.  (Which may never happen; it's definitely not on my own
to-do list.)  Cmd.serialno is intended to be the way for them figure out
when the commands have been changed (which right now only happens when 'O'
is used to alter the number_pad setting); perhaps a new interface callback
would be better suited for communicating this.

     It may be necessary to rearrange header inclusion so that func_tab.h
gets included before flag.h (and/or struct cmd gets moved from the latter
to the former--but then func_tab.h would be needed in a bunch of places
which don't currently use it) to support some pre-ANSI compilers.  And the
command initialization might need to be moved to somewhere earlier than
init_options() at some point if port/interface initialization starts caring
about it.
2005-11-26 02:32:49 +00:00
nethack.allison
ab1872b928 zlib support; also internal compression changes
o Add support for zlib compression via ZLIB_COMP in config.h (ZLIB_COMP
  and COMPRESS are mutually exclusive).
o rlecomp and zerocomp are run time options available if RLECOMP and
  ZEROCOMP are defined, but not turned on by default if either COMPRESS
  or ZLIB_COMP are defined.
o Add information to the save file about internal compression options
  used when writing the save file, particularly rlecomp and zerocomp
  support.
o Automatically adjust rlecomp and zerocomp (if support compiled in)
  when reading in an existing savefile that was saved with those options
  turned on.  Still allows writing out of savefile in preferred format.
o In order to support zlib and not conflict with compress and uncompress
  routines there, the NetHack internal functions were changed to
  nh_uncompress and nh_compress as done in the zlib contribution received
  in 1999 from <Someone>.

I tagged the sources NETHACK_3_5_0_PREZLIB prior to applying these
changes.
2005-01-22 15:28:15 +00:00
nethack.allison
15ae774a78 selectsaved option (trunk only)
- always write plname into save file, no longer conditional
- add 'selectsaved' wincap option to control the display of
  a menu of save files for ports/platforms that support it.
- add support for win32 tty using normal nethack menus.
- the win/tty/wintty code is generalized enough that any
  tty port could support the option if the appropriate port-specific
  code hooks for wildcard file lookups are added to src/file.c
  specifically in the get_saved_games() routine. There is posix
  code in there from Warwick already, and there is findfirst/findnext
  code in there from win32. Warwick has the posix code only
  enabled for Qt at present, but with wintty support, that could be expanded
  to other Unix environments quite easily I would think.

Here is what the tty support looks like:

    NetHack, Copyright 1985-2005
         By Stichting Mathematisch Centrum and M. Stephenson.
         See license for details.

    Select one of your saved games
    a - Bob
    b - Fred
    c - June
    d - mine3
    e - Sirius
    f - Start a new character
    (end)

The following files existed in the NetHack SAVEDIR directory
at the time:
    ALLISONMI-Bob.NetHack-saved-game
    ALLISONMI-Fred.NetHack-saved-game
    ALLISONMI-June.NetHack-saved-game
    ALLISONMI-mine3.NetHack-saved-game
    ALLISONMI-Sirius.NetHack-saved-game
Note that despite the file names, the actual character name
is drawn from the savefile.

The WIN32CON support passes
    USER-*.NetHack-saved-game
to findfirst/findnext where USER is your login name of course.
2005-01-09 21:40:24 +00:00
nethack.allison
c146fe012d housekeeping: mark trunk sources 3.5 (include) 2005-01-02 16:50:12 +00:00
nethack.allison
10480f4397 core support for status field highlighting (trunk only)
This provides the core support needed for status field highlighting.
This patch doesn't actually perform status field highlighting for any port,
but provides the core hooks for doing so.

The syntax is:
OPTIONS=hilite_status:{fieldname}/{threshold}/{below}/{above}
where {fieldname} is the name of a status field.
           {threshold} is the value used as the threshold to trigger a display
                             change.  It can also be set to "updown" to trigger
                             a display change whenever it rises or whenever it falls.
                             If you end the threshold value with %, then it signifies
                             that you want to trigger the display change based on the
                             percentage of maximum.
         {below}, {above}
                        are the color or display attribute that you want to use when
                        the field value is underneath the threshold. Supported display
                        fields are:  normal, inverse, bold, black, red, green,
                                         brown, blue, magenta, cyan, gray, orange,
                                         bright-green, yellow, bright-blue, bright-magenta,
                                         bright-cyan, or white.
Valid field names are:
        alignment, armor-class, carrying-capacity,
        charisma, condition, constitution, dexterity,
        dungeon-level, experience-level, experience,
        gold, HD, hitpoints-max, hitpoints, hunger,
        intelligence, power-max, power, score,
        strength, time, title, wisdom

Refer to window.doc for details. Guidebook updates to come later.
2003-11-30 05:51:53 +00:00
nethack.allison
94ff3505b4 more autopickup_exception
An optimization.

Split the patterns into two chains, one for things you want "always picked up", and one for things you want "never picked up".  That way, the
entire exception list isn't being checked twice, once for each type of
check.  The check for things to "always pick up" only checks the
chain at the AP_GRAB index, and the check for things to "never
pick up" only checks the chain at the AP_LEAVE index.

- Also modifies the toggle autopickup '@' message
appropriately for the AUTOPICKUP_EXCEPTIONS build.
(it just tacks on ", with some exceptions" if there are some)
2003-11-15 23:15:01 +00:00
nethack.allison
c0349ec918 autopickup_exceptions build option
Add config.h experimental option AUTOPICKUP_EXCEPTIONS.

It's an interface-only change which allows you to add lines to your
config file to selectively avoid autopickup of items based on their
text description that is displayed when you pick them up. It does
it by matching a pattern against the xname singular return value.

For example:

autopickup_exception = "*corpse" will avoid picking up corpses, even if
food (%) is in your pickup_types.

autopickup_exception = "*brown*"
will avoid picking up any brown items (why, I do not know)

autopickup_exception = "*loadstone"
will NOT avoid picking up loadstones, unless they are already
identified, because the xname string will be "gray stone", so no
match there.

The matching has no knowledge of in-game objects, it is just
a text pattern match, thus it is an interface change, not a gameplay
change, and it is meant as a convenience for players.
2003-11-15 01:05:32 +00:00
nethack.allison
7bab241f17 flag adjustments (trunk only)
Move all system or port specific flags to sysflags which is used only if
SYSFLAGS is defined, and leave everything else in flags unconditional.
2003-11-09 11:48:38 +00:00
nethack.allison
4775dd3cbf headings in option menus
There was a great deal of inconsistency in
different menus on how headings were displayed.
This allows the user to select what they like best.
I was motivated to do this, because I wasn't satisfied
with the appearance of ATR_INVERSE in the menus
on win32tty, and several of them specified it.
2003-10-05 19:56:22 +00:00
kmhugo
e1f5ddd820 sound cleanup
+ Separate the two uses of flags.soundok.
+ Player-settable option is now called "acoustics".
+ Deafness is now handled as a full-fledged attribute.
+ Check for deafness in You_hear(), rather than caller.
+ Check for deafness in caller, rather than verbalize(),
  because gods can speak to characters in spite of deafness.
+ Since changes are being made to prop.h, reorder it to the
  same order as youprop.h and enlightenment.

There are still some extraneous checks and missing checks
for deafness, which will be followed up in a future patch.

Because of the size of this patch and its savefile incompatibilities,
it is only being applied to the trunk code.  Portions of this patch
were written by Michael Allison.
2003-09-28 03:42:50 +00:00
nethack.allison
74b834c774 trunk only: preserving context (include files)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
2003-09-21 11:46:53 +00:00
nethack.allison
5e94d4478b wraptext port option (from <Someone>)
WC2_WRAPTEXT option was added but core changes
were not included  in the previous wince patch.
2003-08-14 11:04:33 +00:00
nethack.allison
b750eee32a fix display problem with tabs on win32tty 2003-07-27 03:22:15 +00:00
nethack.allison
99bcdf6a4e expand wincap options to second field
<Someone> wishes to add a couple of new options to the wince port ("run fullscreen" and "do not use CE software keyboard").

The wincap field was full, so this adds a second field for
additional options.
2003-07-17 01:35:31 +00:00
cohrs
b633b91875 SF patch 536615: travel cache
This is derived from the proposed patch and feedback to it.  This applies
the last-position cache behavior without an option, making the behavior
more like it is for interfaces with a mouse, where holding the mouse still
acts the same way as the travel cache.  The code is not #ifdef'd either.
2003-06-30 04:00:14 +00:00
nethack.allison
cec8e1ee31 clicklook (main trunk only)
This allows the use of the right mouse button to
look at things on the screen when the
'clicklook' option is set.

Concept came from a patch for 3.4.0
that I saw referenced on r.g.r.n
[see http://www.steelskies.com/nethack.php]
but the implementation is different.
2003-06-30 02:09:04 +00:00
nethack.allison
a67ed775cb number_pad (modified from <Someone>'s patch)
The number_pad option can now optionally hold a value
{0,1, 2 } for {off, on, DOS-mode} but plain number_pad and
!number_pad in config files still work as before.

When number_pad:2 is set, iflags.num_pad_mode is set to 1
which triggers the following behaviour:
> '5', M('5') and M('0') are mapped in rhack()
>in cmd.c, only when they are entered as a command. When used as a
>number, like in the 'n' command, no mapping takes place. '0' is
>already mapped to 'i' by the core. The
>only difference [<Someone>] left in (deliberately) is when you press Ctrl-0;
>this used to map to C('i'), which is an invalid command; now
>keep it '0' (which is interpreted as 'i' by the core.)
2003-06-06 03:49:56 +00:00
nethack.allison
78ce3749dc win32tty keystroke handling
- Move the code for keystroke handling into its own source file.
- Compile and link it as a dynamic link library.
- Dynamically load the keystroke handler at runtime
- Add support for specifying a different handler in defaults.nh
  so that internationalization issues can be dealt with without
  rebuilding nethack, just supply alternative handlers in HACKDIR.

The following exported functions need to be present in
the keystroke handler .dll:
ProcessKeystroke - returns an ascii value to NetHack
NHkbhit  - allows peeking to see if a key/mouse press is waiting
SourceWhere - returns location for souce code for a keystroke handler
SourceAuthor  - returns author information for a keystroke handler
KeyHandlerName  - returns the full or short name of the keystroke handling dll.
2003-03-09 15:44:50 +00:00
nethack.allison
5122409416 Several things that break savefile compatibility
- Version change from 3.4.x
- timed_delay feature ignore in makedefs
- several flags from iflags to flags
- use offsets from mons array entries in save file rather than storing
  the ptr and calculating the distance from beginning of array
2003-03-05 04:39:47 +00:00
nethack.allison
d1c2a37deb fix buglist entry: menu upon request
For "traditional" menu style, pickup and #loot/apply can't accept an 'm'
response to bring up a menu upon request when all items involved are of
the same class, because the prompt where that response is allowed only
gets issued when multiple classes are present.
2003-01-11 17:22:58 +00:00
nethack.allison
2ce6152d63 B08021 scroll_amount wincap option
> - I'd like to see another option added: scroll_amount. In
>   combination with scroll_margin, this would control the amount
>   of squares the screen is scrolled when the scroll_margin is
>   reached (currently, this amount is 1, but if I recall
>   correctly, it used to be more). For example, if both were 5,
>   when you came within 5 spaces of the left screen border, the
>   screen would shift 5 spaces to the right).
2002-08-23 01:03:59 +00:00
nethack.allison
8631cba725 newbie in-game assistance with Guidebook notation
Provide some command assistance for newbies, but
suppress it with !cmdassist in the config file.

If someone misinterprets the Guidebook ^D, ^T
type command notation, this will pop up some
further information to possibly assist them and
explain the notation.
2002-08-04 16:48:15 +00:00
nethack.allison
a849315988 no message 2002-07-29 17:57:57 +00:00
nethack.allison
46721b5a91 flag changes
Several flags added since 3.4.0 were destined for flags
(to be saved with the game) but were placed in iflags for
savefile compatibility.  These include:
 boolean  lootabc;	/* use "a/b/c" rather than "o/i/b" when looting */
 boolean  showrace;	/* show hero glyph by race rather than by role */
 boolean  travelcmd;	/* allow travel command */
 int	 runmode;	/* update screen display during run moves */

This patch has no effect unless you define this in your port's
XXconf.h file.
#define SAVEFILE_340_CONVERT	/* allow moving of some iflags fields to flags
					without destroying savefile compatibility */
Without it, the new flags remain in "iflags."  With it, the flags are moved to
"flags" and the structures are converted when the save file is read. There
is no reverse compatibility.  If you save the game after conversion, you
can't load the savefile on 3.4.0, only 3.4.1.
2002-07-28 16:03:00 +00:00
nethack.rankin
aedd6947d4 runmode option
Provide user control over screen updating for multi-step movement
(run via shift, control, &c and also travel).  [See cvs history for
fixes34.1 for more details.]
2002-07-28 10:45:46 +00:00
nethack.allison
5d3448fc16 Message recall window extensions
by <Someone>

(the following text accompanies the patch at <Someone>'s web page)

add more configurability to the new msg_window option of [..]3.4.0.
It allows the configuration option to take an optional parameter to
specify the style of message history display to use.

allows the following configuration options:

msg_window:s - single message (as was the default in 3.3.0)
msg_window:c - combination; two messages in 'single', then as 'full'
msg_window:f - full window; oldest message first
msg_window:r - full window reversed; newest message first

In the event of no parameter being provided,
the patch is compatible with the current 3.4.0 behaviour:
msg_window = 'full'
!msg_window = 'single'
msg_window can be configured for these options in the
Options menu (Shift-O)
msg_window stores the current window type in the non-persistent
iflags structure, which means that savefile/bones files should be
100% compatible with Vanilla, but at the disadvantage that your
customisations to msg_window will be replaced with your
defaults.nh (or ~/.nethackrc) value every time you restart a saved game.
Credits:

The patch draws inspiration (and code snippets) extensively
from <Someone>'s original msg_window patch, [...] as well as <Someone>'s code for reverse ordering implemented until recently in
Slash'em.
2002-04-20 14:16:23 +00:00
nethack.allison
69ee06a9bc Two new options
Add "travel" boolean option to enable/disable travel command.
Add "mouse_support" wincap option to enable/disable mouse.

- When running the win32 tty version full-screen, some people
complained about the square mouse cursor.

Newsgroups: rec.games.roguelike.nethack
Subject: Re: Getting rid of the cursor?
<email deleted> <email deleted>
Followup-To:

On Thu, 04 Apr 2002 00:20:06 <email deleted> wrote:
> Ok, let me be more specific: when playing the windows non-GUI version, is
> there a way to get rid of the large rectangular white cursor?
>
> <email deleted> wrote in message
> <email deleted>
>> Can you get rid of the cursor in the windows version?  I really hate that
>> thing.
>>

<email deleted>
>Newsgroups: rec.games.roguelike.nethack
>Subject: Disabling Mouse Input
>
>I purchased an older P120 laptop to be able to play Nethack at the hotel.
>I find that I rest my thumbs on the mouse touch pad all too often and my
>@ moves unexpectedly at times. I took a peruse through defaults.nh, but
>came up empty.
>
>Anyone know if mouse input can be disabled?
>
>MRSisson
2002-04-04 03:45:03 +00:00
kmhugo
9e60327b01 lootabc and showrace options
Replace "feature_toggle" implementation with an easier-to-understand
boolean option called "lootabc".

Provide "showrace", an option to display the hero by race glyph rather
than by role glyph.

Document the above.

Remove some obsolete Mac options.
2002-03-31 06:27:27 +00:00
nethack.allison
2baa20217f beta feedback - add more wc options
- splash_screen (boolean for whether to display splash screen at startup)
- player_selection:dialog|prompts

Also moves the font and window manipulation stuff in defaults.nh
further down the file, so that a tty users doesn't have to wade
through it all to find the character adjustment samples.
2002-03-12 05:15:40 +00:00
nethack.allison
3c0e37d9c9 add windowcolors option
Add option windowcolors to control foreground/background
color of menu, message, status, and text windows.
(foreground color is the text color).

The value of the colors is window port specific, the
core code handles the storing of the strings only.
2002-03-05 05:03:48 +00:00