Difference between revisions of "Trap"

From NetHackWiki
Jump to navigation Jump to search
(added squeaky board)
m (style guide on variant templates)
 
(311 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
Beware of '''traps'''! When you step on a square of one, it activates and then probably harms [[you]], for example by dropping a [[rock]], sending a [[boulder]], shooting a [[dart]], or [[blind]]ing you!
+
{{features}}
 +
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.
  
==Arrow trap==
+
==List of traps==
 +
The following traps are activated by stepping on their [[square]]:
  
These can fire [[arrow]]s at you, which generally do little damage, and can therefore be a useful source of arrows. While standing on 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. Rarely, the arrows can be poisoned.
+
* [[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]]
  
==Bear trap==
+
<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.
  
A bear trap renders you immobile for several turns. During this time, you can attack and be attacked; you cannot move from the spot. It is possible to <tt>'''#untrap'''</tt> a bear trap. If successful, it will appear in your inventory and you may apply it to a new location. If unsuccessful, you will become trapped.
+
The following traps are activated by interacting with certain items or doors:
  
==Boulder trap==
+
* [[container trap]]
 +
* [[tin#Explosion|exploding tin]]
 +
* [[door#Door traps|door trap]]
  
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.
+
==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.
  
Moving the boulder out of the path or otherwise destroying it effectly disables a boulder trap.
+
{{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.}}
  
==Dart trap==
+
===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.
  
Similar to an arrow trap, but with [[dart]]s, and therefore less useful.
+
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}}
  
==Fire trap==
+
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.
  
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.  
+
==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.
  
Fire traps are only randomly generated in [[Gehennom]], [[Plane of Fire]] and some [[quest]]s, notably the [[Valkyrie]] quest.
+
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;
 +
* put on or [[Eating jewelry|eat]] a [[ring of searching]];
 +
* put on a [[pair of lenses]];
 +
* wield [[Excalibur]];
 +
* wield the blessed [[Master Key of Thievery]] (or uncursed, if you are a [[Rogue]]) without gloves;
 +
* play a role that gets intrinsic searching
 +
** [[Ranger]]: Level 1
 +
** [[Monk]]: Level 9
 +
** [[Rogue]]: Level 10
 +
** [[Archeologist]]: Level 10
 +
** [[Tourist]]: Level 10
  
==Hole==
+
Some items can be useful in detecting traps, although they may have better uses elsewhere:
 +
* [[scroll of gold detection]] (read while cursed or [[confused]])
 +
* [[crystal ball]] (scry for '''^''' with high [[intelligence]])
 +
* [[wand of secret door detection]]
 +
* [[spellbook of detect unseen]]
 +
* The [[Bell of Opening]]
  
[[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.
+
==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.
  
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.
+
==History==
 +
The "fake bones" found on early traps are introduced in [[NetHack 3.6.1]].
  
==Magic trap==
+
==Variants==
 +
===UnNetHack===
 +
[[UnNetHack]] adds [[ice trap]]s.
  
The effects of magic traps are many and varied...
+
=== FIQHack ===
 +
[[Lenses]] in FIQHack provide [[automatic searching]], making them useful for detecting traps.
  
==Falling rock trap==
+
=== xNetHack ===
 
+
{{main|xNetHack#Trap changes|l1=xNetHack §&nbsp;Trap changes}}
This triggers a falling [[rock]], which hits you on the head, unless you are wearing some kind of hard hat, in which case the damage is lessened. The rock stays on the ground, so it is possible to use them as a rock source, although the trap will be exhausted eventually.
+
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.
 
 
Early [[pet]] deaths are usually due to this type of trap.
 
 
 
==Pit==
 
 
 
[[Pit]]s in the ground open up when you walk over them. They require a turn 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.
 
 
 
==Spiked pit==
 
 
 
These are just pits which do more damage. The spikes are sometimes poisoned, which can be fatal for a character without [[poison resistance]].
 
 
 
==Squeaky board==
 
 
 
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". It can be untrapped with a [[potion of oil]] or [[can of grease]].
 
 
 
==Teleporter==
 
 
 
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.
 
 
 
==Level teleporter==
 
 
 
This teleports you to a random location on a random level. You will rarely be teleported further down than you have already explored.
 
 
 
==Portal==
 
 
 
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]].
 
  
 +
==References==
 +
<references/>
 +
{{nethack-366}}
 
[[Category:Dungeon features]]
 
[[Category:Dungeon features]]
 +
[[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