Difference between revisions of "Warned of monster type"

From NetHackWiki
Jump to navigation Jump to search
(Warned of orcs (Sting) or warned of undead (S Necromancer/Undead Slayer); lengthy description of WARN_OF_MON in source code.)
 
m (Link to NetHack 3.7.0 specifically.)
 
(15 intermediate revisions by 9 users not shown)
Line 1: Line 1:
If you wield the [[artifact weapon]] named [[Sting]], then you are '''warned of orcs'''. You can detect the locations and types of all orcs on the current [[dungeon level]], as if you could see them. This applies to any monster of orcish race, including any '[[o]]' monsters and also [[orc mummy]] and [[orc zombie]].
+
'''Warning of monsters''' is a [[property]] that allows the player to sense certain monsters. When you are warned of a monster, you can detect the locations and types of all types of that monster on the current [[dungeon level]], as if you could see them. This property can be granted by certain artifacts or by [[polymorph]]ing into certain monsters.
  
In [[SLASH'EM]], certain roles are '''warned of undead'''. This is an innate property of an [[Undead Slayer]] from [[experience level]] 1, or a [[Necromancer]] from level 3. It detects the locations of all undead monsters on the current level.
+
The monsters you will be warned against can be any type that can be represented by one of the M2_* monster flags. In practice, these are:
 +
* Wielding [[Sting]] and [[Orcrist]] provides '''warning of orcs''', meaning all monsters of {{white|o}} class and any other orcish monster (zombies, mummies).
 +
* Wielding [[Grimtooth]] provides '''warning of elves''', meaning all elven monsters, elven zombies, and elven mummies.
 +
* Polymorphing into a [[vampire]] or [[vampire lord]] provides '''warning of humans and elves''', meaning all monsters of {{monclass|@}} class, and human zombies and mummies.
 +
* Polymorphing into a [[purple worm]] provides '''warning of shriekers'''.
 +
 
 +
{{upcoming|NetHack 3.7.0|Baby purple worms now also sense shriekers.}}
  
 
== Messages ==
 
== Messages ==
 
These messages can appear during [[enlightenment]]:
 
These messages can appear during [[enlightenment]]:
* "You are aware of the presence of orcs."
+
* "You are aware of the presence of [orcs/elves/humans and elves/shriekers]."
* "You are aware of the presence of undead." (SLASH'EM)
 
  
There is no way to be '''warned of demons''', but the source code in [[vanilla]] NetHack would say, "You are aware of the presence of demons."<ref>{{sourcecode|cmd.c|931}}</ref> For warnings of other monster types, "You are aware of the presence of something".
+
There is no way to be '''warned of demons''', but if there were, the message "You are aware of the presence of demons" would appear.{{refsrc|src/cmd.c|2224|version=NetHack 3.6.1}} If you somehow became warned of some other monster type, the message would be "You are aware of the presence of something."
  
 
== Strategy ==
 
== Strategy ==
Orcs are a small fraction of the monsters you encounter, and typically not much of a threat, so the warning of orcs has little value.
+
Orcs are a small fraction of the monsters you encounter, and typically not much of a threat, so the warning of orcs has little value. It might be useful if you are trying to avoid [[Uruk-hai]]'s poison arrows.
  
In SLASH'EM, a Necromancer begins the game with a pet [[ghoul]]. This ghoul is slow, so you might abandon it. If you are trying to keep your ghoul, the task becomes easier if you reach experience level 3 and become warned of undead, so that you may always track the location of your ghoul. When it is time for your ghoul to follow you through [[staircase]], then you might use your [[pick-axe]] to dig a shortcut from the ghoul's location to the staircase.
+
Warning of elves is similarly only situationally useful.
 +
 
 +
Warning of humans may be more useful because humans make up a larger fraction of monsters.
  
 
== Source code ==
 
== Source code ==
To enable detection of a monster type, the [[hero]] must have the <tt>WARNED_OF_MON</tt> [[property]] (as an [[intrinsic]] or [[extrinsic]])<ref>{{sourcecode|youprop.h|152}}</ref>, and <tt>flags.warntypes</tt> must contain the M2 flag for that monster type.<ref>{{sourcecode|hack.h|103}}</ref>
+
To enable detection of a monster type, the [[hero]] must have the <tt>WARNED_OF_MON</tt> [[property]] (as an [[intrinsic]] or [[extrinsic]]),{{refsrc|youprop.h|152}} and <tt>flags.warntypes</tt> must contain the M2 flag for that monster type.{{refsrc|hack.h|103}}
  
If an [[artifact]] provides SPFX_WARN (either when carried or when worn), and that artifact has any M2 flags, then the artifact will provide warning of those M2 types.<ref>{{sourcecode|artifact.c|442}}</ref> An SPFX_WARN artifact without M2 flags will instead provide [[warning]] like a [[ring of warning]]. Sting is a SPFX_WARN artifact with the M2_ORC flag.
+
If an [[artifact]] provides SPFX_WARN (either when carried or when worn), and that artifact has any M2 flags, then the artifact will provide warning of those M2 types.{{refsrc|artifact.c|442}} For example, Sting is a SPFX_WARN artifact with the M2_ORC flag. An artifact with SPFX_WARN but no M2 flags will instead provide [[warning]] like a [[ring of warning]].
  
=== Caveat for carried artifacts that warn of monster type ===
+
=== Carried artifacts that warn of a monster type ===
Multiple artifacts that provide SPFX_WARN when carried, and have M2 flags, might not interact correctly. This is not currently a problem, because the only such artifacts are [[the Master Key of Thievery]] or [[the Orb of Fate]], and both have no M2 flags.
+
Multiple artifacts that provide SPFX_WARN when carried, and have M2 flags, would not interact correctly. This is not currently a problem, because the only such artifacts are [[the Master Key of Thievery]] or [[the Orb of Fate]], and both have no M2 flags.
  
 
Suppose that there is a new artifact [[pick-axe]] named ''Dwarfwatcher'' that provides SPFX_WARN of M2_DWARF when carried, but [[artifact.c]] is unchanged. Then the following sequence of events might happen:
 
Suppose that there is a new artifact [[pick-axe]] named ''Dwarfwatcher'' that provides SPFX_WARN of M2_DWARF when carried, but [[artifact.c]] is unchanged. Then the following sequence of events might happen:
  
# The hero picks up the Master Key of Thievery, and receives [[warning]].
+
# The hero picks up the Master Key of Thievery and receives [[warning]].
 
# The hero picks up Dwarfwatcher, and becomes warned about dwarves.
 
# The hero picks up Dwarfwatcher, and becomes warned about dwarves.
# The hero drops Dwarfwatcher. NetHack notices that there is another SPFX_WARN artifact in the W_ART (carried artifact) slot, and declines to disable SPFX_WARN.<ref>{{sourcecode|artifact.c|400}}</ref>
+
# The hero drops Dwarfwatcher. ''NetHack'' notices that there is another SPFX_WARN artifact in the W_ART (carried artifact) slot, and declines to disable SPFX_WARN.{{refsrc|artifact.c|400}}
# The hero remains warned about dwarves, despite dropping Dwarfwatcher. (I have not tested this, because Dwarfwatcher does not exist.)
+
# The hero remains warned about dwarves, despite dropping Dwarfwatcher.
  
 
Sting does not cause a problem, because Sting uses a different slot (W_WEP) than carried artifacts.
 
Sting does not cause a problem, because Sting uses a different slot (W_WEP) than carried artifacts.
  
=== Caveat for two artifacts that warn of same type ===
+
=== Multiple artifacts that warn of the same type ===
Two artifacts that simultaneously provide SPFX_WARN, of the same M2 flag, might not interact correctly. This is not currently a problem, because Sting is the only such artifact in the game.
+
Two artifacts that simultaneously provide SPFX_WARN, of the same M2 flag, would not interact correctly. This is not currently a problem, because Sting is the only such artifact in the game.
 +
 
 +
Suppose that there is a new artifact [[amulet]] named ''Orcfinder'' that provides SPFX_WARN of M2_ORC when worn, but [[artifact.c]] is unchanged. Then the following sequence of events might happen:
 +
 
 +
# The hero puts on Orcfinder and becomes warned of orcs.
 +
# The hero wields Sting and remains warned of orcs.
 +
# The hero removes Orcfinder. ''NetHack'' decides to disable SPFX_WARN on the W_AMUL (worn amulet) slot.
 +
# The hero loses the WARN_OF_MON property in the W_AMUL slot. The hero retains the WARN_OF_MON property in the W_WEP slot.{{refsrc|artifact.c|448}}
 +
# The hero loses the M2_ORC flag from <tt>flags.warntype</tt>.{{refsrc|artifact.c|449}}
 +
# The hero becomes not warned of orcs, despite wielding Sting.
  
Suppose that there is a new artifact [[amulet]] named ''Orcfinder'' that provides SPFX_WARN of M2_ORC when worn, but [[artifact.c]] is unchanged. (Orcfinder seems a bad idea, with Sting already in the game.) Then the following sequence of events might happen:
+
== SLASH'EM ==
 +
In [[SLASH'EM]], certain roles are '''warned of undead'''. This is an innate property of an [[Undead Slayer]] from [[experience level]] 1, or a [[Necromancer]] from level 3. It detects the locations of all [[undead]] monsters on the current level.
  
# The hero puts on Orcfinder, and becomes warned of orcs.
+
A Necromancer begins the game with a pet [[ghoul]], which is slow and can be difficult to bring along. Keeping it becomes easier if you reach experience level 3 and become warned of undead, so that you may always track the location of your ghoul. When it is time for your ghoul to follow you through [[staircase]], then you might use your [[pick-axe]] to dig a shortcut from the ghoul's location to the staircase.
# The hero wields Sting, and remains warned of orcs.
 
# The hero removes Orcfinder. NetHack decides to disable SPFX_WARN on the W_AMUL (worn amulet) slot.
 
# The hero loses the WARN_OF_MON property in the W_AMUL slot. The hero retains the WARN_OF_MON property in the W_WEP slot.<ref>{{sourcecode|artifact.c|448}}</ref>
 
# The hero loses the M2_ORC flag from <tt>flags.warntype</tt>.<ref>{{sourcecode|artifact.c|449}}</ref>
 
# The hero becomes not warned of orcs, despite wielding Sting. (I have not tested this, because Orcfinder does not exist.)
 
  
 
=== WARN_UNDEAD ===
 
=== WARN_UNDEAD ===
WARN_UNDEAD is a separate property from WARN_OF_MON, so that [[SLASH'EM]] may include warning of undead in the list of innate properties. When the player changes experience level and gains (or loses) WARN_UNDEAD, then the game also sets (or clears) intrinsic WARN_OF_MON and adds (or removes) M2_UNDEAD to the warned monster types.<ref>{{sourcecode|SLASH'EM 0.0.7E7F2/attrib.c|716}}</ref>
+
Vanilla ''NetHack'' defines a WARN_UNDEAD property separate from WARN_OF_MON and allocates space for its <tt>struct prop</tt> structure.{{refsrc|prop.h|63}} However, vanilla does not implement warning of undead. In SLASH'EM, when the player changes experience level and gains (or loses) WARN_UNDEAD, then the game also sets (or clears) intrinsic WARN_OF_MON and adds (or removes) M2_UNDEAD to the warned monster types.{{refsrc|attrib.c|716|version=SLASH'EM 0.0.7E7F2}}
  
[[Vanilla]] NetHack also defines a WARN_UNDEAD property and allocates space for its <tt>struct prop</tt> structure.<ref>{{sourcecode|prop.h|63}}</ref> However, vanilla does not implement warning of undead.
+
==References==
 +
<references/>
  
=== Source code references ===
+
[[Category:Properties]]
<references/>
+
{{nethack-360}}

Latest revision as of 03:07, 16 February 2021

Warning of monsters is a property that allows the player to sense certain monsters. When you are warned of a monster, you can detect the locations and types of all types of that monster on the current dungeon level, as if you could see them. This property can be granted by certain artifacts or by polymorphing into certain monsters.

The monsters you will be warned against can be any type that can be represented by one of the M2_* monster flags. In practice, these are:

  • Wielding Sting and Orcrist provides warning of orcs, meaning all monsters of o class and any other orcish monster (zombies, mummies).
  • Wielding Grimtooth provides warning of elves, meaning all elven monsters, elven zombies, and elven mummies.
  • Polymorphing into a vampire or vampire lord provides warning of humans and elves, meaning all monsters of ​@ human or elf class, and human zombies and mummies.
  • Polymorphing into a purple worm provides warning of shriekers.

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.

Baby purple worms now also sense shriekers.

Messages

These messages can appear during enlightenment:

  • "You are aware of the presence of [orcs/elves/humans and elves/shriekers]."

There is no way to be warned of demons, but if there were, the message "You are aware of the presence of demons" would appear.[1] If you somehow became warned of some other monster type, the message would be "You are aware of the presence of something."

Strategy

Orcs are a small fraction of the monsters you encounter, and typically not much of a threat, so the warning of orcs has little value. It might be useful if you are trying to avoid Uruk-hai's poison arrows.

Warning of elves is similarly only situationally useful.

Warning of humans may be more useful because humans make up a larger fraction of monsters.

Source code

To enable detection of a monster type, the hero must have the WARNED_OF_MON property (as an intrinsic or extrinsic),[2] and flags.warntypes must contain the M2 flag for that monster type.[3]

If an artifact provides SPFX_WARN (either when carried or when worn), and that artifact has any M2 flags, then the artifact will provide warning of those M2 types.[4] For example, Sting is a SPFX_WARN artifact with the M2_ORC flag. An artifact with SPFX_WARN but no M2 flags will instead provide warning like a ring of warning.

Carried artifacts that warn of a monster type

Multiple artifacts that provide SPFX_WARN when carried, and have M2 flags, would not interact correctly. This is not currently a problem, because the only such artifacts are the Master Key of Thievery or the Orb of Fate, and both have no M2 flags.

Suppose that there is a new artifact pick-axe named Dwarfwatcher that provides SPFX_WARN of M2_DWARF when carried, but artifact.c is unchanged. Then the following sequence of events might happen:

  1. The hero picks up the Master Key of Thievery and receives warning.
  2. The hero picks up Dwarfwatcher, and becomes warned about dwarves.
  3. The hero drops Dwarfwatcher. NetHack notices that there is another SPFX_WARN artifact in the W_ART (carried artifact) slot, and declines to disable SPFX_WARN.[5]
  4. The hero remains warned about dwarves, despite dropping Dwarfwatcher.

Sting does not cause a problem, because Sting uses a different slot (W_WEP) than carried artifacts.

Multiple artifacts that warn of the same type

Two artifacts that simultaneously provide SPFX_WARN, of the same M2 flag, would not interact correctly. This is not currently a problem, because Sting is the only such artifact in the game.

Suppose that there is a new artifact amulet named Orcfinder that provides SPFX_WARN of M2_ORC when worn, but artifact.c is unchanged. Then the following sequence of events might happen:

  1. The hero puts on Orcfinder and becomes warned of orcs.
  2. The hero wields Sting and remains warned of orcs.
  3. The hero removes Orcfinder. NetHack decides to disable SPFX_WARN on the W_AMUL (worn amulet) slot.
  4. The hero loses the WARN_OF_MON property in the W_AMUL slot. The hero retains the WARN_OF_MON property in the W_WEP slot.[6]
  5. The hero loses the M2_ORC flag from flags.warntype.[7]
  6. The hero becomes not warned of orcs, despite wielding Sting.

SLASH'EM

In SLASH'EM, certain roles are warned of undead. This is an innate property of an Undead Slayer from experience level 1, or a Necromancer from level 3. It detects the locations of all undead monsters on the current level.

A Necromancer begins the game with a pet ghoul, which is slow and can be difficult to bring along. Keeping it becomes easier if you reach experience level 3 and become warned of undead, so that you may always track the location of your ghoul. When it is time for your ghoul to follow you through staircase, then you might use your pick-axe to dig a shortcut from the ghoul's location to the staircase.

WARN_UNDEAD

Vanilla NetHack defines a WARN_UNDEAD property separate from WARN_OF_MON and allocates space for its struct prop structure.[8] However, vanilla does not implement warning of undead. In SLASH'EM, when the player changes experience level and gains (or loses) WARN_UNDEAD, then the game also sets (or clears) intrinsic WARN_OF_MON and adds (or removes) M2_UNDEAD to the warned monster types.[9]

References

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

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

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