Combat

From NetHackWiki
Revision as of 18:30, 11 September 2024 by Umbire the Phantom (talk | contribs) (note more bribery)
Jump to navigation Jump to search

Combat in NetHack consists of an exchange of attacks between the combatants, whether in melee or via ranged attack. Combat can occur either between the hero and another monster or between two monsters.

A user has suggested improving this page or section as follows:

"Continue expanding - make sure to mention invisibility and displacement where appropriate, and start on upcoming once a solid enough foundation is laid."

Description

The hero and monsters can attack using the following methods:

  • A weapon or other item that they wield in their hand (or in both hands)
  • Projectiles and other items that can be thrown, shot or fired, with some requiring a specific launcher
  • Certain scrolls that can be read for offensive purposes
  • Certain potions and comestibles that can be used offensively by wielding them or throwing them
  • Wands that can be zapped if the user has hands
  • Tools that can be applied for offensive purposes, or else used in melee like weapons
  • Spellcasting, using spells learned from spellbooks for the hero and other spells for monsters
  • Their bare hands, if they are not wielding any weapon
    • Some of the roles available to the hero have access to martial arts skills in place of standard bare-handed combat.
    • For monsters, the strength of their unarmed attacks is dependent on their hit dice.
  • For monsters that meet the necessary conditions to attack a target, they will perform all available and applicable attacks in their routine once each round; passive attacks have a chance to trigger automatically in melee and "counter-attack" whoever hits them.
  • Monsters are capable of moving and attacking in the same turn.

The ability of a combatant to hit another, as well as the odds of a combatant hitting successfully or else being hit, depend on various factors:

  • To-hit chances and damage are calculated using several factors, such as skill level and whether the weapon is designed to be used in melee or thrown/shot/fired/etc.; each weapon has their own hit dice and to-hit bonuses or penalties.
    • Items that are not designed to function as weapons - such as an iron chain, a potion, or the corpse or egg of a cockatrice or chickatrice -can still deal a base amount of damage when used as one and cause certain effects.
    • The cream pie is an exception to this above rule, and is coded to not deal damage at all if a hero or monster is hit by one.
  • Armor class determines how likely a target combatant is to be hit, as well as how much damage they take upon being hit.
  • Speed determines how many rounds of combat a hero or monster gets each turn.

Hero-monster combat

For the hero, combat is performed through one of several methods:

  • Attempting to move onto a monster's square normally will attempt to attack them.
    • The hero automatically attacks if the monster they move into is hostile, while doing so a peaceful monster will cause a "yes/no" prompt to come up asking the player if they really want to attack. Pets will not be attacked this way, and the hero will attempt to displace them instead.
    • A hero that is stunned or confused will attack any monster if confused movement or stunned movement would take them into that monster's square, with no prompt occurring.
    • While wielding the artifact Stormbringer, the bloodthirsty weapon will cause the hero to attack any monster they move into, ignoring prompts.
  • Using the force-fight command by pressing shift + F will force the next movement input to be interpreted as a melee attack, ignoring any prompts for monsters in the direction of the input given.
  • The hero can throw specific weapons or other objects via t or fire quivered items via f; they can quiver items to throw manually via shift + Q, or else select them from a prompt if they press f with nothing quivered. Throwing items at monsters does not bring up prompts and will anger peaceful monsters regardless of whether or not they hit them, with some notable exceptions:
  • The hero can read certain scrolls with r for offensive purposes.
  • The hero can cast applicable spells that they know using the shift + Z command.
  • The hero can zap directional wands at monsters with z if they have hands to do so.

For monsters, they will only target the hero if they are hostile or under the effects of conflict, and attack under the following conditions:

  • Monsters that have weapon attacks can throw or shoot at the hero if they are in range and the monster has an applicable projectile (including appropriate launchers if necessary). Otherwise, if they are not adjacent to the hero, the monster will attempt to move closer to them, and attack if that movement places them adjacent to the hero; they will also attack if they are already adjacent to the hero at the start of their turn.
  • Monsters with breath weapons or spitting attacks will only use them if the hero is in range and not adjacent to that monster.
  • Monsters carrying cream pies will throw them at the hero.
  • Like the hero, monsters can wield the corpse of a cockatrice or chickatrice to swing at the hero if they have gloves or stoning resistance, and can also throw cockatrice eggs at the hero as well.
  • Monsters that have hands and are carrying certain wands may zap them offensively at the hero.
  • Monsters that have potions with detrimental effects can use them offensively by throwing them at the hero.
  • Monsters using ranged attacks against the hero will not account for any monsters in the attack path.
  • If the hero is invisible or has displacement, the monster will attempt to move towards and/or attack the square where they believe the hero to be. Once they find the hero, they will not miss attacks this way until the hero moves again.
  • A hostile monster that is scared and not under the effects of conflict will attempt to avoid attacking the hero in melee while fleeing - they will still use any ranged attacks they have at their disposal.

Combat between monsters

Monsters attack each other under the following circumstances:

  • Pets will target other non-tame monsters that are in range of their attacks, whether or not those monsters are hostile to the hero.
  • Monsters that are not pets will not actively attack each other, unless they are under the effects of conflict or specific conditions are fulfilled:
  • A monster attacked by another monster under any circumstance has a chance of retaliating against them.

Strategy

It is important to note that you don't have to attack every monster you encounter. Some are best left alone or actively avoided. As the proverb states, discretion is the better part of valor.