Merge remote-tracking branch 'origin/NetHack-3.6.0'

This commit is contained in:
keni
2016-10-09 15:56:50 -04:00
28 changed files with 2228 additions and 508 deletions

View File

@@ -73,6 +73,9 @@ small megabat
uberhulk
tofurkey
+Dudley
shrinking violet
shallow one
spherical cow
# Quendor (Zork, &c.)
grue
@@ -119,6 +122,7 @@ were-rabbit
# Discworld
Luggage
vampiric watermelon
# Lord of the Rings
Ent
@@ -230,6 +234,7 @@ velociraptor
corpulent porpoise
quokka
potoo
lemming
# european cryptids
wolpertinger
@@ -297,6 +302,7 @@ gazebo
gray goo
magnetic monopole
first category perpetual motion device
big dumb object
# Ultima
+Lord British

View File

@@ -513,6 +513,7 @@ start: Blank
S_ss4: \032
S_statue_trap: \032
S_stone: \032
S_strange_obj: \032
S_sw_bc: \032
S_sw_bl: \032
S_sw_br: \032

View File

@@ -8277,17 +8277,141 @@ for such a long time, you don't know how to spit it out."
%e title
#
#
# Sir Terry Pratchett's final book, published posthumously.
# The story is complete, but the length is substantially shorter than
# other recent Discworld novels. Presumably it would have been expanded
# if he had had more time to work on it....
#
%title The Shepherd's Crown (1)
%title The Shepherd's Crown (7)
# pp. 29-30 (Harper edition)
%passage 1
'It's an inconvenience, true enough, and I don't like it at all, but I
know that you do it for everyone, Mister Death. Is there any other way?'
"It's an inconvenience, true enough, and I don't like it at all, but I
know that you do it for everyone, Mr. Death. Is there any other way?"
NO, THERE ISN'T, I'M AFRAID. WE ARE ALL FLOATING IN THE WINDS OF TIME.
NO, THERE ISN'T, I'M AFRAID. WE ARE ALL FLOATING IN THE WINDS OF TIME.
BUT YOUR CANDLE, MISTRESS WEATHERWAX, WILL FLICKER FOR SOME TIME BEFORE
IT GOES OUT -- A LITTLE REWARD FOR A LIFE WELL LIVED. FOR I CAN SEE THE
IT GOES OUT--A LITTLE REWARD FOR A LIFE WELL LIVED. FOR I CAN SEE THE
BALANCE AND YOU HAVE LEFT THE WORLD MUCH BETTER THAN YOU FOUND IT, AND
IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT...
IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT....
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# p. 30 ('she' is Miss Tick, a travelling witch who finds new witches;
# 'under water' is spelled as two words; 'ducking' is accurate)
%passage 2
She sighed. It was such a shame when old customs disappeared. A good
witch-ducking was something she had liked doing in the bad old days--she
had even /trained/ for it. All those swimming lessons, and practice with
knots at the Quirm College for Young Ladies. She had been able to defeat
the mobs under water if necessary. Or at least work at breaking her own
record for untying the simple knots they all thought worked on the nasty
witch.
Now, a bit of pond-dipping had become more like a hobby, and she had a
nasty feeling that others were copying her after she passed through their
villages. She'd even heard talk of a swimming club being started in one
small hamlet over by Ham-on-Rye.(1)
(1) A popular idea among the young lads, since they felt that everyone--
and "everyone" definitely included the young ladies--should swim without
their clothes.
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# p. 37 (passage starts mid-paragraph; 'she' is Tiffany Aching)
%passage 3
Not for the first time, she wondered how it was that cats seemed to be
able to be in one place one moment, and then /almost at the same time/,
reappear somewhere else.(1)
(1) She did not know it, but a keen young philosopher in Ephebe had
pondered exactly that same conumdrum, until he was found one morning--
most of him, anyway--surrounded by a number of purring, and very well fed,
cats. No one had seemed keen to continue his experiments after that.
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# pp. 112-113 (the footnote has a misprint of mismatched quotes: "Chuffley')
%passage 4
Roland de Chumsfanleigh,(1) the young Baron on the Chalk /did/ want to be
like his father in many ways. He knew the old man had been popular--what
was known as an "old-school Baron," which meant that everyone knew what
to expect and the guards polished up their armor and saluted, and did
what was expected of /them/, while the Baron did what was expected of him,
and pretty much left them alone.
But his father had also been a bit of a bad-tempered bully at times. And
/that/ bit Roland wanted to forget about. He particularly wanted to sound
the right note when he called round to see Tiffany Aching at Home Farm.
For they had once been good friends, and to Roland's alarm, Tiffany was
thought of as a good friend by his wife Letitia. Any man with sense was
wise to be fearful of a wife's best friends. For who knew what ... little
secrets might be shared. Roland, having been educated at home and with
limited knowledge of the world outside the Chalk, feared that "little"
might be /exactly/ the kind of comment Letitia might share with Tiffany.
(1) Pronounced "Chuffley" under the strange rule that the more gentrified
a family is, the more peculiar the pronunciation of their name becomes.
Tiffany had once heard a high-born visitor named Ponsonby-Macklewright
(/Pwt/) refer to Roland as /Chf/. She wondered how they managed at dinner
when /Pwt/ introduced /Chf/ to /Wm/ or /Hmpfh/. Surely it could lead to
misunderstandings?
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# p. 158
%passage 5
He kicked the helmet of his chief, the Big Man of the clan, and shouted,
"There's elves here! I can smell it, ye ken!"
And from every hole in turn, the clan of the Nac Mac Feegle poured out in
their hundreds to deal with the ancient enemy, waving claymores and swords,
yodeling their war cries:
"Ach, stickit yer trakkans!"
"Nac Mac Feegle wha hae!"
"Gae awa' wi' ye, yer bogle!"
"Gi'e you sich a guid kickin'!"
"Nae king! Nae quin! We will nae be fooled agin!"
There is a concept known as a hustle and bustle, and the Feegles were very
good at it, cheerfully getting in one another's way in the drive to be the
first into battle, and it seemed as if each small warrior had a battle cry
of his own--and he was very ready to fight anyone who tried to take it
away from him.
"How many elves?" asked Rob Anybody, trying to adjust his spog.
There was a pause.
"One," said Big Yan sheepishly.
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# p. 159 (passage starts mid-paragraph. 'oor' is accurate)
%passage 6
"This elf is oor prisoner. A hostage, ye ken. That means ye are nae tae
kill it until ye are told." He ignored the grumbles from the clan. "As
tae the rest o' ye, tak guard around yon stones. And if they come in
force, show them what the Feegles can dae!"
Daft Wullie said, "I can play the harmonica."
Rob Anybody sighed. "Aye, weel, I suppose that puts the willies up me,
so wud likely keep them awa'."
[The Shepherd's Crown, by Terry Pratchett]
%e passage
# p. 202
%passage 7
Sometimes, Tiffany thought, I am so /fed up/ with being young.(1)
(1) A thought that she would most certainly grow out of, assuming she
survived long enough.
[The Shepherd's Crown, by Terry Pratchett]
%e passage

View File

@@ -465,7 +465,9 @@ more info).
.hn 1
Commands
.pg
Commands are initiated by typing one or two characters. Some commands,
Commands can be initiated by typing one or two characters to which
the command is bound to, or typing the command name in the extended
commands entry. Some commands,
like ``search'', do not require that any more information be collected by
NetHack. Other commands might require additional information, for
example a direction, or an object to be used. For those commands that
@@ -498,11 +500,11 @@ ESC key.
.pg
The list of commands is rather long, but it can be read at any time
during the game through the `?' command, which accesses a menu of
helpful texts. Here are the commands for your reference:
helpful texts. Here are the default key bindings for your reference:
.lp ?
Help menu: display one of several help texts available.
.lp /
The ``what-is'' command, to
The ``whatis'' command, to
tell what a symbol represents. You may choose to specify a location
or type a symbol (or even a whole word) to explain.
Specifying a location is done by moving the cursor to a particular spot
@@ -584,7 +586,8 @@ A few other commands (eat food, offer sacrifice, apply tinning-kit) use
the `m' prefix to skip checking for applicable objects on the floor
and go straight to checking inventory,
or (for ``#loot'' to remove a saddle),
skip containers and go straight to adjacent monsters.
skip containers and go straight to adjacent monsters. The prefix will
make ``#travel'' command show a menu of interesting targets in sight.
.lp F[yuhjklbn]
Prefix: fight a monster (even if you only guess one is there).
.lp M[yuhjklbn]
@@ -823,7 +826,7 @@ via the ``#twoweapon'' extended command.
.lp ""
(In versions prior to 3.6 this was the command to switch from normal
play to "explore mode", also known as "discovery mode", which has now
been moved to ``#explore''.)
been moved to ``#exploremode''.)
.lp ^X
Display basic information about your character.
.lp ""
@@ -912,7 +915,7 @@ compiled with.
.lp #adjust
Adjust inventory letters (most useful when the
.op fixinv
option is ``on'').
option is ``on''). Autocompletes. Default key is 'M-a'.
.lp ""
This command allows you to move an item from one particular inventory
slot to another so that it has a letter which is more meaningful for you
@@ -923,50 +926,113 @@ choosing the item to adjust, enter a count prior to its letter.
.lp #annotate
Allows you to specify one line of text to associate with the current
dungeon level. All levels with annotations are displayed by the
``#overview'' command.
``#overview'' command. Autocompletes. Default key is 'M-A', and '^N' if number_pad is on.
.lp #apply
Apply (use) a tool such as a pick-axe, a key, or a lamp. Default key is 'a'.
.lp #attributes
Show your attributes. Default key is '^X'.
.lp #autopickup
Toggle the autopickup -option on/off. Default key is '@'.
.lp #call
Call (name) a monster, or a object in inventory, on the floor,
or in the discoveries list, or add an annotation for the
current level (same as ``#annotate''). Default key is 'C'.
.lp #cast
Cast a spell. Default key is 'Z'.
.lp #chat
Talk to someone.
Talk to someone. Default key is 'M-c'.
.lp #close
Close a door. Default key is 'c'.
.lp #conduct
List voluntary challenges you have maintained.
List voluntary challenges you have maintained. Autocompletes. Default key is 'M-C'.
.lp ""
See the section below entitled ``Conduct'' for details.
.lp "#dip "
Dip an object into something.
Dip an object into something. Autocompletes. Default key is 'M-d'.
.lp #down
Go down a staircase. Default key is '>'.
.lp #drop
Drop an item. Default key is 'd'.
.lp #droptype
Drop specific item types. Default key is 'D'.
.lp "#eat "
Eat something. Default key is 'e'.
.lp #engrave
Engrave writing on the floor. Default key is 'E'.
.lp #enhance
Advance or check weapon and spell skills.
Advance or check weapon and spell skills. Autocompletes. Default key is 'M-e'.
.lp #exploremode
Enter the explore mode.
.lp #fire
Fire ammunition from quiver. Default key is 'f'.
.lp #force
Force a lock.
Force a lock. Autocompletes. Default key is 'M-f'.
.lp #glance
Show what type of thing a map symbol corresponds to. Default key is ';'.
.lp #help
Show the help menu. Default key is '?', and 'h' if number_pad is on.
.lp #history
Show long version and game history. Default key is 'V'.
.lp #inventory
Show your inventory. Default key is 'i'.
.lp #inventtype
Inventory specific item types. Default key is 'I'.
.lp #invoke
Invoke an object's special powers.
Invoke an object's special powers. Autocompletes. Default key is 'M-i'.
.lp #jump
Jump to another location.
Jump to another location. Autocompletes. Default key is 'M-j', and 'j' if number_pad is on.
.lp #kick
Kick something.
Kick something. Default key is '^D', and 'k' if number_pad is on.
.lp #known
Show what object types have been discovered. Default key is '\'.
.lp #knownclass
Show discovered types for one class of objects. Default key is '`'.
.lp #levelchange
Change your experience level. Autocompletes. Wizard-mode only.
.lp #lightsources
Show mobile light sources. Autocompletes. Wizard-mode only.
.lp #look
Look at what is here, under you. Default key is ':'.
.lp #loot
Loot a box or bag on the floor beneath you, or the saddle
from a steed standing next to you.
from a steed standing next to you. Autocompletes.
Precede with the `m' prefix to skip containers at your location
and go directly to removing a saddle.
and go directly to removing a saddle. Default key is 'M-l', and 'l' if number_pad is on.
.lp #monpolycontrol
Control monster polymorphs. Autocompletes. Wizard-mode only.
.lp #monster
Use a monster's special ability (when polymorphed into monster form).
Autocompletes. Default key is 'M-m'.
.lp #name
Name a monster, an individual object, or a type of object. Same as `C'.
Name a monster, an individual object, or a type of object. Same as #call.
Autocompletes. Default keys are 'N', 'M-n', and 'M-N'.
.lp #offer
Offer a sacrifice to the gods.
Offer a sacrifice to the gods. Autocompletes. Default key is 'M-o'.
.lp ""
You'll need to find an altar to have any chance at success.
Corpses of recently killed monsters are the fodder of choice.
.lp #open
Open a door. Default key is 'o'.
.lp #options
Show and change option settings. Default key is 'O'.
.lp #overview
Display information you've discovered about the dungeon. Any visited
level (unless forgotten due to amnesia) with an annotation is included,
and many things (altars, thrones, fountains, and so on; extra stairs
leading to another dungeon branch) trigger an automatic annotation.
If dungeon overview is chosen during end-of-game disclosure, every visited
level will be included regardless of annotations.
level will be included regardless of annotations. Autocompletes.
Default keys are '^O', and 'M-O'.
.lp #panic
Test the panic routine. Autocompletes. Wizard-mode only.
.lp "#pay "
Pay your shopping bill. Default key is 'p'.
.lp #pickup
Pick up things at the current location. Default key is ','.
.lp #polyself
Polymorph self. Autocompletes. Wizard-mode only.
.lp #pray
Pray to the gods for help.
Pray to the gods for help. Autocompletes. Default key is 'M-p'.
.lp ""
Praying too soon after receiving prior help is a bad idea.
(Hint: entering the dungeon alive is treated as having received help.
@@ -976,40 +1042,152 @@ option to make you confirm your intent before praying. It is enabled
by default, and you can reset the
.op paranoid_confirmation
option to disable it.
.lp #prevmsg
Show previously displayed game messages. Default key is '^P'.
.lp #puton
Put on an accessory (ring, amulet, etc). Default key is 'P'.
.lp #quaff
Quaff (drink) something. Default key is 'q'.
.lp #quit
Quit the program without saving your game.
Quit the program without saving your game. Autocompletes. Default key is 'M-q'.
.lp ""
Since using this command by accident would throw away the current game,
you are asked to confirm your intent before quitting. By default a
response of 'y' acknowledges that intent. You can set the
.op paranoid_confirmation
option to require a response of "yes" instead.
.lp #quiver
Select ammunition for quiver. Default key is 'Q'.
.lp #read
Read a scroll, a spellbook, or something else. Default key is 'r'.
.lp #redraw
Redraw the screen. Default key is '^R', and '^L' if number_pad is on.
.lp #remove
Remove an accessory (ring, amulet, etc). Default key is 'R'.
.lp #ride
Ride (or stop riding) a saddled creature.
Ride (or stop riding) a saddled creature. Autocompletes. Default key is 'M-R'.
.lp "#rub "
Rub a lamp or a stone.
Rub a lamp or a stone. Autocompletes. Default key is 'M-r'.
.lp #save
Save the game. Default key is 'S'.
.lp #search
Search for traps and secret doors around you. Default key is 's'.
.lp #seeall
Show all equipment in use. Default key is '*'.
.lp #seeamulet
Show the amulet currently worn. Default key is '"'.
.lp #seearmor
Show the armor currently worn. Default key is '['.
.lp #seegold
Count your gold. Default key is '$'.
.lp #seenv
Show seen vectors. Autocompletes. Wizard-mode only.
.lp #seerings
Show the ring(s) currently worn. Default key is '='.
.lp #seespells
List and reorder known spells. Default key is '+'.
.lp #seetools
Show the tools currently in use. Default key is '('.
.lp #seetrap
Show the type of a trap near you. Default key is '^'.
.lp #seeweapon
Show the weapon currently wielded. Default key is ')'.
.lp #shell
Do a shell escape. Default key is '!'.
.lp "#sit "
Sit down.
Sit down. Autocompletes. Default key is 'M-s'.
.lp #stats
Show memory statistics. Autocompletes. Wizard-mode only.
.lp #suspend
Suspend the game. Default key is '^Z'.
.lp #swap
Swap wielded and secondary weapons. Default key is 'x'.
.lp #takeoff
Take off one piece of armor. Default key is 'T'.
.lp #takeoffall
Remove all armor. Default key is 'A'.
.lp #teleport
Teleport around the level. Default key is '^T'.
.lp #terrain
Show bare map without displaying monsters, objects, or traps.
Autocompletes.
.lp #throw
Throw something. Default key is 't'.
.lp #timeout
Look at the timeout queue. Autocompletes. Wizard-mode only.
.lp "#tip "
Tip over a container (bag or box) to pour out its contents.
Autocompletes. Default key is 'M-T'.
.lp #travel
Travel to a specific location on the map. Default key is '_'.
Using the ``request menu'' prefix shows a menu of interesting targets in sight
without asking to move the cursor.
.lp #turn
Turn undead.
Turn undead away. Autocompletes. Default key is 'M-t'.
.lp #twoweapon
Toggle two-weapon combat on or off.
Toggle two-weapon combat on or off. Autocompletes. Default keys
are 'X', and 'M-2'.
.lp ""
Note that you must
use suitable weapons for this type of combat, or it will
be automatically turned off.
.lp #untrap
Untrap something (trap, door, or chest).
Untrap something (trap, door, or chest). Default key is 'M-u', and 'u' if number_pad is on.
.lp ""
In some circumstances it can also be used to rescue trapped monsters.
.lp "#up "
Go up a staircase. Default key is '<'.
.lp #vanquished
List vanquished monsters. Autocompletes. Wizard-mode only.
.lp #version
Print compile time options for this version of NetHack.
Autocompletes. Default key is 'M-v'.
.lp #versionshort
Show version string. Default key is 'v'.
.lp #vision
Show vision array. Autocompletes. Wizard-mode only.
.lp #wait
Rest one move while doing nothing. Default key is '.', and ' ' if
rest_on_space is on.
.lp #wear
Wear a piece of armor. Default key is 'W'.
.lp #whatdoes
Tell what a key does. Default key is '&'.
.lp #whatis
Show what type of thing a symbol corresponds to. Default key is '/'.
.lp #wield
Wield a weapon. Default key is 'w'.
.lp #wipe
Wipe off your face.
Wipe off your face. Autocompletes. Default key is 'M-w'.
.lp #wizdebug_bury
Bury objects under and around you. Autocompletes. Wizard-mode only.
.lp #wizdebug_traveldisplay
Toggle travel display. Autocompletes. Wizard-mode only.
.lp #wizdetect
Search a room. Autocompletes. Wizard-mode only. Default key is '^E'.
.lp #wizgenesis
Create a monster. Autocompletes. Wizard-mode only. Default key is '^G'.
.lp #wizidentify
Identify all items in inventory. Autocompletes. Wizard-mode only.
Default key is '^I'.
.lp #wizintrinsic
Set intrinsic. Autocompletes. Wizard-mode only.
.lp #wizlevelport
Teleport to another level. Autocompletes. Wizard-mode only. Default key is '^V'.
.lp #wizmap
Map the level. Autocompletes. Wizard-mode only. Default key is '^F'.
.lp #wizrumorcheck
Verify rumor boundaries. Autocompletes. Wizard-mode only.
.lp #wizsmell
Smell monster. Autocompletes. Wizard-mode only.
.lp #wizwhere
Show locations of special levels. Autocompletes. Wizard-mode only.
.lp #wizwish
Wish for something. Autocompletes. Wizard-mode only. Default key is '^W'.
.lp #wmode
Show wall modes. Autocompletes. Wizard-mode only.
.lp "#zap "
Zap a wand. Default key is 'z'.
.lp "#? "
Help menu: get the list of available extended commands.
.lp ""
@@ -2054,10 +2232,32 @@ HACKDIR, must be writeable.
.lp TROUBLEDIR
The location that a record of game aborts and self-diagnosed game problems
is kept. Defaults to HACKDIR, must be writeable.
.lp AUTOCOMPLETE
Enable or disable an extended command autocompletion.
Autocompletion has no effect for the X11 windowport.
You can specify multiple autocompletions. To enable
autocompletion, list the extended command. Prefix the
command with ``!'' to disable the autocompletion
for that command.
.pg
Example:
.sd
\fBAUTOCOMPLETE=zap,!annotate\fP
.ed
.lp AUTOPICKUP_EXCEPTION
Set exceptions to the
.op pickup_types
option. See the ``Configuring Autopickup Exceptions'' section.
.lp BINDINGS
Change the key bindings of some special keys, menu accelerators, or
extended commands. You can specify multiple bindings. Format is key
followed by the command, separated by a colon.
See the ``Changing Key Bindings`` section for more information.
.pg
Example:
.sd
\fBBIND=^X:getpos.autodescribe\fP
.ed
.lp MSGTYPE
Change the way messages are shown in the top status line.
See the ``Configuring Message Types`` section.
@@ -2955,6 +3155,105 @@ The second example results in the exclusion of any corpse from autopickup.
The last example results in the exclusion of items known to be cursed from
autopickup.
.hn 2
Changing Key Bindings
.pg
It is possible to change the default key bindings of some special commands,
menu accelerator keys, and extended commands, by using BIND stanzas in the
configuration file. Format is key, followed by the command to bind to, separated
by a colon. The key can be a single character (``x''), a control key (``^X'',
``C-x''), a meta key (``M-x''), or a three-digit decimal ASCII code.
.pg
For example:
.sd
.si
BIND=^X:getpos.autodescribe
BIND={:menu_first_page
BIND=v:loot
.ei
.ed
.pg
.lp "Extended command keys"
You can bind multiple keys to the same extended command. Unbind a key by
using ``nothing'' as the extended command to bind to. You can also bind
the ``<esc>'', ``<enter>'', and ``<space>'' keys.
.lp "Menu accelerator keys"
The menu control or accelerator keys can also be rebound via OPTIONS-lines
in the config file. You cannot bind object symbols into menu accelerators.
.lp "Special command keys"
Below are the special commands you can rebind. Some of them can be bound to
same keys with no problems, others are in the same "context", and if bound
to same keys, only one of those commands will be available. Special command
can only be bound to a single key.
.pg
.lp count
Prefix key to start a count, to repeat a command this many times. With number_pad only. Default is 'n'.
.lp doinv
Show inventory. With number_pad only. Default is '0'.
.lp fight
Prefix key to force fight a direction. Default is 'F'.
.lp fight.numpad
Prefix key to force fight a direction. With number_pad only. Default is '-'.
.lp getdir.help
When asked for a direction, the key to show the help. Default is '?'.
.lp getdir.self
When asked for a direction, the key to target yourself. Default is '.'.
.lp getdir.self2
When asked for a direction, the key to target yourself. Default is 's'.
.lp getpos.autodescribe
When asked for a location, the key to toggle autodescribe. Default is '#'.
.lp getpos.door.next
When asked for a location, the key to go to next closest door or doorway. Default is 'd'.
.lp getpos.door.prev
When asked for a location, the key to go to previous closest door or doorway. Default is 'D'.
.lp getpos.help
When asked for a location, the key to show help. Default is '?'.
.lp getpos.mon.next
When asked for a location, the key to go to next closest monster. Default is 'm'.
.lp getpos.mon.prev
When asked for a location, the key to go to previous closest monster. Default is 'M'.
.lp getpos.obj.next
When asked for a location, the key to go to next closest object. Default is 'o'.
.lp getpos.obj.prev
When asked for a location, the key to go to previous closest object. Default is 'O'.
.lp getpos.menu
When asked for a location, show a menu of all interesting targets. Default is 'A'.
.lp getpos.menu.cansee
When asked for a location, show a menu of interesting targets in view. Default is 'a'.
.lp getpos.pick
When asked for a location, the key to choose the location, and possibly ask for more info. Default is '.'.
.lp getpos.pick.once
When asked for a location, the key to choose the location, and skip asking for more info. Default is ','.
.lp getpos.pick.quick
When asked for a location, the key to choose the location, skip asking for more info, and exit the location asking loop. Default is ';'.
.lp getpos.pick.verbose
When asked for a location, the key to choose the location, and show more info without asking. Default is ':'.
.lp getpos.self
When asked for a location, the key to go to your location. Default is '@'.
.lp getpos.unexplored.next
When asked for a location, the key to go to next closest unexplored location. Default is 'x'.
.lp getpos.unexplored.prev
When asked for a location, the key to go to previous closest unexplored location. Default is 'X'.
.lp getpos.valid
When asked for a location, the key to go to show valid target locations. Default is '$'.
.lp nopickup
Prefix key to move without picking up items. Default is 'm'.
.lp redraw
Key to redraw the screen. Default is '^R'.
.lp redraw.numpad
Key to redraw the screen. With number_pad only. Default is '^L'.
.lp repeat
Key to repeat previous command. Default is '^A'.
.lp reqmenu
Prefix key to request menu from some commands. Default is 'm'.
.lp run
Prefix key to run towards a direction. Default is 'G'.
.lp run.nopickup
Prefix key to run towards a direction without picking up items on the way. Default is 'M'.
.lp run.numpad
Prefix key to run towards a direction. With number_pad only. Default is '5'.
.lp rush
Prefix key to rush towards a direction. Default is 'g'.
.hn 2
Configuring Message Types
.pg
You can change the way the messages are shown in the message area, when
@@ -3285,6 +3584,7 @@ s S_spider (arachnid or centipede)
* S_ss4 (magic shield 4 of 4)
^ S_statue_trap (statue trap)
S_stone (dark part of a room)
] S_strange_obj (strange object)
- S_sw_bc (swallow bottom center)
`\e' S_sw_bl (swallow bottom left)
/ S_sw_br (swallow bottom right)

View File

@@ -571,7 +571,9 @@ more info).
\section{Commands}
%.pg
Commands are initiated by typing one or two characters. Some commands,
Commands can initiated by typing one or two characters to which
the command is bound to, or typing the command name in the extended
commands entry. Some commands,
like ``{\tt search}'', do not require that any more information be collected
by {\it NetHack\/}. Other commands might require additional information, for
example a direction, or an object to be used. For those commands that
@@ -607,7 +609,7 @@ greater control (see below). To cancel a count or a prefix, press the
%.pg
The list of commands is rather long, but it can be read at any time
during the game through the `{\tt ?}' command, which accesses a menu of
helpful texts. Here are the commands for your reference:
helpful texts. Here are the default key bindings for your reference:
\blist{}
%.lp
@@ -615,7 +617,7 @@ helpful texts. Here are the commands for your reference:
Help menu: display one of several help texts available.
%.lp
\item[\tb{/}]
The {\tt what-is} command, to
The {\tt whatis} command, to
tell what a symbol represents. You may choose to specify a location
or type a symbol (or even a whole word) to explain.
Specifying a location is done by moving the cursor to a particular spot
@@ -704,7 +706,8 @@ A few other commands (eat food, offer sacrifice, apply tinning-kit) use
the `{\tt m}' prefix to skip checking for applicable objects on the floor
and go straight to checking inventory,
or (for ``{\tt \#loot}'' to remove a saddle),
skip containers and go straight to adjacent monsters.
skip containers and go straight to adjacent monsters. The prefix will
make ``{\tt \#travel}'' command show a menu of interesting targets in sight.
%.lp
\item[\tb{F[yuhjklbn]}]
Prefix: fight a monster (even if you only guess one is there).
@@ -985,7 +988,7 @@ via the ``{\tt \#twoweapon}'' extended command.\\
(In versions prior to 3.6 this was the command to switch from normal
play to ``explore mode'', also known as ``discovery mode'', which has now
been moved to ``{\tt \#explore}''.)
been moved to ``{\tt \#exploremode}''.)
%.lp
\item[\tb{\^{}X}]
Display basic information about your character.\\
@@ -1092,7 +1095,7 @@ the game was compiled with.
\item[\tb{\#adjust}]
Adjust inventory letters (most useful when the
{\it fixinv\/}
option is ``on'').\\
option is ``on''). Autocompletes. Default key is '{\tt M-a}'.\\
%.lp ""
This command allows you to move an item from one particular inventory
slot to another so that it has a letter which is more meaningful for you
@@ -1104,65 +1107,162 @@ choosing the item to adjust, enter a count prior to its letter.
\item[\tb{\#annotate}]
Allows you to specify one line of text to associate with the current
dungeon level. All levels with annotations are displayed by the
``{\tt \#overview}'' command.
``{\tt \#overview}'' command. Autocompletes. Default key is '{\tt M-A}',
and '{\tt \^{}N}' if {\it number\verb+_+pad\/} is on.
%.lp
\item[\tb{\#apply}]
Apply (use) a tool such as a pick-axe, a key, or a lamp.
Default key is '{\tt a}'.
%.lp
\item[\tb{\#attributes}]
Show your attributes. Default key is '{\tt \^{}X}'.\\
%.lp
\item[\tb{\#autopickup}]
Toggle the {\it autopickup\/} -option. Default key is '{\tt @}'.\\
%.lp
\item[\tb{\#call}]
Call (name) a monster, or a object in inventory, on the floor,
or in the discoveries list, or add an annotation for the
current level (same as ``{\tt \#annotate}''). Default key is '{\tt C}'.
%.lp
\item[\tb{\#cast}]
Cast a spell. Default key is '{\tt Z}'.\\
%.lp
\item[\tb{\#chat}]
Talk to someone.
Talk to someone. Default key is '{\tt M-c}'.\\
%.lp
\item[\tb{\#close}]
Close a door. Default key is '{\tt c}'.\\
%.lp
\item[\tb{\#conduct}]
List voluntary challenges you have maintained.\\
List voluntary challenges you have maintained. Autocompletes.
Default key is '{\tt M-C}'.\\
%.lp ""
See the section below entitled ``Conduct'' for details.
%.lp
\item[\tb{\#dip}]
Dip an object into something.
Dip an object into something. Autocompletes. Default key is '{\tt M-d}'.
%.lp
\item[\tb{\#down}]
Go down a staircase. Default key is '{\tt >}'.
%.lp
\item[\tb{\#drop}]
Drop an item. Default key is '{\tt d}'.
%.lp
\item[\tb{\#droptype}]
Drop specific item types. Default key is '{\tt D}'.
%.lp
\item[\tb{\#eat}]
Eat something. Default key is '{\tt e}'.
%.lp
\item[\tb{\#engrave}]
Engrave writing on the floor. Default key is '{\tt E}'.
%.lp
\item[\tb{\#enhance}]
Advance or check weapon and spell skills.
Advance or check weapon and spell skills. Autocompletes.
Default key is '{\tt M-e}'.
%.lp
\item[\tb{\#exploremode}]
Enter the explore mode.
%.lp
\item[\tb{\#fire}]
Fire ammunition from quiver. Default key is '{\tt f}'.
%.lp
\item[\tb{\#force}]
Force a lock.
Force a lock. Autocompletes. Default key is '{\tt M-f}'.
%.lp
\item[\tb{\#glance}]
Show what type of thing a map symbol corresponds to. Default key is '{\tt ;}'.
%.lp
\item[\tb{\#help}]
Show the help menu. Default key is '{\tt ?}', and '{\tt h}' if {\it number\verb+_+pad\/} is on.
%.lp
\item[\tb{\#history}]
Show long version and game history. Default key is '{\tt V}'.
%.lp
\item[\tb{\#inventory}]
Show your inventory. Default key is '{\tt i}'.
%.lp
\item[\tb{\#inventtype}]
Inventory specific item types. Default key is '{\tt I}'.
%.lp
\item[\tb{\#invoke}]
Invoke an object's special powers.
Invoke an object's special powers. Autocompletes. Default key is '{\tt M-i}'.
%.lp
\item[\tb{\#jump}]
Jump to another location.
Jump to another location. Autocompletes. Default key is '{\tt M-j}', and '{\tt j}' if {\it number\verb+_+pad\/} is on.
%.lp
\item[\tb{\#kick}]
Kick something.
Kick something. Default key is '{\tt \^{}D}', and '{\tt k}' if {\it number\verb+_+pad\/} is on.
%.lp
\item[\tb{\#known}]
Show what object types have been discovered. Default key is '{\tt $\backslash$}'.
%.lp
\item[\tb{\#knownclass}]
Show discovered types for one class of objects. Default key is '{\tt `}'.
%.lp
\item[\tb{\#levelchange}]
Change your experience level. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#lightsources}]
Show mobile light sources. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#look}]
Look at what is here, under you. Default key is '{\tt :}'.
%.lp
\item[\tb{\#loot}]
Loot a box or bag on the floor beneath you, or the saddle
from a steed standing next to you.
from a steed standing next to you. Autocompletes.
Default key is '{\tt M-l}', and '{\tt l}' if {\it number\verb+_+pad\/} is on.
Precede with the `{\tt m}' prefix to skip containers at your location
and go directly to removing a saddle.
%.lp
\item[\tb{\#monpolycontrol}]
Control monster polymorphs. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#monster}]
Use a monster's special ability (when polymorphed into monster form).
Autocompletes. Default key is '{\tt M-m}'.
%.lp
\item[\tb{\#name}]
Name a monster, an individual object, or a type of object. Same as `{\tt C}'.
Name a monster, an individual object, or a type of object. Same as `{\tt \#call}'.
Autocompletes. Default keys are '{\tt N}', '{\tt M-n}', and '{\tt M-N}'.
%.lp
\item[\tb{\#offer}]
Offer a sacrifice to the gods.\\
Offer a sacrifice to the gods. Autocompletes. Default key is '{\tt M-o}'.\\
%.lp ""
You'll need to find an altar to have any chance at success.
Corpses of recently killed monsters are the fodder of choice.
%.lp
\item[\tb{\#open}]
Open a door. Default key is '{\tt o}'.
%.lp
\item[\tb{\#options}]
Show and change option settings. Default key is '{\tt O}'.
%.lp
\item[\tb{\#overview}]
Display information you've discovered about the dungeon. Any visited
level (unless forgotten due to amnesia) with an annotation is included,
and many things (altars, thrones, fountains, and so on; extra stairs
leading to another dungeon branch) trigger an automatic annotation.
If dungeon overview is chosen during end-of-game disclosure, every visited
level will be included regardless of annotations.
level will be included regardless of annotations. Autocompletes.
Default keys are '{\tt \^{}O}', and '{\tt M-O}'.
%.lp
\item[\tb{\#panic}]
Test the panic routine. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#pay}]
Pay your shopping bill. Default key is '{\tt p}'.
%.lp
\item[\tb{\#pickup}]
Pick up things at the current location. Default key is '{\tt ,}'.
%.lp
\item[\tb{\#polyself}]
Polymorph self. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#pray}]
Pray to the gods for help.\\
Pray to the gods for help. Autocompletes. Default key is '{\tt M-p}'.\\
%.lp ""
Praying too soon after receiving prior help is a bad idea.
(Hint: entering the dungeon alive is treated as having received help.
@@ -1173,8 +1273,18 @@ by default, and you can reset the
{\it paranoid\verb+_+confirmation\/}
option to disable it.
%.lp
\item[\tb{\#prevmsg}]
Show previously displayed game messages. Default key is '{\tt \^{}P}'.
%.lp
\item[\tb{\#puton}]
Put on an accessory (ring, amulet, etc). Default key is '{\tt P}'.
%.lp
\item[\tb{\#quaff}]
Quaff (drink) something. Default key is '{\tt q}'.
%.lp
\item[\tb{\#quit}]
Quit the program without saving your game.\\
Quit the program without saving your game. Autocompletes.
Default key is '{\tt M-q}'.
%.lp ""
Since using this command by accident would throw away the current game,
you are asked to confirm your intent before quitting. By default a
@@ -1182,40 +1292,196 @@ response of `{\tt y}' acknowledges that intent. You can set the
{\it paranoid\verb+_+confirmation\/}
option to require a response of ``{\tt yes}'' instead.
%.lp
\item[\tb{\#quiver}]
Select ammunition for quiver. Default key is '{\tt Q}'.
%.lp
\item[\tb{\#read}]
Read a scroll, a spellbook, or something else. Default key is '{\tt r}'.
%.lp
\item[\tb{\#redraw}]
Redraw the screen. Default key is '{\tt \^{}R}', and '{\tt \^{}L}' if {\it number\verb+_+pad\/} is on.
%.lp
\item[\tb{\#remove}]
Remove an accessory (ring, amulet, etc). Default key is '{\tt R}'.
%.lp
\item[\tb{\#ride}]
Ride (or stop riding) a saddled creature.
Ride (or stop riding) a saddled creature. Autocompletes.
Default key is '{\tt M-R}'.
%.lp
\item[\tb{\#rub}]
Rub a lamp or a stone.
Rub a lamp or a stone. Autocompletes. Default key is '{\tt M-r}'.
%.lp
\item[\tb{\#save}]
Save the game. Default key is '{\tt S}'.
%.lp
\item[\tb{\#search}]
Search for traps and secret doors around you. Default key is '{\tt s}'.
%.lp
\item[\tb{\#seeall}]
Show all equipment in use. Default key is '{\tt *}'.
%.lp
\item[\tb{\#seeamulet}]
Show the amulet currently worn. Default key is '{\tt "}'.
%.lp
\item[\tb{\#seearmor}]
Show the armor currently worn. Default key is '{\tt [}'.
%.lp
\item[\tb{\#seegold}]
Count your gold. Default key is '{\tt \$}'.
%.lp
\item[\tb{\#seenv}]
Show seen vectors. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#seerings}]
Show the ring(s) currently worn. Default key is '{\tt =}'.
%.lp
\item[\tb{\#seespells}]
List and reorder known spells. Default key is '{\tt +}'.
%.lp
\item[\tb{\#seetools}]
Show the tools currently in use. Default key is '{\tt (}'.
%.lp
\item[\tb{\#seetrap}]
Show the type of a trap near you. Default key is '{\tt \^{}}'.
%.lp
\item[\tb{\#seeweapon}]
Show the weapon currently wielded. Default key is '{\tt )}'.
%.lp
\item[\tb{\#shell}]
Do a shell escape. Default key is '{\tt !}'.
%.lp
\item[\tb{\#sit}]
Sit down.
Sit down. Autocompletes. Default key is '{\tt M-s}'.
%.lp
\item[\tb{\#stats}]
Show memory statistics. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#suspend}]
Suspend the game. Default key is '{\tt \^{}Z}'.
%.lp
\item[\tb{\#swap}]
Swap wielded and secondary weapons. Default key is '{\tt x}'.
%.lp
\item[\tb{\#takeoff}]
Take off one piece of armor. Default key is '{\tt T}'.
%.lp
\item[\tb{\#takeoffall}]
Remove all armor. Default key is '{\tt A}'.
%.lp
\item[\tb{\#teleport}]
Teleport around the level. Default key is '{\tt \^{}T}'.
%.lp
\item[\tb{\#terrain}]
Show bare map without displaying monsters, objects, or traps.
Autocompletes.
%.lp
\item[\tb{\#throw}]
Throw something. Default key is '{\tt t}'.
%.lp
\item[\tb{\#timeout}]
Look at the timeout queue. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#tip}]
Tip over a container (bag or box) to pour out its contents.
Autocompletes. Default key is '{\tt M-T}'.
%.lp
\item[\tb{\#travel}]
Travel to a specific location on the map. Default key is '{\tt _}'.
Using the ``request menu'' prefix shows a menu of interesting targets in sight
without asking to move the cursor.
%.lp
\item[\tb{\#turn}]
Turn undead.
Turn undead away. Autocompletes. Default key is '{\tt M-t}'.
%.lp
\item[\tb{\#twoweapon}]
Toggle two-weapon combat on or off.\\
Toggle two-weapon combat on or off. Autocompletes. Default keys are '{\tt X}',
and '{\tt M-2}'.
%.lp ""
Note that you must
use suitable weapons for this type of combat, or it will
be automatically turned off.
%.lp
\item[\tb{\#untrap}]
Untrap something (trap, door, or chest).\\
Untrap something (trap, door, or chest). Default key is '{\tt M-u}', and '{\tt u}' if {\it number\verb+_+pad\/} is on.
%.lp ""
In some circumstancs it can also be used to rescue trapped monsters.
%.lp
\item[\tb{\#up}]
Go up a staircase. Default key is '{\tt <}'.
%.lp
\item[\tb{\#vanquished}]
List vanquished monsters. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#version}]
Print compile time options for this version of {\it NetHack}.
Autocompletes. Default key is '{\tt M-v}'.
%.lp
\item[\tb{\#versionshort}]
Show version string. Default key is '{\tt v}'.
%.lp
\item[\tb{\#vision}]
Show vision array. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wait}]
Rest one move while doing nothing. Default key is '{\tt .}', and '{\tt{ }}' if {\it rest\verb+_+on\verb+_+space\/} is on.
%.lp
\item[\tb{\#wear}]
Wear a piece of armor. Default key is '{\tt W}'.
%.lp
\item[\tb{\#whatdoes}]
Tell what a key does. Default key is '{\tt \&}'.
%.lp
\item[\tb{\#whatis}]
Show what type of thing a symbol corresponds to. Default key is '{\tt /}'.
%.lp
\item[\tb{\#wield}]
Wield a weapon. Default key is '{\tt w}'.
%.lp
\item[\tb{\#wipe}]
Wipe off your face.
Wipe off your face. Autocompletes. Default key is '{\tt M-w}'.
%.lp
\item[\tb{\#wizdebug\verb+_+bury}]
Bury objects under and around you. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizdebug\verb+_+traveldisplay}]
Toggle travel display. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizdetect}]
Search a room. Autocompletes. Wizard-mode only. Default key is '{\tt \^{}E}'.
%.lp
\item[\tb{\#wizgenesis}]
Create a monster. Autocompletes. Wizard-mode only. Default key is '{\tt \^{}G}'.
%.lp
\item[\tb{\#wizidentify}]
Identify all items in inventory. Autocompletes. Wizard-mode only.
Default key is '{\tt \^{}I}'.
%.lp
\item[\tb{\#wizintrinsic}]
Set intrinsic. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizlevelport}]
Teleport to another level. Autocompletes. Wizard-mode only. Default key is '{\tt \^{}V}'.
%.lp
\item[\tb{\#wizmap}]
Map the level. Autocompletes. Wizard-mode only. Default key is '{\tt \^{}F}'.
%.lp
\item[\tb{\#wizrumorcheck}]
Verify rumor boundaries. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizsmell}]
Smell monster. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizwhere}]
Show locations of special levels. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#wizwish}]
Wish for something. Autocompletes. Wizard-mode only. Default key is '{\tt \^{}W}'.
%.lp
\item[\tb{\#wmode}]
Show wall modes. Autocompletes. Wizard-mode only.
%.lp
\item[\tb{\#zap}]
Zap a wand. Default key is '{\tt z}'.
%.lp
\item[\tb{\#?}]
Help menu: get the list of available extended commands.
@@ -2464,10 +2730,42 @@ HACKDIR, must be writeable.
\item[\bb{TROUBLEDIR}]
The location that a record of game aborts and self-diagnosed game problems
is kept. Defaults to HACKDIR, must be writeable.
%.lp
\item[\bb{AUTOCOMPLETE}]
Enable or disable an extended command autocompletion.
Autocompletion has no effect for the X11 windowport.
You can specify multiple autocompletions. To enable
autocompletion, list the extended command. Prefix the
command with ``{{\tt !}}'' to disable the autocompletion
for that command.
%.pg
Example:
%.sd
\begin{verbatim}
AUTOCOMPLETE=zap,!annotate
\end{verbatim}
%.ed
%.lp
\item[\bb{AUTOPICKUP\_EXCEPTION}]
Set exceptions to the {{\it pickup\_types\/}}
option. See the ``Configuring Autopickup Exceptions'' section.
%.lp
\item[\bb{BINDINGS}]
Change the key bindings of some special keys, menu accelerators, or
extended commands. You can specify multiple bindings. Format is key
followed by the command, separated by a colon.
See the ``Changing Key Bindings`` section for more information.
%.pg
Example:
%.sd
\begin{verbatim}
BIND=^X:getpos.autodescribe
\end{verbatim}
%.ed
%.lp
\item[\bb{MSGTYPE}]
Change the way messages are shown in the top status line.
@@ -3552,6 +3850,154 @@ The last example results in the exclusion of items known to be cursed from
autopickup.
%.lp
%.hn 2
\subsection*{Changing Key Bindings}
%.pg
It is possible to change the default key bindings of some special commands,
menu accelerator keys, and extended commands, by using BIND stanzas in the
configuration file. Format is key, followed by the command to bind to, separated
by a colon. The key can be a single character (``{\tt x}''),
a control key (``{\tt \^{}X}'', ``{\tt C-x}''), a meta key (``{\tt M-x}''),
or a three-digit decimal ASCII code.
%.pg
For example:
\begin{verbatim}
BIND=^X:getpos.autodescribe
BIND={:menu_first_page
BIND=v:loot
\end{verbatim}
\blist{}
%.lp "Extended command keys"
\item[\tb{Extended command keys}]
You can bind multiple keys to the same extended command. Unbind a key by
using ``{\tt nothing}'' as the extended command to bind to. You can also bind
the ``{\tt <esc>}'', ``{\tt <enter>}'', and ``{\tt <space>}'' keys.
%.lp "Menu accelerator keys"
\item[\tb{Menu accelerator keys}]
The menu control or accelerator keys can also be rebound via OPTIONS-lines
in the config file. You cannot bind object symbols into menu accelerators.
%.lp "Special command keys"
\item[\tb{Special command keys}]
Below are the special commands you can rebind. Some of them can be bound to
same keys with no problems, others are in the same "context", and if bound
to same keys, only one of those commands will be available. Special command
can only be bound to a single key.
%.pg
\blist{}
%.lp
\item{\bb{count}}
Prefix key to start a count, to repeat a command this many times. With {\it number\verb+_+pad\/} only. Default is ``{\tt n}''.
%.lp
\item{\bb{doinv}}
Show inventory. With {\it number\verb+_+pad\/} only. Default is ``{\tt 0}''.
%.lp
\item{\bb{fight}}
Prefix key to force fight a direction. Default is ``{\tt F}''.
%.lp
\item{\bb{fight.numpad}}
Prefix key to force fight a direction. With {\it number\verb+_+pad\/} only. Default is ``{\tt -}''.
%.lp
\item{\bb{getdir.help}}
When asked for a direction, the key to show the help. Default is ``{\tt ?}''.
%.lp
\item{\bb{getdir.self}}
When asked for a direction, the key to target yourself. Default is ``{\tt .}''.
%.lp
\item{\bb{getdir.self2}}
When asked for a direction, the key to target yourself. Default is ``{\tt s}''.
%.lp
\item{\bb{getpos.autodescribe}}
When asked for a location, the key to toggle {\it autodescribe\/}. Default is ``{\tt \#}''.
%.lp
\item{\bb{getpos.door.next}}
When asked for a location, the key to go to next closest door or doorway. Default is ``{\tt d}''.
%.lp
\item{\bb{getpos.door.prev}}
When asked for a location, the key to go to previous closest door or doorway. Default is ``{\tt D}''.
%.lp
\item{\bb{getpos.help}}
When asked for a location, the key to show help. Default is ``{\tt ?}''.
%.lp
\item{\bb{getpos.mon.next}}
When asked for a location, the key to go to next closest monster. Default is ``{\tt m}''.
%.lp
\item{\bb{getpos.mon.prev}}
When asked for a location, the key to go to previous closest monster. Default is ``{\tt M}''.
%.lp
\item{\bb{getpos.obj.next}}
When asked for a location, the key to go to next closest object. Default is ``{\tt o}''.
%.lp
\item{\bb{getpos.obj.prev}}
When asked for a location, the key to go to previous closest object. Default is ``{\tt O}''.
%.lp
\item{\bb{getpos.menu}}
When asked for a location, show a menu of all interesting targets. Default is '{\tt A}'.
%.lp
\item{\bb{getpos.menu.cansee}}
When asked for a location, show a menu of interesting targets in view. Default is '{\tt a}'.
%.lp
\item{\bb{getpos.pick}}
When asked for a location, the key to choose the location, and possibly ask for more info. Default is ``{\tt .}''.
%.lp
\item{\bb{getpos.pick.once}}
When asked for a location, the key to choose the location, and skip asking for more info. Default is ``{\tt ,}''.
%.lp
\item{\bb{getpos.pick.quick}}
When asked for a location, the key to choose the location, skip asking for more info, and exit the location asking loop. Default is ``{\tt ;}''.
%.lp
\item{\bb{getpos.pick.verbose}}
When asked for a location, the key to choose the location, and show more info without asking. Default is ``{\tt :}''.
%.lp
\item{\bb{getpos.self}}
When asked for a location, the key to go to your location. Default is ``{\tt @}''.
%.lp
\item{\bb{getpos.unexplored.next}}
When asked for a location, the key to go to next closest unexplored location. Default is ``{\tt x}''.
%.lp
\item{\bb{getpos.unexplored.prev}}
When asked for a location, the key to go to previous closest unexplored location. Default is ``{\tt X}''.
%.lp
\item{\bb{getpos.valid}}
When asked for a location, the key to go to show valid target locations. Default is ``{\tt \$}''.
%.lp
\item{\bb{nopickup}}
Prefix key to move without picking up items. Default is ``{\tt m}''.
%.lp
\item{\bb{redraw}}
Key to redraw the screen. Default is ``{\tt \^{}R}''.
%.lp
\item{\bb{redraw.numpad}}
Key to redraw the screen. With {\it number\verb+_+pad\/} only. Default is ``{\tt \^{}L}''.
%.lp
\item{\bb{repeat}}
Key to repeat previous command. Default is ``{\tt \^{}A}''.
%.lp
\item{\bb{reqmenu}}
Prefix key to request menu from some commands. Default is ``{\tt m}''.
%.lp
\item{\bb{run}}
Prefix key to run towards a direction. Default is ``{\tt G}''.
%.lp
\item{\bb{run.nopickup}}
Prefix key to run towards a direction without picking up items on the way. Default is ``{\tt M}''.
%.lp
\item{\bb{run.numpad}}
Prefix key to run towards a direction. With {\it number\verb+_+pad\/} only. Default is ``{\tt 5}''.
%.lp
\item{\bb{rush}}
Prefix key to rush towards a direction. Default is ``{\tt g}''.
\elist
\elist
%.hn 2
\subsection*{Configuring Message Types}
@@ -3926,6 +4372,7 @@ Default & Symbol Name & Description\\
\verb@*@ & S\verb+_+ss4 & (magic shield 4 of 4)\\
\verb@^@ & S\verb+_+statue\verb+_+trap & (statue trap)\\
\verb@ @ & S\verb+_+stone & (dark part of a room)\\
\verb@]@ & S\verb+_+strange\verb+_+obj & (strange object)\\
\verb@-@ & S\verb+_+sw\verb+_+bc & (swallow bottom center)\\
\verb@\@ & S\verb+_+sw\verb+_+bl & (swallow bottom left)\\
\verb@/@ & S\verb+_+sw\verb+_+br & (swallow bottom right )\\
@@ -3998,7 +4445,7 @@ These co-ordinates are often useful in giving players a better sense of the
overall location of items on the screen.
%.pg
NetHack can also be compiled with support for sending the game messages
to an external program, such as a text-to-speech synthesizer. If the #version
to an external program, such as a text-to-speech synthesizer. If the \#version
extended command shows "external program as a message handler", your NetHack
has been compiled with the capability. When compiling NetHack from source
on Linux and other POSIX systems, define {\it MSGHANDLER\/} to enable it. To use

View File

@@ -344,6 +344,10 @@ don't show monster vs. monster attack message, if the message refers to
a monster that cannot be sensed by the hero
umber hulk gazing at hidden mimic forces mimic to unhide
show some timed hero properties in wizard-mode #timeout
give quest guardians some equipment
hero polyed into ghoul can only eat non-veggy corpses or eggs
kicking activates statue traps
pets start with apport equal to your charisma
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
@@ -441,8 +445,8 @@ allow knife and stiletto as possible tin opening tools
wizard mode #wizintrinsic command
additional tribute passages for The Colour of Magic, The Light Fantastic,
Equal Rites, Mort, Sourcery, Wyrd Sisters, Pyramids, Guards! Guards!,
Eric, Moving Pictures, Reaper Man, Witches Abroad, Snuff, and
Raising Steam
Eric, Moving Pictures, Reaper Man, Witches Abroad, Snuff,
Raising Steam, and The Shepherd's Crown
compile-time options SIMPLE_MAIL and SERVER_ADMIN_MSG for public server use
database entries for Cleaver, Sunsword, Frost and Fire brands, and
polymorph trap
@@ -496,6 +500,8 @@ when moving a cursor for travel target, show if there is no known travel
show the reason why travel was interrupted if mention_walls is on
random horses have a tiny chance of being generated saddled
give feedback just before timed levitation runs out
travel accepts 'm' (request menu) prefix
pressing a or A when cursor positioning shows menu of "interesting" features
Platform- and/or Interface-Specific New Features
@@ -514,6 +520,7 @@ X11: status display split into three columns to accomodate Stone/Deaf/Lev/&c;
NetHack*status_condition.foreground, .background, and .showGrip
resources replaced by status_condition[1-3].*
X11: more terminal-like default resources
win32gui: save and load map colors from registry
NetHack Community Patches (or Variation) Included
@@ -530,6 +537,7 @@ Ray Chason's MS-DOS port restored to functionality with credit to Reddit user
b_helyer for the fix to sys/share/pcmain.c
Ray Chason's MSDOS port support for some VESA modes
Darshan Shaligram's pet ranged attack
Jason Dorje Short's key rebinding
Code Cleanup and Reorganization

View File

@@ -184,7 +184,10 @@ E void FDECL(set_occupation, (int (*)(void), const char *, int));
E char NDECL(pgetchar);
E void FDECL(pushch, (CHAR_P));
E void FDECL(savech, (CHAR_P));
E void NDECL(add_debug_extended_commands);
E const char *FDECL(key2extcmddesc, (UCHAR_P));
E boolean FDECL(bind_specialkey, (UCHAR_P, const char *));
E char FDECL(txt2key, (char *));
E void FDECL(parseautocomplete, (char *, BOOLEAN_P));
E void FDECL(reset_commands, (BOOLEAN_P));
E void FDECL(rhack, (char *));
E int NDECL(doextlist);
@@ -193,6 +196,8 @@ E int NDECL(enter_explore_mode);
E void FDECL(enlightenment, (int, int));
E void FDECL(youhiding, (BOOLEAN_P, int));
E void FDECL(show_conduct, (int));
E void FDECL(bind_key, (UCHAR_P, const char *));
E void NDECL(dokeylist);
E int FDECL(xytod, (SCHAR_P, SCHAR_P));
E void FDECL(dtoxy, (coord *, int));
E int FDECL(movecmd, (CHAR_P));
@@ -211,6 +216,7 @@ E void NDECL(end_of_input);
#endif
E char NDECL(readchar);
E void NDECL(sanity_check);
E char* FDECL(key2txt, (UCHAR_P, char *));
E char FDECL(yn_function, (const char *, const char *, CHAR_P));
E boolean FDECL(paranoid_query, (BOOLEAN_P, const char *));
@@ -373,6 +379,7 @@ E void NDECL(heal_legs);
/* ### do_name.c ### */
E char *FDECL(coord_desc, (int, int, char *, CHAR_P));
E boolean FDECL(getpos_menu, (coord *, BOOLEAN_P));
E int FDECL(getpos, (coord *, BOOLEAN_P, const char *));
E void FDECL(getpos_sethilite, (void (*f)(int)));
E void FDECL(new_mname, (struct monst *, int));
@@ -847,6 +854,7 @@ E char *FDECL(lcase, (char *));
E char *FDECL(ucase, (char *));
E char *FDECL(upstart, (char *));
E char *FDECL(mungspaces, (char *));
E char *FDECL(trimspaces, (char *));
E char *FDECL(strip_newline, (char *));
E char *FDECL(eos, (char *));
E boolean FDECL(str_end_is, (const char *, const char *));
@@ -1664,8 +1672,11 @@ E void FDECL(next_opt, (winid, const char *));
E int FDECL(fruitadd, (char *, struct fruit *));
E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P,
char *, char *));
E void FDECL(parsebindings, (char *));
E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
E char FDECL(get_menu_cmd_key, (CHAR_P));
E char FDECL(map_menu_cmd, (CHAR_P));
E void FDECL(show_menu_controls, (winid, BOOLEAN_P));
E void FDECL(assign_warnings, (uchar *));
E char *FDECL(nh_getenv, (const char *));
E void FDECL(set_duplicate_opt_detection, (int));

View File

@@ -424,9 +424,56 @@ extern NEARDATA struct instance_flags iflags;
#ifdef NHSTDC
/* forward declaration sufficient to declare pointers */
struct func_tab; /* from func_tab.h */
struct ext_func_tab; /* from func_tab.h */
#endif
/* special key functions */
enum nh_keyfunc {
NHKF_ESC = 0,
NHKF_DOAGAIN,
NHKF_REQMENU,
/* run ... clicklook need to be in a continuous block */
NHKF_RUN,
NHKF_RUN2,
NHKF_RUSH,
NHKF_FIGHT,
NHKF_FIGHT2,
NHKF_NOPICKUP,
NHKF_RUN_NOPICKUP,
NHKF_DOINV,
NHKF_TRAVEL,
NHKF_CLICKLOOK,
NHKF_REDRAW,
NHKF_REDRAW2,
NHKF_GETDIR_SELF,
NHKF_GETDIR_SELF2,
NHKF_GETDIR_HELP,
NHKF_COUNT,
NHKF_GETPOS_SELF,
NHKF_GETPOS_PICK,
NHKF_GETPOS_PICK_Q, /* quick */
NHKF_GETPOS_PICK_O, /* once */
NHKF_GETPOS_PICK_V, /* verbose */
NHKF_GETPOS_SHOWVALID,
NHKF_GETPOS_AUTODESC,
NHKF_GETPOS_MON_NEXT,
NHKF_GETPOS_MON_PREV,
NHKF_GETPOS_OBJ_NEXT,
NHKF_GETPOS_OBJ_PREV,
NHKF_GETPOS_DOOR_NEXT,
NHKF_GETPOS_DOOR_PREV,
NHKF_GETPOS_UNEX_NEXT,
NHKF_GETPOS_UNEX_PREV,
NHKF_GETPOS_HELP,
NHKF_GETPOS_MENU,
NHKF_GETPOS_MENU_FOV,
NUM_NHKF
};
/* commands[] is used to directly access cmdlist[] instead of looping
through it to find the entry for a given input character;
move_X is the character used for moving one step in direction X;
@@ -443,7 +490,8 @@ struct cmd {
char move_W, move_NW, move_N, move_NE, move_E, move_SE, move_S, move_SW;
const char *dirchars; /* current movement/direction characters */
const char *alphadirchars; /* same as dirchars if !numpad */
const struct func_tab *commands[256]; /* indexed by input character */
const struct ext_func_tab *commands[256]; /* indexed by input character */
char spkeys[NUM_NHKF];
};
extern NEARDATA struct cmd Cmd;

View File

@@ -5,17 +5,18 @@
#ifndef FUNC_TAB_H
#define FUNC_TAB_H
struct func_tab {
char f_char;
boolean can_if_buried;
int NDECL((*f_funct));
const char *f_text;
};
/* extended command flags */
#define IFBURIED 0x01 /* can do command when buried */
#define AUTOCOMPLETE 0x02 /* command autocompletes */
#define WIZMODECMD 0x04 /* wizard-mode command */
#define GENERALCMD 0x08 /* general command, does not take game time */
struct ext_func_tab {
uchar key;
const char *ef_txt, *ef_desc;
int NDECL((*ef_funct));
boolean can_if_buried;
int flags;
const char *f_text;
};
extern struct ext_func_tab extcmdlist[];

View File

@@ -230,6 +230,7 @@
#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap)
#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge)
#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor)
#define is_cmap_wall(i) ((i) >= S_stone && (i) <= S_trwall)
struct symdef {
uchar sym;

View File

@@ -34,9 +34,6 @@ boolean resuming;
monstr_init(); /* monster strengths */
objects_init();
if (wizard)
add_debug_extended_commands();
/* if a save file created in normal mode is now being restored in
explore mode, treat it as normal restore followed by 'X' command
to use up the save file and require confirmation for explore mode */

1009
src/cmd.c

File diff suppressed because it is too large Load Diff

View File

@@ -59,45 +59,90 @@ const char *goal;
putstr(tmpwin, 0, sbuf);
putstr(tmpwin, 0, "Use 'H', 'J', 'K', 'L' to move the cursor 8 units at a time.");
putstr(tmpwin, 0, "Or enter a background symbol (ex. '<').");
putstr(tmpwin, 0, "Use '@' to move the cursor on yourself.");
if (!iflags.terrainmode || (iflags.terrainmode & TER_MON) != 0)
putstr(tmpwin, 0, "Use 'm' or 'M' to move the cursor to next monster.");
if (!iflags.terrainmode || (iflags.terrainmode & TER_OBJ) != 0)
putstr(tmpwin, 0, "Use 'o' or 'O' to move the cursor to next object.");
Sprintf(sbuf, "Use '%s' to move the cursor on yourself.",
visctrl(Cmd.spkeys[NHKF_GETPOS_SELF]));
putstr(tmpwin, 0, sbuf);
if (!iflags.terrainmode || (iflags.terrainmode & TER_MON) != 0) {
Sprintf(sbuf, "Use '%s' or '%s' to move the cursor to next monster.",
visctrl(Cmd.spkeys[NHKF_GETPOS_MON_NEXT]),
visctrl(Cmd.spkeys[NHKF_GETPOS_MON_PREV]));
putstr(tmpwin, 0, sbuf);
}
if (!iflags.terrainmode || (iflags.terrainmode & TER_OBJ) != 0) {
Sprintf(sbuf, "Use '%s' or '%s' to move the cursor to next object.",
visctrl(Cmd.spkeys[NHKF_GETPOS_OBJ_NEXT]),
visctrl(Cmd.spkeys[NHKF_GETPOS_OBJ_PREV]));
putstr(tmpwin, 0, sbuf);
}
if (!iflags.terrainmode || (iflags.terrainmode & TER_MAP) != 0) {
/* both of these are primarily useful when choosing a travel
destination for the '_' command */
putstr(tmpwin, 0,
"Use 'd' or 'D' to move the cursor to next door or doorway.");
putstr(tmpwin, 0,
"Use 'x' or 'X' to move the cursor to unexplored location.");
Sprintf(sbuf,
"Use '%s' or '%s' to move the cursor to next door or doorway.",
visctrl(Cmd.spkeys[NHKF_GETPOS_DOOR_NEXT]),
visctrl(Cmd.spkeys[NHKF_GETPOS_DOOR_PREV]));
putstr(tmpwin, 0, sbuf);
Sprintf(sbuf,
"Use '%s' or '%s' to move the cursor to unexplored location.",
visctrl(Cmd.spkeys[NHKF_GETPOS_UNEX_NEXT]),
visctrl(Cmd.spkeys[NHKF_GETPOS_UNEX_PREV]));
putstr(tmpwin, 0, sbuf);
}
Sprintf(sbuf, "Use '%s' for a menu of interesting targets in view.",
visctrl(Cmd.spkeys[NHKF_GETPOS_MENU_FOV]));
putstr(tmpwin, 0, sbuf);
Sprintf(sbuf, "Use '%s' for a menu of all interesting targets.",
visctrl(Cmd.spkeys[NHKF_GETPOS_MENU]));
putstr(tmpwin, 0, sbuf);
if (!iflags.terrainmode) {
if (getpos_hilitefunc)
putstr(tmpwin, 0, "Use '$' to display valid locations.");
putstr(tmpwin, 0, "Use '#' to toggle automatic description.");
if (iflags.cmdassist) /* assisting the '/' command, I suppose... */
putstr(tmpwin, 0,
(iflags.getpos_coords == GPCOORDS_NONE)
? "(Set 'whatis_coord' option to include coordinates with '#' text.)"
: "(Reset 'whatis_coord' option to omit coordinates from '#' text.)");
char kbuf[BUFSZ];
if (getpos_hilitefunc) {
Sprintf(sbuf, "Use '%s' to display valid locations.",
visctrl(Cmd.spkeys[NHKF_GETPOS_SHOWVALID]));
putstr(tmpwin, 0, sbuf);
}
Sprintf(sbuf, "Use '%s' to toggle automatic description.",
visctrl(Cmd.spkeys[NHKF_GETPOS_AUTODESC]));
putstr(tmpwin, 0, sbuf);
if (iflags.cmdassist) { /* assisting the '/' command, I suppose... */
Sprintf(sbuf,
(iflags.getpos_coords == GPCOORDS_NONE)
? "(Set 'whatis_coord' option to include coordinates with '%s' text.)"
: "(Reset 'whatis_coord' option to omit coordinates from '%s' text.)",
visctrl(Cmd.spkeys[NHKF_GETPOS_AUTODESC]));
}
/* disgusting hack; the alternate selection characters work for any
getpos call, but only matter for dowhatis (and doquickwhatis) */
doing_what_is = (goal == what_is_an_unknown_object);
Sprintf(sbuf, "Type a '.'%s when you are at the right place.",
doing_what_is ? " or ',' or ';' or ':'" : "");
doing_what_is = (goal == what_is_an_unknown_object);
if (doing_what_is) {
Sprintf(kbuf, "'%s' or '%s' or '%s' or '%s'",
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK]),
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_Q]),
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_O]),
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_V]));
} else {
Sprintf(kbuf, "'%s'", visctrl(Cmd.spkeys[NHKF_GETPOS_PICK]));
}
Sprintf(sbuf, "Type a %s when you are at the right place.", kbuf);
putstr(tmpwin, 0, sbuf);
if (doing_what_is) {
putstr(tmpwin, 0,
" ':' describe current spot, show 'more info', move to another spot.");
Sprintf(sbuf,
" '.' describe current spot,%s move to another spot;",
" '%s' describe current spot, show 'more info', move to another spot.",
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_V]));
putstr(tmpwin, 0, sbuf);
Sprintf(sbuf,
" '%s' describe current spot,%s move to another spot;",
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK]),
flags.help ? " prompt if 'more info'," : "");
putstr(tmpwin, 0, sbuf);
putstr(tmpwin, 0,
" ',' describe current spot, move to another spot;");
putstr(tmpwin, 0,
" ';' describe current spot, stop looking at things;");
Sprintf(sbuf,
" '%s' describe current spot, move to another spot;",
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_Q]));
putstr(tmpwin, 0, sbuf);
Sprintf(sbuf,
" '%s' describe current spot, stop looking at things;",
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK_O]));
putstr(tmpwin, 0, sbuf);
}
}
if (!force)
@@ -135,7 +180,10 @@ enum gloctypes {
GLOC_DOOR,
GLOC_EXPLORE,
NUM_GLOCS
NUM_GLOCS,
GLOC_INTERESTING,
GLOC_INTERESTING_FOV
};
@@ -183,6 +231,26 @@ int x,y, gloc;
|| IS_UNEXPLORED_LOC(x - 1, y)
|| IS_UNEXPLORED_LOC(x, y + 1)
|| IS_UNEXPLORED_LOC(x, y - 1)));
case GLOC_INTERESTING_FOV:
if (!cansee(x,y))
return FALSE;
case GLOC_INTERESTING:
return gather_locs_interesting(x,y, GLOC_DOOR)
|| !(glyph_is_cmap(glyph)
&& (is_cmap_wall(glyph_to_cmap(glyph))
|| glyph_to_cmap(glyph) == S_tree
|| glyph_to_cmap(glyph) == S_bars
|| glyph_to_cmap(glyph) == S_ice
|| glyph_to_cmap(glyph) == S_air
|| glyph_to_cmap(glyph) == S_cloud
|| glyph_to_cmap(glyph) == S_lava
|| glyph_to_cmap(glyph) == S_water
|| glyph_to_cmap(glyph) == S_pool
|| glyph_to_cmap(glyph) == S_ndoor
|| glyph_to_cmap(glyph) == S_room
|| glyph_to_cmap(glyph) == S_darkroom
|| glyph_to_cmap(glyph) == S_corr
|| glyph_to_cmap(glyph) == S_litcorr));
}
/*NOTREACHED*/
return FALSE;
@@ -331,15 +399,88 @@ int cx, cy;
}
}
boolean
getpos_menu(ccp, fovonly)
coord *ccp;
boolean fovonly;
{
coord *garr = DUMMY;
int gcount = 0;
winid tmpwin;
anything any;
int i, pick_cnt;
menu_item *picks = (menu_item *) 0;
char tmpbuf[BUFSZ];
gather_locs(&garr, &gcount,
fovonly ? GLOC_INTERESTING_FOV : GLOC_INTERESTING);
if (gcount < 2) { /* gcount always includes the hero */
You("cannot %s anything interesting.", fovonly ? "see" : "detect");
return FALSE;
}
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
any = zeroany;
for (i = 0; i < gcount; i++) {
char fullbuf[BUFSZ];
coord tmpcc;
const char *firstmatch = "unknown";
int sym = 0;
any.a_int = i + 1;
tmpcc.x = garr[i].x;
tmpcc.y = garr[i].y;
if (do_screen_description(tmpcc, TRUE, sym, tmpbuf, &firstmatch)) {
(void) coord_desc(garr[i].x, garr[i].y, tmpbuf, iflags.getpos_coords);
Sprintf(fullbuf, "%s%s%s", firstmatch, (*tmpbuf ? " " : ""), tmpbuf);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, fullbuf,
MENU_UNSELECTED);
}
}
Sprintf(tmpbuf, "Pick a target%s%s",
fovonly ? " in view" : "",
iflags.getloc_travelmode ? " for travel" : "");
end_menu(tmpwin, tmpbuf);
pick_cnt = select_menu(tmpwin, PICK_ONE, &picks);
destroy_nhwindow(tmpwin);
if (pick_cnt > 0) {
ccp->x = garr[picks->item.a_int - 1].x;
ccp->y = garr[picks->item.a_int - 1].y;
free((genericptr_t) picks);
}
free((genericptr_t) garr);
return (pick_cnt > 0);
}
int
getpos(ccp, force, goal)
coord *ccp;
boolean force;
const char *goal;
{
static const char pick_chars[] = ".,;:",
mMoOdDxX[] = "mMoOdDxX";
const char *cp;
struct {
int nhkf, ret;
} const pick_chars_def[] = {
{ NHKF_GETPOS_PICK, LOOK_TRADITIONAL },
{ NHKF_GETPOS_PICK_Q, LOOK_QUICK },
{ NHKF_GETPOS_PICK_O, LOOK_ONCE },
{ NHKF_GETPOS_PICK_V, LOOK_VERBOSE }
};
const int mMoOdDxX_def[] = {
NHKF_GETPOS_MON_NEXT,
NHKF_GETPOS_MON_PREV,
NHKF_GETPOS_OBJ_NEXT,
NHKF_GETPOS_OBJ_PREV,
NHKF_GETPOS_DOOR_NEXT,
NHKF_GETPOS_DOOR_PREV,
NHKF_GETPOS_UNEX_NEXT,
NHKF_GETPOS_UNEX_PREV
};
char pick_chars[6];
char mMoOdDxX[9];
int result = 0;
int cx, cy, i, c;
int sidx, tx, ty;
@@ -350,10 +491,19 @@ const char *goal;
int gcount[NUM_GLOCS] = DUMMY;
int gidx[NUM_GLOCS] = DUMMY;
for (i = 0; i < SIZE(pick_chars_def); i++)
pick_chars[i] = Cmd.spkeys[pick_chars_def[i].nhkf];
pick_chars[SIZE(pick_chars_def)] = '\0';
for (i = 0; i < SIZE(mMoOdDxX_def); i++)
mMoOdDxX[i] = Cmd.spkeys[mMoOdDxX_def[i]];
mMoOdDxX[SIZE(mMoOdDxX_def)] = '\0';
if (!goal)
goal = "desired location";
if (flags.verbose) {
pline("(For instructions type a '?')");
pline("(For instructions type a '%s')",
visctrl(Cmd.spkeys[NHKF_GETPOS_HELP]));
msg_given = TRUE;
}
cx = ccp->x;
@@ -388,7 +538,7 @@ const char *goal;
if (iflags.autodescribe)
msg_given = FALSE;
if (c == '\033') {
if (c == Cmd.spkeys[NHKF_ESC]) {
cx = cy = -10;
msg_given = TRUE; /* force clear */
result = -1;
@@ -404,7 +554,7 @@ const char *goal;
}
if ((cp = index(pick_chars, c)) != 0) {
/* '.' => 0, ',' => 1, ';' => 2, ':' => 3 */
result = (int) (cp - pick_chars);
result = pick_chars_def[(int) (cp - pick_chars)].ret;
break;
}
for (i = 0; i < 8; i++) {
@@ -442,26 +592,23 @@ const char *goal;
goto nxtc;
}
if (c == '?' || redraw_cmd(c)) {
if (c == '?')
if (c == Cmd.spkeys[NHKF_GETPOS_HELP] || redraw_cmd(c)) {
if (c == Cmd.spkeys[NHKF_GETPOS_HELP])
getpos_help(force, goal);
else /* ^R */
docrt(); /* redraw */
/* update message window to reflect that we're still targetting */
show_goal_msg = TRUE;
msg_given = TRUE;
} else if (c == '$' && getpos_hilitefunc) {
} else if (c == Cmd.spkeys[NHKF_GETPOS_SHOWVALID]
&& getpos_hilitefunc) {
if (!hilite_state) {
(*getpos_hilitefunc)(0);
(*getpos_hilitefunc)(1);
hilite_state = TRUE;
}
goto nxtc;
} else if (c == '#') {
/* unfortunately, using '#' as a command means we can't move
cursor to sinks, iron bars, and poison clouds; perhaps
when autodescribe is already on, next '#' should try to
move to '#' rather than to toggle off? (or ask; ick...) */
} else if (c == Cmd.spkeys[NHKF_GETPOS_AUTODESC]) {
iflags.autodescribe = !iflags.autodescribe;
pline("Automatic description %sis %s.",
flags.verbose ? "of features under cursor " : "",
@@ -470,7 +617,15 @@ const char *goal;
show_goal_msg = TRUE;
msg_given = TRUE;
goto nxtc;
} else if (c == '@') { /* return to hero's spot */
} else if (c == Cmd.spkeys[NHKF_GETPOS_MENU]
|| c == Cmd.spkeys[NHKF_GETPOS_MENU_FOV]) {
coord tmpcrd;
if (getpos_menu(&tmpcrd, (c == Cmd.spkeys[NHKF_GETPOS_MENU_FOV]))) {
cx = tmpcrd.x;
cy = tmpcrd.y;
}
goto nxtc;
} else if (c == Cmd.spkeys[NHKF_GETPOS_SELF]) {
/* reset 'm&M', 'o&O', &c; otherwise, there's no way for player
to achieve that except by manually cycling through all spots */
for (i = 0; i < NUM_GLOCS; i++)
@@ -568,9 +723,10 @@ const char *goal;
if (!force)
Strcpy(note, "aborted");
else
Sprintf(note, "use '%c', '%c', '%c', '%c' or '.'", /* hjkl */
Sprintf(note, "use '%c', '%c', '%c', '%c' or '%s'", /* hjkl */
Cmd.move_W, Cmd.move_S, Cmd.move_N,
Cmd.move_E);
Cmd.move_E,
visctrl(Cmd.spkeys[NHKF_GETPOS_PICK]));
pline("Unknown direction: '%s' (%s).", visctrl((char) c),
note);
msg_given = TRUE;

View File

@@ -41,7 +41,7 @@ register struct monst *mtmp;
mtmp->meating = 0;
EDOG(mtmp)->droptime = 0;
EDOG(mtmp)->dropdist = 10000;
EDOG(mtmp)->apport = 10;
EDOG(mtmp)->apport = ACURR(A_CHA);
EDOG(mtmp)->whistletime = 0;
EDOG(mtmp)->hungrytime = 1000 + monstermoves;
EDOG(mtmp)->ogoal.x = -1; /* force error if used before set */

View File

@@ -497,15 +497,20 @@ xchar x, y;
|| kickedobj == uchain)
return 0;
if ((trap = t_at(x, y)) != 0
&& (((trap->ttyp == PIT || trap->ttyp == SPIKED_PIT) && !Passes_walls)
|| trap->ttyp == WEB)) {
if (!trap->tseen)
find_trap(trap);
You_cant("kick %s that's in a %s!", something,
Hallucination ? "tizzy" : (trap->ttyp == WEB) ? "web"
: "pit");
return 1;
if ((trap = t_at(x, y)) != 0) {
if (((trap->ttyp == PIT || trap->ttyp == SPIKED_PIT) && !Passes_walls)
|| trap->ttyp == WEB) {
if (!trap->tseen)
find_trap(trap);
You_cant("kick %s that's in a %s!", something,
Hallucination ? "tizzy" :
(trap->ttyp == WEB) ? "web" : "pit");
return 1;
}
if (trap->ttyp == STATUE_TRAP) {
activate_statue_trap(trap, x,y, FALSE);
return 1;
}
}
if (Fumbling && !rn2(3)) {

View File

@@ -671,6 +671,7 @@ struct symparse loadsyms[] = {
{ SYM_PCHAR, S_explode7, "S_explode7" },
{ SYM_PCHAR, S_explode8, "S_explode8" },
{ SYM_PCHAR, S_explode9, "S_explode9" },
{ SYM_OC, ILLOBJ_CLASS + SYM_OFF_O, "S_strange_obj" },
{ SYM_OC, WEAPON_CLASS + SYM_OFF_O, "S_weapon" },
{ SYM_OC, ARMOR_CLASS + SYM_OFF_O, "S_armor" },
{ SYM_OC, ARMOR_CLASS + SYM_OFF_O, "S_armour" },

View File

@@ -93,6 +93,12 @@ register struct obj *obj;
&& (youmonst.data != &mons[PM_RUST_MONSTER] || is_rustprone(obj)))
return TRUE;
/* Ghouls only eat non-veggy corpses or eggs (see dogfood()) */
if (u.umonnum == PM_GHOUL)
return (boolean)((obj->otyp == CORPSE
&& !vegan(&mons[obj->corpsenm]))
|| (obj->otyp == EGG));
if (u.umonnum == PM_GELATINOUS_CUBE && is_organic(obj)
/* [g.cubes can eat containers and retain all contents
as engulfed items, but poly'd player can't do that] */
@@ -1622,7 +1628,7 @@ struct obj *otmp;
pline("Ecch - that must have been poisonous!");
if (!Poison_resistance) {
losestr(rnd(4));
losehp(rnd(15), !glob ? "poisonous corpse" : "posionous glob",
losehp(rnd(15), !glob ? "poisonous corpse" : "poisonous glob",
KILLED_BY_AN);
} else
You("seem unaffected by the poison.");

View File

@@ -2152,6 +2152,10 @@ int src;
parseoptions(bufp, TRUE, TRUE);
} else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) {
add_autopickup_exception(bufp);
} else if (match_varname(buf, "BINDINGS", 4)) {
parsebindings(bufp);
} else if (match_varname(buf, "AUTOCOMPLETE", 5)) {
parseautocomplete(bufp, TRUE);
} else if (match_varname(buf, "MSGTYPE", 7)) {
(void) msgtype_parse_add(bufp);
#ifdef NOCWD_ASSUMPTIONS

View File

@@ -18,6 +18,7 @@
char * ucase (char *)
char * upstart (char *)
char * mungspaces (char *)
char * trimspaces (char *)
char * strip_newline (char *)
char * eos (char *)
boolean str_end_is (const char *, const char *)
@@ -159,6 +160,22 @@ char *bp;
return bp;
}
/* remove leading and trailing whitespace, in place */
char*
trimspaces(txt)
char* txt;
{
char* end;
while (*txt == ' ' || *txt == '\t')
txt++;
end = eos(txt);
while (--end >= txt && (*end == ' ' || *end == '\t'))
*end = '\0';
return txt;
}
/* remove \n from end of line; remove \r too if one is there */
char *
strip_newline(str)
@@ -385,13 +402,17 @@ char *sbuf;
return strcpy(sbuf, buf);
}
#define VISCTRL_NBUF 5
/* make a displayable string from a character */
char *
visctrl(c)
char c;
{
Static char ccc[5];
Static char visctrl_bufs[VISCTRL_NBUF][5];
static int nbuf = 0;
register int i = 0;
char *ccc = visctrl_bufs[nbuf];
nbuf = (nbuf + 1) % VISCTRL_NBUF;
if ((uchar) c & 0200) {
ccc[i++] = 'M';

View File

@@ -269,6 +269,58 @@ register struct monst *mtmp;
} else if (mm == PM_NINJA) { /* extra quest villains */
(void) mongets(mtmp, rn2(4) ? SHURIKEN : DART);
(void) mongets(mtmp, rn2(4) ? SHORT_SWORD : AXE);
} else if (ptr->msound == MS_GUARDIAN) {
/* quest "guardians" */
switch (mm) {
case PM_STUDENT:
case PM_ATTENDANT:
case PM_ABBOT:
case PM_ACOLYTE:
case PM_GUIDE:
case PM_APPRENTICE:
if (rn2(2))
(void) mongets(mtmp, rn2(3) ? DAGGER : KNIFE);
if (rn2(5))
(void) mongets(mtmp, rn2(3) ? LEATHER_JACKET : LEATHER_CLOAK);
if (rn2(3))
(void) mongets(mtmp, rn2(3) ? LOW_BOOTS : HIGH_BOOTS);
if (rn2(3))
(void) mongets(mtmp, POT_HEALING);
break;
case PM_CHIEFTAIN:
case PM_PAGE:
case PM_ROSHI:
case PM_WARRIOR:
(void) mongets(mtmp, rn2(3) ? LONG_SWORD : SHORT_SWORD);
(void) mongets(mtmp, rn2(3) ? CHAIN_MAIL : LEATHER_ARMOR);
if (rn2(2))
(void) mongets(mtmp, rn2(2) ? LOW_BOOTS : HIGH_BOOTS);
if (!rn2(3))
(void) mongets(mtmp, LEATHER_CLOAK);
if (!rn2(3)) {
(void) mongets(mtmp, BOW);
m_initthrow(mtmp, ARROW, 12);
}
break;
case PM_HUNTER:
(void) mongets(mtmp, rn2(3) ? SHORT_SWORD : DAGGER);
if (rn2(2))
(void) mongets(mtmp, rn2(2) ? LEATHER_JACKET : LEATHER_ARMOR);
(void) mongets(mtmp, BOW);
m_initthrow(mtmp, ARROW, 12);
break;
case PM_THUG:
(void) mongets(mtmp, CLUB);
(void) mongets(mtmp, rn2(3) ? DAGGER : KNIFE);
if (rn2(2))
(void) mongets(mtmp, LEATHER_GLOVES);
(void) mongets(mtmp, rn2(2) ? LEATHER_JACKET : LEATHER_ARMOR);
break;
case PM_NEANDERTHAL:
(void) mongets(mtmp, CLUB);
(void) mongets(mtmp, LEATHER_ARMOR);
break;
}
}
break;

View File

@@ -237,7 +237,7 @@ int dir;
mz_move(x, y, dir);
mz_move(x, y, dir);
if (x < 3 || y < 3 || x > x_maze_max || y > y_maze_max
|| levl[x][y].typ != 0)
|| levl[x][y].typ != STONE)
return FALSE;
return TRUE;
}

View File

@@ -469,21 +469,21 @@ static char def_inv_order[MAXOCLASSES] = {
typedef struct {
const char *name;
char cmd;
const char *desc;
} menu_cmd_t;
#define NUM_MENU_CMDS 11
static const menu_cmd_t default_menu_cmd_info[NUM_MENU_CMDS] = {
/* 0*/ { "menu_first_page", MENU_FIRST_PAGE },
{ "menu_last_page", MENU_LAST_PAGE },
{ "menu_next_page", MENU_NEXT_PAGE },
{ "menu_previous_page", MENU_PREVIOUS_PAGE },
{ "menu_select_all", MENU_SELECT_ALL },
/* 5*/ { "menu_deselect_all", MENU_UNSELECT_ALL },
{ "menu_invert_all", MENU_INVERT_ALL },
{ "menu_select_page", MENU_SELECT_PAGE },
{ "menu_deselect_page", MENU_UNSELECT_PAGE },
{ "menu_invert_page", MENU_INVERT_PAGE },
/*10*/ { "menu_search", MENU_SEARCH },
static const menu_cmd_t default_menu_cmd_info[] = {
{ "menu_first_page", MENU_FIRST_PAGE, "Go to first page" },
{ "menu_last_page", MENU_LAST_PAGE, "Go to last page" },
{ "menu_next_page", MENU_NEXT_PAGE, "Go to next page" },
{ "menu_previous_page", MENU_PREVIOUS_PAGE, "Go to previous page" },
{ "menu_select_all", MENU_SELECT_ALL, "Select all items" },
{ "menu_deselect_all", MENU_UNSELECT_ALL, "Unselect all items" },
{ "menu_invert_all", MENU_INVERT_ALL, "Insert selection" },
{ "menu_select_page", MENU_SELECT_PAGE, "Select items in current page" },
{ "menu_deselect_page", MENU_UNSELECT_PAGE, "Unselect items in current page" },
{ "menu_invert_page", MENU_INVERT_PAGE, "Invert current page selection" },
{ "menu_search", MENU_SEARCH, "Search and toggle matching items" },
};
/*
@@ -833,6 +833,10 @@ int maxlen;
* has the effect of 'meta'-ing the value which follows (so that the
* alternate character set will be enabled).
*
* X normal key X
* ^X control-X
* \mX meta-X
*
* For 3.4.3 and earlier, input ending with "\M", backslash, or caret
* prior to terminating '\0' would pull that '\0' into the output and then
* keep processing past it, potentially overflowing the output buffer.
@@ -3233,7 +3237,7 @@ boolean tinitial, tfrom_file;
}
/* check for menu command mapping */
for (i = 0; i < NUM_MENU_CMDS; i++) {
for (i = 0; i < SIZE(default_menu_cmd_info); i++) {
fullname = default_menu_cmd_info[i].name;
if (duplicate)
complain_about_duplicate(opts, 1);
@@ -3241,7 +3245,6 @@ boolean tinitial, tfrom_file;
if (negated) {
bad_negation(fullname, FALSE);
} else if ((op = string_for_opt(opts, FALSE)) != 0) {
int j;
char c, op_buf[BUFSZ];
escapes(op, op_buf);
@@ -3475,6 +3478,56 @@ boolean tinitial, tfrom_file;
badoption(opts);
}
/* parse key:command */
void
parsebindings(bindings)
char* bindings;
{
char *bind;
char key;
int i;
/* break off first binding from the rest; parse the rest */
if ((bind = index(bindings, ',')) != 0) {
*bind++ = 0;
parsebindings(bind);
}
/* parse a single binding: first split around : */
if (! (bind = index(bindings, ':'))) return; /* it's not a binding */
*bind++ = 0;
/* read the key to be bound */
key = txt2key(bindings);
if (!key) {
raw_printf("Bad binding %s.", bindings);
wait_synch();
return;
}
bind = trimspaces(bind);
/* is it a special key? */
if (bind_specialkey(key, bind))
return;
/* is it a menu command? */
for (i = 0; i < SIZE(default_menu_cmd_info); i++) {
if (!strcmp(default_menu_cmd_info[i].name, bind)) {
if (illegal_menu_cmd_key(key)) {
char tmp[BUFSZ];
Sprintf(tmp, "Bad menu key %s:%s", visctrl(key), bind);
badoption(tmp);
} else
add_menu_cmd_alias(key, default_menu_cmd_info[i].cmd);
return;
}
}
/* extended command? */
bind_key(key, bind);
}
static NEARDATA const char *menutype[] = { "traditional", "combination",
"full", "partial" };
@@ -3525,6 +3578,18 @@ char from_ch, to_ch;
}
}
char
get_menu_cmd_key(ch)
char ch;
{
char *found = index(mapped_menu_op, ch);
if (found) {
int idx = (int) (found - mapped_menu_op);
ch = mapped_menu_cmds[idx];
}
return ch;
}
/*
* Map the given character to its corresponding menu command. If it
* doesn't match anything, just return the original.
@@ -3541,6 +3606,57 @@ char ch;
return ch;
}
void
show_menu_controls(win, dolist)
winid win;
boolean dolist;
{
char buf[BUFSZ];
putstr(win, 0, "Menu control keys:");
if (dolist) {
int i;
for (i = 0; i < SIZE(default_menu_cmd_info); i++) {
Sprintf(buf, "%-8s %s",
visctrl(get_menu_cmd_key(default_menu_cmd_info[i].cmd)),
default_menu_cmd_info[i].desc);
putstr(win, 0, buf);
}
} else {
putstr(win, 0, "");
putstr(win, 0, " Page All items");
Sprintf(buf, " Select %s %s",
visctrl(get_menu_cmd_key(MENU_SELECT_PAGE)),
visctrl(get_menu_cmd_key(MENU_SELECT_ALL)));
putstr(win, 0, buf);
Sprintf(buf, "Deselect %s %s",
visctrl(get_menu_cmd_key(MENU_UNSELECT_PAGE)),
visctrl(get_menu_cmd_key(MENU_UNSELECT_ALL)));
putstr(win, 0, buf);
Sprintf(buf, " Invert %s %s",
visctrl(get_menu_cmd_key(MENU_INVERT_PAGE)),
visctrl(get_menu_cmd_key(MENU_INVERT_ALL)));
putstr(win, 0, buf);
putstr(win, 0, "");
Sprintf(buf, " Go to %s Next page",
visctrl(get_menu_cmd_key(MENU_NEXT_PAGE)));
putstr(win, 0, buf);
Sprintf(buf, " %s Previous page",
visctrl(get_menu_cmd_key(MENU_PREVIOUS_PAGE)));
putstr(win, 0, buf);
Sprintf(buf, " %s First page",
visctrl(get_menu_cmd_key(MENU_FIRST_PAGE)));
putstr(win, 0, buf);
Sprintf(buf, " %s Last page",
visctrl(get_menu_cmd_key(MENU_LAST_PAGE)));
putstr(win, 0, buf);
putstr(win, 0, "");
Sprintf(buf, " %s Search and toggle matching entries",
visctrl(get_menu_cmd_key(MENU_SEARCH)));
putstr(win, 0, buf);
}
}
#if defined(MICRO) || defined(MAC) || defined(WIN32)
#define OPTIONS_HEADING "OPTIONS"
#else

View File

@@ -1371,6 +1371,7 @@ whatdoes_help()
destroy_nhwindow(tmpwin);
}
#if 0
#define WD_STACKLIMIT 5
struct wd_stack_frame {
Bitfield(active, 1);
@@ -1501,18 +1502,31 @@ int *depth, lnum;
}
return stack[*depth].active ? TRUE : FALSE;
}
#endif /* 0 */
char *
dowhatdoes_core(q, cbuf)
char q;
char *cbuf;
{
dlb *fp;
char buf[BUFSZ];
#if 0
dlb *fp;
struct wd_stack_frame stack[WD_STACKLIMIT];
boolean cond;
int ctrl, meta, depth = 0, lnum = 0;
#endif /* 0 */
const char *ec_desc;
if ((ec_desc = key2extcmddesc(q)) != NULL) {
char keybuf[QBUFSZ];
Sprintf(buf, "%-8s%s.", key2txt(q, keybuf), ec_desc);
Strcpy(cbuf, buf);
return cbuf;
}
return 0;
#if 0
fp = dlb_fopen(CMDHELPFILE, "r");
if (!fp) {
pline("Cannot open \"%s\" data file!", CMDHELPFILE);
@@ -1568,6 +1582,7 @@ char *cbuf;
if (depth != 0)
impossible("cmdhelp: mismatched &? &: &. conditionals.");
return (char *) 0;
#endif /* 0 */
}
int
@@ -1705,6 +1720,15 @@ hmenu_doextlist()
(void) doextlist();
}
void
domenucontrols()
{
winid cwin = create_nhwindow(NHW_TEXT);
show_menu_controls(cwin, FALSE);
display_nhwindow(cwin, FALSE);
destroy_nhwindow(cwin);
}
/* data for dohelp() */
static struct {
void (*f)();
@@ -1718,7 +1742,9 @@ static struct {
{ hmenu_dowhatdoes, "Info on what a given key does." },
{ option_help, "List of game options." },
{ dispfile_optionfile, "Longer explanation of game options." },
{ dokeylist, "Full list of keyboard commands" },
{ hmenu_doextlist, "List of extended commands." },
{ domenucontrols, "List menu control keys" },
{ dispfile_license, "The NetHack license." },
{ docontact, "Support information." },
#ifdef PORT_HELP

View File

@@ -814,7 +814,7 @@ nextpos:
else
ny += dy;
while ((typ = (crm = &levl[nx][ny])->typ) != 0) {
while ((typ = (crm = &levl[nx][ny])->typ) != STONE) {
/* in view of the above we must have IS_WALL(typ) or typ == POOL */
/* must be a wall here */
if (isok(nx + nx - x, ny + ny - y) && !IS_POOL(typ)

View File

@@ -238,7 +238,9 @@ char *base;
com_index = -1;
for (oindex = 0; extcmdlist[oindex].ef_txt != (char *) 0; oindex++) {
if (!strncmpi(base, extcmdlist[oindex].ef_txt, strlen(base))) {
if ((extcmdlist[oindex].flags & AUTOCOMPLETE)
&& !(!wizard && (extcmdlist[oindex].flags & WIZMODECMD))
&& !strncmpi(base, extcmdlist[oindex].ef_txt, strlen(base))) {
if (com_index == -1) /* no matches yet */
com_index = oindex;
else /* more than 1 match */

View File

@@ -9,6 +9,7 @@
#include "mhinput.h"
#include "mhfont.h"
#include "color.h"
#include "patchlevel.h"
#define NHMAP_FONT_NAME TEXT("Terminal")
@@ -1025,41 +1026,8 @@ nhglyph2charcolor(short g, uchar *ch, int *color)
COLORREF
nhcolor_to_RGB(int c)
{
switch (c) {
case CLR_BLACK:
return RGB(0x55, 0x55, 0x55);
case CLR_RED:
return RGB(0xFF, 0x00, 0x00);
case CLR_GREEN:
return RGB(0x00, 0x80, 0x00);
case CLR_BROWN:
return RGB(0xA5, 0x2A, 0x2A);
case CLR_BLUE:
return RGB(0x00, 0x00, 0xFF);
case CLR_MAGENTA:
return RGB(0xFF, 0x00, 0xFF);
case CLR_CYAN:
return RGB(0x00, 0xFF, 0xFF);
case CLR_GRAY:
return RGB(0xC0, 0xC0, 0xC0);
case NO_COLOR:
return RGB(0xFF, 0xFF, 0xFF);
case CLR_ORANGE:
return RGB(0xFF, 0xA5, 0x00);
case CLR_BRIGHT_GREEN:
return RGB(0x00, 0xFF, 0x00);
case CLR_YELLOW:
return RGB(0xFF, 0xFF, 0x00);
case CLR_BRIGHT_BLUE:
return RGB(0x00, 0xC0, 0xFF);
case CLR_BRIGHT_MAGENTA:
return RGB(0xFF, 0x80, 0xFF);
case CLR_BRIGHT_CYAN:
return RGB(0x80, 0xFF, 0xFF); /* something close to aquamarine */
case CLR_WHITE:
return RGB(0xFF, 0xFF, 0xFF);
default:
return RGB(0x00, 0x00, 0x00); /* black */
}
if (c >= 0 && c < CLR_MAX)
return GetNHApp()->regMapColors[c];
return RGB(0x00, 0x00, 0x00);
}

View File

@@ -8,6 +8,7 @@
*/
#include "hack.h"
#include "color.h"
#include "dlb.h"
#include "func_tab.h" /* for extended commands */
#include "winMS.h"
@@ -1726,7 +1727,9 @@ mswin_get_ext_cmd()
com_index = -1;
for (oindex = 0; extcmdlist[oindex].ef_txt != (char *) 0;
oindex++) {
if (!strncmpi(cmd, extcmdlist[oindex].ef_txt, len)) {
if ((extcmdlist[oindex].flags & AUTOCOMPLETE)
&& !(!wizard && (extcmdlist[oindex].flags & WIZMODECMD))
&& !strncmpi(cmd, extcmdlist[oindex].ef_txt, len)) {
if (com_index == -1) /* no matches yet */
com_index = oindex;
else
@@ -2276,6 +2279,25 @@ mswin_read_reg()
DWORD size;
DWORD safe_buf;
char keystring[MAX_PATH];
int i;
COLORREF default_mapcolors[CLR_MAX] = {
RGB(0x55, 0x55, 0x55), /* CLR_BLACK */
RGB(0xFF, 0x00, 0x00), /* CLR_RED */
RGB(0x00, 0x80, 0x00), /* CLR_GREEN */
RGB(0xA5, 0x2A, 0x2A), /* CLR_BROWN */
RGB(0x00, 0x00, 0xFF), /* CLR_BLUE */
RGB(0xFF, 0x00, 0xFF), /* CLR_MAGENTA */
RGB(0x00, 0xFF, 0xFF), /* CLR_CYAN */
RGB(0xC0, 0xC0, 0xC0), /* CLR_GRAY */
RGB(0xFF, 0xFF, 0xFF), /* NO_COLOR */
RGB(0xFF, 0xA5, 0x00), /* CLR_ORANGE */
RGB(0x00, 0xFF, 0x00), /* CLR_BRIGHT_GREEN */
RGB(0xFF, 0xFF, 0x00), /* CLR_YELLOW */
RGB(0x00, 0xC0, 0xFF), /* CLR_BRIGHT_BLUE */
RGB(0xFF, 0x80, 0xFF), /* CLR_BRIGHT_MAGENTA */
RGB(0x80, 0xFF, 0xFF), /* CLR_BRIGHT_CYAN */
RGB(0xFF, 0xFF, 0xFF) /* CLR_WHITE */
};
sprintf(keystring, "%s\\%s\\%s\\%s", CATEGORYKEY, COMPANYKEY, PRODUCTKEY,
SETTINGSKEY);
@@ -2286,6 +2308,9 @@ mswin_read_reg()
GetNHApp()->saveRegistrySettings = 1; /* Normally, we always save */
GetNHApp()->regNetHackMode = TRUE;
for (i = 0; i < CLR_MAX; i++)
GetNHApp()->regMapColors[i] = default_mapcolors[i];
if (RegOpenKeyEx(HKEY_CURRENT_USER, keystring, 0, KEY_READ, &key)
!= ERROR_SUCCESS)
return;
@@ -2338,6 +2363,14 @@ mswin_read_reg()
NHGETREG_DWORD(INVENTBOTTOM, GetNHApp()->rtInvenWindow.bottom);
#undef NHGETREG_DWORD
for (i = 0; i < CLR_MAX; i++) {
COLORREF cl;
char mapcolorkey[64];
sprintf(mapcolorkey, "MapColor%02d", i);
if (RegQueryValueEx(key, mapcolorkey, NULL, NULL, (BYTE *)&cl, &size) == ERROR_SUCCESS)
GetNHApp()->regMapColors[i] = cl;
}
RegCloseKey(key);
/* check the data for validity */
@@ -2356,6 +2389,7 @@ mswin_write_reg()
{
HKEY key;
DWORD disposition;
int i;
if (GetNHApp()->saveRegistrySettings) {
char keystring[MAX_PATH];
@@ -2417,6 +2451,13 @@ mswin_write_reg()
NHSETREG_DWORD(INVENTBOTTOM, GetNHApp()->rtInvenWindow.bottom);
#undef NHSETREG_DWORD
for (i = 0; i < CLR_MAX; i++) {
COLORREF cl = GetNHApp()->regMapColors[i];
char mapcolorkey[64];
sprintf(mapcolorkey, "MapColor%02d", i);
RegSetValueEx(key, mapcolorkey, 0, REG_DWORD, (BYTE *)&cl, sizeof(DWORD));
}
RegCloseKey(key);
}
}

View File

@@ -25,6 +25,7 @@
#include <commctrl.h>
#include <tchar.h>
#include "hack.h"
#include "color.h"
/* Create an array to keep track of the various windows */
@@ -94,6 +95,8 @@ typedef struct mswin_nhwindow_app {
regNetHackMode; /* NetHack mode means no Windows keys in some places
*/
COLORREF regMapColors[CLR_MAX];
LONG regMainMinX;
LONG regMainMinY;
LONG regMainMaxX;