Attack type

From NetHackWiki
Jump to navigation Jump to search

Every attack in NetHack has a defined attack type that determines how a hero or monster performs an attack targeted at another monster and whether or not it makes contact. This is distinct from the damage type, which determines the impact of that attack such as what kind of hit point loss occurs for the defender and/or any properties that the attack can inflict.

Attack types are defined within monattk.h in the source code.

Description

A hero or monster may have up to 6 attacks with a defined attack type and damage type. Each attack type has an internal ID used in the source code, and some articles may use this symbol when describing the attack types.[1]

An attack type falls into at least one of two categories:

  • Melee, where the attacker must be next to the defender; or
  • Ranged, where the attacker may target the defender from a distance, including targets adjacent to the attacker.

Wielded items such as weapons can be used for various attacks, and various other items, properties and qualities can affect the outcomes of some attacks—one common example of the latter is the defender's worn armor and armor class, a value which can result in certain attacks dealing reduced damage or being blocked entirely, while another is the attacker's own armor, with attacks that use the head or other limbs sometimes factoring in anything worn in the relevant armor slots. Magic cancellation, resistance properties and some other items can prevent certain types of attacks from being used.

Magic cancellation and attack types

Magic cancellation (not to be confused with cancellation, which is discussed just below) has a probability of blocking the effects of certain attack and damage types, which is only possible if the attack has both an eligible attack type and an eligible damage type.

These attack types can be blocked by magic cancellation: claw attacks, bite attacks, kick attacks, headbutt attacks, touch attacks, sting attacks, tentacle attacks, holding attacks, and melee weapon attacks. In practice, all kicks, headbutts, tentacle attacks, and holding attacks that exist in NetHack use damage types that bypass magic cancellation, and so will not be blocked by it.

Cancellation and attack types

If the attacker is cancelled, then several damage types are blocked and may have no effect—cancellation is effective if either the attack type or the damage type are blocked. For example, if a dragon is cancelled, its breath attack cannot be used and will do no damage, regardless of the damage type.

These attack types can be blocked by cancellation: spitting, breath weapons, gaze attacks, and active explosion attacks.

Displacement and invisibility

A hero with displacement or invisibility has a chance of causing a monster attacking them to target an entirely different square instead, which includes potentially attacking a monster occupying that target square—both of these outcomes depend on the attack type being used. Melee attacks targeted at a hero's displaced image will always miss the hero. A hero's displacement and invisibility have no effect on gaze attacks, nor do they affect a monster currently engulfing the hero.

List of attack types

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

"Linkify the attack types, creating articles where necessary, and finish incorporating the two sections above into the table."

Below is a list of attack types and their descriptions, as well as whether or not they are affected by cancellation or magic cancellation:

List of damage types
ID Name Description Resistance(s) MC? Cancel? Contact? Example monsters
AT_NONE Passive attack Takes effect in response to melee attacks on a target, and may inflict damage or other effects upon the attacker and/or any weapon or other item that they used to hit the target. Ignores armor class. No Damage-type dependent No floating eye, yellow mold, disenchanter
AT_CLAW Claw Strikes the target directly with hands, clawed fingers, clawed feet, or rough equivalent. May check the attacker's worn gloves. Yes Damage-type dependent Yes imp, jaguar, mimic
AT_BITE Bite Attacks the target directly with teeth or tusks. Yes Damage-type dependent Yes giant ant, foocubus, mumak
AT_KICK Kick Strikes the target using a foot or several feet. May check the attacker's worn boots. Yes No Yes any unicorn or horse
AT_BUTT Head-butting attack Strikes the target with the forehead or horns. May check the attacker's worn helm. Yes No Yes unicorns, mastodon
AT_TUCH Touch attack Uses a hand or other extremity to make damaging contact with the target. May check the attacker's worn gloves, and may also use the wielded weapon for the hero. Yes Damage-type dependent Yes lichen, cockatrice, rust monster
AT_STNG Sting attack Pierces the target with a stinging organ or limb. Yes Damage-type dependent Yes killer bee, xan, jellyfish
AT_HUGS Crushing "bearhug" Grapples the target and holds them tightly against the attacker's body, preventing them from moving to another square until the attacker releases them. May check the attacker's worn cloak and gloves. Yes No Yes owlbear, rope golem, pit fiend
AT_SPIT Spitting attack Spits a substance at the target. No Yes No (ranged) cobra, black naga, Juiblex
AT_ENGL Engulfing attack Envelops and traps the target within the attacker's mass using their mouth, amorphous body or unsolid form. No No Yes fog cloud, air elemental, purple worm
AT_BREA Breath weapon Exhales a stream of elemental energy, gas or other similar substance at the target. Reflection No Yes No (ranged) adult dragons, Nazgul, iron golem
AT_EXPL Active explosion attack Explodes directly at the target to inflict damage, killing or destroying the attacker in the process. No Yes No both lights
AT_BOOM On-death explosion Behaves similar to a passive attack, and causes the target to explodes in a 3x3 square range if they are killed by HP loss. No No No only gas spore
AT_GAZE Gaze attack Inflicts damage and/or other effects on a target by using eye contact, which may require both the attacker and the target to see each other. Gaze attacks targeted at the hero ignore displacement and invisibility. Blindness No Yes No (ranged) floating eye, pyrolisk, umber hulk, Medusa
AT_TENT Tentacle attack Strikes the target with tentacles, tendrils or similar limb-like extensions. Yes No Yes only mind flayer and master mind flayer
AT_WEAP Weapon attack Strikes the target with the attacker's wielded weapon if they are in range, including pounding with a wielded polearm or lance if the target is in its range, throwing or shooting projectile weapons if the target is lined up at an appropriate distance, or attacking with their fists if the target is adjacent and the attacker is unarmed (which may use the attacker's worn gloves). This is the default attack type usable by every hero. No No Only for ungloved hands orcs, ogres, trolls
AT_MAGC Magical attack Casts a monster spell that the attacker knows at the target. Monster spells are separate from the hero's spellcasting system, and the hero cannot cast monster spells even if they are polymorphed into a spellcasting monster. No Yes No liches, titans, the Wizard of Yendor

History

Attack types are formally defined in NetHack 3.0.0. From this version to NetHack 3.4.3, including some variants based on those versions, magic cancellation has higher probabilities for blocking the effects of certain attacks types—in particular, MC3 blocks 4950 (98%) of effects from attacks that are affected by it, making MC3 an incredibly desirable and reliable property to have.

Variants

Variants of NetHack often introduce new attack types.

References