Fix an assortment of compiler warnings.

A few potential bugs were removed in the process.  Much code cleanup
remains to be done.
This commit is contained in:
John "Elwin" Edwards 2019-11-22 21:18:27 -05:00
parent de95b19cee
commit 7d459d7d36
47 changed files with 608 additions and 591 deletions

View file

@ -238,7 +238,7 @@ do_fuses(int flag)
void void
activity(void) activity(void)
{ {
sprintf(outstring,"Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %d", sprintf(outstring,"Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %ld",
demoncnt,fusecnt,total,md_memused()); demoncnt,fusecnt,total,md_memused());
msg(outstring); msg(outstring);
} }

View file

@ -174,7 +174,7 @@ new(int size)
static char errbuf[LINELEN]; static char errbuf[LINELEN];
if (space == NULL) { if (space == NULL) {
sprintf(errbuf,"Rogue ran out of memory (used = %d, wanted = %d).", sprintf(errbuf,"Rogue ran out of memory (used = %ld, wanted = %d).",
md_memused(), size); md_memused(), size);
fatal(errbuf); fatal(errbuf);
} }

View file

@ -22,7 +22,7 @@ struct cell {
}; };
struct bordercells { struct bordercells {
char num_pos; /* number of frontier cells next to you */ unsigned char num_pos; /* number of frontier cells next to you */
struct cell conn[4]; /* the y,x position of above cell */ struct cell conn[4]; /* the y,x position of above cell */
} border_cells; } border_cells;

View file

@ -607,7 +607,7 @@ void writelog(unsigned long amount, int flags, short monst) {
else else
return; return;
fprintf(logfile, "%d %d %s %d %s %d %d %d %c %s\n", time(NULL), amount, fprintf(logfile, "%ld %ld %s %d %s %d %d %d %c %s\n", time(NULL), amount,
whoami, pstats.s_lvl, class, level, max_level, quest_item, had_quest, whoami, pstats.s_lvl, class, level, max_level, quest_item, had_quest,
fate); fate);
fclose(logfile); fclose(logfile);

View file

@ -420,78 +420,78 @@ char *cnames[4][11] = {
} ; } ;
struct h_list helpstr[] = { struct h_list helpstr[] = {
'?', " prints help", { '?', " prints help" },
'/', " identify object", { '/', " identify object" },
'h', " left", { 'h', " left" },
'j', " down", { 'j', " down" },
'k', " up", { 'k', " up" },
'l', " right", { 'l', " right" },
'y', " up & left", { 'y', " up & left" },
'u', " up & right", { 'u', " up & right" },
'b', " down & left", { 'b', " down & left" },
'n', " down & right", { 'n', " down & right" },
'H', " run left", { 'H', " run left" },
'J', " run down", { 'J', " run down" },
'K', " run up", { 'K', " run up" },
'L', " run right", { 'L', " run right" },
'Y', " run up & left", { 'Y', " run up & left" },
'U', " run up & right", { 'U', " run up & right" },
'B', " run down & left", { 'B', " run down & left" },
'N', " run down & right", { 'N', " run down & right" },
't', "<dir> throw something", { 't', "<dir> throw something" },
'f', "<dir> forward until find something", { 'f', "<dir> forward until find something" },
'z', "<dir> zap a wand or staff", { 'z', "<dir> zap a wand or staff" },
'>', " go down a staircase", { '>', " go down a staircase" },
'<', " go up a staircase", { '<', " go up a staircase" },
's', " search for trap/secret door", { 's', " search for trap/secret door" },
'.', " rest for a while", { '.', " rest for a while" },
'i', " inventory", { 'i', " inventory" },
'I', " inventory single item", { 'I', " inventory single item" },
'q', " quaff potion", { 'q', " quaff potion" },
'r', " read paper", { 'r', " read paper" },
'e', " eat food", { 'e', " eat food" },
'w', " wield a weapon", { 'w', " wield a weapon" },
'W', " wear something", { 'W', " wear something" },
'T', " take off something", { 'T', " take off something" },
'd', " drop object", { 'd', " drop object" },
'P', " pick up object(s)", { 'P', " pick up object(s)" },
'c', " call object (generic)", { 'c', " call object (generic)" },
'm', " mark object (specific)", { 'm', " mark object (specific)" },
'o', " examine/set options", { 'o', " examine/set options" },
'C', " cast a spell", { 'C', " cast a spell" },
'p', " pray", { 'p', " pray" },
'a', " affect the undead", { 'a', " affect the undead" },
'^', " set a trap", { '^', " set a trap" },
'G', " sense gold", { 'G', " sense gold" },
'D', " dip something (into a pool)", { 'D', " dip something (into a pool)" },
CTRL('T'), "<dir> take (steal) from (direction)", { CTRL('T'), "<dir> take (steal) from (direction)" },
CTRL('U'), " use miscellaneous magic item", { CTRL('U'), " use miscellaneous magic item" },
CTRL('L'), " redraw screen", { CTRL('L'), " redraw screen" },
CTRL('R'), " repeat last message", { CTRL('R'), " repeat last message" },
ESCAPE, " cancel command", { ESCAPE, " cancel command" },
'v', " print program version number", { 'v', " print program version number" },
'!', " shell escape", { '!', " shell escape" },
'S', " save game", { 'S', " save game" },
'Q', " quit", { 'Q', " quit" },
0, 0 { 0, 0 }
} ; } ;
struct h_list wiz_help[] = { struct h_list wiz_help[] = {
CTRL('A'), " system activity", { CTRL('A'), " system activity" },
CTRL('C'), " move to another dungeon level", { CTRL('C'), " move to another dungeon level" },
CTRL('D'), " down 1 dungeon level", { CTRL('D'), " down 1 dungeon level" },
CTRL('E'), " food remaining", { CTRL('E'), " food remaining" },
CTRL('F'), " display entire level", { CTRL('F'), " display entire level" },
CTRL('H'), " jump 9 experience levels", { CTRL('H'), " jump 9 experience levels" },
CTRL('I'), " inventory of level", { CTRL('I'), " inventory of level" },
CTRL('J'), " teleport", { CTRL('J'), " teleport" },
CTRL('N'), " recharge staff", { CTRL('N'), " recharge staff" },
CTRL('P'), " toggle wizard status", { CTRL('P'), " toggle wizard status" },
CTRL('U'), " up 1 dungeon level", { CTRL('U'), " up 1 dungeon level" },
CTRL('X'), " detect monsters", { CTRL('X'), " detect monsters" },
CTRL('Z'), " identify", { CTRL('Z'), " identify" },
'M', " make object", { 'M', " make object" },
0, 0 { 0, 0 }
}; };

View file

@ -218,7 +218,7 @@ new(int size)
static char errbuf[LINELEN]; static char errbuf[LINELEN];
if (space == NULL) { if (space == NULL) {
sprintf(errbuf,"Rogue ran out of memory (used = %d, wanted = %d).", sprintf(errbuf,"Rogue ran out of memory (used = %ld, wanted = %d).",
md_memused(), size); md_memused(), size);
fatal(errbuf); fatal(errbuf);
} }

View file

@ -21,7 +21,7 @@ struct cell {
char x_pos; char x_pos;
}; };
struct bordercells { struct bordercells {
char num_pos; /* number of frontier cells next to you */ unsigned char num_pos; /* number of frontier cells next to you */
struct cell conn[4]; /* the y,x position of above cell */ struct cell conn[4]; /* the y,x position of above cell */
} border_cells; } border_cells;

View file

