use utf8;

{
title => 'NetHack',
version => '1.2',
description => [
	"Keyboard overview sheet for the NetHack console roguelike game,",
	"describing the default controls.",
],
intro => "Command bindings for version 3.6.1 of the vanilla NetHack game.",
keywords => [qw' nethack rogue game controls '],
rows => [3, 2, 1, 0],
moderows => '4321-421',

key => {
	'b' =>   "step left down\nnumpad 1",
	'j' =>        "step down\nnumpad 2",
	'n' =>  "step right down\nnumpad 3",
	'h' =>        "step left\nnumpad 4",
	'l' =>       "step right\nnumpad 6",
	'y' =>     "step left up\nnumpad 7",
	'k' =>          "step up\nnumpad 8",
	'u' =>    "step right up\nnumpad 9",

	'B' =>     "go left down\nshift numpad 1",
	'J' =>          "go down\nshift numpad 2",
	'N' =>    "go right down\nshift numpad 3",
	'H' =>          "go left\nshift numpad 4",
	'L' =>         "go right\nshift numpad 6",
	'Y' =>       "go left up\nshift numpad 7",
	'K' =>            "go up\nshift numpad 8",
	'U' =>      "go right up\nshift numpad 9",

	'^b'=>    "run left down\nnumpad 5 1",
	'^j'=>         "run down\nnumpad 5 2",
	'^n'=>   "run right down\nnumpad 5 3",
	'^h'=>         "run left\nnumpad 5 4",
	'^l'=>        "run right\nnumpad 5 6",
	'^y'=>      "run left up\nnumpad 5 7",
	'^k'=>           "run up\nnumpad 5 8",
	'^u'=>     "run right up\nnumpad 5 9",

	'g' => "run until interest",
	'm' => "m<>ove blind\nno pickup",
	'M' => "go far",
	'G' => "g any<>where\nfollow branches",

	'?' => "help menu",
	'+?'=> "more help",
	'/' => "explain symbol",
	'&' => "tell com<>m<>and",
	'<' => "climb up ladder",
	'>' => "desc<>ent ladder",
	'.' => "rest (noop)",
	'_' => "travel to",

	'+2'=> "two<>weapon toggle",
	'a' => "apply tool",
	'A' => "remove all armor",
	'^a'=> "redo comm<>and\nAgain",
	'+a'=> "adjust inv<>ent<>ory",
	'c' => "close door",
	'C' => "call monster",
	'^c'=> "panic quit",
	'+c'=> "chat",
	'd' => "drop item",
	'D' => "drop items",
	'^d'=> "kick",
	'+d'=> "dip",
	'e' => "eat food",
	'E' => "en<>grave",
	'+e'=> "weapon skills\nEnhance",
	'f' => "fire quiver",
	'F' => "fight monster",
	'+f'=> "force lock",
	'i' => "invent<>ory",
	'I' => "invent<>ory part",
	'+i'=> "invoke object",
	'+j'=> "jump",
	'+l'=> "loot",
	'+m'=> "mons<>ter abil<>ity",
	'+n'=> "name item<>(s)",
	'o' => "open door",
	'O' => "options",
	'^o'=> "overview levels",
	'+o'=> "offer sacrifice",
	'p' => "pay bill",
	'P' => "put on",
	'^p'=> "repeat message",
	'+p'=> "pray",
	'q' => "drink\nQuaff",
	'Q' => "quiver ammo",
	'+q'=> "exit game\nQuit",
	'r' => "read scroll",
	'R' => "put off\nRemove accessory",
	'^r'=> "redraw",
	'+r'=> "rub object",
	's' => "search secrets",
	'S' => "save game",
	'+s'=> "sit down",
	't' => "throw<>/shoot",
	'T' => "remove armor",
	'^t'=> "teleport",
	'+t'=> "turn undead",
	'+u'=> "untrap",
	'v' => "version",
	'V' => "verbose version",
	'+v'=> "compile details",
	'w' => "wield weap<>on",
	'W' => "wear armor",
	'+w'=> "wipe face",
	'x' => "swap weapons\nXchange",
	'X' => "explore mode",
	'^x'=> "show stats",
	'z' => "zap wand",
	'Z' => "cast spell",
	'^z'=> "suspend game",

	':' => "look here",
	';' => "look else<>where",
	',' => "pick up",
	'@' => "toggle pick<>up",
	'^' => "show trap",
	')' => "show weapon",
	'[' => "show armor",
	'=' => "show rings",
	'"' => "show amulet",
	'(' => "show tools",
	'*' => "show equip<>ment",
	'$' => "count gold",
	'+' => "list spells",
	'\\'=> "discover<>ed obj<>ects",
	'`' => "types ident<>if<>ied",
	'!' => "shell escape",
	'#' => "more comm<>ands",

	'DB' => 'drop blessed',
	'DU' => 'drop uncursed',
	'DC' => 'drop cursed',
	'DX' => 'drop unknown',
	'Da' => 'drop all',
	'Di' => "invent<>ory",
	'Du' => 'drop unpaid',
	'Dm' => 'drop any',
	'D%' => 'drop more',

	'I*' => 'list gems',
	'Iu' => 'list unpaid',
	'Ix' => 'list billed',
	'I$' => 'count money',
	'IB' => 'list blessed',
	'IU' => 'list uncurs<>e<>d',
	'IC' => 'list cursed',
	'IX' => 'list un<>know<>n',
},

mode => {
	'' => 'normal gameplay',
	'I' => 'inventory type',
	'D' => 'drop item type',
},

flag => {
	g2 => [direction => "Direction to move to or target a command (<motion>)."],
	g3 => [move      => "Other character movement."],
	g4 => [act       => "Direct action command: takes a turn."],
	g6 => [info      => "Informational command: shows/does something without ending the turn."],
	g7 => [invertory => "Display invertory menu."],
	g8 => [menu      => "Enters some other menu."],

	arg  => ["key<arg>"  => "Commands with a dot need at least one argument afterwards."],
	argi => ["key<argi>" => "Asks for an inventory item."],
	argm => ["key<argm>" => "Requires a direction afterwards."],
},

def => {
	'' => {
		'b' => 'g2',
		'j' => 'g2',
		'n' => 'g2',
		'h' => 'g2',
		'l' => 'g2',
		'y' => 'g2',
		'k' => 'g2',
		'u' => 'g2',

		'B' => 'g3',
		'J' => 'g3',
		'N' => 'g3',
		'H' => 'g3',
		'L' => 'g3',
		'Y' => 'g3',
		'K' => 'g3',
		'U' => 'g3',

		'^b'=> 'g3',
		'^j'=> 'g3',
		'^n'=> 'g3',
		'^h'=> 'g3',
		'^l'=> 'g3',
		'^y'=> 'g3',
		'^k'=> 'g3',
		'^u'=> 'g3',

		'g' => 'g3 argm',
		'm' => 'g3 argm',
		'M' => 'g3 argm',
		'G' => 'g3 argm',

		'?' => 'g8 mode?', #help
		'+?'=> 'g8',
		'/' => 'g6 arg mode/', #whatis
		'&' => 'g6 arg',
		'<' => 'g2', #up
		'>' => 'g2', #down
		'.' => 'g2', #rest
		'_' => 'g3 argM', #travel

		'+2'=> 'g4', #twoweapon
		'a' => 'g4 argi', #apply
		'A' => 'g4', #armor
		'^a'=> 'g4', #again
		'+a'=> 'g6', #adjust
		'c' => 'g4 argm', #close
		'C' => 'g4 arg', #call
		'^c'=> 'g6',
		'+c'=> 'g4 arg', #chat
		'd' => 'g4 argi', #drop
		'D' => 'g4 arg modeD', #Drop
		'^d'=> 'g4 argm', #kick
		'+d'=> 'g4 argi', #dip
		'e' => 'g4 argi', #eat
		'E' => 'g4 argi', #engrave
		'+e'=> 'g4', #enhance
		'f' => 'g4 argm', #fire
		'F' => 'g4 argm', #fight
		'+f'=> 'g4', #force
		'i' => 'g7', #invent
		'I' => 'g7 arg modeI', #Invent
		'+i'=> 'g4 argi', #invoke
		'+j'=> 'g4', #jump
		'+l'=> 'g4', #loot
		'+m'=> 'g4', #monster
		'+n'=> 'g7 arg', #name
		'o' => 'g4 argm', #open
		'O' => 'g8 modeO', #options
		'^o'=> 'g6',
		'+o'=> 'g4 argi', #offer
		'+O'=> "=^o", #overview
		'p' => 'g4', #pay
		'P' => 'g4 argi', #puton
		'^p'=> 'g6', #prevmsg
		'+p'=> 'g4 arg', #pray
		'q' => 'g4 argi', #quaff
		'Q' => 'g4 argi', #quiver
		'+q'=> 'g6', #quit
		'r' => 'g4 argi', #read
		'R' => 'g4 argi', #remove
		'^r'=> 'g6', #redraw
		'+r'=> 'g4 argi', #rub
		's' => 'g4', #search
		'S' => 'g6', #save
		'+s'=> 'g4', #sit
		't' => 'g4 argm', #throw
		'T' => 'g4 argi', #takeoff
		'^t'=> 'g4', #'port
		'+t'=> 'g4', #turn
		'+u'=> 'g4', #untrap
		'v' => 'g6',
		'V' => 'g6', #history
		'+v'=> 'g6', #version
		'w' => 'g4 argi', #wield
		'W' => 'g4 argi', #wear
		'+w'=> 'g4', #wipe
		'x' => 'g4', #xchange
		'X' => 'g6', #explore
		'^x'=> 'g6', #show
		'z' => 'g4 argm', #zap
		'Z' => 'g4 argi', #Zap
		'^z'=> 'g6', #suspend

		':' => 'g6', #look
		';' => 'g6 argM', #farlook
		',' => 'g4', #pickup
		'@' => 'g6',
		'^' => 'g6 argm', #trap_id
		')' => 'g7', #seeweapon
		'[' => 'g7', #seearmor
		'=' => 'g7', #seerings
		'"' => 'g7', #seeamulet
		'(' => 'g7', #seetools
		'*' => 'g7', #seeall
		'$' => 'g6', #seegold
		'+' => 'g7', #seespells
		'\\'=> 'g7', #known
		'`' => 'g7', #knownclass
		'!' => 'g6', #sh
		'#' => 'g8',
	},

	'D' => {
		"\e" => 'g8 mode', # static reset button, even though it's not (officially) in the game

		'B' => 'g4',
		'U' => 'g4',
		'C' => 'g4',
		'X' => 'g4',
		'a' => 'g4',
		'i' => 'g6',
		'u' => 'g4',
		'm' => 'g4 argi',
		'%' => 'g4 arg',
	},

	'I' => {
		"\e" => 'g8 mode',

		'*' => 'g6',
		'u' => 'g6',
		'x' => 'g6',
		'$' => 'g6',
		'B' => 'g6',
		'U' => 'g6',
		'C' => 'g6',
		'X' => 'g6',
	},
},
}
