Charge

From NetHackWiki
(Redirected from Recharging)
Jump to navigation Jump to search
This article is about the usage or duration of certain items and items that can increase this quality. For money owed to a shopkeeper from the use of shop property, see usage fee.
For money owed to a shopkeeper in general, see debt.

In NetHack, certain items have charges that dictate either the amount of times they can be used or the amount of turns that they can remain active for. Some other items have an effect that increases or decreases in accordance with the amount of charge they have, making it similar to enchantment for armor—indeed, the same variable in the code is used for both.[1]

There are also items that can potentially increase or decrease the amount of charges some items have.

Description

The following items have charges and can be recharged:[2][3][4]

When charging items, the player will be prompted to select an item from a menu displaying all known chargeable items in the hero's inventory, except for lamps and lanterns. By default, the known beatitude of a chargeable item is not displayed if that item is uncursed.

For wands and chargeable tools that have a set number of uses, fully identifying them will display their charge counter when those items are viewed in the inventory: the charge counter lists the total amount of recharges for the item and the number of current charges it has. For example, an identified wand of magic missile that currently has five charges and has never been recharged will display a (0:5) next to the item. Identified chargeable rings will display an enchantment, e.g. a +3 ring of protection.

The charge counter for an identified non-ring item will always stop updating after seven recharges, (7:y), even if the item can still be recharged further.[5] Oil lamps, brass lanterns and other light sources use their "charges" to measure their duration of activity, and do not display a charge counter at all.

Some chargeable items cannot be used if they are out of charges, (x:0), while others may be used but will behave differently than they do when used while charged: for example, the fire horn and frost horn behave like tooled horns if applied with no charges, a drum of earthquake behaves like a "weaker" leather drum if applied with no charges, and an uncharged ring that the hero puts on will not cause ring hunger while it is worn.[6][7]

Cancellation removes charges from any chargeable magical items that it affects:[8] magical tools have their current charges set to 0, while chargeable rings will have their enchantment set to +0—magical wands other than the wand of cancellation will lose all charges, displaying (x:-1) if they are identified, and attempting to zap or engrave with a cancelled wand will turn it to dust. Items belonging to a shop that lose charges this way will incur billing from the shopkeeper.[9] An item being cancelled does not necessarily prevent it from being recharged (even if the charging source if cursed).[10]

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 4e1cf071, oil lamps and brass lanterns are shown in the default charging prompt.

Per commit 7ea7058c, a worn +0 ring of protection causes ring hunger if it is the hero's only source of extrinsic protection—if the hero is wearing two rings of protection and the one on their left hand is +0, ring hunger applies to that left-hand ring even if the right hand's ring is charged.

Charging mechanics

The outcomes of charging (or recharging) naturally differ depending on whether the source of the charging effect is blessed, uncursed or cursed. As indicated prior, chargeable items also have different types of rules governing how many times an item can be recharged and how many charges can be added this way, including maximum limits—these mechanics are determined by object class and sometimes also differ on a per-item basis, and all of this information is sorted accordingly in the sections below.

There are two items that can be used to perform charging:

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 ef6a88e1, chargeable rings affected by shock damage have a 23 chance of being charged by one point of enchantment rather than being destroyed, with normal charging limits (and chance of destruction) applied.

Wands

Wands can be charged a limited number of times, with a chance of exploding if they are recharged enough times or sometimes when they are charged over their maximum.[13]

For the successful charging of wands, charging from a blessed source will always set a wand of wishing's charges to their maximum of 3 if it currently has fewer[14]—otherwise, their current charge count is set to a number between the wand's natural maximum charges and (MAX - 4) inclusively, with all values having equal probability.[15] The maximum is 8 charges for directional wands and 15 for non-directional wands.[16] This is summarized by the following probability table:

Wand type Number chosen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
wand of wishing (always)
directional 20% 20% 20% 20% 20%
non-directional 20% 20% 20% 20% 20%

Charging from an uncursed source chooses a number in the same way as blessed charging, then reduces the number to a value between 1 and the chosen number inclusively.[17] The net result is summarized by the following probability table:

