Container

From NetHackWiki
Revision as of 22:48, 4 June 2024 by Furey (talk | contribs) (TNNT (the game): TNNT (the game) is the game we play during TNNT (the tournament). Here we are documenting the game.)
Jump to navigation Jump to search

A container is a type of tool that appears in NetHack, and is designed for the purpose of storing and removing items.

List of containers

The following items are considered containers:

Although the bag of tricks is defined with the CONTAINER macro in objects.c[1] and appears as a bag while unidentified, it cannot actually store items. Statues can hold items, and floor squares and ice squares can contain items buried within - these are not treated as container tools.

Generation

Containers created via normal generation (i.e. outside of bones files or trap "bones") are always uncursed and may contain the following quantities of items:[2]

Container Contents Lockable
sack 0–1 items No
large box 0–5 items Yes
chest 0–7 items Yes
ice box 0–20 corpses No
bag of holding 0–1 items No
oilskin sack 0–1 items No

Containers that can be locked have a 45 chance of generating as locked, and a separate 110 chance of generating with a container trap.[3]

Containers in the hero's starting inventory will always be empty. Otherwise, for containers other than the ice box, each of the items in randomly generated containers are created with the following probabilities:[4]

Type Probability
gem or stone 18%
comestible 15%
potion 18%
scroll 18%
spellbook 12%
gold 7%
wand 6%
ring 5%
amulet 1%

There are some special cases for the contents of containers:[5]

  • Gold is increased to 2.5x its normal amount.
  • Gems will not include rocks.
  • A bag of holding will not contain an object that would explode it.

Description

Containers can store an unlimited number of items. Containers on the ground can be opened with the #loot extended command, which is used to view a container's contents and add and/or remove items, including stashing a singular item (or stack of items); they can also be emptied with the #tip command, which will dump the contents onto the ground at the character's square. A container in the character's inventory is used by applying it, which works the same as looting, and can also be tipped to deposit its contents on the ground. Tipping a container while levitating will cause fragile items to break.

Large boxes and chests can be locked, requiring an unlocking tool, the wand of opening, or the spell of knock in order to open, and may also have a container trap hidden on them, which will trigger if the box is opened, locked, unlocked, or else the character fails an untrap attempt. It is possible to force a locked container and break the lock open, though this comes with risks: Forcing the lock with a bladed weapon exercises dexterity, but risks breaking that weapon unless it is cursed, while forcing the lock with a blunt weapon exercises strength, but may destroy the container and possibly some or all of its contents. Kicking a container can break open locks if applicable, but can also destroy items inside the container, particularly fragile ones. A broken lock can be repaired with the wand of locking, the wand of opening, the spell of wizard lock, or the spell of knock.[6]

The contents of containers are generally protected from being affected by fire, cold, shock, or cancellation: Magical containers (i.e. the bag of holding) also protect their contents from being destroyed if the bag is kicked, thrown, being dropped down stairs, or being dropped while levitating. Water will wet the contents of sacks and bags of holding; applying grease to these containers protects against wetting until it wears off. Lava will destroy any container that touches it outright and burn up any flammable contents that spill out, unless the container is an ice box or is fireproof[7] - containers cannot be fireproofed directly, though polymorphing an erosion-proofed tool can produce a fireproof container.[8]

If a container is polymorphed, its contents are lost regardless of what the resulting item is.

There are limitations to what can be placed in a container:

  • Unique items cannot ever be placed into containers.
  • Large boxes, ice boxes, and chests are too big to fit into any other container.
  • Placing certain items in a bag of holding will cause it to explode and destroy any items within - see the article on the bag of holding for specific details.

Some monsters can pick up containers, but most will not attempt to access their contents, with one notable exception: a gelatinous cube that engulfs a container made of an organic material (i.e. all except the ice box) will eat the container, destroying it and harmlessly engulfing the contents regardless of whether it would eat those items normally. A character polymorphed into a gelatinous cube can only eat these containers if they are empty.

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.

Monsters can loot containers and will use unlocking tools to open locked containers.

Strategy

Randomly generated containers are typically used as stash locations, and common places for stashes often include a guaranteed container or two, such as the Quest home level and the Castle - the latter even provides a cursed scroll of scare monster to deter monsters with.

