data/claims/rogue.yamlRogue 5.4.4 (source release)
Game: Rogue.
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. rogue/hunger-clock
About: Rogue Hunger clock
Value: 1300 food at the start
CodeRogue 5.4.4 source code ·init.c#L29food_left = HUNGERTIME;Rogue 5.4.4 source code · rogue.h#L117#define HUNGERTIME 1300Rogue 5.4.4 source code · main.c#L150start_daemon(stomach, 0, AFTER);Rogue 5.4.4 source code · command.c#L32-L39if (on(player, ISHASTE))Rogue 5.4.4 source code · command.c#L444do_daemons(AFTER);Rogue 5.4.4 source code · daemons.c#L160-L163food_left -= ring_eat(LEFT) + ring_eat(RIGHT) + 1 - amulet;Rogue 5.4.4 source code · pack.c#L147-L148amulet = TRUE;Checked by claude, 2026-10-21 — read init_player, the HUNGERTIME define, the daemon start in main, command()'s haste count and the do_daemons(AFTER) after its move loop, stomach() L139-L186, and the amulet flag set on pickup (cleared on drop at things.c L167)Cited by: Hunger clock, NetHack, Rogue
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. rogue/ring-hunger
About: Rogue Hunger clock
CodeRogue 5.4.4 source code ·rings.c#L163-L179-2, /* R_DIGEST */Checked by claude, 2026-10-21 — read ring_eat: positive entries are a fixed cost, a negative entry -n costs 1 when rnd(n) == 0, and R_DIGEST's result is negated; R_ADDHIT is dexterity, R_NOP adornmentCited by: Rogue
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/hunger-states
About: Rogue Hunger clock
CodeRogue 5.4.4 source code ·rogue.h#L118-L120#define MORETIME 150Rogue 5.4.4 source code · daemons.c#L144-L159if (food_left-- < -STARVETIME)Rogue 5.4.4 source code · daemons.c#L165-L179else if (food_left < 2 * MORETIME && oldfood >= 2 * MORETIME)Rogue 5.4.4 source code · io.c#L182-L185"", "Hungry", "Weak", "Faint"Rogue 5.4.4 source code · main.c#L186-L189return range == 0 ? 0 : abs((int) RN) % range;Checked by claude, 2026-10-21 — read stomach(): the faint branch returns when no_command is set or rnd(5) != 0, adds rnd(8) + 4 helpless turns; rnd(n) is 0 to n - 1Cited by: Hunger clock, Rogue
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. rogue/eating
About: Rogue Hunger clock
CodeRogue 5.4.4 source code ·misc.c#L296-L300if ((food_left += HUNGERTIME - 200 + rnd(400)) > STOMACHSIZE)Rogue 5.4.4 source code · rogue.h#L119#define STOMACHSIZE 2000Checked by claude, 2026-10-21 — read eat() in misc.c; rnd(400) is 0 to 399 (main.c L186-L189)Cited by: Hunger clock, NetHack
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. rogue/swing
About: Rogue Hit chance
CodeRogue 5.4.4 source code ·fight.c#L378-L384int need = (20 - at_lvl) - op_arm;Rogue 5.4.4 source code · fight.c#L411-L433hplus += cur_weapon->o_hplus;Rogue 5.4.4 source code · fight.c#L438-L453if (!on(*thdef, ISRUN))Rogue 5.4.4 source code · fight.c#L460-L470if (swing(att->s_lvl, def_arm, hplus + str_plus[att->s_str]))Rogue 5.4.4 source code · main.c#L186-L189return range == 0 ? 0 : abs((int) RN) % range;Checked by claude, 2026-10-21 — read swing and roll_em: res in 0..19 hits when res >= need - wplus, which is level + armor + bonus values out of 20Cited by: Hit chance, Rogue
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. rogue/swing-example
About: Rogue Hit chance
Value: 0.45
CodeRogue 5.4.4 source code ·fight.c#L378-L384return (res + wplus >= need);Rogue 5.4.4 source code · fight.c#L46-L49-7, -6, -5, -4, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,Rogue 5.4.4 source code · fight.c#L442-L443hplus += 4;Checked by claude, 2026-10-21 — need = 20 - 1 - 7 = 12, wplus = 1 + str_plus[16] = 1, so res of 11 to 19 hits: 9 in 20; asleep, wplus = 5 and res of 7 to 19 hits: 13 in 20Rogue 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/room-grid
About: Rogue Procedural dungeon
CodeRogue 5.4.4 source code ·rogue.h#L22#define MAXROOMS 9Rogue 5.4.4 source code · rogue.h#L30-L31#define NUMCOLS 80Rogue 5.4.4 source code · rooms.c#L41-L42bsze.x = NUMCOLS / 3;Rogue 5.4.4 source code · rooms.c#L55-L57rooms[rnd_room()].r_flags |= ISGONE;Rogue 5.4.4 source code · rooms.c#L61-L82Place a gone room.Rogue 5.4.4 source code · rooms.c#L86-L91if (rnd(10) < level - 1)Rogue 5.4.4 source code · passages.c#L169-L183if not gone pick door posChecked by claude, 2026-10-21 — read do_rooms L31-L91: left_out = rnd(4) is 0 to 3 picks of rnd_room(); a gone room's r_max is negative and the loop continues before digging; conn() runs a corridor to a gone room's r_pos instead of a doorCited by: Procedural dungeon, Rogue
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. rogue/passages
About: Rogue Procedural dungeon
CodeRogue 5.4.4 source code ·passages.c#L33-L43{ { 0, 1, 0, 1, 0, 1, 0, 1, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0 },Rogue 5.4.4 source code · passages.c#L55-L95if (r1->conn[i] && !rdes[i].ingraph && rnd(++j) == 0)Rogue 5.4.4 source code · passages.c#L97-L115for (roomcount = rnd(5); roomcount > 0; roomcount--)Checked by claude, 2026-10-21 — read do_passages: rdes[].conn marks the up to four grid neighbors of each box; the first loop runs until roomcount reaches MAXROOMSCited by: Procedural dungeon, Rogue
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. rogue/restore
About: Rogue Permadeath
CodeRogue 5.4.4 source code ·save.c#L222-L229md_unlink_open_file(file, inf) < 0)Rogue 5.4.4 source code · save.c#L237-L248defeat multiple restarting from the same placeRogue 5.4.4 source code · save.c#L250-L255if (pstats.s_hpt <= 0)Rogue 5.4.4 source code · save.c#L262srand(md_getpid());Checked by claude, 2026-10-21 — read restore() L162-L265; sbuf2 is the file's stat and syml is_symlink(file), taken before the unlinkCited by: Permadeath, Rogue
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. rogue/random-names
About: Rogue Item identification
CodeRogue 5.4.4 source code ·main.c#L118-L119init_colors(); /* Set up colors of potions */Rogue 5.4.4 source code · init.c#L81-L111#define NCOLORS (sizeof rainbow / sizeof (char *))Rogue 5.4.4 source code · init.c#L240-L253until (!used[j]);Rogue 5.4.4 source code · init.c#L260-L289nwords = rnd(3) + 2;Rogue 5.4.4 source code · rogue.h#L219#define MAXPOTIONS 14Rogue 5.4.4 source code · rogue.h#L242#define MAXSCROLLS 18Checked by claude, 2026-10-21 — counted 27 entries in rainbow[]; init_names stops adding syllables to a word once one would pass prbuf[MAXNAME], MAXNAME 40; the calls run in the new-game path after restore() is triedCited by: Item identification, Rogue
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. rogue/death
About: Rogue Permadeath
CodeRogue 5.4.4 source code ·rip.c#L228death(char monst)Rogue 5.4.4 source code · rip.c#L240-L246if (!tombstone)Rogue 5.4.4 source code · rip.c#L270-L274my_exit(0);Rogue 5.4.4 source code · main.c#L391-L395exit(st);Checked by claude, 2026-10-21 — read death() L228-L275, which has no return before my_exit(0)Cited by: Permadeath, Rogue