Wand type Number chosen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
wand of wishing 33.3% 33.3% 33.3%
directional 17.69% 17.69% 17.69% 17.69% 12.69% 8.69% 5.36% 2.5%
non-directional 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 7.79% 5.97% 4.30% 2.76% 1.33%

For both blessed and uncursed charging, the wand's number of charges is set to the chosen value, and if the wand already has that many charges (or more) it instead gains one charge.[18] If this extra charge brings a wand of wishing to more than 3 charges, it explodes.[19] A wand other than the wand of wishing will simply glow blue with no effect if charged while it is already at their natural maximum amount of charges.[20]

Charging from a cursed source sets the wand's number of charges to 0[21][22]—it will have no effect on a blessed wand.[23]

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 615edb1c, a wand of wishing can only hold one charge, and recharging an empty one with a non-cursed source will add one charge.

Wand explosions

n3343

If a wand has been recharged at least once before, there is an increasing chance as the hero recharges it that the wand might explode and destroy itself instead of gaining charges, dealing damage to the hero depending on the type of wand that exploded.[24][19] A wand of wishing always explodes if recharged more than once or charged beyond their maximum, while other wands have a chance equal to n3343, where n is the number of times the wand has been recharged before.[13][19] This is summarized in the following table:[25]

Times recharged 0 1 2 3 4 5 6 7
Chance of exploding (never) 0.29% 2.33% 7.87% 18.66% 36.44% 62.97% (always)
Cumulative

The combined, cumulative probability of achieving the maximum amount of recharges with a wand is summarized here:

Times recharged 0 1 2 3 4 5 6 7
Cumulative chance (never) 0.29% 2.62% 10.28% 27.02% 53.62% 82.83% (always)

The expected average per wand is 5.2334 recharges before a wand eventually explodes from overcharging.

Rings

When charging a ring, its current enchantment is checked first[26]—a ring has an n7 probability of exploding instead of changing its enchantment if 0 < n < 7, and will always explode if the ring's enchantment is a value that is either -5 or less, or +7 or greater.[27] An exploding ring deals 1d(3×|n|) damage to the hero.[28]

The probabilities of a ring exploding when charged at a given enchantment are covered by the following table:

Current enchantment ≤ -5 -4 to -1 0 1 2 3 4 5 6 ≥ 7
Chance of destruction 100% 0% 0% 14% 29% 43% 57% 71% 86% 100%

If the ring does not explode, its enchantment is changed based on the beatitude of the charging source: blessed charging adds 1-3 points, uncursed charging adds 1 point, and cursed charging subtracts 1-2 points.

Tools

For chargeable tools, magic markers can only be properly recharged once while any other tool may be recharged indefinitely[29][30]—after such a tool is recharged at least seven times, the displayed recharge value will not update further.[5]

For all tools, cursed charging reduces the number of charges to 0, unless the item itself is blessed, in which case nothing will happen.

Tool Uncursed charging adds Blessed charging adds Maximum Notes
Bell of Opening 1 d3 5
tinning kit, expensive camera, magic marker 10-20 15-30 127
  • If blessed charging and charges are greater than 50 but less than 75, round up to 75.
  • If blessed or uncursed charging and charges are less than 50, round up to 50.
  • Magic markers that have already been recharged will not charge again, and if 3 or fewer charges remain on an already-recharged marker, they are lost.
crystal ball 1 set to 6 5 (unless blessed charging)
bag of tricks, can of grease, horn of plenty 1-5 6-15 if fewer than 10 charges left; else 5-10 50
magic flute, magic harp, frost horn, fire horn, drum of earthquake d4 2d4 20
oil lamp, brass lantern 750 1500 1500 Dipping an oil lamp in a potion of oil non-magically fills it to 1500

Strategy

Sources of charging are limited, so only save them for the items that are most important to your specific kit and situation: since tools other than magic markers can be recharged indefinitely, they may not be as necessary to charge unless the hero's strategy is reliant on them—as an example, a tinning kit is unlikely to require recharging unless used extensively, which in turn is almost always unnecessary outside of some instances of vegan or vegetarian conduct.

