Change summary:

Creates a new artifact weapon, the Tooth of Shai-hulud, which confers blindness, warning, and an enhanced form of clairvoyance when weilded. This weapon is an intelligent permanently fixed restricted chaotic artifact crysknife.

The intent is to recall Frank Herbert's Dune series by giving the player abilities similar to those Paul Atreides had: clairvoyance and prescience. (He was also blinded later in the series, but could still see thanks to his clairvoyance.) This crysknife is supposed to be the same one that Paul owned and later gave to his son Leto II, who kept the blade for thousands of years.

If this artifact were listed in Kevin Hugo/Dylan O'Donnell's art1-341.txt, its listing would be something like this:

~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~ ~~~~~ ~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~
T Shai-hulud crysknife 3000 bo w C ! +d2 +d4 warn, sclair, blind

Its attack power is roughly equivalent to Vorpal Blade, if my calculations aren't too far off. The properties it confers when wielded are warning, "super-clairvoyance," and blindness (overcomable only by the Eyes of the Overworld, unless I'm mistaken.) The Tooth of Shai-hulud does not confer telepathy, but they mix nicely with one another...

Besides creating the artifact, this patch also tweaks the behavior of clairvoyance and detect unseen in order to create a more consistent effect. Basically, clairvoyance conferred by this weapon happens about 4x more frequently than regular clairvoyance. Also, whenever this type of clairvoyance activates, detect unseen is cast. I modified detect unseen (in general) to draw revealed traps even when the player is blind, since this makes its behavior more consistent. Before, secret doors and corridors would be revealed and drawn on the map while blind, but traps would only be discovered, and not drawn until the player could actually see those spaces.

Another technical alteration I made was to move the clairvoyance phase of the player's turn into the "once-per-movement" section of allmain.c rather than the "once-per-player-input" section. This prevents clairvoyance from ever happening while the player is doing things that don't increase the turn counter, like bumping up against a wall over and over again. In vanilla Nethack, this problem is only avoided by making sure clairvoyance can only happen on certain turns (specifically, those turns that are divisible by 15). But moving clairvoyance into the once-per-movement phase opens up more possibilities for defining the frequency of the effect.