@ -327,9 +327,10 @@ picked_up:
start_daemon(eat_gold, obj, AFTER); start_daemon(eat_gold, obj, AFTER);
} }
/* For the axe start a fuse to change player to a fighter. */ /* For the axe start a fuse to change player to a fighter. */
if (obj->o_which == AXE_AKLAD) if (obj->o_which == AXE_AKLAD) {
newclass = C_FIGHTER; newclass = C_FIGHTER;
fuse(changeclass, &newclass, roll(20, 20), AFTER); fuse(changeclass, &newclass, roll(20, 20), AFTER);
}
if (cur_weapon != NULL) { if (cur_weapon != NULL) {
msg("The artifact insists you release your current weapon."); msg("The artifact insists you release your current weapon.");
if (!dropcheck(cur_weapon)) { if (!dropcheck(cur_weapon)) {

View file

@ -233,7 +233,7 @@ writelog(unsigned long amount, int flags, short monst)
else else
return; return;
/* Write */ /* Write */
fprintf(logfile, "%d %d %s %d %s %d %d %d %c %s\n", time(NULL), amount, fprintf(logfile, "%ld %ld %s %d %s %d %d %d %c %s\n", time(NULL), amount,
whoami, pstats.s_lvl, char_class[char_type].name, level, max_level, whoami, pstats.s_lvl, char_class[char_type].name, level, max_level,
quest_item, had_quest, fate); quest_item, had_quest, fate);
fclose(logfile); fclose(logfile);

View file

@ -625,81 +625,81 @@ char *cnames[NUM_CHARTYPES-1][NUM_CNAMES] = {
} ; } ;
struct h_list helpstr[] = { struct h_list helpstr[] = {
'?', " prints help", { '?', " prints help" },
'/', " identify object", { '/', " identify object" },
'=', " identify screen character", { '=', " identify screen character" },
'h', " left", { 'h', " left" },
'j', " down", { 'j', " down" },
'k', " up", { 'k', " up" },
'l', " right", { 'l', " right" },
'y', " up & left", { 'y', " up & left" },
'u', " up & right", { 'u', " up & right" },
'b', " down & left", { 'b', " down & left" },
'n', " down & right", { 'n', " down & right" },
'H', " run left", { 'H', " run left" },
'J', " run down", { 'J', " run down" },
'K', " run up", { 'K', " run up" },
'L', " run right", { 'L', " run right" },
'Y', " run up & left", { 'Y', " run up & left" },
'U', " run up & right", { 'U', " run up & right" },
'B', " run down & left", { 'B', " run down & left" },
'N', " run down & right", { 'N', " run down & right" },
't', "<dir> throw something", { 't', "<dir> throw something" },
'f', "<dir> forward until find something", { 'f', "<dir> forward until find something" },
'z', "<dir> zap a wand or staff", { 'z', "<dir> zap a wand or staff" },
'>', " go down a staircase", { '>', " go down a staircase" },
'<', " go up a staircase", { '<', " go up a staircase" },
's', " search for trap/secret door", { 's', " search for trap/secret door" },
'.', " rest for a while", { '.', " rest for a while" },
'i', " inventory", { 'i', " inventory" },
'I', " inventory single item", { 'I', " inventory single item" },
'q', " quaff potion", { 'q', " quaff potion" },
'r', " read paper", { 'r', " read paper" },
'e', " eat food", { 'e', " eat food" },
'w', " wield a weapon", { 'w', " wield a weapon" },
'W', " wear something", { 'W', " wear something" },
'T', " take off something", { 'T', " take off something" },
'd', " drop object", { 'd', " drop object" },
'P', " pick up object(s)", { 'P', " pick up object(s)" },
CTRL('N'), " name object or monster", { CTRL('N'), " name object or monster" },
'm', " mark object (specific)", { 'm', " mark object (specific)" },
'o', " examine/set options", { 'o', " examine/set options" },
'c', " chant", { 'c', " chant" },
'C', " cast a spell", { 'C', " cast a spell" },
'p', " pray", { 'p', " pray" },
'a', " affect the undead", { 'a', " affect the undead" },
'^', " set a trap", { '^', " set a trap" },
'G', " sense gold", { 'G', " sense gold" },
'D', " dip something (into a pool)", { 'D', " dip something (into a pool)" },
'*', " count up gold pieces", { '*', " count up gold pieces" },
CTRL('T'), "<dir> take (steal) from (direction)", { CTRL('T'), "<dir> take (steal) from (direction)" },
CTRL('U'), " use miscellaneous magic item", { CTRL('U'), " use miscellaneous magic item" },
CTRL('L'), " redraw screen", { CTRL('L'), " redraw screen" },
CTRL('R'), " repeat last message", { CTRL('R'), " repeat last message" },
ESCAPE, " cancel command", { ESCAPE, " cancel command" },
'v', " print program version number", { 'v', " print program version number" },
'!', " shell escape", { '!', " shell escape" },
'S', " save game", { 'S', " save game" },
'Q', " quit", { 'Q', " quit" },
0, 0 { 0, 0 }
} ; } ;
struct h_list wiz_help[] = { struct h_list wiz_help[] = {
CTRL('A'), " system activity", { CTRL('A'), " system activity" },
CTRL('C'), " move to another dungeon level", { CTRL('C'), " move to another dungeon level" },
CTRL('D'), " down 1 dungeon level", { CTRL('D'), " down 1 dungeon level" },
CTRL('E'), " food remaining", { CTRL('E'), " food remaining" },
CTRL('F'), " display entire level", { CTRL('F'), " display entire level" },
CTRL('H'), " jump 9 experience levels", { CTRL('H'), " jump 9 experience levels" },
CTRL('I'), " inventory of level", { CTRL('I'), " inventory of level" },
CTRL('J'), " teleport", { CTRL('J'), " teleport" },
CTRL('M'), " recharge staff", { CTRL('M'), " recharge staff" },
CTRL('P'), " toggle wizard status", { CTRL('P'), " toggle wizard status" },
CTRL('U'), " up 1 dungeon level", { CTRL('U'), " up 1 dungeon level" },
CTRL('X'), " detect monsters", { CTRL('X'), " detect monsters" },
CTRL('Z'), " identify", { CTRL('Z'), " identify" },
'M', " make object", { 'M', " make object" },
0, 0 { 0, 0 }
}; };

View file

@ -548,50 +548,50 @@ badcheck(char *name, struct magic_item *magic, int bound)
} }
struct h_list helpstr[] = { struct h_list helpstr[] = {
'?', " prints help", { '?', " prints help" },
'/', " identify object", { '/', " identify object" },
'h', " left", { 'h', " left" },
'j', " down", { 'j', " down" },
'k', " up", { 'k', " up" },
'l', " right", { 'l', " right" },
'y', " up & left", { 'y', " up & left" },
'u', " up & right", { 'u', " up & right" },
'b', " down & left", { 'b', " down & left" },
'n', " down & right", { 'n', " down & right" },
'H', " run left", { 'H', " run left" },
'J', " run down", { 'J', " run down" },
'K', " run up", { 'K', " run up" },
'L', " run right", { 'L', " run right" },
'Y', " run up & left", { 'Y', " run up & left" },
'U', " run up & right", { 'U', " run up & right" },
'B', " run down & left", { 'B', " run down & left" },
'N', " run down & right", { 'N', " run down & right" },
't', "<dir> throw something", { 't', "<dir> throw something" },
'f', "<dir> forward until find something", { 'f', "<dir> forward until find something" },
'p', "<dir> zap a wand in a direction", { 'p', "<dir> zap a wand in a direction" },
'z', " zap a wand or staff", { 'z', " zap a wand or staff" },
'>', " go down a staircase", { '>', " go down a staircase" },
's', " search for trap/secret door", { 's', " search for trap/secret door" },
'.', " rest for a turn", { '.', " rest for a turn" },
'i', " inventory", { 'i', " inventory" },
'I', " inventory single item", { 'I', " inventory single item" },
'q', " quaff potion", { 'q', " quaff potion" },
'r', " read paper", { 'r', " read paper" },
'e', " eat food", { 'e', " eat food" },
'w', " wield a weapon", { 'w', " wield a weapon" },
'W', " wear armor", { 'W', " wear armor" },
'T', " take armor off", { 'T', " take armor off" },
'P', " put on ring", { 'P', " put on ring" },
'R', " remove ring", { 'R', " remove ring" },
'd', " drop object", { 'd', " drop object" },
'c', " call object", { 'c', " call object" },
'o', " examine/set options", { 'o', " examine/set options" },
CTRL('L'), " redraw screen", { CTRL('L'), " redraw screen" },
CTRL('R'), " repeat last message", { CTRL('R'), " repeat last message" },
ESCAPE, " cancel command", { ESCAPE, " cancel command" },
'v', " print program version number", { 'v', " print program version number" },
'!', " shell escape", { '!', " shell escape" },
'S', " save game", { 'S', " save game" },
'Q', " quit", { 'Q', " quit" },
0, 0 { 0, 0 }
}; };

View file

@ -121,7 +121,7 @@ _new(size_t size)
if (space == NULL) if (space == NULL)
{ {
sprintf(prbuf, "Rogue ran out of memory (%d). Fatal error!", md_memused()); sprintf(prbuf, "Rogue ran out of memory (%ld). Fatal error!", md_memused());
fatal(prbuf); fatal(prbuf);
} }
total++; total++;

View file

@ -314,7 +314,7 @@ void writelog(int amount, int flags, int monst)
if (waswizard) if (waswizard)
return; return;
#ifdef LOGFILE #ifdef LOGFILE
sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, sprintf(logmessage, "%ld %d %s %d ", time(NULL), amount, whoami,
pstats.s_lvl); pstats.s_lvl);
if (flags == 0) /* died */ if (flags == 0) /* died */
{ {

View file

@ -62,9 +62,9 @@ inv_name(struct object *obj, int drop)
when FOOD: when FOOD:
if (obj->o_which == 1) if (obj->o_which == 1)
if (obj->o_count == 1) if (obj->o_count == 1)
sprintf(prbuf, "A%s %s", vowelstr(fruit), fruit); sprintf(prbuf, "A%s %.76s", vowelstr(fruit), fruit);
else else
sprintf(prbuf, "%d %ss", obj->o_count, fruit); sprintf(prbuf, "%d %.66ss", obj->o_count, fruit);
else else
if (obj->o_count == 1) if (obj->o_count == 1)
strcpy(prbuf, "Some food"); strcpy(prbuf, "Some food");

View file

@ -38,18 +38,18 @@ static struct init_weps {
int iw_launch; int iw_launch;
int iw_flags; int iw_flags;
} init_dam[MAXWEAPONS] = { } init_dam[MAXWEAPONS] = {
"2d4", "1d3", NONE, 0, /* Mace */ { "2d4", "1d3", NONE, 0 }, /* Mace */
"1d10", "1d2", NONE,0, /* Long sword */ { "1d10", "1d2", NONE,0 }, /* Long sword */
"1d1", "1d1", NONE, 0, /* Bow */ { "1d1", "1d1", NONE, 0 }, /* Bow */
"1d1", "1d6", BOW, ISMANY|ISMISL, /* Arrow */ { "1d1", "1d6", BOW, ISMANY|ISMISL }, /* Arrow */
"1d6", "1d4", NONE, ISMISL, /* Dagger */ { "1d6", "1d4", NONE, ISMISL }, /* Dagger */
"1d2", "1d4", SLING,ISMANY|ISMISL, /* Rock */ { "1d2", "1d4", SLING,ISMANY|ISMISL }, /* Rock */
"3d6", "1d2", NONE, 0, /* 2h sword */ { "3d6", "1d2", NONE, 0 }, /* 2h sword */
"0d0", "0d0", NONE, 0, /* Sling */ { "0d0", "0d0", NONE, 0 }, /* Sling */
"1d1", "1d3", NONE, ISMANY|ISMISL, /* Dart */ { "1d1", "1d3", NONE, ISMANY|ISMISL }, /* Dart */
"1d1", "1d1", NONE, 0, /* Crossbow */ { "1d1", "1d1", NONE, 0 }, /* Crossbow */
"1d2", "1d10", CROSSBOW, ISMANY|ISMISL,/* Crossbow bolt */ { "1d2", "1d10", CROSSBOW, ISMANY|ISMISL }, /* Crossbow bolt */
"1d8", "1d6", NONE, ISMISL, /* Spear */ { "1d8", "1d6", NONE, ISMISL } /* Spear */
}; };
/* /*

View file

@ -145,21 +145,25 @@ struct stats max_stats = INIT_STATS; /* The maximum for the player */
struct room *oldrp; /* Roomin(&oldpos) */ struct room *oldrp; /* Roomin(&oldpos) */
struct room rooms[MAXROOMS]; /* One for each room -- A level */ struct room rooms[MAXROOMS]; /* One for each room -- A level */
#define NON {0, 0}
#define NON12 { NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON }
struct room passages[MAXPASS] = /* One for each passage */ struct room passages[MAXPASS] = /* One for each passage */
{ {
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
{ {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 } { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 }
}; };
#undef NON12
#undef NON
#define ___ 1 #define ___ 1
#define XX 10 #define XX 10
@ -276,51 +280,51 @@ struct magic_item ws_magic[MAXSTICKS] = {
}; };
struct h_list helpstr[] = { struct h_list helpstr[] = {
'?', " prints help", { '?', " prints help" },
'/', " identify object", { '/', " identify object" },
'h', " left", { 'h', " left" },
'j', " down", { 'j', " down" },
'k', " up", { 'k', " up" },
'l', " right", { 'l', " right" },
'y', " up & left", { 'y', " up & left" },
'u', " up & right", { 'u', " up & right" },
'b', " down & left", { 'b', " down & left" },
'n', " down & right", { 'n', " down & right" },
'H', " run left", { 'H', " run left" },
'J', " run down", { 'J', " run down" },
'K', " run up", { 'K', " run up" },
'L', " run right", { 'L', " run right" },
'Y', " run up & left", { 'Y', " run up & left" },
'U', " run up & right", { 'U', " run up & right" },
'B', " run down & left", { 'B', " run down & left" },
'N', " run down & right", { 'N', " run down & right" },
't', "<dir> throw something", { 't', "<dir> throw something" },
'f', "<dir> forward until find something", { 'f', "<dir> forward until find something" },
'z', "<dir> zap a wand in a direction", { 'z', "<dir> zap a wand in a direction" },
'^', "<dir> identify trap type", { '^', "<dir> identify trap type" },
's', " search for trap/secret door", { 's', " search for trap/secret door" },
'>', " go down a staircase", { '>', " go down a staircase" },
'<', " go up a staircase", { '<', " go up a staircase" },
'.', " rest for a while", { '.', " rest for a while" },
'i', " inventory", { 'i', " inventory" },
'I', " inventory single item", { 'I', " inventory single item" },
'q', " quaff potion", { 'q', " quaff potion" },
'r', " read paper", { 'r', " read paper" },
'e', " eat food", { 'e', " eat food" },
'w', " wield a weapon", { 'w', " wield a weapon" },
'W', " wear armor", { 'W', " wear armor" },
'T', " take armor off", { 'T', " take armor off" },
'P', " put on ring", { 'P', " put on ring" },
'R', " remove ring", { 'R', " remove ring" },
'd', " drop object", { 'd', " drop object" },
'c', " call object", { 'c', " call object" },
'D', " recall what's been discovered", { 'D', " recall what's been discovered" },
'o', " examine/set options", { 'o', " examine/set options" },
CTRL('L'), " redraw screen", { CTRL('L'), " redraw screen" },
CTRL('R'), " repeat last message", { CTRL('R'), " repeat last message" },
ESCAPE, " cancel command", { ESCAPE, " cancel command" },
'!', " shell escape", { '!', " shell escape" },
'S', " save game", { 'S', " save game" },
'Q', " quit", { 'Q', " quit" },
0, 0 { 0, 0 }
}; };

View file

@ -259,7 +259,7 @@ eat(void)
else else
msg("yum, that tasted good"); msg("yum, that tasted good");
if (--obj->o_count < 1) if (--obj->o_count < 1)
{ {
detach(pack, obj); detach(pack, obj);
discard(obj); discard(obj);

View file

@ -136,7 +136,7 @@ void
conn(int r1, int r2) conn(int r1, int r2)
{ {
register struct room *rpf, *rpt = NULL; register struct room *rpf, *rpt = NULL;
register char rmt; unsigned char rmt;
register int distance = 0, turn_spot = 0, turn_distance = 0, index; register int distance = 0, turn_spot = 0, turn_distance = 0, index;
register int rm; register int rm;
register char direc; register char direc;

View file

@ -241,7 +241,7 @@ void writelog(int amount, int flags, char monst)
if (log_file == NULL) if (log_file == NULL)
return; return;
/* otherwise writing should work */ /* otherwise writing should work */
sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, sprintf(logmessage, "%ld %d %s %d ", time(NULL), amount, whoami,
pstats.s_lvl); pstats.s_lvl);
if (flags == 0) /* died */ if (flags == 0) /* died */
{ {

View file

@ -79,9 +79,9 @@ inv_name(THING *obj, bool drop)
when FOOD: when FOOD:
if (obj->o_which == 1) if (obj->o_which == 1)
if (obj->o_count == 1) if (obj->o_count == 1)
sprintf(pb, "A%s %s", vowelstr(fruit), fruit); sprintf(pb, "A%s %.76s", vowelstr(fruit), fruit);
else else
sprintf(pb, "%d %ss", obj->o_count, fruit); sprintf(pb, "%d %.66ss", obj->o_count, fruit);
else else
if (obj->o_count == 1) if (obj->o_count == 1)
strcpy(pb, "Some food"); strcpy(pb, "Some food");

View file

@ -23,16 +23,16 @@ static struct init_weps {
char iw_launch; /* Launching weapon */ char iw_launch; /* Launching weapon */
int iw_flags; /* Miscellaneous flags */ int iw_flags; /* Miscellaneous flags */
} init_dam[MAXWEAPONS] = { } init_dam[MAXWEAPONS] = {
"2d4", "1d3", NONE, 0, /* Mace */ { "2d4", "1d3", NONE, 0 }, /* Mace */
"3d4", "1d2", NONE, 0, /* Long sword */ { "3d4", "1d2", NONE, 0 }, /* Long sword */
"1d1", "1d1", NONE, 0, /* Bow */ { "1d1", "1d1", NONE, 0 }, /* Bow */
"1d1", "2d3", BOW, ISMANY|ISMISL, /* Arrow */ { "1d1", "2d3", BOW, ISMANY|ISMISL },/* Arrow */
"1d6", "1d4", NONE, ISMISL, /* Dagger */ { "1d6", "1d4", NONE, ISMISL }, /* Dagger */
"4d4", "1d2", NONE, 0, /* 2h sword */ { "4d4", "1d2", NONE, 0 }, /* 2h sword */
"1d1", "1d3", NONE, ISMANY|ISMISL, /* Dart */ { "1d1", "1d3", NONE, ISMANY|ISMISL },/* Dart */
"1d1", "1d1", NONE, 0, /* Crossbow */ { "1d1", "1d1", NONE, 0 }, /* Crossbow */
"1d2", "2d5", CROSSBOW, ISMANY|ISMISL, /* Crossbow bolt */ { "1d2", "2d5", CROSSBOW, ISMANY|ISMISL },/* Crossbow bolt */
"2d3", "1d6", NONE, ISMISL, /* Spear */ { "2d3", "1d6", NONE, ISMISL } /* Spear */
}; };
/* /*

View file

@ -237,7 +237,7 @@ void writelog(int amount, int flags, int monst)
return; return;
} }
#endif #endif
sprintf(logmessage, "%d %d %.80s %d ", time(NULL), amount, whoami, sprintf(logmessage, "%ld %d %.80s %d ", time(NULL), amount, whoami,
pstats.s_lvl); pstats.s_lvl);
if (flags == 0) /* dead */ if (flags == 0) /* dead */
{ {

View file

@ -175,7 +175,7 @@ restore(const char *file)
if (strcmp(file, "-r") == 0) if (strcmp(file, "-r") == 0)
file = file_name; file = file_name;
md_tstphold(); md_tstphold();
if ((inf = fopen(file,"r")) == NULL) if ((inf = fopen(file,"r")) == NULL)
{ {

View file

@ -179,52 +179,52 @@ struct monster monsters[MAXMONS + 1] = {
#undef _r #undef _r
struct h_list helpstr[] = { struct h_list helpstr[] = {
'?', " prints help", { '?', " prints help" },
'/', " identify object", { '/', " identify object" },
'h', " left", { 'h', " left" },
'j', " down", { 'j', " down" },
'k', " up", { 'k', " up" },
'l', " right", { 'l', " right" },
'y', " up & left", { 'y', " up & left" },
'u', " up & right", { 'u', " up & right" },
'b', " down & left", { 'b', " down & left" },
'n', " down & right", { 'n', " down & right" },
'H', " run left", { 'H', " run left" },
'J', " run down", { 'J', " run down" },
'K', " run up", { 'K', " run up" },
'L', " run right", { 'L', " run right" },
'Y', " run up & left", { 'Y', " run up & left" },
'U', " run up & right", { 'U', " run up & right" },
'B', " run down & left", { 'B', " run down & left" },
'N', " run down & right", { 'N', " run down & right" },
't', "<dir> throw something", { 't', "<dir> throw something" },
'f', "<dir> forward until find something", { 'f', "<dir> forward until find something" },
'p', "<dir> zap a wand in a direction", { 'p', "<dir> zap a wand in a direction" },
'z', " zap a wand or staff", { 'z', " zap a wand or staff" },
'>', " go down a staircase", { '>', " go down a staircase" },
's', " search for trap/secret door", { 's', " search for trap/secret door" },
'.', " (dot) rest for a while", { '.', " (dot) rest for a while" },
'i', " inventory pack", { 'i', " inventory pack" },
'I', " inventory single item", { 'I', " inventory single item" },
'q', " quaff potion", { 'q', " quaff potion" },
'r', " read a scroll", { 'r', " read a scroll" },
'e', " eat food", { 'e', " eat food" },
'w', " wield a weapon", { 'w', " wield a weapon" },
'W', " wear armor", { 'W', " wear armor" },
'T', " take armor off", { 'T', " take armor off" },
'P', " put on ring", { 'P', " put on ring" },
'R', " remove ring", { 'R', " remove ring" },
'd', " drop object", { 'd', " drop object" },
'c', " call object", { 'c', " call object" },
'O', " examine/set options", { 'O', " examine/set options" },
'a', " display maximum stats", { 'a', " display maximum stats" },
'D', " dip object in pool", { 'D', " dip object in pool" },
CTRL('L')," redraw screen", { CTRL('L')," redraw screen" },
ESCAPE, " cancel command", { ESCAPE, " cancel command" },
'!', " shell escape", { '!', " shell escape" },
'S', " save game", { 'S', " save game" },
'Q', " quit", { 'Q', " quit" },
0, 0 { 0, 0 }
}; };
char *s_names[MAXSCROLLS]; /* Names of the scrolls */ char *s_names[MAXSCROLLS]; /* Names of the scrolls */

View file

@ -100,7 +100,7 @@ new(int size)
register char *space = ALLOC(size); register char *space = ALLOC(size);
if (space == NULL) { if (space == NULL) {
sprintf(prbuf,"Rogue ran out of memory (%d).", md_memused()); sprintf(prbuf,"Rogue ran out of memory (%ld).", md_memused());
fatal(prbuf); fatal(prbuf);
} }
total++; total++;

View file

@ -47,7 +47,8 @@ main(int argc, char *argv[], char *envp[])
register char *env; register char *env;
register struct linked_list *item; register struct linked_list *item;
register struct object *obj; register struct object *obj;
char alldone, wpt; char alldone;
int wpt;
char *getpass(), *xcrypt(), *strrchr(); char *getpass(), *xcrypt(), *strrchr();
char *homedir = roguehome(); char *homedir = roguehome();

View file

@ -63,7 +63,8 @@ void showpack(bool winner, char *howso);
void void
death(char monst) death(char monst)
{ {
reg char dp, *killer; reg char *killer;
int dp;
struct tm *lt; struct tm *lt;
time_t date; time_t date;
char buf[LINLEN]; char buf[LINLEN];
@ -180,21 +181,21 @@ score(int amount, int aflag, char monst)
for (scp = top_ten; scp <= &top_ten[9]; scp++) for (scp = top_ten; scp <= &top_ten[9]; scp++)
if (amount > scp->sc_score) if (amount > scp->sc_score)
break; break;
if (scp <= &top_ten[9]) { if (scp <= &top_ten[9]) {
for (sc2 = &top_ten[9]; sc2 > scp; sc2--) for (sc2 = &top_ten[9]; sc2 > scp; sc2--)
*sc2 = *(sc2-1); *sc2 = *(sc2-1);
scp->sc_score = amount; scp->sc_score = amount;
strcpy(scp->sc_name, whoami); strcpy(scp->sc_name, whoami);
scp->sc_flags = aflag; scp->sc_flags = aflag;
if (aflag == WINNER) if (aflag == WINNER)
scp->sc_level = max_level; scp->sc_level = max_level;
else else
scp->sc_level = level; scp->sc_level = level;
scp->sc_monster = monst; scp->sc_monster = monst;
scp->sc_uid = playuid; scp->sc_uid = playuid;
scp->sc_explvl = him->s_lvl; scp->sc_explvl = him->s_lvl;
scp->sc_exppts = him->s_exp; scp->sc_exppts = him->s_exp;
time(&scp->sc_date); time(&scp->sc_date);
} }
} }
ignore(); ignore();
@ -228,7 +229,7 @@ void writelog(int amount, int aflag, char monst)
#ifdef LOGFILE #ifdef LOGFILE
if (logfile == NULL) if (logfile == NULL)
return; return;
sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, sprintf(logmessage, "%ld %d %s %d ", time(NULL), amount, whoami,
him->s_lvl); him->s_lvl);
if (amulet) if (amulet)
sprintf(mlev, " [max %d] with the Amulet", max_level); sprintf(mlev, " [max %d] with the Amulet", max_level);

View file

@ -79,7 +79,7 @@ inv_name(struct object *obj, bool drop)
if (wh == 1) { if (wh == 1) {
if (obj->o_count == 1) if (obj->o_count == 1)
q = vowelstr(fruit); q = vowelstr(fruit);
sprintf(prbuf, "%s%s %s%s", nm, q, fruit, pl); sprintf(prbuf, "%s%s %.72s%s", nm, q, fruit, pl);
} }
else { else {
if (obj->o_count == 1) if (obj->o_count == 1)

View file

@ -338,7 +338,7 @@ struct cell {
char x_pos; char x_pos;
}; };
struct bordercells { struct bordercells {
char num_pos; /* number of frontier cells next to you */ unsigned char num_pos; /* number of frontier cells next to you */
struct cell conn[4]; /* the y,x position of above cell */ struct cell conn[4]; /* the y,x position of above cell */
} mborder; } mborder;

View file

@ -288,10 +288,10 @@ baf_print_item(struct object *obj_p, bag_arg *type, int id)
if (*type->iarg == 0) if (*type->iarg == 0)
sprintf(inv_temp, "%c%c) %s", obj_p->o_type, sprintf(inv_temp, "%c%c) %s", obj_p->o_type,
print_letters[id], inv_name(obj_p, LOWERCASE), FALSE); print_letters[id], inv_name(obj_p, LOWERCASE));
else else
sprintf(inv_temp, "%c) %s", print_letters[id], sprintf(inv_temp, "%c) %s", print_letters[id],
inv_name(obj_p, LOWERCASE), FALSE); inv_name(obj_p, LOWERCASE));
add_line(inv_temp); add_line(inv_temp);
return(TRUE); return(TRUE);

View file

@ -1143,8 +1143,8 @@ get_hurl(struct thing *tp)
if (off(*tp, ISCHARMED) && oil) if (off(*tp, ISCHARMED) && oil)
return(oil); return(oil);
if (off(*tp, ISCHARMED) && grenade) if (off(*tp, ISCHARMED) && grenade)
return(grenade); return(grenade);
if (footbow && fbbolt) if (footbow && fbbolt)
return(fbbolt); return(fbbolt);

View file

@ -152,7 +152,7 @@ puta_player(void)
wclrtoeol(hw); wclrtoeol(hw);
sprintf(pbuf, sprintf(pbuf,
"Int: %d Str: %d Wis: %d Dex: %d Con: %d Cha: %d Pow: %d Hpt: %d", "Int: %d Str: %d Wis: %d Dex: %d Con: %d Cha: %d Pow: %d Hpt: %ld",
pstats.s_intel, pstats.s_intel,
pstats.s_str, pstats.s_str,
pstats.s_wisdom, pstats.s_wisdom,

View file

@ -161,7 +161,7 @@ status(int display)
mvwaddstr(cw, LINES - 2, 0, buf); mvwaddstr(cw, LINES - 2, 0, buf);
wclrtoeol(cw); wclrtoeol(cw);
sprintf(buf, "Lvl:%d Au:%d Hpt:%3d(%3d) Pow:%d(%d) Ac:%d Exp:%d+%ld %s", sprintf(buf, "Lvl:%d Au:%ld Hpt:%3ld(%3ld) Pow:%d(%d) Ac:%d Exp:%d+%ld %s",
level, level,
purse, purse,
stat_ptr->s_hpt, max_ptr->s_hpt, stat_ptr->s_hpt, max_ptr->s_hpt,

View file

@ -1417,11 +1417,11 @@ sell(struct thing *tp)
if (selection[i].count > 1) if (selection[i].count > 1)
strcat(dbuf, "s"); strcat(dbuf, "s");
sprintf(buffer, "%-50s Price: %d", dbuf, selection[i].worth); sprintf(buffer, "%-50.80s Price: %d", dbuf, selection[i].worth);
waddstr(hw, buffer); waddstr(hw, buffer);
} }
sprintf(buffer, "Purse: %d", purse); sprintf(buffer, "Purse: %ld", purse);
mvwaddstr(hw, nitems + 3, 0, buffer); mvwaddstr(hw, nitems + 3, 0, buffer);
mvwaddstr(hw, 0, 0, "How about one of the following goods? "); mvwaddstr(hw, 0, 0, "How about one of the following goods? ");
wrefresh(hw); wrefresh(hw);

View file

@ -29,15 +29,19 @@ int get_score(opt_arg *opt, WINDOW *win);
/* description of an option and what to do with it */ /* description of an option and what to do with it */
static OPTION optlist[] = static OPTION optlist[] =
{ {
{"jump","Show position only at end of run (jump): ", &jump,put_bool,get_bool}, {"jump","Show position only at end of run (jump): ", { &jump },
{"inven","Style of inventories (inven): ", &inv_type, put_inv, get_inv}, put_bool, get_bool},
{"askme","Ask me about unidentified things (askme): ",&askme,put_bool,get_bool}, {"inven","Style of inventories (inven): ", { &inv_type },
{"doorstop","Stop running when adjacent (doorstop): ",&doorstop,put_bool,get_bool}, put_inv, get_inv},
{"name", "Name (name): ", &whoami, put_str, get_restr}, {"askme","Ask me about unidentified things (askme): ", { &askme},
{"fruit", "Fruit (fruit): ", &fruit, put_str, get_str}, put_bool, get_bool},
{"file", "Save file (file): ", &file_name, put_str, get_restr}, {"doorstop","Stop running when adjacent (doorstop): ", { &doorstop },
{"score", "Score file (score): ", &score_file, put_str, get_score}, put_bool, get_bool},
{"class", "Character class (class): ",&char_type, put_abil, get_abil} {"name", "Name (name): ", { &whoami }, put_str, get_restr},
{"fruit", "Fruit (fruit): ", { &fruit }, put_str, get_str},
{"file", "Save file (file): ", { &file_name }, put_str, get_restr},
{"score", "Score file (score): ", { &score_file }, put_str, get_score},
{"class", "Character class (class): ", { &char_type }, put_abil, get_abil}
}; };
/* /*

View file

@ -215,33 +215,33 @@ quaff(struct thing *quaffer, int which, int flags)
case 2: ctype = C_CLERIC; break; case 2: ctype = C_CLERIC; break;
case 3: ctype = C_THIEF; break; case 3: ctype = C_THIEF; break;
} }
switch (ctype) switch (ctype)
{ {
case C_FIGHTER:add_strength(cursed); break; case C_FIGHTER:add_strength(cursed); break;
case C_PALADIN:add_strength(cursed); break; case C_PALADIN:add_strength(cursed); break;
case C_RANGER:add_strength(cursed); break; case C_RANGER:add_strength(cursed); break;
case C_MAGICIAN:add_intelligence(cursed); break; case C_MAGICIAN:add_intelligence(cursed); break;
case C_ILLUSION:add_intelligence(cursed); break; case C_ILLUSION:add_intelligence(cursed); break;
case C_CLERIC:add_wisdom(cursed); break; case C_CLERIC:add_wisdom(cursed); break;
case C_DRUID:add_wisdom(cursed); break; case C_DRUID:add_wisdom(cursed); break;
case C_THIEF:add_dexterity(cursed); break; case C_THIEF:add_dexterity(cursed); break;
case C_ASSASIN:add_dexterity(cursed); break; case C_ASSASIN:add_dexterity(cursed); break;
case C_NINJA:add_dexterity(cursed); break; case C_NINJA:add_dexterity(cursed); break;
default: msg("You're a strange type!"); break; default: msg("You're a strange type!"); break;
}
} }
if (rnd(100) < 10)
add_const(cursed);
if (rnd(100) < 60)
curp->s_arm += (cursed ? 1 : -1);
if (!cursed)
know_items[TYP_POTION][P_GAINABIL] = TRUE;
} }
if (rnd(100) < 10)
add_const(cursed);
if (rnd(100) < 60)
curp->s_arm += (cursed ? 1 : -1);
if (!cursed)
know_items[TYP_POTION][P_GAINABIL] = TRUE;
} }
break; }
break;
case P_MONSTDET: case P_MONSTDET:

View file

@ -408,8 +408,8 @@ writelog(long amount, int lvl, int flags, int monst)
} }
else else
return; return;
fprintf(file_log, "%d %d %s %d %s %d %d %d %s\n", time(NULL), amount, fprintf(file_log, "%ld %ld %s %d %s %d %d %d %s\n", time(NULL), amount,
whoami, lvl, which_class(player.t_ctype), level, max_level, whoami, lvl, which_class(player.t_ctype), level, max_level,
has_artifact, fate); has_artifact, fate);
fclose(file_log); fclose(file_log);
return; return;

View file

@ -573,7 +573,7 @@ find_object(struct linked_list *list, int num)
if ( (num < 1) || (list == NULL) ) if ( (num < 1) || (list == NULL) )
return(NULL); return(NULL);
num--; num--;
for(cnt = 0; cnt < num; cnt++) for(cnt = 0; cnt < num; cnt++)
{ {

View file

@ -257,7 +257,7 @@ buy_more:
for(i=0,m_item=magic_array; i < array_size; i++, m_item++) for(i=0,m_item=magic_array; i < array_size; i++, m_item++)
if (!is_spell && m_item->mi_worth > 0) if (!is_spell && m_item->mi_worth > 0)
{ {
sprintf(buf, "%3d) %8d %s", i, m_item->mi_worth, sprintf(buf, "%3d) %8ld %s", i, m_item->mi_worth,
m_item->mi_name); m_item->mi_name);
add_line(buf); add_line(buf);
} }
@ -267,7 +267,7 @@ buy_more:
for (i = 0; i < array_size; i++) for (i = 0; i < array_size; i++)
if (!is_spell && armors[i].a_worth > 0) if (!is_spell && armors[i].a_worth > 0)
{ {
sprintf(buf, "%3d) %8d %s", i, armors[i].a_worth, sprintf(buf, "%3d) %8ld %s", i, armors[i].a_worth,
armors[i].a_name); armors[i].a_name);
add_line(buf); add_line(buf);
@ -278,7 +278,7 @@ buy_more:
for (i = 0; i < array_size; i++) for (i = 0; i < array_size; i++)
if (!is_spell && weaps[i].w_worth > 0) if (!is_spell && weaps[i].w_worth > 0)
{ {
sprintf(buf, "%3d) %8d %s", i, weaps[i].w_worth, sprintf(buf, "%3d) %8ld %s", i, weaps[i].w_worth,
weaps[i].w_name); weaps[i].w_name);
add_line(buf); add_line(buf);
} }
@ -646,7 +646,7 @@ describe_it(struct object *obj)
else else
charp = normal_d[rnd(sizeof(normal_d) / sizeof(char *))]; charp = normal_d[rnd(sizeof(normal_d) / sizeof(char *))];
sprintf(buf, "It's a%s %s worth %d pieces of gold.", sprintf(buf, "It's a%s %s worth %ld pieces of gold.",
vowelstr(charp), charp, obj->o_worth); vowelstr(charp), charp, obj->o_worth);
mvwaddstr(hw, 10, 0, inv_name(obj, TRUE)); mvwaddstr(hw, 10, 0, inv_name(obj, TRUE));
@ -794,11 +794,11 @@ trans_line(void)
int adorned = is_wearing(R_ADORNMENT); int adorned = is_wearing(R_ADORNMENT);
if (level == 0 && purse > 0) if (level == 0 && purse > 0)
sprintf(buf, "You still have %d pieces of gold left.", purse); sprintf(buf, "You still have %ld pieces of gold left.", purse);
else if (purse == 0) else if (purse == 0)
sprintf(buf, "You have no money left."); sprintf(buf, "You have no money left.");
else if (!wizard) else if (!wizard)
sprintf(buf, "You have %d transactions and %d gold pieces remaining.", sprintf(buf, "You have %d transactions and %ld gold pieces remaining.",
max(0, (adorned ? MAXPURCH + 4 : MAXPURCH) - player.t_trans), max(0, (adorned ? MAXPURCH + 4 : MAXPURCH) - player.t_trans),
EFFECTIVE_PURSE); EFFECTIVE_PURSE);
else else

View file

@ -696,12 +696,12 @@ eat_gold(struct object *obj)
if (purse == 50) if (purse == 50)
msg("%s.. Commands you to find more gold!! ", inv_name(obj, FALSE)); msg("%s.. Commands you to find more gold!! ", inv_name(obj, FALSE));
if (purse == 0) { if (purse == 0) {
if (rnd(10) >= 7) if (rnd(10) >= 7)
msg("You feel the artifact gnawing away... "); msg("You feel the artifact gnawing away... ");
if (--pstats.s_hpt < 1) { if (--pstats.s_hpt < 1) {
pstats.s_hpt = -1; pstats.s_hpt = -1;
death(D_RELIC); death(D_RELIC);
} }
} }
else else
purse--; purse--;

View file

@ -160,143 +160,143 @@ static char *game_begin ="To be updated...";
/* help list */ /* help list */
static struct h_list helpstr[] = { static struct h_list helpstr[] = {
'?', " Print help", { '?', " Print help" },
'/', " Identify object", { '/', " Identify object" },
'=', " Identify a screen character", { '=', " Identify a screen character" },
' ', "", { ' ', "" },
'h', " Move left", { 'h', " Move left" },
'j', " Move down", { 'j', " Move down" },
'k', " Move up", { 'k', " Move up" },
'l', " Move right", { 'l', " Move right" },
'y', " Move up and left", { 'y', " Move up and left" },
'u', " Move up and right", { 'u', " Move up and right" },
'b', " Move down and left", { 'b', " Move down and left" },
'n', " Move down and right", { 'n', " Move down and right" },
'H', " Run left", { 'H', " Run left" },
'J', " Run down", { 'J', " Run down" },
'K', " Run up", { 'K', " Run up" },
'L', " Run right", { 'L', " Run right" },
'Y', " Run up & left", { 'Y', " Run up & left" },
'U', " Run up & right", { 'U', " Run up & right" },
'B', " Run down & left", { 'B', " Run down & left" },
'N', " Run down & right", { 'N', " Run down & right" },
' ', "", { ' ', "" },
'>', " Go down a staircase", { '>', " Go down a staircase" },
'<', " Go up a staircase", { '<', " Go up a staircase" },
'\\', " Game descriptions", { '\\', " Game descriptions" },
'.', " Rest for a while", { '.', " Rest for a while" },
'*', " Count gold pieces", { '*', " Count gold pieces" },
'a', " Affect the undead", { 'a', " Affect the undead" },
'A', " Choose artifact (equipage)", { 'A', " Choose artifact (equipage)" },
'c', " Chant a mantra", { 'c', " Chant a mantra" },
'C', " Cast a spell", { 'C', " Cast a spell" },
'd', " Drop something", { 'd', " Drop something" },
'D', " Dip something (into a pool)", { 'D', " Dip something (into a pool)" },
'e', " Eat food or fruit", { 'e', " Eat food or fruit" },
'f', "<dir> Forward until find something", { 'f', "<dir> Forward until find something" },
'F', " Frighten a monster", { 'F', " Frighten a monster" },
'g', " Give food to monster", { 'g', " Give food to monster" },
'G', " Sense for gold", { 'G', " Sense for gold" },
'i', " Inventory", { 'i', " Inventory" },
'I', " Inventory (single item)", { 'I', " Inventory (single item)" },
'm', " Mark an object (specific)", { 'm', " Mark an object (specific)" },
'o', " Examine and/or set options", { 'o', " Examine and/or set options" },
'O', " Character type and quest item", { 'O', " Character type and quest item" },
'p', " Pray to the powers that be", { 'p', " Pray to the powers that be" },
'P', " Pick up object(s)", { 'P', " Pick up object(s)" },
'q', " Quaff a potion", { 'q', " Quaff a potion" },
'Q', " Quit the game", { 'Q', " Quit the game" },
'r', " Read a scroll", { 'r', " Read a scroll" },
's', " Search for a trap/secret door", { 's', " Search for a trap/secret door" },
'S', " Save your game", { 'S', " Save your game" },
't', "<dir> Throw something", { 't', "<dir> Throw something" },
'T', " Take off something", { 'T', " Take off something" },
'v', " Print program version", { 'v', " Print program version" },
'w', " Wield a weapon", { 'w', " Wield a weapon" },
'W', " Wear something", { 'W', " Wear something" },
'X', " Sense for traps", { 'X', " Sense for traps" },
'z', "<dir> Zap a wand or staff", { 'z', "<dir> Zap a wand or staff" },
' ', "", { ' ', "" },
'^', " Set a trap", { '^', " Set a trap" },
'$', " Price an item (trading post)", { '$', " Price an item (trading post)" },
'#', " Buy an item (trading post)", { '#', " Buy an item (trading post)" },
'%', " Sell an item (trading post)", { '%', " Sell an item (trading post)" },
'!', " Shell escape", { '!', " Shell escape" },
ESC, " Cancel command (Esc)", { ESC, " Cancel command (Esc)" },
' ', "", { ' ', "" },
CTRL('B'), " Current score (if you win)", { CTRL('B'), " Current score (if you win)" },
CTRL('E'), " Current food level", { CTRL('E'), " Current food level" },
CTRL('L'), " Redraw the screen", { CTRL('L'), " Redraw the screen" },
CTRL('N'), " Name an object or a monster", { CTRL('N'), " Name an object or a monster" },
CTRL('O'), " Character affect status", { CTRL('O'), " Character affect status" },
CTRL('R'), " Repeat last message", { CTRL('R'), " Repeat last message" },
CTRL('T'), "<dir> Take (steal) from (direction)", { CTRL('T'), "<dir> Take (steal) from (direction)" },
CTRL('U'), " Use a magic item", { CTRL('U'), " Use a magic item" },
0, 0 { 0, "" }
} ; } ;
/* wizard help list */ /* wizard help list */
static struct h_list wiz_help[] = { static struct h_list wiz_help[] = {
' ', "", { ' ', "" },
'+', " Random fortunes", { '+', " Random fortunes" },
'M', " Make an object", { 'M', " Make an object" },
'V', " Display vlevel and turns", { 'V', " Display vlevel and turns" },
CTRL('A'), " System activity", { CTRL('A'), " System activity" },
CTRL('C'), " Move to another dungeon level", { CTRL('C'), " Move to another dungeon level" },
CTRL('D'), " Go down 1 dungeon level", { CTRL('D'), " Go down 1 dungeon level" },
CTRL('F'), " Display the entire level", { CTRL('F'), " Display the entire level" },
CTRL('G'), " Charge wands and staffs", { CTRL('G'), " Charge wands and staffs" },
CTRL('H'), " Jump 9 experience levels", { CTRL('H'), " Jump 9 experience levels" },
CTRL('I'), " Inventory of level", { CTRL('I'), " Inventory of level" },
CTRL('J'), " Teleport somewhere", { CTRL('J'), " Teleport somewhere" },
CTRL('K'), " Identify an object", { CTRL('K'), " Identify an object" },
CTRL('M'), " Recharge wand or staff", { CTRL('M'), " Recharge wand or staff" },
CTRL('P'), " Toggle wizard status", { CTRL('P'), " Toggle wizard status" },
CTRL('X'), " Detect monsters", { CTRL('X'), " Detect monsters" },
CTRL('Y'), " Display food levels", { CTRL('Y'), " Display food levels" },
0, 0 { 0, "" }
}; };
/* item help list */ /* item help list */
static struct item_list item_help[] = { static struct item_list item_help[] = {
'@', " You (visible)", { '@', " You (visible)" },
'_', " You (invisible)", { '_', " You (invisible)" },
' ', "", { ' ', "" },
':', " Food ration or fruit (eat)", { ':', " Food ration or fruit (eat)" },
'!', " Potion (quaff)", { '!', " Potion (quaff)" },
'?', " Scroll (read)", { '?', " Scroll (read)" },
'=', " Ring (wear)", { '=', " Ring (wear)" },
')', " Weapon (wield)", { ')', " Weapon (wield)" },
']', " Armor (wear)", { ']', " Armor (wear)" },
'/', " Wand or staff (zap)", { '/', " Wand or staff (zap)" },
';', " Magic item (use)", { ';', " Magic item (use)" },
',', " Artifact (quest item)", { ',', " Artifact (quest item)" },
'*', " Gold or zapped missile", { '*', " Gold or zapped missile" },
' ', "", { ' ', "" },
'$', " Magical item in room", { '$', " Magical item in room" },
'>', " Blessed magical item", { '>', " Blessed magical item" },
'<', " Cursed magical item", { '<', " Cursed magical item" },
' ', " ", { ' ', " " },
'`', " Dart trap", { '`', " Dart trap" },
'{', " Arrow trap", { '{', " Arrow trap" },
'}', " Bear trap", { '}', " Bear trap" },
'~', " Teleport trap", { '~', " Teleport trap" },
'$', " Sleeping gas trap", { '$', " Sleeping gas trap" },
'>', " Trap door", { '>', " Trap door" },
'<', " Outer region entrance", { '<', " Outer region entrance" },
'\'', " Maze entrance", { '\'', " Maze entrance" },
'^', " Trading post entrance", { '^', " Trading post entrance" },
'"', " Magic pool or lake", { '"', " Magic pool or lake" },
' ', " Solid rock or mountain", { ' ', " Solid rock or mountain" },
'.', " Floor of a room or meadow", { '.', " Floor of a room or meadow" },
'%', " Stairs (up or down)", { '%', " Stairs (up or down)" },
'+', " Doorway", { '+', " Doorway" },
'&', " Secret doorway", { '&', " Secret doorway" },
'#', " Passage between rooms", { '#', " Passage between rooms" },
'\\', " Forest", { '\\', " Forest" },
HORZWALL, " Horizontal wall of a room", { HORZWALL, " Horizontal wall of a room" },
VERTWALL, " Vertical wall of a room", { VERTWALL, " Vertical wall of a room" },
0, 0 { 0, "" }
}; };
void void

View file

@ -37,67 +37,71 @@ enter a '\\' on any other screen.";
*/ */
struct words rainbow[NCOLORS] = { struct words rainbow[NCOLORS] = {
"Amber", "Aquamarine", "Beige", { "Amber" }, { "Aquamarine" }, { "Beige" },
"Black", "Blue", "Brown", { "Black" }, { "Blue" }, { "Brown" },
"Clear", "Crimson", "Ecru", { "Clear" }, { "Crimson" }, { "Ecru" },
"Gold", "Green", "Grey", { "Gold" }, { "Green" }, { "Grey" },
"Indigo", "Khaki", "Lavender", { "Indigo" }, { "Khaki" }, { "Lavender" },
"Magenta", "Orange", "Pink", { "Magenta" }, { "Orange" }, { "Pink" },
"Plaid", "Purple", "Red", { "Plaid" }, { "Purple" }, { "Red" },
"Silver", "Saffron", "Scarlet", { "Silver" }, { "Saffron" }, { "Scarlet" },
"Tan", "Tangerine", "Topaz", { "Tan" }, { "Tangerine" }, { "Topaz" },
"Turquoise", "Vermilion", "Violet", { "Turquoise" }, { "Vermilion" }, { "Violet" },
"White", "Yellow", { "White" }, { "Yellow" }
}; };
struct words sylls[NSYLLS] = { struct words sylls[NSYLLS] = {
"a", "ae", "ak", "an", "ax", "ach", "ano", "ars", "bha", "bar", "bre", {"a"}, {"ae"}, {"ak"}, {"an"}, {"ax"}, {"ach"}, {"ano"}, {"ars"},
"cha", "cre", "cum", "cow", "duh", "dha", "e", "ea", "em", "et", "ey", {"bha"}, {"bar"}, {"bre"}, {"cha"}, {"cre"}, {"cum"}, {"cow"}, {"duh"},
"eck", "etk", "egg", "exl", "fu", "fen", "fid", "gan", "gle", "h", "ha", {"dha"}, {"e"}, {"ea"}, {"em"}, {"et"}, {"ey"}, {"eck"}, {"etk"},
"hr", "ht", "how", "hex", "hip", "hoc", "i", "ia", "ig", "it", "iz", {"egg"}, {"exl"}, {"fu"}, {"fen"}, {"fid"}, {"gan"}, {"gle"}, {"h"},
"ion", "ink", "ivi", "iss", "je", "jin", "jha", "jyr", "ka", "kho", "kal", {"ha"}, {"hr"}, {"ht"}, {"how"}, {"hex"}, {"hip"}, {"hoc"}, {"i"},
"kli", "lu", "lre", "lta", "lri", "m", "ma", "mh", "mi", "mr", "mar", {"ia"}, {"ig"}, {"it"}, {"iz"}, {"ion"}, {"ink"}, {"ivi"}, {"iss"},
"myr", "moh", "mul", "nep", "nes", "o", "oc", "om", "oq", "ox", "orn", {"je"}, {"jin"}, {"jha"}, {"jyr"}, {"ka"}, {"kho"}, {"kal"}, {"kli"},
"oxy", "olm", "ode", "po", "pie", "pod", "pot", "qar", "que", "ran", "rah", {"lu"}, {"lre"}, {"lta"}, {"lri"}, {"m"}, {"ma"}, {"mh"}, {"mi"},
"rok", "sa", "sat", "sha", "sol", "sri", "ti", "tem", "tar", "tki", "tch", {"mr"}, {"mar"}, {"myr"}, {"moh"}, {"mul"}, {"nep"}, {"nes"}, {"o"},
"tox", "u", "ub", "uh", "ur", "uv", "unk", "uwh", "ugh", "uyr", "va", {"oc"}, {"om"}, {"oq"}, {"ox"}, {"orn"}, {"oxy"}, {"olm"}, {"ode"},
"vil", "vit", "vom", "vux", "wah", "wex", "xu", "xed", "xen", "ya", "yep", {"po"}, {"pie"}, {"pod"}, {"pot"}, {"qar"}, {"que"}, {"ran"}, {"rah"},
"yih", "zef", "zen", "zil", "zym", "-" {"rok"}, {"sa"}, {"sat"}, {"sha"}, {"sol"}, {"sri"}, {"ti"}, {"tem"},
{"tar"}, {"tki"}, {"tch"}, {"tox"}, {"u"}, {"ub"}, {"uh"}, {"ur"},
{"uv"}, {"unk"}, {"uwh"}, {"ugh"}, {"uyr"}, {"va"}, {"vil"}, {"vit"},
{"vom"}, {"vux"}, {"wah"}, {"wex"}, {"xu"}, {"xed"}, {"xen"}, {"ya"},
{"yep"}, {"yih"}, {"zef"}, {"zen"}, {"zil"}, {"zym"}, {"-"}
}; };
struct words stones[NSTONES] = { struct words stones[NSTONES] = {
"Agate", "Alexandrite", "Amethyst", { "Agate" }, { "Alexandrite" }, { "Amethyst" },
"Azurite", "Bloodstone", "Cairngorm", { "Azurite" }, { "Bloodstone" }, { "Cairngorm" },
"Carnelian", "Chalcedony", "Chrysoberyl", { "Carnelian" }, { "Chalcedony" }, { "Chrysoberyl" },
"Chrysolite", "Chrysoprase", "Citrine", { "Chrysolite" }, { "Chrysoprase" }, { "Citrine" },
"Coral", "Diamond", "Emerald", { "Coral" }, { "Diamond" }, { "Emerald" },
"Garnet", "Heliotrope", "Hematite", { "Garnet" }, { "Heliotrope" }, { "Hematite" },
"Hyacinth", "Jacinth", "Jade", { "Hyacinth" }, { "Jacinth" }, { "Jade" },
"Jargoon", "Jasper", "Kryptonite", { "Jargoon" }, { "Jasper" }, { "Kryptonite" },
"Lapis lazuli", "Malachite", "Mocca stone", { "Lapis lazuli" }, { "Malachite" }, { "Mocca stone" },
"Moonstone", "Obsidian", "Olivine", { "Moonstone" }, { "Obsidian" }, { "Olivine" },
"Onyx", "Opal", "Pearl", { "Onyx" }, { "Opal" }, { "Pearl" },
"Peridot", "Quartz", "Rhodochrosite", { "Peridot" }, { "Quartz" }, { "Rhodochrosite" },
"Rhodolite", "Ruby", "Sapphire", { "Rhodolite" }, { "Ruby" }, { "Sapphire" },
"Sardonyx", "Serpentine", "Spinel", { "Sardonyx" }, { "Serpentine" }, { "Spinel" },
"Tiger eye", "Topaz", "Tourmaline", { "Tiger eye" }, { "Topaz" }, { "Tourmaline" },
"Turquoise", "Zircon", { "Turquoise" }, { "Zircon" }
}; };
struct words wood[NWOOD] = { struct words wood[NWOOD] = {
"Avocado wood", "Balsa", "Banyan", "Birch", {"Avocado wood"}, {"Balsa"}, {"Banyan"}, {"Birch"},
"Cedar", "Cherry", "Cinnabar", "Dogwood", {"Cedar"}, {"Cherry"}, {"Cinnabar"}, {"Dogwood"},
"Driftwood", "Ebony", "Eucalyptus", "Hemlock", {"Driftwood"}, {"Ebony"}, {"Eucalyptus"}, {"Hemlock"},
"Ironwood", "Mahogany", "Manzanita", "Maple", {"Ironwood"}, {"Mahogany"}, {"Manzanita"}, {"Maple"},
"Oak", "Pine", "Redwood", "Rosewood", {"Oak"}, {"Pine"}, {"Redwood"}, {"Rosewood"},
"Teak", "Walnut", "Aloe", "Sandalwood", {"Teak"}, {"Walnut"}, {"Aloe"}, {"Sandalwood"}
}; };
struct words metal[NMETAL] = { struct words metal[NMETAL] = {
"Aluminium", "Bone", "Brass", "Bronze", {"Aluminium"}, {"Bone"}, {"Brass"}, {"Bronze"},
"Copper", "Chromium", "Iron", "Lead", {"Copper"}, {"Chromium"}, {"Iron"}, {"Lead"},
"Magnesium", "Pewter", "Platinum", "Silver", {"Magnesium"}, {"Pewter"}, {"Platinum"}, {"Silver"},
"Steel", "Tin", "Titanium", "Zinc", {"Steel"}, {"Tin"}, {"Titanium"}, {"Zinc"}
}; };
/* /*

View file

@ -238,7 +238,7 @@ new(int size)
register char *space = ALLOC(size); register char *space = ALLOC(size);
if (space == NULL) { if (space == NULL) {
sprintf(prbuf,"Rogue ran out of memory (used = %d, wanted = %d).", sprintf(prbuf,"Rogue ran out of memory (used = %ld, wanted = %d).",
md_memused(), size); md_memused(), size);
fatal(prbuf); fatal(prbuf);
} }

View file

@ -21,7 +21,7 @@ struct cell {
char x_pos; char x_pos;
}; };
struct b_cellscells { struct b_cellscells {
char num_pos; /* number of frontier cells next to you */ unsigned char num_pos; /* number of frontier cells next to you */
struct cell conn[4]; /* the y,x position of above cell */ struct cell conn[4]; /* the y,x position of above cell */
} b_cells; } b_cells;

View file

@ -521,9 +521,10 @@ quaff(int which, int kind, int flags, bool is_potion)
fuse(sight, NULL, SEEDURATION, AFTER); fuse(sight, NULL, SEEDURATION, AFTER);
light(&hero); light(&hero);
} }
else else {
msg("The darkness around you thickens. "); msg("The darkness around you thickens. ");
lengthen(sight, SEEDURATION); lengthen(sight, SEEDURATION);
}
} }
else { else {
if (off(player, CANSEE)) { if (off(player, CANSEE)) {

View file

@ -180,7 +180,7 @@ writelog(unsigned long amount, int flags, short monst)
else else
return; return;
/* Write the line */ /* Write the line */
fprintf(logfile, "%d %d %s %d %s %d %d %d %c %s\n", time(NULL), amount, fprintf(logfile, "%ld %ld %s %d %s %d %d %d %c %s\n", time(NULL), amount,
whoami, pstats.s_lvl, char_class[char_type].name, level, max_level, whoami, pstats.s_lvl, char_class[char_type].name, level, max_level,
quest_item, had_quest, fate); quest_item, had_quest, fate);
fclose(logfile); fclose(logfile);

View file

@ -166,7 +166,8 @@ struct character_types char_class[NUM_CHARTYPES] = {
*/ */
struct words abilities[NUMABILITIES] = { struct words abilities[NUMABILITIES] = {
"Intelligence", "Strength", "Wisdom", "Dexterity", "Constitution", "Charisma" { "Intelligence" }, { "Strength" }, { "Wisdom" },
{ "Dexterity" }, { "Constitution" }, { "Charisma" }
}; };
/* /*