Computed from both games' code, NetHack 3.6.7's melee roll keeps the rate of Rogue 5.4's swing: each point of the attacker's level or the target's armor class adds 5% to the chance to hit, which is (level + armor class + bonuses) / 20 in Rogue and (level + armor class + Luck + bonuses) / 20 in NetHack. | fight.c L378–384main.c L186–189 | Code |
Rogue 5.4 starts the hero with 1,300 food. The stomach daemon runs once per pass of the command loop, after the hero's move, or after both moves when the hero is hasted. While food is above 0 it takes 1, plus each worn ring's cost, and 1 less while the hero carries the Amulet of Yendor, so with the Amulet and no rings the count stops. | init.c L29rogue.h L117main.c L150command.c L32–39command.c L444daemons.c L160–163pack.c L147–148 | Code |
| In Rogue 5.4 each worn ring adds to the turn's food cost by kind: 2 for regeneration; 1 for protection, add strength, sustain strength, stealth, or maintain armor; 1 at a chance of 1 in 3 for searching, dexterity, or increase damage, and 1 in 5 for see invisible; 0 for adornment, aggravate monster, or teleportation. A ring of slow digestion gives 1 back at a chance of 1 in 2. | rings.c L163–179 | Code |
| Rogue 5.4 shows Hungry once food drops below 300 and Weak below 150. At 0 or below, rings stop counting and food drops by 1 a turn; on each turn the hero isn't already helpless, a 1-in-5 chance faints the hero for 4 to 11 turns, and the hero starves once the count is below −850. | rogue.h L118–120daemons.c L144–159daemons.c L165–179io.c L182–185main.c L186–189 | Code |
Eating any food in Rogue 5.4 first raises a negative count to 0, then adds 1,100 to 1,499 (HUNGERTIME - 200 + rnd(400)), capped at 2,000. | misc.c L296–300rogue.h L119 | Code |
In Rogue 5.4 an attack hits when rnd(20), a roll of 0 to 19, plus a to-hit bonus is at least 20 less the attacker's level less the defender's armor class. The bonus is the weapon's plus (with a fired missile's launcher plus, and the hero's dexterity rings when the weapon used is the hero's wielded one), the attacker's strength adjustment, and +4 when the target isn't running (asleep or held); a hero defender's armor class is the worn armor's, when the hero wears any, less any rings of protection. Computed, the chance is (level + armor class + bonus) / 20, held within 0 to 100%. Damage is rolled only after a hit. | fight.c L378–384fight.c L411–433fight.c L438–453fight.c L460–470main.c L186–189 | Code |
Computed from swing, a level-1 Rogue 5.4 hero at strength 16 with a +1 weapon hits a monster of armor class 7 45% of the time while it is running, and 65% while it is asleep or held. | fight.c L378–384fight.c L46–49fight.c L442–443 | Code |
| Rogue 5.4 lays out each level as nine boxes in a 3 by 3 grid over the 80 by 24 screen. It first marks 0 to 3 boxes, picked at random and possibly the same twice, as gone: a gone box gets a point for corridors to meet but no room. Each other box gets a room; it is dark when a roll of 0 to 9 is below the depth less 1, and a dark room is a maze at a chance of 1 in 15. | rogue.h L22rogue.h L30–31rooms.c L41–42rooms.c L55–57rooms.c L61–82rooms.c L86–91passages.c L169–183 | Code |
| Rogue 5.4 joins the boxes with corridors only between grid neighbors: from a random box it grows a tree, each step joining a random neighbor not yet joined, until all nine are connected, and then makes 0 to 4 tries at an extra corridor between a random box and a neighbor it isn't joined to. | passages.c L33–43passages.c L55–95passages.c L97–115 | Code |
Restoring a Rogue 5.4 game deletes the save file as soon as it is read, refuses a file with another hard link or reached through a symbolic link, “to defeat multiple restarting from the same place”, and refuses a saved hero with no hit points left. It then reseeds the random number generator from the process id. A wizard in a debug (MASTER) build skips the deletion and the link check. | save.c L222–229save.c L237–248save.c L250–255save.c L262 | Code |
| At the start of each game, Rogue 5.4 gives each of its 14 kinds of potion a different color, drawn at random from a list of 27 (amber to yellow), and each of its 18 kinds of scroll a title of 2 to 4 random words, each word 1 to 3 syllables from a fixed list, up to about 40 characters. | main.c L118–119init.c L81–111init.c L240–253init.c L260–289rogue.h L219rogue.h L242 | Code |
When a Rogue 5.4 hero dies, death shows the tombstone (or, with the tombstone option off, one line naming the killer), records the score, waits for return, and exits the program. | rip.c L228rip.c L240–246rip.c L270–274main.c L391–395 | Code |