Difference between revisions of "Trap"

From NetHackWiki
Jump to navigation Jump to search
m (Hole: Added "main article" link)
m (style guide on variant templates)
 
(243 intermediate revisions by 96 users not shown)
Line 1: Line 1:
 
{{features}}
 
{{features}}
Beware of '''traps'''! When you step on one, it activates: for example, a [[rock]] falls from the ceiling, a [[boulder]] is released, a [[dart]] is fired, or a flash of light [[blind]]s you.
+
In ''[[NetHack]]'', '''traps''' are mechanisms on a space which may activate when you or a [[monster]] steps on them. Traps can be detected through various methods, and certain types of traps can be disarmed with the #[[untrap]] command.
  
To detect hidden traps, [[search]] for them or read a [[scroll of gold detection]] while confused.
+
==List of traps==
 +
The following traps are activated by stepping on their [[square]]:
  
 +
* [[anti-magic field]]
 +
* [[arrow trap]]
 +
* [[bear trap]]
 +
* [[dart trap]]
 +
* [[fire trap]]
 +
* [[hole]]
 +
* [[falling rock trap]]
 +
* [[land mine]]
 +
* [[level teleporter]]
 +
* [[magic portal]]<sup>†</sup>
 +
* [[magic trap]]
 +
* [[pit]]
 +
* [[polymorph trap]]
 +
* [[rolling boulder trap]]
 +
* [[rust trap]]
 +
* [[sleeping gas trap]]
 +
* [[spiked pit]]
 +
* [[squeaky board]]
 +
* [[statue trap]]
 +
* [[teleportation trap]]
 +
* [[trap door]]
 +
* [[vibrating square]]<sup>†</sup>
 +
* [[web]]
  
=={{brightblue|^}} Anti-magic field [[image:anti-magic field.png]]==
+
<sup>†</sup>: The vibrating square and magic portal are internally represented as traps, even though they are meant to aid the player instead of causing peril.
  
This trap will drain between 2 and your [[experience level]] + 1 points of your spell [[power]].
+
The following traps are activated by interacting with certain items or doors:
If this would cause your spell power to go below zero, your ''maximum'' spell power will be permanently reduced as well!<ref>{{sourcecode|trap.c|2970}}</ref>
 
  
Magic resistance will protect your spell [[power]] from being drained.
+
* [[container trap]]
 +
