Talk:Scroll of light

From NetHackWiki
Revision as of 08:25, 4 July 2016 by Nethacker (talk | contribs) (Created page with "== Scroll behaviour in 3.6.0 == The source is: if (!confused || rn2(5)) { // generate light or dark field // darkness is generated if the scroll is curse...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Scroll behaviour in 3.6.0

The source is:

   if (!confused || rn2(5)) {
       // generate light or dark field
       // darkness is generated if the scroll is cursed or the player is confused  
   } else {
       // generate yellow or black light
   }

If the player is confused, !confused is always false, rn2(5) has 20% chance to be true, therefore there is 80% chance to generate a monster. If the player is not confused, !confused is always true, so the scroll never generates a monster.

--Nethacker (talk) 08:25, 4 July 2016 (UTC)