A dwarf is a type of monster in NetHack, and is also a playable race. It also characterizes several dwarf-related monsters.
Racial benefits and restrictions
Dwarves have intrinsic infravision. From an attribute perspective, Dwarves have good physical attributes (the highest Dexterity and Constitution) but those are offset by the lowest mental attributes. The following table outlines their maximum (unaided) attribute levels.
When playing as a dwarf, you will see yourself as @ (unless you have showrace on), but you are considered to be both @ and the letter h. For this reason, using blessed genocide to eliminate mind flayers (entering 'h' at the prompt) is a Bad Idea, as it will result in an instadeath. Therefore, dwarves must use two uncursed genocides to eliminate all mind flayers (master mind flayer and mind flayer), while other characters can eliminate them both with a single blessed genocide.
Curiously, there is really no dwarf role that seems especially "dwarvish" -- Cavemen are primitive, Archeologists are combat-averse scientists, and Valkyries are all female! The typical fantasy vision of the warrior/craftsman/miner is therefore not really available to the player of NetHack, at least not at present.
The monster flag M2_DWARF determines if a monster is considered to be a sort of dwarf or otherwise of dwarvish origin. The following monsters have this flag:
The following objects are defined as dwarven objects. Strangely, the code doesn't actually use this definition anywhere.
- Dwarvish iron helm (hard hat)
- Dwarvish mithril-coat
- Dwarvish cloak (hooded cloak)
- Dwarvish roundshield (large round shield)
No dwarvish artifacts currently exist in the game.
Dwarvish items are said to be exceptional metalworks, and their stats generally show this: they are superior to than orcish or nonracial counterparts, and are largely better (if heavier) than elven counterparts.
Dwarves in dNethack can additionally take on the Noble or Knight role. Dwarves in one of these roles get special quests, the Dwarf Noble and Dwarf Knight quest. Dwarves begin the game knowing all four stave-wards.
Dwarfs have faces like men (ugly men, with wrinkled, leathery
skins), but are generally either flat-footed, duck-footed, or
have feet pointing backwards. They are of the earth, earthy,
living in the darkest of caverns and venturing forth only
with the cloaks by which they can make themselves invisible,
and others disguised as toads. Miners often come across them,
and sometimes establish reasonably close relations with them.
... The miners of Cornwall were always delighted to hear a
bucca busily mining away, for all dwarfs have an infallible
nose for precious metals.
Among other things, dwarfs are rightly valued for their skill
as blacksmiths and jewellers: they made Odin his famous spear
Gungnir, and Thor his hammer; for Freya they designed a
magnificent necklace, and for Frey a golden boar. And in their
spare time they are excellent bakers. Ironically, despite
their odd feet, they are particularly fond of dancing. They
can also see into the future, and consequently are excellent
meteorologists. They can be free with presents to people
they like, and a dwarvish gift is likely to turn to gold in
the hand. But on the whole they are a snappish lot.