Be mindful of how many times you recharge a wand, since a wand that explodes while recharging can deal significant damage, especially if it is a wand of cancellation, death, polymorph, undead turning:[31][32] when recharging such a wand, make sure that you do so in a relatively safe area and have healing methods ready to go in the event of misfortune. A hero with a wand of wishing that has already been recharged once should always wrest the last wish from the wand by zapping it repeatedly.

Although similar conditions apply to chargeable rings, players do not charge them nearly as often both because of their limited long-term use (especially in ascension kits) and because they have a significant chance of losing the ring from charging it even at relatively low enchantments—exceptions to this generalized trend include nudist characters, who are much more reliant on worn rings and other non-armor sources of AC, and may even polymorph for the purpose of eating jewelry in order to gain their bonuses, e.g. protection and increase damage. Monk builds used for conducts play may similarly rely on charging and eating rings to boost AC and weaponless damage among other benefits.

History

The modern mechanics of charging are first introduced in NetHack 3.0.0 with the scroll of charging—in Hack 1.21, which is based on Jay Fenlason's Hack, a "scroll of charge wand" exists that can be considered a precursor to the scroll of charging.

From NetHack 3.0.0 to NetHack 3.4.3, including some variants based on those versions, a wand that explodes from overcharging always deals between 1 and 2(maxhp+1)3 HP in damage regardless of the wand's type. These versions are also subject to the following bugs:

  • Chargeable rings do not show up in the default prompt for items to charge. This is fixed in NetHack 3.6.0 via commit ae36e5b3.
  • Charging for magic markers, tinning kits and expensive cameras were commented incorrectly—an uncursed source of charging adds 10-14 charges with the comment reading "5 to 15", while a blessed scroll adds 16-25 charges with the comment reading "10 to 25". This is fixed in NetHack 3.6.0 via commit f2a958e7, which raises the amount of charges added to these items by uncursed and blessed charging sources to their current values, and also correctly records them in the comment text.

Variants

NetHack variants may make significant changes to charging mechanics, such as displaying charge counters for some light sources, adding charges to normally non-chargeable items, and changing how often certain items can be charged. Many variants also add more sources of charging as well as items that can be charged (not counting new wands).

SLASH'EM

SLASH'EM makes spellbooks into chargeable items: they are normally generated with 2-4 charges, and a hero reading a non-cursed and charged spellbook will use up a charge to either guarantee a successful reading or increase the rate at which they complete reading. Spellbooks only have a 12 chance of incrementing the charge counter when recharged, and follow the same recharging rules as wands (including the distinction between directional and non-directional spells, strangely enough). Spellbooks of blank paper that result from water damage to other spellbooks or reading them enough to make their ink completely fade will retain their charges and recharge count, although both will be set to zero upon using a magic marker on them.

SLASH'EM also adds the following chargeable items, not counting wands and spellbooks:

Furthermore, shopekeepers of hardware stores and lighting stores may offer charging as a form of service.

GruntHack

GruntHack adds the felt marker as a chargeable item.

UnNetHack

In UnNetHack, charging an applicable item with a blessed source of charging will additionally reveal its current charges and charge counter. This includes oil lamps and brass lanterns, which are shown in the default charging menu and will display the number of turns they can remain lit for when their charge counter is visible.

A bag of tricks can be charged through either normal means or by physically placeing a non-cursed scroll of charging into it, which uses up the scroll: doing so while the bag is being used as a container (which is only possibly for an empty bag of tricks) will also destroy its contents.

AceHack

In AceHack, identifying an item or charging it will reveal its charge counter, including the number of turns that an oil lamp or brass lantern will remain active for.

dNetHack

dNetHack gives dwarvish helms internal lamps that can be charged, and also adds several new items that use charges, not counting wands:

Charges and enchantment are tracked separately for armor that has a light source built in.