* [[tin#Explosion|exploding tin]]
 +
* [[door#Door traps|door trap]]
  
Anti-magic fields have no effect if your maximum spell power is zero.
+
==Generation==
 +
In both filler levels and most special levels, a "random" trap is selected uniformly from the whole set of eligible traps, subject to level difficulty checks and some exclusions.{{refsrc|src/mklev.c|1271|version=NetHack 3.6.6}} Oddly, special levels that contain maze filler (the Castle, Asmodeus, Baalzebub, Orcus, and all real and fake Wizard's Tower levels, but ''not'' the Big Room or the Catacombs) use a completely separate formula that ignores level difficulty for selecting traps in the mazes.{{refsrc|src/sp_lev.c|829|version=NetHack 3.6.6}} It nonetheless ends up working much the same way overall, but actually makes fire traps ''less'' common than they would otherwise be in Gehennom on those levels.
  
'''To remove:''' Dig a pit into the ground while standing on the trap, then fill the pit.
+
{{upcoming|NetHack 3.7.0|While [[hallucinating]], traps may appear on the map and in messages as random or nonexistent trap types, though any messages resulting from triggering the trap are unchanged.}}
  
=={{Cyan|^}} Arrow trap [[image:arrow trap.png]]==
+
===Fake bones===
 +
Certain types of traps up to dungeon level 4 may have a pre-aged [[corpse]] generated on top, along with random cursed weapons, tools, food or gems. These are often referred to as '''fake bones''', based on their similarity to [[bones file]]s.
  
These fire [[arrow]]s at you, which generally do 1d6 damage, and can be a useful source of arrows. While standing on or adjacent to the square with the trap, try using the <tt>'''#untrap'''</tt> command. You might fail a few times as a few more arrows hit you, but if you are lucky, you will obtain a large supply of arrows.
+
Arrow traps, dart traps, falling rock traps, and rolling boulder traps have a 1 &minus; {{sfrac|Dlvl &minus; 1|4}} chance of a corpse and items being placed on its square, i.e. this will always be the case with such traps on the first floor.{{refsrc|src/mklev.c|1415|version=NetHack 3.6.7}} There will always be at least one possession, and there is a {{frac|5}} chance of placing an additional possession after each one.{{refsrc|src/mklev.c|1487|version=NetHack 3.6.7}}
  
'''To remove:''' #untrap, or trigger it repeatedly until it runs out of arrows ("''You hear a loud click!''")
+
Squeaky boards and rust traps never have a corpse because they are non-lethal. Pits and holes also never generate a corpse - any corpses found in pits are usually from generated monsters that fell in, especially if their associated items are present (e.g. finding an [[orcish helm]] with a [[goblin]] corpse). Magic traps do not have corpses either as a result of not being specified in the relevant code.
  
=={{Cyan|^}} Bear trap [[image:bear trap.png]]==
+
==Detection==
 +
{{merge|[[Portal detection methods]]}}
 +
Avoiding traps in the dungeon takes patience and care. Therefore, the more time-consuming of these methods are only worthwhile when you are especially vulnerable. You can minimize your chances of stepping on a trap by paying close attention to monsters, pets, [[you hear|noises]], and terrain. Be wary of the telltale signs of traps such as conspicuous boulders, suspicious corpses, and piles of rocks, darts, or arrows. Traps that you've already discovered will also not be visible under items like these, so it's a good idea to use the [[trap id]] command if you need to step onto that square that looks suspicious, even though you may have already been in that area and discovered all traps. By walking only where you have seen pets or monsters safely walk, you can avoid most traps. Remember where you have safely stepped before. [[Elbereth]] can cause monsters to [[flee]], possibly uncovering traps as they do. A [[leash]]ed pet will whine if it is near a trap. [[Magic resistance]] and [[fire resistance]] can help nullify some of the more dangerous effects of traps.
  
A bear trap renders you immobile for several turns. During this time, you can attack and be attacked, but you cannot move from the spot. When caught in a bear trap, you are unable to [[kick]]. For some reason, escaping a bear trap is 5 times more likely when moving diagonally than when moving orthogonally.<ref>[[hack.c#line1250]]</ref>
+
The [[search]] command is a great way to uncover traps without setting them off. #Untrap can be used on doors and containers. You can improve your chances of finding traps if you:
 
+
* have high Luck;
It is possible to <tt>'''#untrap'''</tt> a bear trap. If successful, it will appear as a [[beartrap]] on the dungeon floor. You may then pick it up and apply it to a new location. If unsuccessful, you will become trapped. If a bugbear or an owlbear gets stuck in a bear trap outside your sight, then you will hear "the roaring of an angry bear".
+
* put on or [[Eating jewelry|eat]] a [[ring of searching]];
 
+
* put on a [[pair of lenses]];
'''To remove:''' #untrap, or eat the trap as a [[metallivore]].
+
* wield [[Excalibur]];
 
+
* wield the blessed [[Master Key of Thievery]] (or uncursed, if you are a [[Rogue]]) without gloves;
=={{Cyan|^}} Dart trap [[image:dart trap.png]]==
+
* play a role that gets intrinsic searching
 
 
Similar to an arrow trap, but with [[dart]]s.  Darts will generally do 1d3 damage.  Darts can be poisoned (1 in 6 chance), so be careful.  Disarming a dart trap will recover a large stack of darts, but this should probably not be attempted by characters lacking [[poison resistance]].
 
 
 
'''To remove:''' #untrap, or trigger it repeatedly until it runs out of darts ("''You hear a soft click.''")
 
 
 
=={{Red|^}} Fire trap [[image:fire trap.png]]==
 
 
 
This will set off a column of flame underneath you, causing significant damage and a permanent drop in maximum [[Hit points|HP]] to those without the [[fire resistance]] [[intrinsic]]. There is also a chance of carried [[scroll]]s and [[spellbook]]s burning, [[potion]]s boiling, and [[armor]] being burnt.
 
 
 
Fire traps are only randomly generated in [[Gehennom]], [[Plane of Fire]] and some [[quest]]s, notably the [[Valkyrie quest]].
 
 
 
'''To remove:''' Dig a pit into the ground while standing on the trap, then fill the pit.
 
 
 
=={{Brown|^}} Hole [[image:hole.png]]==
 
 
 
''Main article: [[Hole]]''
 
 
 
[[Hole]]s simply drop you down a number of levels. 2-3 levels is a typical fall distance, but there is no upper limit, bar extreme improbability, on how many levels it is possible to fall through, although you won't fall beyond the Castle.
 
 
 
The same hole is not guaranteed to lead to the same location, or even the same level, even if an object, monster or pet went through it immediately before you.
 
 
 
'''To remove:''' Push a [[boulder]] into it.
 
 
 
=={{brightblue|^}} Magic trap [[image:magic trap.png]]==
 
 
 
''Main article: [[Magic trap]]''
 
 
 
The effects of magic traps are many and varied...
 
 
 
'''To remove:''' Trigger it repeatedly until it explodes.
 
 
 
=={{Lightgray|^}} Falling rock trap [[image:falling rock trap.png]]==
 
 
 
This triggers a falling [[rock]], which hits you on the head for 6-12 damage, unless you are wearing some kind of hard hat, in which case the damage is reduced to 2. The rock stays on the ground, so it is possible to use them as a rock source, although the trap will be exhausted eventually.
 
 
 
Early [[pet]] deaths are often due to this type of trap, earning it the nickname of "kitty killer".
 
 
 
'''To remove:''' Trigger it repeatedly until it runs out of rocks.
 
 
 
=={{Red|^}} Land mine [[image:land mine.png]]==
 
 
 
Land mines are hidden explosives, especially common in the [[Fort Ludios]]. They wound your legs and create a [[pit]] in which you fall after the explosion. You may #untrap a land mine from next to it, pick it up and install it elsewhere, just like with a bear trap.  These traps won't be generated randomly before dungeon level 6.
 
 
 
'''To remove:''' #untrap, or just set it off (although the latter will replace it with a pit).
 
 
 
=={{Magenta|^}} Level teleporter [[image:level teleporter.png]]==
 
 
 
This teleports you to a random location on a random level. You will rarely be teleported further down than you have already explored.  These traps won't be generated randomly before dungeon level 5, nor on a [[no-teleport level]]. After a successful teleport of the player it vanishes.
 
 
 
'''To remove:''' Set it off personally; it is not removed when a pet or monster triggers it.
 
 
 
=={{Darkgray|^}} Pit [[image:pit.png]]==
 
 
 
[[Pit]]s in the ground open up when you walk over them, causing 1-6 damage. This will also [[abuse]] [[strength]] and [[dexterity]].  They require 3-7 [[turn]]s to "climb to the edge" and escape. While in the pit, any [[light]] source you are carrying will not travel beyond the walls of the pit.
 
 
 
'''To remove:''' Push a [[boulder]] into it.
 
 
 
=={{Brightgreen|^}} Polymorph trap [[image:polymorph trap.png]]==
 
 
 
''Main article: [[Polymorph trap]]''
 
 
 
A polymorph trap turns you into another monster for a limited time. Monsters can make use of them too. After a successful polymorph of the player it vanishes.
 
 
 
'''To remove:''' Set it off personally; it is not removed when a pet or monster triggers it.
 
 
 
=={{Brightmagenta|^}} Magic portal [[image:magic portal.png]]==
 
 
 
This uses the '''^''' symbol, and is therefore a kind of trap. They are used to transport you between [[dungeon branches]], and between the [[elemental planes]]. Temporary portals are generated by [[the Eye of the Aethiopica]].
 
 
 
'''To remove:''' This trap cannot be removed, although the portal to your [[quest]] disappears if you are rejected with prejudice.
 
 
 
=={{Lightgray|^}} Rolling boulder trap [[image:rolling boulder trap.png]]==
 
 
 
This is a trap in two parts. The actual trap is a switch, which when activated by stepping on it, sets a nearby [[boulder]] rolling towards you. The existence of these traps can sometimes be inferred by an incongruously placed boulder in a room.  These traps won't be generated randomly before dungeon level 2.
 
 
 
'''To remove:''' Destroy the boulder or move it out of line with the trap, then set it off to formally remove it.
 
 
 
=={{blue|^}} Rust trap [[image:rust trap.png]]==
 
 
 
This trap will spray you with water, [[rust]]ing any rustable items you have on where it hits. [[Gremlin]]s like to use these traps to multiply.
 
 
 
'''To remove:''' Dig a pit into the ground while standing on the trap, then fill the pit. In [[SLASH'EM]], #untrapping a rust trap will, if successful, turn the trap into a [[fountain]].
 
 
 
=={{Brightblue|^}} Sleeping gas trap [[image:sleeping gas trap.png]]==
 
 
 
This trap makes you fall asleep for up to 25 turns, unless you're polymorphed into a monster that doesn't breathe, or have sleep resistance.  These traps won't be generated randomly before dungeon level 2.
 
 
 
'''To remove:''' Dig a pit into the ground while standing on the trap, then fill the pit.
 
 
 
=={{Darkgray|^}} Spiked pit [[image:spiked pit.png]]==
 
 
 
These are just pits which do 1-10 damage. The spikes are sometimes (1 in 6 chance) poisoned, which can be fatal for a character without [[poison resistance]].  These traps won't be generated randomly before dungeon level 5. Note that the chance of spikes being poisoned is re-randomized every time you fall on them, not per spiked pit.  [[Metallivore]]s can eat the spikes out of a spiked pit, turning it in to a normal pit.
 
 
 
'''WARNING:''' Pets that fall in to a pit can be helped out by standing adjacent to the pit and '''u'''ntrapping in the direction of the pit. When you do this with a spiked pit, if you fail to remove your pet, they will suffer the effects of falling on to spikes each time you fail, making them angry (reducing their [[tame]]ness) and counting as abuse for resurrection from the [[wand of undead turning]]. If they die at your hands, you suffer the consequences of killing them in a trap yourself (-15 alignment and an angry [[god]]).
 
 
 
'''To remove:''' Push a [[boulder]] into it.
 
 
 
=={{Brown|^}} Squeaky board [[image:squeaky board.png]]==
 
 
 
A squeaky board alerts monsters to your presence. If a monster steps on a squeaky board on your level, you "hear a distant squeaking sound".
 
 
 
'''To remove:''' #untrap, but you must select a potion of oil (which will be consumed) or a charged can of grease (one charge will be consumed).
 
 
 
=={{gray|^}} Statue trap [[image:statue trap.png]]==
 
 
 
Statue traps look like normal [[statue]]s of a monster, until you try to walk on the same square as one. When you walk on one, it will transform into the monster it was posing as.  A statue trap can also be discovered by searching, [[apply]]ing a [[stethoscope]], or a [[pick-axe]].
 
 
 
'''To remove:''' Set it off.  A statue trap is a monster, not a statue, so a [[wand of striking]]/[[spellbook of force bolt|force bolt]] will not (necessarily) dispose of it.
 
 
 
=={{Magenta|^}} Teleportation trap [[image:teleportation trap.png]]==
 
 
 
This [[teleport]]s you to a random location on the map, unless it is a [[vault]] teleporter located in a [[closet]] behind [[ad aerarium]], in which case you are teleported to the vault. Teleporters won't be generated randomly on a no-teleport level.
 
 
 
'''To remove:''' This trap cannot be removed, unless it is located behind ad aerarium, in which case it will disappear after use.
 
 
 
=={{Brown|^}} Trap door [[image:trap door.png]]==
 
 
 
A '''trap door''' is a hidden door located in the floor. When triggered the door falls open and creates a hole that drops anything over it onto a random spot in the dungeon level below.  They are sometimes found in closets, with "[[Vlad]] was here" engraved in front of the door.
 
 
 
One technique of dealing with this problem is to go down any [[stairs]] you encounter and then go up. This way, if you should ever fall down to that level you will know where the exit is. A high [[dexterity]] status will reduce your chances of falling down the pit should you accidentally trigger a trap door.
 
 
 
'''To remove:''' Push a [[boulder]] into it, or zap a [[wand of locking]] downward.
 
 
 
=={{Lightgray|"}} Web [[image:web.png]]==
 
 
 
A spider web is a rare type of non-magical trap. 
 
 
 
* If you "stumble into a spider web", you will be unable to escape it for 0-12 turns, depending on your [[strength]].
 
* If your strength was high enough to escape in 0 turns, then "You tear through a web!" and the web is destroyed.
 
* If you are wielding [[Sting]], you always escape in 1 turn ("Sting cuts through the web!"), and the web remains
 
* If you are [[polymorph]]ed into an [[amoeboid]] or [[whirly]] form, a web will not stick to you.  ("You flow through the spider web")
 
* If you are polymorphed into a [[acidic]] monster or [[fire elemental]], you burn or dissolve the web.  This should also be the case for [[gelatinous cube]]s, but there is a bug.
 
* If you are polymorphed into a [[spider]], you walk over the web without being trapped.
 
* If a bugbear or an owlbear gets stuck in a web outside your sight, then you will hear "the roaring of a confused bear".
 
 
 
These traps won't be generated randomly before dungeon level 7. This is the only trap to use the " symbol, rather than the ^ symbol. Attempting to untrap stuck monsters risks trapping you and spreading the web.
 
 
 
You can produce webs with the [[Monster (command)|#monster]] command if you are a [[spider]].  All web-related messages are lovingly crafted to reflect whether things are happening to "your web" or "a spider web".
 
 
 
'''To remove:''' #untrap (difficult), or walk in while wearing [[gauntlets of power]] or burn it away with a [[wand of fire]].
 
 
 
==Container traps==
 
Containers can be searched with the #untrap command.  A high [[luck]] can be helpful in avoiding the effects of container traps.  Bad luck increases the likelihood of more dangerous traps.  Be careful of trapped containers in [[shop]]s, you will be charged for any items that are destroyed if you set off a trap that damages the merchandise.  Container traps include:
 
* Explosive charge:  [[Strength]] abused and 6d6 damage (unlucky trap)
 
* Poison gas:  [[Constitution]] abused, [[Poison]]ed if not [[poison resistance|poison resistant]]
 
* Poison needle:  Constitution abused, Poisoned if not poison resistant
 
* Fire trap:  As per floor trap
 
* Electric charge:  4d4 damage and [[wand]]s/[[ring]]s may be destroyed, unless [[shock resistant]]
 
* [[Paralysis]] trap:  [[Dexterity]] abused and paralyzed for 6-30 turns, unless you have [[free action]]
 
* Mind-affecting gas:  [[Stun]]s and causes [[hallucination]] for up to 16 turns
 
 
 
==Door traps==
 
Trapped [[door]]s (and rarely, [[cursed]] [[tin]]s) will explode when opened ("''KABOOM!! The <object> was booby-trapped!''"), causing damage, abusing strength and possibly constitution, and stunning you.  The damage and duration of the stun depend on a number of factors, including (but not limited to) your level and how deep you have been in the dungeon.
 
 
 
==Strategy==
 
Avoiding traps in the dungeon takes patience and care.  You can minimize your chances of stepping on a trap by paying close attention to monsters, pets, [[you hear|noises]], and terrain.  Be wary for the telltale signs of traps such as conspicuous boulders, suspicious corpses, or piles of rocks, darts or arrows.  By walking only where you have seen pets or monsters safely walk, you can avoid most traps.  Remember where you have safely stepped before.  [[Elbereth]] can cause monsters to flee, possibly uncovering traps as they do.  A [[leash]]ed pet will whine if it is near a trap.  [[Magic resistance]] and [[fire resistance]] can help nullify some of the more dangerous effects of traps.
 
 
 
The [[search]] command is a great way to uncover traps without setting them off. #Untrap can be used on doors and containers. You can improve your chances for finding traps if you:
 
* have positive luck
 
* [[put on]] a [[ring of searching]]
 
* put on a pair of [[lenses]]
 
* [[wield]] [[Excalibur]]
 
* play a [[role]] with [[intrinsic]] searching
 
 
** [[Ranger]]: Level 1
 
** [[Ranger]]: Level 1
 
** [[Monk]]: Level 9
 
** [[Monk]]: Level 9
 
** [[Rogue]]: Level 10
 
** [[Rogue]]: Level 10
** [[Archaeologist]]: Level 10
+
** [[Archeologist]]: Level 10
 
** [[Tourist]]: Level 10
 
** [[Tourist]]: Level 10
  
 
Some items can be useful in detecting traps, although they may have better uses elsewhere:
 
Some items can be useful in detecting traps, although they may have better uses elsewhere:
* [[scroll of gold detection]] (cursed or [[confused]])
+
* [[scroll of gold detection]] (read while cursed or [[confused]])
* [[crystal ball]] (with high [[intelligence]] scry for '''^''')
+
* [[crystal ball]] (scry for '''^''' with high [[intelligence]])
 
* [[wand of secret door detection]]
 
* [[wand of secret door detection]]
 
* [[spellbook of detect unseen]]
 
* [[spellbook of detect unseen]]
* The [[Bell of Opening]] (probably better used to find [[portal]]s)
+
* The [[Bell of Opening]]
  
 +
==Removal==
 +
Because of technical limitations in the level format, only one trap can exist on any given square. If you aren't able to #[[untrap]] a physical trap, or if the trap is non-physical, you can usually remove most traps by entering the square and digging a [[pit]]. This will overwrite the existing trap in the level data, replacing it with a pit trap. You can then leave the pit and avoid it, or fill it by pushing a [[boulder]] in. The downside to this strategy is that you must expose yourself to the trap by entering its space.
  
==Source code references==
+
==History==
 +
The "fake bones" found on early traps are introduced in [[NetHack 3.6.1]].
  
 +
==Variants==
 +
===UnNetHack===
 +
[[UnNetHack]] adds [[ice trap]]s.
 +
 +
=== FIQHack ===
 +
[[Lenses]] in FIQHack provide [[automatic searching]], making them useful for detecting traps.
 +
 +
=== xNetHack ===
 +
{{main|xNetHack#Trap changes|l1=xNetHack §&nbsp;Trap changes}}
 +
In [[xNetHack]], you are asked for confirmation when stepping onto a square with a trap you have already found (and are not clearly immune to). This eliminates the problem of accidentally walking onto traps that you can't see, without needing to use the [[trap id]] command at every step. xNetHack also changes the effects of many traps.
 +
 +
==References==
 
<references/>
 
<references/>
 
+
{{nethack-366}}
 
[[Category:Dungeon features]]
 
[[Category:Dungeon features]]
 
[[Category:Traps]]
 
[[Category:Traps]]

Latest revision as of 19:18, 20 January 2024

In NetHack, traps are mechanisms on a space which may activate when you or a monster steps on them. Traps can be detected through various methods, and certain types of traps can be disarmed with the #untrap command.

List of traps

The following traps are activated by stepping on their square:

: The vibrating square and magic portal are internally represented as traps, even though they are meant to aid the player instead of causing peril.

The following traps are activated by interacting with certain items or doors:

Generation

In both filler levels and most special levels, a "random" trap is selected uniformly from the whole set of eligible traps, subject to level difficulty checks and some exclusions.[1] Oddly, special levels that contain maze filler (the Castle, Asmodeus, Baalzebub, Orcus, and all real and fake Wizard's Tower levels, but not the Big Room or the Catacombs) use a completely separate formula that ignores level difficulty for selecting traps in the mazes.[2] It nonetheless ends up working much the same way overall, but actually makes fire traps less common than they would otherwise be in Gehennom on those levels.

The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

While hallucinating, traps may appear on the map and in messages as random or nonexistent trap types, though any messages resulting from triggering the trap are unchanged.

Fake bones

Certain types of traps up to dungeon level 4 may have a pre-aged corpse generated on top, along with random cursed weapons, tools, food or gems. These are often referred to as fake bones, based on their similarity to bones files.

Arrow traps, dart traps, falling rock traps, and rolling boulder traps have a 1 − Dlvl − 14 chance of a corpse and items being placed on its square, i.e. this will always be the case with such traps on the first floor.[3] There will always be at least one possession, and there is a 15 chance of placing an additional possession after each one.[4]

Squeaky boards and rust traps never have a corpse because they are non-lethal. Pits and holes also never generate a corpse - any corpses found in pits are usually from generated monsters that fell in, especially if their associated items are present (e.g. finding an orcish helm with a goblin corpse). Magic traps do not have corpses either as a result of not being specified in the relevant code.

Detection

A user has suggested this page be merged with "Portal detection methods"

Avoiding traps in the dungeon takes patience and care. Therefore, the more time-consuming of these methods are only worthwhile when you are especially vulnerable. You can minimize your chances of stepping on a trap by paying close attention to monsters, pets, noises, and terrain. Be wary of the telltale signs of traps such as conspicuous boulders, suspicious corpses, and piles of rocks, darts, or arrows. Traps that you've already discovered will also not be visible under items like these, so it's a good idea to use the trap id command if you need to step onto that square that looks suspicious, even though you may have already been in that area and discovered all traps. By walking only where you have seen pets or monsters safely walk, you can avoid most traps. Remember where you have safely stepped before. Elbereth can cause monsters to flee, possibly uncovering traps as they do. A leashed pet will whine if it is near a trap. Magic resistance and fire resistance can help nullify some of the more dangerous effects of traps.

The search command is a great way to uncover traps without setting them off. #Untrap can be used on doors and containers. You can improve your chances of finding traps if you:

Some items can be useful in detecting traps, although they may have better uses elsewhere:

Removal

Because of technical limitations in the level format, only one trap can exist on any given square. If you aren't able to #untrap a physical trap, or if the trap is non-physical, you can usually remove most traps by entering the square and digging a pit. This will overwrite the existing trap in the level data, replacing it with a pit trap. You can then leave the pit and avoid it, or fill it by pushing a boulder in. The downside to this strategy is that you must expose yourself to the trap by entering its space.

History

The "fake bones" found on early traps are introduced in NetHack 3.6.1.

Variants

UnNetHack

UnNetHack adds ice traps.

FIQHack

Lenses in FIQHack provide automatic searching, making them useful for detecting traps.

xNetHack

In xNetHack, you are asked for confirmation when stepping onto a square with a trap you have already found (and are not clearly immune to). This eliminates the problem of accidentally walking onto traps that you can't see, without needing to use the trap id command at every step. xNetHack also changes the effects of many traps.

References