Many characters carry two bags: a primary bag of holding with much of their stuff and a secondary bag, not a bag of holding, with items such as a wand of cancellation, some holy water, a blessed scroll of remove curse, and a scroll of scare monster. In an emergency, the character can #tip the secondary bag and spill the scroll of scare monster directly onto the floor in one action.

History

The ice box first appears in Hack 1.0, while all other containers are introduced in NetHack 3.0.0.

In NetHack 3.2.0 and previous versions, including some variants based on those versions, a popular technique for identifying worthless glass was called "kickboxing". Players would gather a large pile of gems, name all of them "fake red" or whatever color, dump them in a box, and then repeatedly kick the box until they were all broken, then retrieve the remaining gems and un-name them, informally identifying worthless glass of all colors. Starting in NetHack 3.2.0, worthless glass no longer breaks, so kickboxing no longer works.

The ability to #tip containers is added in NetHack 3.6.0 - some variants based on NetHack 3.4.3 and earlier versions may not include this feature.

Messages

You hear a muffled shatter.
You kicked or threw a container, or dropped it from a significant height, and broke at least one item inside it.
You hear a muffled cracking.
As above, and at least one egg inside was destroyed.
That would be an interesting topological exercise.
You attempted to place a container inside itself.

Variants

Some variants of NetHack add new containers, while others may change how certain containers function - a common quality-of-life addition is to allow placing a container on an altar to identify the beatitude of both the container and its contents. The magic chest is also a common addition to many variants, with each one implementing it differently (e.g. it may be an item or a dungeon feature). A less common change is to enable a bag of tricks to carry items under certain circumstances.

Variants that implement object materials may alter a container's properties based on its material.

SporkHack

SporkHack introduces a maximum carrying capacity for containers, with the default being 1000 aum; large boxes can carry 3000 aum worth of items, while ice boxes, chests and bags of holding have unlimited carrying capacity. SporkHack also adds a couple of new containers:

  • Iron safe, which has unlimited carrying capacity and can only be locked and unlocked by magic or stethoscope
  • small sack, which has only 200 aum of carrying capacity

The bag of poo is an object that is defined as a container but cannot be used to store items, similar to the bag of tricks.

UnNetHack

UnNetHack adds the iron safe from SporkHack, and makes the bag of tricks usable as a container once it runs out of charges.

AceHack

In AceHack, placing a container on an altar identifies the beatitude of the container and its contents.

dNetHack

dNetHack, notdNetHack and notnotdNetHack add three new containers:

The huge stone crate replaces the boulders in Sokoban and combines the properties of a container and a boulder, but cannot be used as a proper container.

Maids that pick up lockable containers with broken locks will mend them.

DynaHack

DynaHack includes the iron safe from SporkHack and adds the magic chest as a dungeon feature that is generated at fixed points in the dungeon and shares its contents across each magic chest.

NetHack Fourk

NetHack Fourk adds the magic chest as a dungeon feature that contains randomized items suited to a character's current role - magic chests can be created in any location by reading a scroll of consecration while confused.

FIQHack

In FIQHack, monsters are capable of looting containers and carrying items in bags. The Castle chest is special-cased to prevent monsters from stealing the guaranteed wand of wishing.

FIQHack also adds the magic chest as an item that behaves like a dungeon feature similar to DynaHack and Nethack Fourk: they cannot be picked up, teleported, polymorphed, etc. Minetown, Sokoban, the Castle, Orcus-town, and the Quest home level all have magic chests, and magic chests can be created by wishing for one.

EvilHack

EvilHack includes the iron safe from SporkHack, and magic chests are implemented as dungeon feature-like objects similar to DynaHack, and are generated at fixed locations in the dungeon - there are also special magic keys that are required to lock and unlock the chest. EvilHack adds the crystal chest as a type of container that can only be unlocked or locked through magical means and is immune to other forms of magic.

Fireproofed containers can survive being submerged in lava, and their contents will not be affected.

TNNT (the game)

TNNT (the game) adds the swap chest, a magic container that enables players to exchange objects between games.

References