The power pack is a tool that can be used to charge items as the scroll of charging does—both the scroll and the power pack can be used interchangeably to charge normal items and "future tech" (which are items normally only found on Anachrononauts and Androids or in the Anachrononaut and Android quests.

Preservative engines interact with charging sources differently from most other tools: a cursed scroll of charging or similar source used on a preservative engine will set its charges to the maximum of 8, while a blessed source instead removes all charges, and an uncursed source will add one charge up to the maximum of 8.

As in SLASH'EM and similar variants, shopekeepers of hardware stores and lighting stores may offer charging as shopkeeper services.

Maids are monsters that have the unique ability to recharge specific items they come across, which primarily consist of a few light sources and expensive cameras.

FIQHack

FIQHack adds the spellbook of charging, whose enchantment spell can be learned and cast to replicate the effects of reading an uncursed scroll of charging.

notdNetHack

In addition to dNetHack details, notdNetHack adds the following chargeable items (not counting wands):

EvilHack

EvilHack adds some new items that use charges (not counting wands):

All wands of wishing that are generated will be precharged, (1:x), and both the wand of wishing and wand of death can only be recharged once.

SlashTHEM

In addition to SLASH'EM details, SlashTHEM also adds a few other items that use charges (not counting wands and spellbooks):

The Gourd of Infinity, the Drunk quest artifact, can be invoked to charge items much like the Tourist quest artifact—Drunks invoking the blessed artifact can similarly perform blessed charging.

notnotdNetHack

In addition to dNetHack and notdNetHack details, notnotdNetHack adds the mist projector as a chargeable non-wand item.

References

  1. include/obj.h in NetHack 3.6.7, line 44: spe definition; the comment outlines the various purposes it is employed for
  2. src/read.c in NetHack 3.6.7, line 477
  3. src/read.c in NetHack 3.6.7, line 536
  4. src/read.c in NetHack 3.6.7, line 570
  5. 5.0 5.1 src/read.c in NetHack 3.6.7, line 573-L576: tools can be recharged indefinitely; wands are guaranteed to explode upon being recharged a seventh time, so this is usually moot in their case
  6. src/eat.c in NetHack 3.6.7, line 2821-L2825
  7. src/eat.c in NetHack 3.6.7, line 2830-L2833
  8. src/zap.c in NetHack 3.6.7, line 1055-L1060
  9. src/zap.c in NetHack 3.6.7, line 1059
  10. src/read.c in NetHack 3.6.7, line 483: charging always sets the current charges to 0 if it is below 0 before other effects apply
  11. src/read.c in NetHack 3.6.7, line 1514
  12. src/artifact.c in NetHack 3.6.7, line 1502
  13. 13.0 13.1 src/read.c in NetHack 3.6.7, line 500-L503: calls wand_explode()
  14. src/read.c in NetHack 3.6.7, line 478-L479
  15. src/read.c in NetHack 3.6.7, line 512-L520
  16. src/read.c in NetHack 3.6.7, line 480
  17. src/read.c in NetHack 3.6.7, line 514
  18. src/read.c in NetHack 3.6.7, line 517-L520
  19. 19.0 19.1 19.2 src/read.c in NetHack 3.6.7, line 521-L523
  20. src/read.c in NetHack 3.6.7, line 525
  21. src/read.c in NetHack 3.6.7, line 510
  22. src/read.c in NetHack 3.6.7, line 412-L421
  23. src/read.c in NetHack 3.6.7, line 415
  24. src/read.c in NetHack 3.6.7, line 1849-L1894: wand_explode() function
  25. src/read.c in NetHack 3.6.7, line 486-L499
  26. src/read.c in NetHack 3.6.7, line 541: "destruction depends on current state, not adjustment"
  27. src/read.c in NetHack 3.6.7, line 542-L546
  28. src/read.c in NetHack 3.6.7, line 547-L549
  29. src/read.c in NetHack 3.6.7, line 594-L601
  30. src/read.c in NetHack 3.6.7, line 570
  31. src/read.c in NetHack 3.6.7, line 1854
  32. src/read.c in NetHack 3.6.7, line 1867-L1872