Difference between revisions of "Yeenoghu"

From NetHackWiki
Jump to navigation Jump to search
m (Text replace - "([.,]{{refsrc\|[^{}]*}})([A-Za-z])" to "$1 $2")
m (minor improvements)
Line 20: Line 20:
 
  |reference=[[monst.c#line2674]]
 
  |reference=[[monst.c#line2674]]
 
}}
 
}}
'''Yeenoghu''', {{monsym|yeenoghu}}, is a [[monster]] in [[NetHack]], specifically, one of the [[demon lord]]s. He can deal out tremendous physical damage if you lack [[Ring of free action|free action]] and [[MC3]], and he can zap you with magic missiles, like [[Angel|angels]] do, but is not generally regarded a problem if [[you]] are prepared for him. He [[Monster_starting_inventory|is generated with]] a [[flail]]. Yeenoghu respects [[Elbereth]].
+
'''Yeenoghu''', {{monsym|yeenoghu}}, is a [[monster]] in [[NetHack]], specifically, one of the [[demon lord]]s. He can deal out tremendous physical damage if you lack [[free action]] and [[MC3]], and he can zap you with magic missiles, like [[Angel]]s do, but is not generally regarded a problem if [[you]] are prepared for him. He [[monster starting inventory|is generated with]] a [[flail]]. Yeenoghu respects [[Elbereth]].
  
 
Yeenoghu, together with [[Juiblex]], is one of the two demon lords that can be summoned with chaotic own-race sacrifice. He will be peaceful then.
 
Yeenoghu, together with [[Juiblex]], is one of the two demon lords that can be summoned with chaotic own-race sacrifice. He will be peaceful then.
Line 39: Line 39:
 
Yeenoghu is the subject of one of the longest-running bugs in NetHack history. In [[NetHack 3.1.0]], the [[Riders]] were introduced. The code that handles their special attacks comes right after that which handles Yeenoghu's [[confusion]] attack.{{refsrc|mhitu.c|1474}} Early versions had this code inserted carelessly; consequently, after Yeenoghu used his confusion attack, execution would proceed into the section that handles [[Death (monster)|Death]]'s touch{{refsrc|mhitu.c|1485}}:
 
Yeenoghu is the subject of one of the longest-running bugs in NetHack history. In [[NetHack 3.1.0]], the [[Riders]] were introduced. The code that handles their special attacks comes right after that which handles Yeenoghu's [[confusion]] attack.{{refsrc|mhitu.c|1474}} Early versions had this code inserted carelessly; consequently, after Yeenoghu used his confusion attack, execution would proceed into the section that handles [[Death (monster)|Death]]'s touch{{refsrc|mhitu.c|1485}}:
  
<pre>
+
Yeenoghu reaches out with its deadly touch.--More--
Yeenoghu reaches out with its deadly touch.--More--
+
Do you want your possessions identified? [yn]
Do you want your possessions identified? [yn]
 
</pre>
 
  
 
A comment at the end of Yeenoghu's section read:
 
A comment at the end of Yeenoghu's section read:
  
<pre>
+
<syntaxhighlight lang="c">
/* fall through to next case */
+
/* fall through to next case */</syntaxhighlight>
</pre>
 
  
 
and contemporary source-divers thought from this that the behavior was deliberate. Thus for many years the bug was never reported.
 
and contemporary source-divers thought from this that the behavior was deliberate. Thus for many years the bug was never reported.
Line 59: Line 56:
 
These source excerpts might make clear the origin of the bug. Here is src/mhitu.c lines 999-1012 from [[NetHack 3.0.0]]; the [[Riders]] do not yet exist:
 
These source excerpts might make clear the origin of the bug. Here is src/mhitu.c lines 999-1012 from [[NetHack 3.0.0]]; the [[Riders]] do not yet exist:
  
<pre>
+
<syntaxhighlight lang="c">
 
#ifdef HARD /* a non-gaze AD_CONF exists only for one of the demons */
 
