Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Files
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ medusa-3.lua medusa-4.lua minefill.lua minend-1.lua minend-2.lua
minend-3.lua minetn-1.lua minetn-2.lua minetn-3.lua minetn-4.lua
minetn-5.lua minetn-6.lua minetn-7.lua nhcore.lua nhlib.lua
opthelp optmenu oracle.lua oracles.txt orcus.lua
quest.lua rumors.fal rumors.tru sanctum.lua soko1-1.lua
quest.lua rumors_f.txt rumors_t.txt sanctum.lua soko1-1.lua
soko1-2.lua soko2-1.lua soko2-2.lua soko3-1.lua soko3-2.lua
soko4-1.lua soko4-2.lua symbols themerms.lua tower1.lua
tower2.lua tower3.lua tribute tut-1.lua tut-2.lua
Expand Down Expand Up @@ -670,7 +670,8 @@ regenerated from the files in the distribution.

dat:
(files generated by makedefs at playground creation time)
data options oracles rumors
data options oracles rumors_t rumors_t.idx rumors_f rumors_f.idx
epitaphs epitaphs.idx engrave engrave.idx bogusmon bogusmon.idx

(files generated for Qt interface on macOS)
Info.plist nethack.icns
Expand Down
8 changes: 7 additions & 1 deletion dat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ rip.xpm
pet_mark.xbm
pilemark.xbm
quest.dat
rumors
rumors_t
rumors_t.idx
rumors_f
rumors_f.idx
bogusmon
bogusmon.idx
engrave
engrave.idx
epitaph
epitaph.idx
x11tiles
nhtiles.bmp
*.lev
Expand Down
3 changes: 1 addition & 2 deletions dat/epitaph.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ I died laughing
I disbelieved in reincarnation in my last life, too.
I hacked myself to death
I have all the time in the world
#"reached Mine's End": not necessarily true; sounds like "reached my end"
I have reached Mine's End
I have reached Mine's End ## not necessarily true; sounds like "reached my end"
I knew I'd find a use for this gravestone!
I know my mind. And it's around here someplace.
I lied! I'll never be alright!
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,7 @@ extern int genl_player_setup(int);
/* ### rumors.c ### */

extern char *getrumor(int, char *, boolean) NONNULLARG2;
extern char *get_rnd_text(const char *, char *, int(*)(int),
unsigned) NONNULLPTRS;
extern char *get_rnd_text(const char *, char *, int(*)(int)) NONNULLPTRS;
extern void outrumor(int, int);
extern void outoracle(boolean, boolean);
extern void save_oracles(NHFILE *) NONNULLARG1;
Expand Down
11 changes: 2 additions & 9 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#define SHELP "hh" /* abbreviated form of the same */
#define KEYHELP "keyhelp" /* explanatory text for 'whatdoes' command */
#define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
#define RUMORFILE "rumors" /* file with fortune cookies */
#define RUMORSTFILE "rumors_t" /* file with true fortune cookies */
#define RUMORSFFILE "rumors_f" /* file with false fortune cookies */
#define ORACLEFILE "oracles" /* file with oracular information */
#define DATAFILE "data" /* file giving the meaning of symbols used */
#define CMDHELPFILE "cmdhelp" /* file telling what commands do */
Expand All @@ -33,14 +34,6 @@
#define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */
#define LEV_EXT ".lua" /* extension for special level files */

/* padding amounts for files that have lines chosen by fseek to random spot,
advancing to the next line, and using that line; makedefs forces shorter
lines to be padded to these lengths; value of 0 will inhibit any padding,
avoiding an increase in files' sizes, but resulting in biased selection;
used by makedefs while building and by core's callers of get_rnd_text() */
#define MD_PAD_RUMORS 60u /* for RUMORFILE, EPITAPHFILE, and ENGRAVEFILE */
#define MD_PAD_BOGONS 20u /* for BOGUSMONFILE */

/* Assorted definitions that may depend on selections in config.h. */

/*
Expand Down
2 changes: 1 addition & 1 deletion src/do_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ bogusmon(char *buf, char *code)
if (code)
*code = '\0';
/* might fail (return empty buf[]) if the file isn't available */
get_rnd_text(BOGUSMONFILE, buf, rn2_on_display_rng, MD_PAD_BOGONS);
get_rnd_text(BOGUSMONFILE, buf, rn2_on_display_rng);
if (!*mnam) {
Strcpy(buf, "bogon");
} else if (strchr(bogon_codes, *mnam)) { /* strip prefix if present */
Expand Down
4 changes: 2 additions & 2 deletions src/engrave.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ random_engraving(char *outbuf, char *pristine_copy)
/* a random engraving may come from the "rumors" file,
or from the "engrave" file (formerly in an array here) */
if (!rn2(4) || !(rumor = getrumor(0, pristine_copy, TRUE)) || !*rumor)
(void) get_rnd_text(ENGRAVEFILE, pristine_copy, rn2, MD_PAD_RUMORS);
(void) get_rnd_text(ENGRAVEFILE, pristine_copy, rn2);

Strcpy(outbuf, pristine_copy);
wipeout_text(outbuf, (int) (strlen(outbuf) / 4), 0);
Expand Down Expand Up @@ -1696,7 +1696,7 @@ make_grave(coordxy x, coordxy y, const char *str)
/* Engrave the headstone */
del_engr_at(x, y);
if (!str)
str = get_rnd_text(EPITAPHFILE, buf, rn2, MD_PAD_RUMORS);
str = get_rnd_text(EPITAPHFILE, buf, rn2);
make_engr_at(x, y, str, NULL, 0L, HEADSTONE);
return;
}
Expand Down
Loading