Iron bars
Iron bars are a dungeon feature that appear in NetHack, represented by #.
Contents
Generation
Randomly generated inaccessible closets (that have a guaranteed scroll of teleportation) have a 1⁄5 chance of iron bars being generated where the door would be.
Iron bars also appear in the following branches and special levels:
- The Minetown variant Orcish Town will also have several iron bars blocking off entrance into the ruined town.
- There are guaranteed iron bars in the Wizard, Tourist, and Ranger quests.
- The Big Room has a wall of iron bars in the middle of the map for #8, and there is a chance of iron bars being selected as the terrain for maps #1 and #10.
- The fourth snake-filled variant of Medusa's Island has some iron bars around Medusa's dwelling.
The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.
Per commit 4af086be and commit 0bfd6b22, some Gehennom levels have iron bars instead of walls.Description
Iron bars cannot be dug through, and objects thrown through them have a chance of being stopped by the iron bars. Specifically, large objects such as most melee weapons, most armor and boulders will always be stopped - smaller objects such as potions and most projectiles (including spears, but not daggers or boomerangs) will pass through with a 4⁄5 chance, and will always pass through if they are thrown from a square adjacent to the bars in question.[1][2] Rays (e.g. dragon breath) and beams will always pass right through iron bars.
All monsters that are whirly, amorphous, phasing, tiny, or else medium-sized (or smaller) and slithy, can pass through them, and monsters with rusting or corrosive attacks, such as rust monsters and gray oozes, can eat through the bars.[3] Characters can do the same by polymorphing into a monster with any of these properties. A bug identified in NetHack 3.4.0 allows whirly and/or amorphous engulfing monsters to pass through iron bars while engulfing a monster (e.g. the unpolymorphed character) that cannot.
Acid can be used to dissolve iron bars: smashing a wielded potion of acid onto them using F will dissolve them, while a thrown potion only has a 1⁄5 chance of hitting the bars due to the aforementioned.[4][5] The acidic breath of a yellow dragon will dissolve the bars as well.[6] Bars that are marked "non-diggable" cannot be dissolved by any of these methods.
The following information pertains to an upcoming version (3.7.0). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.
The bug that lets engulfers pull engulfed monsters through iron bars that they could not pass otherwise is fixed via commit 21068b05.
Per commit f61e1e8e, there is a small chance of breaking iron bars by hitting them with a war hammer. commit c212ee44 extends this to include hitting them with a heavy iron ball. The chance is dependent on the character's strength, whether they throw or force-fight with the weapon, and the weapon's enchantment or iron ball's weight.
Per commit 738c2239, there is a 1⁄10 chance that iron bars will melt when hit by lightning.
Per commit 0e713dc4, all metallivores are also capable of eating iron bars.
Strategy
Iron bars do not impede visibility, allowing spellcasting or wand-using players and monsters to direct their beams, rays and gazes through them. In particular, this can be used to pick off Orcish Town's invaders without as much immediate risk to yourself - but beware of the poisoned arrows that many of them can fire back at you, especially if you lack poison resistance.
The iron bars on the fourth variant of Medusa's Island present a significant hazard: you may inadvertently catch a glimpse of Medusa through the bars as you approach her, depending on where she is first generated, and risk being immediately petrified. Wearing a blindfold or towel well before approaching is a good idea, especially if you lack reflection.
History
Iron bars first appear in NetHack 3.1.0, when the Quest was introduced to the game.
NetHack 3.6.0 introduces the more commonplace iron bars in the main dungeon, and is the first version where certain monsters can eat through them; NetHack 3.6.1 adds the ability to dissolve iron bars with acid, imported from UnNetHack.
Variants
SLASH'EM
In SLASH'EM, iron bars can be found in some of the Sokoban levels, and also appear in Grund's Stronghold. Some maze levels within the dungeon may be partially comprised of iron bars, e.g. in Gehennom - these can prove especially annoying during the ascension run.
In addition to the applicable methods described above, player dopplegangers can use the liquid leap technique to pass through them. This can even be used on the iron bars in Sokoban, which otherwise prevents creatures from passing through them.
SporkHack
In SporkHack, iron bars are sometimes generated as part of room-and-corridor dungeon levels.
UnNetHack
In UnNetHack, iron bars appear in some of the Sokoban levels and Gehennom mazes as in SLASH'EM. They also appear much more frequently within the main dungeon, often replacing doorways and sections of rock wall within room-and-corridor levels - as mentioned above, UnNetHack is also the first variant that allows them to be dissolved via acid.
A ring of iron bars is created around the magic portal connecting the Black Market to the main dungeon if you attempt to steal anything from the shops.
dNetHack
In dNetHack, notdNetHack and notnotdNetHack, characters can break iron bars with a wand of striking, force bolt, or a laser such as a lightsaber - this will produce 1-7 iron bar objects. These bars can be picked up and wielded as weapons, and use the quarterstaff skill.
EvilHack
In EvilHack, iron bars can also be broken with a force bolt or wand of striking.
References
- ↑ src/mthrowu.c in NetHack 3.6.7, line 476: calls
hits_bars
- ↑ src/mthrowu.c in NetHack 3.6.7, line 1122:
hits_bars
function - ↑ src/mondata.c in NetHack 3.6.7, line 325:
passes_bars
function - ↑ src/hack.c in NetHack 3.6.7, line 1632
- ↑ src/mthrowu.c in NetHack 3.6.7, line 1136
- ↑ src/zap.c in NetHack 3.6.7, line 4567