#ifdef HARD /* a non-gaze AD_CONF exists only for one of the demons */
 
             case AD_CONF:
 
             case AD_CONF:
Line 73: Line 70:
 
                 /* fall through to next case */
 
                 /* fall through to next case */
 
             default:    dmg = 0;
 
             default:    dmg = 0;
                         break;
+
                         break;</syntaxhighlight>
</pre>
 
  
 
Here is a partial quote of src/mhitu.c lines 1214-1258 from [[NetHack 3.1.0]], the first version to implement the [[Riders]]:
 
Here is a partial quote of src/mhitu.c lines 1214-1258 from [[NetHack 3.1.0]], the first version to implement the [[Riders]]:
  
<pre>
+
<syntaxhighlight lang="c">
 
             case AD_CONF:
 
             case AD_CONF:
 
                 hitmsg(mtmp, mattk);
 
                 hitmsg(mtmp, mattk);
Line 93: Line 89:
 
                 [... the rest of the Rider code ...]
 
                 [... the rest of the Rider code ...]
 
             default:    dmg = 0;
 
             default:    dmg = 0;
                         break;
+
                         break;</syntaxhighlight>
</pre>
 
  
 
The Rider code was carelessly placed between the AD_CONF section, which handles Yeenoghu's confusion attack, and the default section, where it was supposed to finish. Thus execution improperly proceeded into Death's touch attack.
 
The Rider code was carelessly placed between the AD_CONF section, which handles Yeenoghu's confusion attack, and the default section, where it was supposed to finish. Thus execution improperly proceeded into Death's touch attack.
Line 100: Line 95:
 
