Difference between revisions of "Jumping"

From NetHackWiki
Jump to navigation Jump to search
m (Fix a reference)
(describe the path taken by jumps; mention that you can't jump over monsters)
Line 5: Line 5:
  
 
Using any of the three sources to jump, you must be able to see your destination. The jump will consume d25 [[nutrition]] (plus the usual spellcasting hunger penalty, if you cast the spell), and you become [[immobile]] for one full turn (not simply one move) after landing<ref>{{sourcecode|apply.c|1361}}</ref>. Players with [[speed]] can move farther in one turn by stepping as far as possible without advancing the turn counter, then jumping, ''see [[Speed#Strategy]]''.
 
Using any of the three sources to jump, you must be able to see your destination. The jump will consume d25 [[nutrition]] (plus the usual spellcasting hunger penalty, if you cast the spell), and you become [[immobile]] for one full turn (not simply one move) after landing<ref>{{sourcecode|apply.c|1361}}</ref>. Players with [[speed]] can move farther in one turn by stepping as far as possible without advancing the turn counter, then jumping, ''see [[Speed#Strategy]]''.
 +
 +
Note that you cannot jump ''over'' [[monster]]s. If you attempt to do so, you will bump into them, which will wake them up and anger them if they are [[peaceful]].
  
 
You can jump to try to escape from a [[pit]] or [[lava]]. You can also jump out of a [[web]], which will tear it apart.  You can jump out of a [[bear trap]], but it will cause 1d10 damage and can inflict a long-lasting [[wounded legs|leg wound]].  If you are stuck in the floor (because you were caught in cooling lava) and attempt to jump, you will remain stuck and wound your legs.
 
You can jump to try to escape from a [[pit]] or [[lava]]. You can also jump out of a [[web]], which will tear it apart.  You can jump out of a [[bear trap]], but it will cause 1d10 damage and can inflict a long-lasting [[wounded legs|leg wound]].  If you are stuck in the floor (because you were caught in cooling lava) and attempt to jump, you will remain stuck and wound your legs.
 +
 +
== Range ==
  
 
In the following diagrams, tiles to which you can jump are marked by an 'x'.
 
In the following diagrams, tiles to which you can jump are marked by an 'x'.
Line 34: Line 38:
 
   ...........    ...........    ...........    ....xxx....
 
   ...........    ...........    ...........    ....xxx....
 
   ...........    ...........    ...........    ...........
 
   ...........    ...........    ...........    ...........
 +
 +
== Path ==
 +
{{Wikipedia|Bresenham's line algorithm}}
 +
 +
Once you select a destination, you will be moved towards it along a path determined by a version of ''Bresenham's line algorithm''.<ref>{{sourcecode|apply.c|1354}} calls {{function|dothrow.c|walk_path}}, which calculates the path</ref> The path will be as close to a straight line as possible, but will tend to move you along the longer axis of your jump. It will never move you a greater proportion of the distance along the shorter axis than it has moved you along the longer axis.
 +
 +
The following diagrams should help illustrate some typical paths:
 +
 +
  ...........    ...........    ...........    ...........
 +
  ...........    ...........    ...........    ...........
 +
  ...........    ...........    ...........    ...........
 +
  ....X......    ...........    ...........    ...........
 +
  .....*.....    ...........    ...........    .........X.
 +
  .....@.....    ...**@.....    .....@.....    .....@***..
 +
  ...........    ..X........    .....*.....    ...........
 +
  ...........    ...........    ....*......    ...........
 +
  ...........    ...........    ...X.......    ...........
 +
  ...........    ...........    ...........    ...........
 +
  ...........    ...........    ...........    ...........
 +
 +
Being able to predict the path of your jump is important for maximizing jump distance, and to avoid angering peaceful monsters.
 +
 +
== Restrictions ==
  
 
You cannot jump if:
 
You cannot jump if:
Line 39: Line 66:
 
* You are [[engulfing|engulfed]] by a monster.
 
* You are [[engulfing|engulfed]] by a monster.
 
* You are in water.
 
* You are in water.
* You are stuck to a nontame, nonconfused monster, unless [[conflict]] is in effect.
+
* You are stuck to a monster, unless it is tame and not suffering from [[confusion]] or [[conflict]].
 
* You are [[levitation|levitating]], are on the [[Plane of Air]], or are on the [[Plane of Water]].
 
* You are [[levitation|levitating]], are on the [[Plane of Air]], or are on the [[Plane of Water]].
 
* Either of your legs is wounded.
 
* Either of your legs is wounded.

Revision as of 04:37, 24 July 2008

Jumping is a property that allows a player to traverse multiple tiles in one movement. The ability to jump comes from three sources: being a Knight, wearing jumping boots, or reading a spellbook of jumping. To perform a jump:

  • As a Knight or wearing the boots, you use the extended command #jump. If number_pad is set, you can also press j. Knight jumping and jumping from the boots are practically identical; the only difference is to which squares you can jump.
  • Using the spell, you must press Z and select jumping. (The #jump command will not cast the spell; see Dudley's dungeon of 21 December 2007 for a discussion of this.) The spell lets you jump farther, depending on your skill in escape spells.

Using any of the three sources to jump, you must be able to see your destination. The jump will consume d25 nutrition (plus the usual spellcasting hunger penalty, if you cast the spell), and you become immobile for one full turn (not simply one move) after landing[1]. Players with speed can move farther in one turn by stepping as far as possible without advancing the turn counter, then jumping, see Speed#Strategy.

Note that you cannot jump over monsters. If you attempt to do so, you will bump into them, which will wake them up and anger them if they are peaceful.

You can jump to try to escape from a pit or lava. You can also jump out of a web, which will tear it apart. You can jump out of a bear trap, but it will cause 1d10 damage and can inflict a long-lasting leg wound. If you are stuck in the floor (because you were caught in cooling lava) and attempt to jump, you will remain stuck and wound your legs.

Range

In the following diagrams, tiles to which you can jump are marked by an 'x'.

 Knight's Jump   Jumping Boots
   .........       .........
   .........       ....x....
   ...x.x...       ..xxxxx..
   ..x...x..       ..xxxxx..
   ....@....       .xxx@xxx.
   ..x...x..       ..xxxxx..
   ...x.x...       ..xxxxx..
   .........       ....x....
   .........       .........
 
                      JUMPING SPELL
  Unskilled        Basic         Skilled         Expert
 ...........    ...........    ...........    ...........
 ...........    ...........    ...........    ....xxx....
 .....x.....    ....xxx....    ...xxxxx...    ..xxxxxxx..
 ...xxxxx...    ...xxxxx...    ..xxxxxxx..    ..xxxxxxx..
 ...xxxxx...    ..xxxxxxx..    ..xxxxxxx..    .xxxxxxxxx.
 ..xxx@xxx..    ..xxx@xxx..    ..xxx@xxx..    .xxxx@xxxx.
 ...xxxxx...    ..xxxxxxx..    ..xxxxxxx..    .xxxxxxxxx.
 ...xxxxx...    ...xxxxx...    ..xxxxxxx..    ..xxxxxxx..
 .....x.....    ....xxx....    ...xxxxx...    ..xxxxxxx..
 ...........    ...........    ...........    ....xxx....
 ...........    ...........    ...........    ...........

Path

Once you select a destination, you will be moved towards it along a path determined by a version of Bresenham's line algorithm.[2] The path will be as close to a straight line as possible, but will tend to move you along the longer axis of your jump. It will never move you a greater proportion of the distance along the shorter axis than it has moved you along the longer axis.

The following diagrams should help illustrate some typical paths:

 ...........    ...........    ...........    ...........
 ...........    ...........    ...........    ...........
 ...........    ...........    ...........    ...........
 ....X......    ...........    ...........    ...........
 .....*.....    ...........    ...........    .........X.
 .....@.....    ...**@.....    .....@.....    .....@***..
 ...........    ..X........    .....*.....    ...........
 ...........    ...........    ....*......    ...........
 ...........    ...........    ...X.......    ...........
 ...........    ...........    ...........    ...........
 ...........    ...........    ...........    ...........

Being able to predict the path of your jump is important for maximizing jump distance, and to avoid angering peaceful monsters.

Restrictions

You cannot jump if:

In addition, if you are not casting the jumping spell, you cannot jump if:

  • You do not have legs.
  • You are burdened to any degree.
  • You are hungrier than the halfway point between not hungry and weak.
  • You have less than six strength.

Source code references

  1. apply.c, line 1361
  2. apply.c, line 1354 calls walk_path in dothrow.c, which calculates the path

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.