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',

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',   "step left down\nnumpad 1"],
		'j' => ['g2',        "step down\nnumpad 2"],
		'n' => ['g2',  "step right down\nnumpad 3"],
		'h' => ['g2',        "step left\nnumpad 4"],
		'l' => ['g2',       "step right\nnumpad 6"],
		'y' => ['g2',     "step left up\nnumpad 7"],
		'k' => ['g2',          "step up\nnumpad 8"],
		'u' => ['g2',    "step right up\nnumpad 9"],

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

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

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

		'?' => ['g8 mode?', "help menu"], #help
		'+?'=> ['g8', "more help"],
		'/' => ['g6 arg mode/', "explain symbol"], #whatis
		'&' => ['g6 arg', "tell com<>m<>and"],
		'<' => ['g2', "climb up ladder"], #up
		'>' => ['g2', "desc<>ent ladder"], #down
		'.' => ['g2', "rest (noop)"], #rest
		'_' => ['g3 argM', "travel to"], #travel

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

		':' => ['g6', "look here"], #look
		';' => ['g6 argM', "look else<>where"], #farlook
		',' => ['g4', "pick up"], #pickup
		'@' => ['g6', "toggle pick<>up"],
		'^' => ['g6 argm', "show trap"], #trap_id
		')' => ['g7', "show weapon"], #seeweapon
		'[' => ['g7', "show armor"], #seearmor
		'=' => ['g7', "show rings"], #seerings
		'"' => ['g7', "show amulet"], #seeamulet
		'(' => ['g7', "show tools"], #seetools
		'*' => ['g7', "show equip<>ment"], #seeall
		'$' => ['g6', "count gold"], #seegold
		'+' => ['g7', "list spells"], #seespells
		'\\'=> ['g7', "discover<>ed obj<>ects"], #known
		'`' => ['g7', "types ident<>if<>ied"], #knownclass
		'!' => ['g6', "shell escape"], #sh
		'#' => ['g8', "more comm<>ands"],
	},

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

		'B' => ['g4', 'drop blessed'],
		'U' => ['g4', 'drop uncursed'],
		'C' => ['g4', 'drop cursed'],
		'X' => ['g4', 'drop unknown'],
		'a' => ['g4', 'drop all'],
		'i' => ['g6', "invent<>ory"],
		'u' => ['g4', 'drop unpaid'],
		'm' => ['g4 argi', 'drop any'],
		'%' => ['g4 arg', 'drop more'],
	},

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

		'*' => ['g6', 'list gems'],
		'u' => ['g6', 'list unpaid'],
		'x' => ['g6', 'list billed'],
		'$' => ['g6', 'count money'],
		'B' => ['g6', 'list blessed'],
		'U' => ['g6', 'list uncurs<>e<>d'],
		'C' => ['g6', 'list cursed'],
		'X' => ['g6', 'list un<>know<>n'],
	},
},
}