The bug was written up as bug C331-96<ref>[http://www.nethack.org/v331/bugs.html www.nethack.org NetHack 3.3.1 bugs]</ref> and was fixed in [[NetHack 3.4.0]]. Here is src/mhitu.c lines 1474-1486 from [[NetHack 3.4.3]]:
 
The bug was written up as bug C331-96<ref>[http://www.nethack.org/v331/bugs.html www.nethack.org NetHack 3.3.1 bugs]</ref> and was fixed in [[NetHack 3.4.0]]. Here is src/mhitu.c lines 1474-1486 from [[NetHack 3.4.3]]:
  
<pre>
+
<syntaxhighlight lang="c">
 
             case AD_CONF:
 
             case AD_CONF:
 
                 hitmsg(mtmp, mattk);
 
                 hitmsg(mtmp, mattk);
Line 114: Line 109:
 
             case AD_DETH:
 
             case AD_DETH:
 
                 pline("%s reaches out with its deadly touch.", Monnam(mtmp));
 
                 pline("%s reaches out with its deadly touch.", Monnam(mtmp));
                 [... the rest of the Rider code ...]
+
                 [... the rest of the Rider code ...]</syntaxhighlight>
</pre>
 
  
 
The "dmg = 0;" and "break;" lines duplicate the ones in the default section, and Yeenoghu is restored to his pre-[[NetHack 3.1.0|3.1.0]] behavior.
 
The "dmg = 0;" and "break;" lines duplicate the ones in the default section, and Yeenoghu is restored to his pre-[[NetHack 3.1.0|3.1.0]] behavior.
  
== Encyclopaedia Entry ==
+
== Encyclopedia entry ==
  
 
{{encyclopedia|
 
{{encyclopedia|

Revision as of 21:23, 26 April 2013

Yeenoghu, &, is a monster in NetHack, specifically, one of the demon lords. He can deal out tremendous physical damage if you lack free action and MC3, and he can zap you with magic missiles, like Angels do, but is not generally regarded a problem if you are prepared for him. He is generated with a flail. Yeenoghu respects Elbereth.

Yeenoghu, together with Juiblex, is one of the two demon lords that can be summoned with chaotic own-race sacrifice. He will be peaceful then.

Combat

Yeenoghu will teleport next to you to attack you and fire magic missiles and then teleport away. He escapes upstairs to regenerate when his hitpoints are low, so an effective strategy would be to camp on the up stairs when he teleports himself off of them. He does respect Elbereth, but be sure you can deal with confusion or have it written already, since you are unlikely to write it correctly while confused.

Do not even try to charm Yeenoghu: His high level and magic resistance means you would waste more turns than in melee fight. Also, he is covetous, so he would only become peaceful.

History

Yeenoghu first appears in NetHack 3.0.0.

"A ludicrous bug"

Yeenoghu is the subject of one of the longest-running bugs in NetHack history. In NetHack 3.1.0, the Riders were introduced. The code that handles their special attacks comes right after that which handles Yeenoghu's confusion attack.[1] Early versions had this code inserted carelessly; consequently, after Yeenoghu used his confusion attack, execution would proceed into the section that handles Death's touch[2]:

Yeenoghu reaches out with its deadly touch.--More--
Do you want your possessions identified? [yn]

A comment at the end of Yeenoghu's section read:

/* fall through to next case */

and contemporary source-divers thought from this that the behavior was deliberate. Thus for many years the bug was never reported.

Pat Rankin of the DevTeam was made aware of this property in a rec.games.roguelike.nethack discussion, and called it "a ludicrous bug". [3] The then-current version was NetHack 3.3.1. In NetHack 3.4.0, Yeenoghu's illicit deadly touch was taken away.

Umber hulks were not affected, because their confusion attack is handled in a different part of the code.[4]

These source excerpts might make clear the origin of the bug. Here is src/mhitu.c lines 999-1012 from NetHack 3.0.0; the Riders do not yet exist:

#ifdef HARD /* a non-gaze AD_CONF exists only for one of the demons */
            case AD_CONF:
                hitmsg(mtmp,mattk->aatyp);
                if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
                    mtmp->mspec_used += (dmg + rn2(6));
                    if(Confusion)
                         You("are getting even more confused.");
                    else You("are getting confused.");
                    make_confused(HConfusion + dmg, FALSE);
                }
#endif
                /* fall through to next case */
            default:    dmg = 0;
                        break;

Here is a partial quote of src/mhitu.c lines 1214-1258 from NetHack 3.1.0, the first version to implement the Riders:

            case AD_CONF:
                hitmsg(mtmp, mattk);
                if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
                    mtmp->mspec_used = mtmp->mspec_used + (dmg + rn2(6));
                    if(Confusion)
                         You("are getting even more confused.");
                    else You("are getting confused.");
                    make_confused(HConfusion + dmg, FALSE);
                }
                /* fall through to next case */
            case AD_DETH:
                pline("%s reaches out with its deadly touch.", Monnam(mtmp));
                [... the rest of the Rider code ...]
            default:    dmg = 0;
                        break;

The Rider code was carelessly placed between the AD_CONF section, which handles Yeenoghu's confusion attack, and the default section, where it was supposed to finish. Thus execution improperly proceeded into Death's touch attack.

The bug was written up as bug C331-96[5] and was fixed in NetHack 3.4.0. Here is src/mhitu.c lines 1474-1486 from NetHack 3.4.3:

            case AD_CONF:
                hitmsg(mtmp, mattk);
                if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
                    mtmp->mspec_used = mtmp->mspec_used + (dmg + rn2(6));
                    if(Confusion)
                         You("are getting even more confused.");
                    else You("are getting confused.");
                    make_confused(HConfusion + dmg, FALSE);
                }
                dmg = 0;
                break;
            case AD_DETH:
                pline("%s reaches out with its deadly touch.", Monnam(mtmp));
                [... the rest of the Rider code ...]

The "dmg = 0;" and "break;" lines duplicate the ones in the default section, and Yeenoghu is restored to his pre-3.1.0 behavior.

Encyclopedia entry

Yeenoghu, the demon lord of gnolls, still exists although
all his followers have been wiped off the face of the earth.
He casts magic projectiles at those close to him, and a mere
gaze into his piercing eyes may hopelessly confuse the
battle-weary adventurer.

References