Remove trailing whitespace.

This commit is contained in:
Rodney W. Grimes 1995-05-30 03:37:36 +00:00
parent 2162b2d226
commit 010f5413b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8856
101 changed files with 521 additions and 521 deletions

View File

@ -11,7 +11,7 @@ GAMES= ATC_scores Game_List Killer crossover default easy game_2
CLEANFILES=grammar.c y.tab.h lex.c
HIDEGAME=hidegame
beforeinstall:
beforeinstall:
(cd ${.CURDIR}/games; install -c -o ${BINOWN} -g ${BINGRP} -m 400 \
${GAMES} ${DESTDIR}/usr/share/games/atc)

View File

@ -115,7 +115,7 @@ init_gr()
initscr();
setbuf(stdout, buffer);
input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0);
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,
COLS - PLANE_COLS);
planes = newwin(LINES - INPUT_LINES, PLANE_COLS, 0, COLS - PLANE_COLS);
}
@ -204,7 +204,7 @@ setup_screen(scp)
wmove(radar, scp->airport[i].y, scp->airport[i].x * 2);
waddstr(radar, str);
}
overwrite(radar, cleanradar);
wrefresh(radar);
wrefresh(credit);

View File

@ -93,8 +93,8 @@ typedef struct {
#define NUMSTATES NUMELS(st)
char *setplane(), *circle(), *left(), *right(), *Left(), *Right(),
*beacon(), *ex_it(), *climb(), *descend(), *setalt(), *setrelalt(),
char *setplane(), *circle(), *left(), *right(), *Left(), *Right(),
*beacon(), *ex_it(), *climb(), *descend(), *setalt(), *setrelalt(),
*benum(), *to_dir(), *rel_dir(), *delayb(), *mark(), *unmark(),
*airport(), *turn(), *ignore();
@ -104,17 +104,17 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ CRTOKEN, -1, "", NULL },
#endif
{ HELPTOKEN, 12, " [a-z]<ret>", NULL }},
state1[] = { { 't', 2, " turn", turn },
{ 'a', 3, " altitude:", NULL },
state1[] = { { 't', 2, " turn", turn },
{ 'a', 3, " altitude:", NULL },
{ 'c', 4, " circle", circle },
{ 'm', 7, " mark", mark },
{ 'u', 7, " unmark", unmark },
{ 'i', 7, " ignore", ignore },
{ HELPTOKEN, 12, " tacmui", NULL }},
state2[] = { { 'l', 6, " left", left },
{ 'r', 6, " right", right },
state2[] = { { 'l', 6, " left", left },
{ 'r', 6, " right", right },
{ 'L', 4, " left 90", Left },
{ 'R', 4, " right 90", Right },
{ 'R', 4, " right 90", Right },
{ 't', 11, " towards", NULL },
{ 'w', 4, " to 0", to_dir },
{ 'e', 4, " to 45", to_dir },
@ -125,14 +125,14 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ 'a', 4, " to 270", to_dir },
{ 'q', 4, " to 315", to_dir },
{ HELPTOKEN, 12, " lrLRt<dir>", NULL }},
state3[] = { { '+', 10, " climb", climb },
{ 'c', 10, " climb", climb },
{ '-', 10, " descend", descend },
{ 'd', 10, " descend", descend },
state3[] = { { '+', 10, " climb", climb },
{ 'c', 10, " climb", climb },
{ '-', 10, " descend", descend },
{ 'd', 10, " descend", descend },
{ NUMTOKEN, 7, " %c000 feet", setalt },
{ HELPTOKEN, 12, " +-cd[0-9]", NULL }},
state4[] = { { '@', 9, " at", NULL },
{ 'a', 9, " at", NULL },
state4[] = { { '@', 9, " at", NULL },
{ 'a', 9, " at", NULL },
{ RETTOKEN, -1, "", NULL },
#ifdef SYSV
{ CRTOKEN, -1, "", NULL },
@ -150,9 +150,9 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ 'z', 4, " 225", rel_dir },
{ 'a', 4, " 270", rel_dir },
{ 'q', 4, " 315", rel_dir },
{ RETTOKEN, -1, "", NULL },
{ RETTOKEN, -1, "", NULL },
#ifdef SYSV
{ CRTOKEN, -1, "", NULL },
{ CRTOKEN, -1, "", NULL },
#endif
{ HELPTOKEN, 12, " @a<dir><ret>",NULL }},
state7[] = { { RETTOKEN, -1, "", NULL },
@ -167,7 +167,7 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ HELPTOKEN, 12, " b*", NULL }},
state10[] = { { NUMTOKEN, 7, " %c000 ft", setrelalt},
{ HELPTOKEN, 12, " [0-9]", NULL }},
state11[] = { { 'b', 8, " beacon #", beacon },
state11[] = { { 'b', 8, " beacon #", beacon },
{ '*', 8, " beacon #", beacon },
{ 'e', 8, " exit #", ex_it },
{ 'a', 8, " airport #", airport },
@ -272,7 +272,7 @@ getcommand()
return (1); /* forced update */
dest_type = T_NODEST;
for (i = 0; i < level; i++) {
func = st[stack[i].state].rule[stack[i].rule].func;
if (func != NULL)

View File

@ -99,7 +99,7 @@ delete(l, p)
{
if (l->head == NULL)
loser(p, "deleted a non-existant plane! Get help!");
if (l->head == p && l->tail == p)
l->head = l->tail = NULL;
else if (l->head == p) {

View File

@ -106,7 +106,7 @@ log_score(list_em)
return (-1);
}
/*
* This is done to take advantage of stdio, while still
* This is done to take advantage of stdio, while still
* allowing a O_CREAT during the open(2) of the log file.
*/
fp = fdopen(fd, "r+");
@ -126,10 +126,10 @@ log_score(list_em)
}
for (;;) {
good = fscanf(fp, "%s %s %s %d %d %d",
score[num_scores].name,
score[num_scores].host,
score[num_scores].name,
score[num_scores].host,
score[num_scores].game,
&score[num_scores].planes,
&score[num_scores].planes,
&score[num_scores].time,
&score[num_scores].real_time);
if (good != 6 || ++num_scores >= NUM_SCORES)
@ -137,7 +137,7 @@ log_score(list_em)
}
if (!test_mode && !list_em) {
if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) {
fprintf(stderr,
fprintf(stderr,
"getpwuid failed for uid %d. Who are you?\n",
getuid());
return (-1);
@ -187,7 +187,7 @@ log_score(list_em)
if (num_scores < NUM_SCORES)
num_scores++;
bcopy(&score[i],
&score[num_scores - 1],
&score[num_scores - 1],
sizeof (score[i]));
bcopy(&thisscore, &score[i],
sizeof (score[i]));
@ -197,7 +197,7 @@ log_score(list_em)
}
}
if (!found && !changed && num_scores < NUM_SCORES) {
bcopy(&thisscore, &score[num_scores],
bcopy(&thisscore, &score[num_scores],
sizeof (score[num_scores]));
num_scores++;
changed++;
@ -212,7 +212,7 @@ log_score(list_em)
rewind(fp);
for (i = 0; i < num_scores; i++)
fprintf(fp, "%s %s %s %d %d %d\n",
score[i].name, score[i].host,
score[i].name, score[i].host,
score[i].game, score[i].planes,
score[i].time, score[i].real_time);
} else {
@ -230,7 +230,7 @@ log_score(list_em)
/* lock will evaporate upon close */
#endif
fclose(fp);
printf("%2s: %-8s %-8s %-18s %4s %9s %4s\n", "#", "name", "host",
printf("%2s: %-8s %-8s %-18s %4s %9s %4s\n", "#", "name", "host",
"game", "time", "real time", "planes safe");
puts("-------------------------------------------------------------------------------");
for (i = 0; i < num_scores; i++) {

View File

@ -75,7 +75,7 @@ main(ac, av)
name = *av++;
while (*av) {
#ifndef SAVEDASH
if (**av == '-')
if (**av == '-')
*++*av;
else
break;
@ -106,7 +106,7 @@ main(ac, av)
file = *av;
av++;
break;
default:
default:
fprintf(stderr, "Unknown option '%c'\n", *ptr,
name);
f_usage++;
@ -118,7 +118,7 @@ main(ac, av)
srandom(seed);
if (f_usage)
fprintf(stderr,
fprintf(stderr,
"Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed]\n",
name);
if (f_showscore)
@ -132,7 +132,7 @@ main(ac, av)
buf[strlen(buf) - 1] = '\0';
puts(buf);
}
if (f_usage || f_showscore || f_list || f_printpath)
exit(0);

View File

@ -157,10 +157,10 @@ update()
if (pp->xpos == sp->airport[i].x &&
pp->ypos == sp->airport[i].y) {
if (pp->dest_type == T_AIRPORT)
loser(pp,
loser(pp,
"landed at the wrong airport.");
else
loser(pp,
loser(pp,
"landed instead of exited.");
}
loser(pp, "crashed on the ground.");
@ -171,10 +171,10 @@ update()
if (pp->xpos == sp->exit[i].x &&
pp->ypos == sp->exit[i].y) {
if (pp->dest_type == T_EXIT)
loser(pp,
loser(pp,
"exited via the wrong exit.");
else
loser(pp,
loser(pp,
"exited instead of landed.");
}
loser(pp, "illegally left the flight arena.");
@ -228,7 +228,7 @@ command(pp)
buf[0] = '\0';
bp = buf;
(void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude,
(void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude,
(pp->fuel < LOWFUEL) ? '*' : ' ',
(pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no);
@ -245,7 +245,7 @@ command(pp)
(void)sprintf(bp, " @ B%d", pp->delayd_no);
bp = index(buf, '\0');
if (*comm_start == '\0' &&
if (*comm_start == '\0' &&
(pp->status == S_UNMARKED || pp->status == S_IGNORED))
strcpy(bp, "---------");
return (buf);
@ -267,7 +267,7 @@ number(l)
return (-1);
else if (l >= 'a' && l <= 'z')
return (l - 'a');
else
else
return (l - 'A');
}

View File

@ -64,19 +64,19 @@ int goodmoves[MAXGMOV];
int probmoves[MAXGMOV];
int brown[] = { /* brown position table */
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
};
int white[] = { /* white position table */
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
};
int probability[] = {
0, 11, 12, 13, 14, 15, 16,
0, 11, 12, 13, 14, 15, 16,
06, 05, 04, 03, 02, 01
};
@ -688,7 +688,7 @@ prtbrd()
fprintf(stdout, "%4d",k);
fprintf(stdout, " ");
for(k = 7; k <= 12; k++)
fprintf(stdout, "%4d",k);
fprintf(stdout, "%4d",k);
putchar('\n');
numline(brown, white, 1, 6);
fprintf(stdout, " ");

View File

@ -512,7 +512,7 @@ newpos () {
for (i = 0; i < c; i++)
tputs (ND,1,addbuf);
break;
/* down and over */
case 3:
for (i = 0; i < r-curr; i++)
@ -520,7 +520,7 @@ newpos () {
for (i = 0; i < c-curc; i++)
tputs (ND,1,addbuf);
break;
/* down and back */
case 4:
for (i = 0; i < r-curr; i++)
@ -528,7 +528,7 @@ newpos () {
for (i = 0; i < curc-c; i++)
addbuf ('\010');
break;
/* CR and up and over */
case 5:
addbuf ('\015');
@ -537,7 +537,7 @@ newpos () {
for (i = 0; i < c; i++)
tputs (ND,1,addbuf);
break;
/* up and over */
case 6:
for (i = 0; i < curr-r; i++)
@ -545,7 +545,7 @@ newpos () {
for (i = 0; i < c-curc; i++)
tputs (ND,1,addbuf);
break;
/* up and back */
case 7:
for (i = 0; i < curr-r; i++)

View File

@ -44,7 +44,7 @@ int r2, val;
register int i, j;
if (r1 == 0) {
for (i = 0; i < 6; i++)
for (i = 0; i < 6; i++)
for (j = 0; j < 6; j++)
table[i][j] = 0;
return;

View File

@ -39,7 +39,7 @@ static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93";
makmove (i)
register int i;
{
register int n, d;
int max;

View File

@ -136,7 +136,7 @@ register char *l;
if (trace == NULL)
trace = fopen ("bgtrace","w");
fprintf (trace,"writel: \"");
for (s = l; *s; s++) {
if (*s < ' ' || *s == '\177')

View File

@ -108,45 +108,45 @@ char **argv;
init();
while (i)
switch (i) {
case 1:
leave();
case 2:
if (i = text(intro1))
break;
wrboard();
if (i = text(intro2))
break;
case 3:
if (i = text(moves))
break;
case 4:
if (i = text(remove))
break;
case 5:
if (i = text(hits))
break;
case 6:
if (i = text(endgame))
break;
case 7:
if (i = text(doubl))
break;
case 8:
if (i = text(stragy))
break;
case 9:
if (i = text(prog))
break;
case 10:
if (i = text(lastch))
break;

View File

@ -140,7 +140,7 @@ news()
fight(WOODSMAN,50);
}
switch(position){
case 267:
case 257: /* entering a cave */
case 274:
@ -225,7 +225,7 @@ crash()
if (!location[position].flyhere || (testbit(location[position].objects,LAND) && fuel <= 0)){
if (!location[position].flyhere)
puts("You're flying too low. We're going to crash!");
else{
else{
puts("You're out of fuel. We'll have to crash land!");
if (!location[position].down){
puts("Your viper strikes the ground and explodes into firey fragments.");

View File

@ -48,7 +48,7 @@ wearit() /* synonyms = {sheathe, sheath} */
value = wordvalue[wordnumber];
for (n=0; objsht[value][n]; n++);
switch(value){
case -1:
puts("Wear what?");
return(firstnumber);
@ -86,11 +86,11 @@ wearit() /* synonyms = {sheathe, sheath} */
}
else if (testbit(wear,value))
printf("You are already wearing the %s.\n", objsht[value]);
else
else
printf("You aren't holding the %s.\n", objsht[value]);
if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
wordnumber++;
else
else
return(firstnumber);
} /* end switch */
} /* end while */
@ -166,7 +166,7 @@ murder()
printf("Your %s should do the trick.\n",objsht[n]);
while (wordtype[++wordnumber] == ADJS);
switch(wordvalue[wordnumber]){
case NORMGOD:
if (testbit(location[position].objects,BATHGOD)){
puts("The goddess's head slices off. Her corpse floats in the water.");
@ -290,7 +290,7 @@ follow()
notes[CANTSEE] = 1;
return(0);
}
else
else
puts("There is no one to follow.");
return(-1);
}

View File

@ -57,7 +57,7 @@ dig()
puts("Nothing happens.");
}
}
else
else
puts("You don't have a shovel.");
}
@ -216,7 +216,7 @@ shoot()
if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS){
time++;
switch(wordvalue[wordnumber]){
case DOOR:
switch(position){
case 189:

View File

@ -88,7 +88,7 @@ unsigned int from[];
if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS)
switch(wordvalue[wordnumber]){
case SWORD:
if (testbit(from, SWORD)){
wordtype[wordnumber--] = OBJECT;
@ -169,7 +169,7 @@ unsigned int from[];
clearbit(location[position].objects,BATHGOD);
} else if (!testbit(location[position].objects,BATHGOD))
puts("You're in no position to take her.");
else
else
puts("She moves away from you.");
break;
@ -191,7 +191,7 @@ throw(name)
first = wordnumber;
if (drop(name) != -1){
switch(wordvalue[wordnumber]){
case AHEAD:
deposit = ahead;
break;
@ -253,7 +253,7 @@ throw(name)
}
if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
wordnumber++;
else
else
return(first);
}
return(first);
@ -264,7 +264,7 @@ throw(name)
drop(name)
char *name;
{
int firstnumber, value;
firstnumber = wordnumber;
@ -333,7 +333,7 @@ eat()
while(wordnumber <= wordcount){
value = wordvalue[wordnumber];
switch(value){
case -1:
puts("Eat what?");
return(firstnumber);
@ -371,7 +371,7 @@ eat()
printf("You aren't holding the %s.\n", objsht[value]);
if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
wordnumber++;
else
else
return(firstnumber);
} /* end switch */
} /* end while */

View File

@ -57,7 +57,7 @@ kiss()
break;
default:
puts("She's gone limp.");
}
break;
case NATIVE:

View File

@ -72,7 +72,7 @@ int enemy,strength;
hurt = rnd(50)%(WEIGHT-carrying)-card(injuries,NUMOFINJURIES)-encumber - exhaustion;
else if (testbit(inven,KNIFE) || testbit(inven,MALLET) || testbit(inven,CHAIN) || testbit(inven,MACE) || testbit(inven,HALBERD))
hurt = rnd(15) - card(injuries,NUMOFINJURIES) - exhaustion;
else
else
hurt = rnd(7) - encumber;
if (hurt < 5)
switch(rnd(3)){
@ -233,7 +233,7 @@ int enemy,strength;
cypher();
time--;
break;
default:
puts("You don't have a chance, he is too quick.");
break;

View File

@ -79,19 +79,19 @@ cypher()
return(-1);
lflag = 0;
break;
case AHEAD:
if (!move(ahead, AHEAD))
return(-1);
lflag = 0;
break;
case BACK:
if (!move(back, BACK))
return(-1);
lflag = 0;
break;
case SHOOT:
if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){
for (n=0; n < NUMOFOBJECTS; n++)
@ -102,7 +102,7 @@ cypher()
wordnumber++;
wordnumber++;
}
else
else
shoot();
break;
@ -116,7 +116,7 @@ cypher()
wordnumber++;
wordnumber++;
}
else
else
take(location[position].objects);
break;
@ -131,7 +131,7 @@ cypher()
wordnumber++;
wordnumber++;
}
else
else
drop("Dropped");
break;
@ -146,7 +146,7 @@ cypher()
wordnumber = throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown");
}
wordnumber += 2;
} else
} else
throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown");
break;
@ -159,7 +159,7 @@ cypher()
}
wordnumber += 2;
}
else
else
takeoff();
break;
@ -174,7 +174,7 @@ cypher()
}
wordnumber += 2;
}
else
else
draw();
break;
@ -189,7 +189,7 @@ cypher()
}
wordnumber += 2;
}
else
else
puton();
break;
@ -203,7 +203,7 @@ cypher()
}
wordnumber += 2;
}
else
else
wearit();
break;
@ -218,7 +218,7 @@ cypher()
}
wordnumber += 2;
}
else
else
eat();
break;
@ -239,7 +239,7 @@ cypher()
}
else
puts("You aren't carrying anything.");
if (ucard(wear)){
puts("\nYou are wearing:\n");
for (n=0; n < NUMOFOBJECTS; n++)
@ -272,7 +272,7 @@ cypher()
puts("\nYour match splutters out.");
matchlight = 0;
}
} else
} else
puts("I can't see anything.");
return(-1);
break;
@ -320,7 +320,7 @@ cypher()
else
puts("You aren't a wizard.");
break;
case SCORE:
printf("\tPLEASURE\tPOWER\t\tEGO\n");
printf("\t%3d\t\t%3d\t\t%3d\n\n",pleasure,power,ego);
@ -373,7 +373,7 @@ cypher()
case LAUNCH:
if (!launch())
return(-1);
else
else
lflag = 0;
break;
@ -420,7 +420,7 @@ cypher()
return(-1);
break;
}
if (wordnumber < wordcount && *words[wordnumber++] == ',')
continue;

View File

@ -60,7 +60,7 @@
#define CONJ 5
/* words numbers */
#define KNIFE 0
#define KNIFE 0
#define SWORD 1
#define LAND 2
#define WOODSMAN 3
@ -175,7 +175,7 @@
#define RIDE 1047
#define DRIVE 1048
#define SCORE 1049
#define BURY 1050
#define BURY 1050
#define JUMP 1051
#define KICK 1052
@ -192,7 +192,7 @@
#define CANTLAUNCH 0
#define LAUNCHED 1
#define CANTSEE 2
#define CANTMOVE 3
#define CANTMOVE 3
#define JINXED 4
#define DUG 5
#define NUMOFNOTES 6

View File

@ -45,7 +45,7 @@ getcom(buf, size, prompt, error)
char *prompt, *error;
{
for (;;) {
fputs(prompt, stdout);
fputs(prompt, stdout);
if (fgets(buf, size, stdin) == 0) {
clearerr(stdin);
continue;

View File

@ -186,14 +186,14 @@ char *ouch[NUMOFINJURIES] = {
"a few broken ribs",
"a broken leg and torn ligaments",
"a broken back and ruptured spleen",
"some deep incisions and a loss of blood",
"some deep incisions and a loss of blood",
"a fractured skull and mashed face",
"a broken neck"
};
int objwt[NUMOFOBJECTS] = {
1, 5, 0, 10, 15, 2, 10, 10,
3, 5, 50, 2500, 2, 1, 100, 1,
3, 5, 50, 2500, 2, 1, 100, 1,
2, 1, 1, 1, 60, 10, 5, 0,
50, 5, 15, 5, 1, 20, 10, 10,
0, 0, 0, 0, 1, 0, 0, 1,

View File

@ -79,7 +79,7 @@ struct room here;
ahead = here.north;
back = here.south;
break;
case SOUTH:
left = here.east;
right = here.west;
@ -143,7 +143,7 @@ char option;
return("left");
case EAST:
return("ahead");
case WEST:
case WEST:
return(option == '+' ? "behind you" : "back");
}

View File

@ -1,4 +1,4 @@
/*
/*
* bs.c - original author: Bruce Holloway
* salvo option by: Chuck A DeGaul
* with improved user interface, autoconfiguration and code cleanup
@ -260,7 +260,7 @@ static void intro()
init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
#endif /* A_COLOR */
}
}
/* VARARGS1 */
static void prompt(n, f, s)
@ -468,7 +468,7 @@ static void initgame()
placeship(PLAYER, ss, TRUE);
error((char *)NULL);
ss->placed = TRUE;
}
}
else if (c == 'R')
{
prompt(1, "Placing the rest of your fleet at random...");
@ -480,7 +480,7 @@ static void initgame()
ss->placed = TRUE;
}
error((char *)NULL);
}
}
else if (strchr("hjkl8462", c))
{
ss->x = curx;
@ -492,7 +492,7 @@ static void initgame()
case 'j': case '2': ss->dir = S; break;
case 'h': case '4': ss->dir = W; break;
case 'l': case '6': ss->dir = E; break;
}
}
if (checkplace(PLAYER, ss, TRUE))
{
@ -744,7 +744,7 @@ int x, y;
for (i = -1; i <= ss->length; ++i)
{
int x, y;
x = bx + i * xincr[ss->dir];
y = by + i * yincr[ss->dir];
if (ONBOARD(x, y))
@ -1236,7 +1236,7 @@ char *argv[];
i = 0;
}
}
}
}
}
else
while(turn ? cputurn() : plyturn())

View File

@ -174,7 +174,7 @@ int uid;
#define maxtimecharge 3
#define valuepercardup 5
/*
* Variables associated with betting
* Variables associated with betting
*/
struct betinfo {
long hand; /* cost of dealing hand */
@ -560,7 +560,7 @@ printcard(a, b, cp)
}
/*
* procedure to move the top card from one location to the top
* procedure to move the top card from one location to the top
* of another location. The pointers always point to the top
* of the piles.
*/
@ -568,7 +568,7 @@ transit(source, dest)
struct cardtype **source, **dest;
{
struct cardtype *temp;
temp = *source;
*source = (*source)->next;
temp->next = *dest;
@ -616,7 +616,7 @@ fndbase(cp, column, row)
game.wins += valuepercardup;
total.wins += valuepercardup;
}
} else
} else
nomore = TRUE;
} while (nomore == FALSE);
}
@ -754,7 +754,7 @@ struct cardtype *cp;
move(msgrow, msgcol);
printw("Error: no cards to move");
return (FALSE);
} else
} else
return (TRUE);
}
@ -765,14 +765,14 @@ bool
ranklower(cp1, cp2)
struct cardtype *cp1, *cp2;
{
if (cp2->rank == Ace)
if (cp2->rank == Ace)
if (cp1->rank == King)
return (TRUE);
else
else
return (FALSE);
else if (cp1->rank + 1 == cp2->rank)
return (TRUE);
else
else
return (FALSE);
}
@ -785,7 +785,7 @@ diffcolor(cp1, cp2)
{
if (cp1->color == cp2->color)
return (FALSE);
else
else
return (TRUE);
}
@ -799,15 +799,15 @@ tabok(cp, des)
if ((cp == stock) && (tableau[des] == NIL))
return (TRUE);
else if (tableau[des] == NIL)
if (stock == NIL &&
cp != bottom[0] && cp != bottom[1] &&
if (stock == NIL &&
cp != bottom[0] && cp != bottom[1] &&
cp != bottom[2] && cp != bottom[3])
return (TRUE);
else
else
return (FALSE);
else if (ranklower(cp, tableau[des]) && diffcolor(cp, tableau[des]))
return (TRUE);
else
else
return (FALSE);
}
@ -1123,7 +1123,7 @@ struct cardtype **cp;
usedtalon();
printcard(taloncol, talonrow, talon);
}
} else
} else
destinerror();
}
}
@ -1142,7 +1142,7 @@ tabprint(sour, des)
slength = length[sour];
if (slength == tabrow)
printcard(pilemap[des], dlength, tableau[sour]);
else
else
while (slength != tabrow - 1) {
tempcard = tableau[sour];
for (i=1; i<=slength-tabrow; i++)
@ -1174,7 +1174,7 @@ tabtotab(sour, des)
length[des] = length[des] + (length[sour] - (tabrow - 1));
length[sour] = tabrow - 1;
timesthru = 0;
} else
} else
destinerror();
}
}
@ -1189,11 +1189,11 @@ rankhigher(cp, let)
if (found[let]->rank == King)
if (cp->rank == Ace)
return(TRUE);
else
else
return(FALSE);
else if (cp->rank - 1 == found[let]->rank)
return(TRUE);
else
else
return(FALSE);
}
@ -1205,7 +1205,7 @@ samesuit(cp, let)
{
if (cp->suit == found[let]->suit)
return (TRUE);
else
else
return (FALSE);
}
@ -1251,7 +1251,7 @@ movetofound(cp, source)
mtfdone = TRUE;
} else
tempbase++;
else
else
tempbase++;
} while ((tempbase != 4) && !mtfdone);
if (!mtfdone)

View File

@ -7,7 +7,7 @@ SRCS= extern.c crib.c cards.c instr.c io.c score.c support.c
MAN6= cribbage.6
HIDEGAME=hidegame
beforeinstall:
beforeinstall:
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/cribbage.n \
${DESTDIR}/usr/share/games/cribbage.instr

View File

@ -243,7 +243,7 @@ load()
*/
users()
{
register int nusers, utmp;
struct utmp buf;

View File

@ -75,7 +75,7 @@ static char sccsid[] = "@(#)factor.c 8.3 (Berkeley) 3/30/94";
/*
* prime[i] is the (i-1)th prime.
*
* We are able to sieve 2^32-1 because this byte table yields all primes
* We are able to sieve 2^32-1 because this byte table yields all primes
* up to 65537 and 65537^2 > 2^32-1.
*/
extern ubig prime[];

View File

@ -4,7 +4,7 @@ PROG= fish
MAN6= fish.6
HIDEGAME=hidegame
beforeinstall:
beforeinstall:
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fish.instr \
${DESTDIR}/usr/share/games/fish.instr

View File

@ -98,7 +98,7 @@ main(argc, argv)
}
printplayer(USER);
(void)printf("get to start.\n");
for (;;) {
move = usermove();
if (!comphand[move]) {
@ -208,12 +208,12 @@ promove()
max = i;
break;
}
while (++i < RANKS)
while (++i < RANKS)
if (comphand[i] != CARDS &&
comphand[i] > comphand[max])
max = i;
return(max);
}
}
if (nrandom(1024) == 0723) {
for (i = 0; i < RANKS; ++i)
if (userhand[i] && comphand[i])
@ -340,7 +340,7 @@ printhand(hand)
for (book = i = 0; i < RANKS; i++)
if (hand[i] < CARDS)
for (j = hand[i]; --j >= 0;)
for (j = hand[i]; --j >= 0;)
PRC(i);
else
++book;

View File

@ -68,7 +68,7 @@ static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
* s - Silent. Give no summary of data processed at the end of
* the run.
* o - order the strings in alphabetic order
* i - if ordering, ignore case
* i - if ordering, ignore case
* r - randomize the order of the strings
* x - set rotated bit
*

View File

@ -62,17 +62,17 @@ int n = 0;
cbreak();
noecho();
hascolor = has_colors();
if(hascolor) {
if(hascolor) {
start_color();
init_pair(1, COLOR_BLACK, COLOR_RED);
init_pair(2, COLOR_RED, COLOR_BLACK);
init_pair(3, COLOR_WHITE, COLOR_BLACK);
attrset(COLOR_PAIR(2));
}
clear();
refresh();
while(--argc > 0) {
@ -82,7 +82,7 @@ int n = 0;
n = atoi(*argv);
}
if(hascolor) {
if(hascolor) {
attrset(COLOR_PAIR(3));
mvaddch(YBASE - 2, XBASE - 3, ACS_ULCORNER);
@ -183,8 +183,8 @@ standt(int on)
if(hascolor) {
attron(COLOR_PAIR(1));
} else {
attron(A_STANDOUT);
}
attron(A_STANDOUT);
}
} else {
if(hascolor) {
attron(COLOR_PAIR(2));

View File

@ -24,7 +24,7 @@ hack.onames.h: makedefs def.objects.h
makedefs: makedefs.c
${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${.PREFIX}.c
beforeinstall:
beforeinstall:
install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
${DESTDIR}/var/games/hackdir/perm
install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \

View File

@ -57,7 +57,7 @@
*/
/* #define MAIL */
#define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */
#define MAILCKFREQ 100
#define MAILCKFREQ 100
#define SHELL /* do not delete the '!' command */

View File

@ -207,7 +207,7 @@ register struct obj *otmp;
if(type == BURN) otmp->spe++;
return(0);
}
switch(type) {
case DUST:
case BURN:

View File

@ -93,7 +93,7 @@ monstone(mdef) register struct monst *mdef; {
}
mondead(mdef);
}
fightm(mtmp) register struct monst *mtmp; {
register struct monst *mon;

View File

@ -42,7 +42,7 @@ extern xchar dlevel;
#define ON 1
#define OFF 0
extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg,
extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg,
*uleft, *uright, *fcobj;
extern struct obj *uchain; /* defined iff PUNISHED */
extern struct obj *uball; /* defined if PUNISHED */

View File

@ -221,7 +221,7 @@ register int lowx,lowy,hix,hiy;
/* walk down since rscnt and rsmax change */
for(rsp = &rs[rsmax-1]; rsp >= rs; rsp--) {
if((lx = rsp->rlx) > hix || (ly = rsp->rly) > hiy ||
(hx = rsp->rhx) < lowx || (hy = rsp->rhy) < lowy)
continue;

View File

@ -40,7 +40,7 @@ mkobj(let) {
)
);
}
struct obj zeroobj;

View File

@ -18,7 +18,7 @@ register char ch;
init_objects(){
register int i, j, first, last, sum, end;
register char let, *tmp;
/* init base; if probs given check that they add up to 100,
/* init base; if probs given check that they add up to 100,
otherwise compute probs; shuffle descriptions */
end = SIZE(objects);
first = 0;

View File

@ -45,7 +45,7 @@ boolean from_env;
if(*opts == '!') opts++; else opts += 2;
negated = !negated;
}
if(!strncmp(opts,"standout",8)) {
flags.standout = !negated;
return;

View File

@ -148,7 +148,7 @@ dodrink() {
Blind += rn1(100,250);
seeoff(0);
break;
case POT_GAIN_LEVEL:
case POT_GAIN_LEVEL:
pluslvl();
break;
case POT_EXTRA_HEALING:
@ -280,7 +280,7 @@ register struct obj *obj;
case POT_BLINDNESS:
mon->mblinded |= 64 + rn2(64);
break;
/*
/*
case POT_GAIN_LEVEL:
case POT_LEVITATION:
case POT_FRUIT_JUICE:
@ -332,7 +332,7 @@ register struct obj *obj;
Blind += rnd(5);
seeoff(0);
break;
/*
/*
case POT_GAIN_LEVEL:
case POT_LEVITATION:
case POT_FRUIT_JUICE:

View File

@ -295,7 +295,7 @@ doread() {
known = TRUE;
pline("You smell %s close nearby.",
confused ? "something" : "food");
} else {
known = TRUE;
cls();

View File

@ -140,7 +140,7 @@ register roomno = inroom(u.ux,u.uy);
(u.uinshop != roomno + 1 || shlevel != dlevel || !shopkeeper)) {
if(shopkeeper) {
if(ESHK(shopkeeper)->billct) {
if(inroom(shopkeeper->mx, shopkeeper->my)
if(inroom(shopkeeper->mx, shopkeeper->my)
== u.uinshop - 1) /* ab@unido */
pline("Somehow you escaped the shop without paying!");
addupbill();
@ -361,7 +361,7 @@ int pass, tmp;
}
return(1);
}
if(!ESHK(shkp)->billct){
pline("You do not owe %s anything.", monnam(shkp));
if(!u.ugold){

View File

@ -36,7 +36,7 @@ startup()
error("Unknown terminal type: %s.", term);
if(pc = tgetstr("pc", &tbufptr))
PC = *pc;
if(!(BC = tgetstr("bc", &tbufptr))) {
if(!(BC = tgetstr("bc", &tbufptr))) {
if(!tgetflag("bs"))
error("Terminal must backspace.");
BC = tbufptr;

View File

@ -245,7 +245,7 @@ getlock()
error("cannot close lock");
}
}
}
}
#ifdef MAIL
@ -393,7 +393,7 @@ boolean away;
md->my = fy;
}
break;
}
}
}
tmp_at(-1,-1); /* close call */
}

View File

@ -223,7 +223,7 @@ treasureroom(lv)
for (tx=1+rnd(10); tx<MAXX-10; tx+=10)
if ( (lv==MAXLEVEL-1) || (lv==MAXLEVEL+MAXVLEVEL-1) || rnd(13)==2)
{
xsize = rnd(6)+3; ysize = rnd(3)+3;
xsize = rnd(6)+3; ysize = rnd(3)+3;
ty = rnd(MAXY-9)+1; /* upper left corner of room */
if (lv==MAXLEVEL-1 || lv==MAXLEVEL+MAXVLEVEL-1)
troom(lv,xsize,ysize,tx=tx+rnd(MAXX-24),ty,rnd(3)+6);
@ -232,8 +232,8 @@ treasureroom(lv)
}
/*
* subroutine to create a treasure room of any size at a given location
* room is filled with objects and monsters
* subroutine to create a treasure room of any size at a given location
* room is filled with objects and monsters
* the coordinate given is that of the upper left corner of the room
*/
troom(lv,xsize,ysize,tx,ty,glyph)
@ -247,7 +247,7 @@ troom(lv,xsize,ysize,tx,ty,glyph)
for (j=ty; j<ty+ysize; j++)
for (i=tx; i<tx+xsize; i++) /* now put in the walls */
{
item[i][j]=OWALL; mitem[i][j]=0;
item[i][j]=OWALL; mitem[i][j]=0;
}
for (j=ty+1; j<ty+ysize-1; j++)
for (i=tx+1; i<tx+xsize-1; i++) /* now clear out interior */

View File

@ -47,7 +47,7 @@ static char aa2[] = "apprentice demi-god";
static char aa3[] = " minor demi-god ";
static char aa4[] = " major demi-god ";
static char aa5[] = " minor deity ";
static char aa6[] = " major deity ";
static char aa6[] = " major deity ";
static char aa7[] = " novice guardian ";
static char aa8[] = "apprentice guardian";
static char aa9[] = " The Creator ";
@ -456,7 +456,7 @@ char spelweird[MAXMONST+8][SPNUM] = {
/* p m d s c s w s e h c c p i b c p c h c v d l d g f f s h s t m s g s w a p */
/* r l e l h s e t n e b r h n a l l a a k p r i r l l g c l t e f p e u t l e */
/* o e x e m p b r l l l e a v l d y n s l r y t l o o r a d p l i h n m w t r */
/* bat */ { 0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0 },
/* gnome */ { 0,0,0,0,0,0, 0,0,0,0,0,0,0,5, 0,0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0 },
@ -608,7 +608,7 @@ char is_alpha[]= /* isalpha[character] = TRUE || FALSE */
};
/*
* function to create scroll numbers with appropriate probability of
* function to create scroll numbers with appropriate probability of
* occurrence
*
* 0 - armor 1 - weapon 2 - enlightenment 3 - paper

View File

@ -87,7 +87,7 @@ diag()
for (j=0; j<SPNUM; j++)
{
lprc(' '); lprcat(spelcode[j]);
lprintf(" %21s %s\n",spelname[j],speldescript[j]);
lprintf(" %21s %s\n",spelname[j],speldescript[j]);
}
lprcat("\n\nFor the c[] array:\n");

View File

@ -100,7 +100,7 @@ bot_hpx()
{
recalc(); bot_linex();
}
else botsub(makecode(HP,5,19),"%3d");
else botsub(makecode(HP,5,19),"%3d");
}
/*
@ -203,7 +203,7 @@ drawscreen()
{
d_flag=1; clear(); /* clear the screen */
}
else
else
{
d_flag=0; cursor(1,1);
}
@ -229,7 +229,7 @@ drawscreen()
}
while (j <= m)
{
if (j <= m-3)
if (j <= m-3)
{
for (k=j; k<=j+3; k++) if (screen[k][i] != ' ') k=1000;
if (k < 1000)
@ -287,7 +287,7 @@ showcell(x,y)
else switch(k=item[i][j])
{
case OWALL: case 0: case OIVTELETRAP: case OTRAPARROWIV:
case OIVDARTRAP: case OIVTRAPDOOR:
case OIVDARTRAP: case OIVTRAPDOOR:
lprc(objnamelist[k]); break;
default: setbold(); lprc(objnamelist[k]); resetbold();
@ -311,8 +311,8 @@ show1cell(x,y)
if ((k=mitem[x][y]) != 0) lprc(monstnamelist[k]);
else switch(k=item[x][y])
{
case OWALL: case 0: case OIVTELETRAP: case OTRAPARROWIV:
case OIVDARTRAP: case OIVTRAPDOOR:
case OWALL: case 0: case OIVTELETRAP: case OTRAPARROWIV:
case OIVDARTRAP: case OIVTRAPDOOR:
lprc(objnamelist[k]); break;
default: setbold(); lprc(objnamelist[k]); resetbold();

View File

@ -23,7 +23,7 @@ extern int score[],srcount,dropflag;
extern int random;/* the random number seed */
extern short playerx,playery,lastnum;
extern char cheat,level,monstnamelist[];
extern char lastmonst[],*what[],*who[];
extern char lastmonst[],*what[],*who[];
extern char winner[];
extern char logname[],monstlevel[];
extern char sciv[SCORESIZE+1][26][2],*potionname[],*scrollname[];
@ -208,7 +208,7 @@ losemspells(x)
int lev;
function to return monster number for a randomly selected monster
for the given cave level
for the given cave level
*/
makemonst(lev)
register int lev;
@ -251,7 +251,7 @@ recalc()
{
register int i,j,k;
c[AC] = c[MOREDEFENSES];
if (c[WEAR] >= 0)
if (c[WEAR] >= 0)
switch(iven[c[WEAR]])
{
case OSHIELD: c[AC] += 2 + ivenarg[c[WEAR]]; break;
@ -324,7 +324,7 @@ quit()
if ((i == 'n') || (i == '\33')) { lprcat(" no"); lflush(); return; }
lprcat("\n"); setbold(); lprcat("Yes"); resetbold(); lprcat(" or ");
setbold(); lprcat("No"); resetbold(); lprcat(" please? Do you want to quit? ");
}
}
}
/*
@ -387,7 +387,7 @@ drop_object(k)
item[playerx][playery] = itm;
iarg[playerx][playery] = ivenarg[k];
srcount=0; lprcat("\n You drop:"); show3(k); /* show what item you dropped*/
know[playerx][playery] = 0; iven[k]=0;
know[playerx][playery] = 0; iven[k]=0;
if (c[WIELD]==k) c[WIELD]= -1; if (c[WEAR]==k) c[WEAR] = -1;
if (c[SHIELD]==k) c[SHIELD]= -1;
adjustcvalues(itm,ivenarg[k]);
@ -430,7 +430,7 @@ enchweapon()
*/
pocketfull()
{
register int i,limit;
register int i,limit;
if ((limit = 15+(c[LEVEL]>>1)) > 26) limit=26;
for (i=0; i<limit; i++) if (iven[i]==0) return(0);
return(1);

View File

@ -219,7 +219,7 @@ struct sphere
#define OSCROLL 41
#define OPOTION 42
#define OBOOK 43
#define OCHEST 44
#define OCHEST 44
#define OAMULET 45
#define OORBOFDRAGON 46
@ -260,48 +260,48 @@ struct sphere
/* defines for the monsters as objects */
#define BAT 1
#define GNOME 2
#define HOBGOBLIN 3
#define JACKAL 4
#define KOBOLD 5
#define ORC 6
#define BAT 1
#define GNOME 2
#define HOBGOBLIN 3
#define JACKAL 4
#define KOBOLD 5
#define ORC 6
#define SNAKE 7
#define CENTIPEDE 8
#define JACULI 9
#define TROGLODYTE 10
#define ANT 11
#define EYE 12
#define JACULI 9
#define TROGLODYTE 10
#define ANT 11
#define EYE 12
#define LEPRECHAUN 13
#define NYMPH 14
#define QUASIT 15
#define RUSTMONSTER 16
#define ZOMBIE 17
#define ASSASSINBUG 18
#define BUGBEAR 19
#define HELLHOUND 20
#define ICELIZARD 21
#define CENTAUR 22
#define TROLL 23
#define YETI 24
#define WHITEDRAGON 25
#define ELF 26
#define CUBE 27
#define METAMORPH 28
#define VORTEX 29
#define ZILLER 30
#define VIOLETFUNGI 31
#define WRAITH 32
#define FORVALAKA 33
#define LAMANOBE 34
#define OSEQUIP 35
#define ROTHE 36
#define XORN 37
#define VAMPIRE 38
#define INVISIBLESTALKER 39
#define POLTERGEIST 40
#define DISENCHANTRESS 41
#define SHAMBLINGMOUND 42
#define NYMPH 14
#define QUASIT 15
#define RUSTMONSTER 16
#define ZOMBIE 17
#define ASSASSINBUG 18
#define BUGBEAR 19
#define HELLHOUND 20
#define ICELIZARD 21
#define CENTAUR 22
#define TROLL 23
#define YETI 24
#define WHITEDRAGON 25
#define ELF 26
#define CUBE 27
#define METAMORPH 28
#define VORTEX 29
#define ZILLER 30
#define VIOLETFUNGI 31
#define WRAITH 32
#define FORVALAKA 33
#define LAMANOBE 34
#define OSEQUIP 35
#define ROTHE 36
#define XORN 37
#define VAMPIRE 38
#define INVISIBLESTALKER 39
#define POLTERGEIST 40
#define DISENCHANTRESS 41
#define SHAMBLINGMOUND 42
#define YELLOWMOLD 43
#define UMBERHULK 44
#define GNOMEKING 45

View File

@ -1,7 +1,7 @@
/* help.c Larn is copyrighted 1986 by Noah Morgan. */
#include "header.h"
/*
* help function to display the help info
* help function to display the help info
*
* format of the .larn.help file
*

View File

@ -43,7 +43,7 @@
* cursors() position cursor at [1,24] (saves memory)
* cl_line(x,y) Clear line at [1,y] and leave cursor at [x,y]
* cl_up(x,y) Clear screen from [x,1] to current line.
* cl_dn(x,y) Clear screen from [1,y] to end of display.
* cl_dn(x,y) Clear screen from [1,y] to end of display.
* standout(str) Print the string in standout mode.
* set_score_output() Called when output should be literally printed.
** putchar(ch) Print one character in decoded output buffer.
@ -99,7 +99,7 @@ static char lgetwbuf[LINBUFSIZE]; /* get line (word) buffer */
/*
* setupvt100() Subroutine to set up terminal in correct mode for game
*
* Attributes off, clear screen, set scrolling region, set tty mode
* Attributes off, clear screen, set scrolling region, set tty mode
*/
setupvt100()
{
@ -109,7 +109,7 @@ setupvt100()
/*
* clearvt100() Subroutine to clean up terminal when the game is over
*
* Attributes off, clear screen, unset scrolling region, restore tty mode
* Attributes off, clear screen, unset scrolling region, restore tty mode
*/
clearvt100()
{
@ -170,7 +170,7 @@ newgame()
* and any needed arguments following it
* Note: lprintf() only supports %s, %c and %d, with width modifier and left
* or right justification.
* No correct checking for output buffer overflow is done, but flushes
* No correct checking for output buffer overflow is done, but flushes
* are done beforehand if needed.
* Returns nothing of value.
*/
@ -204,7 +204,7 @@ va_dcl
va_start(ap); /* initialize the var args pointer */
fmt = va_arg(ap, char *); /* pointer to format string */
if (lpnt >= lpend) lflush();
if (lpnt >= lpend) lflush();
outb = lpnt;
for ( ; ; )
{
@ -229,7 +229,7 @@ va_dcl
cont=0; break;
case 's': tmpb = va_arg(ap, char *);
if (wide==0) { while (*outb++ = *tmpb++); --outb; }
if (wide==0) { while (*outb++ = *tmpb++); --outb; }
else
{
n = wide - strlen(tmpb);
@ -290,7 +290,7 @@ lprint(x)
* lwrite(buf,len) write a buffer to the output buffer
* char *buf;
* int len;
*
*
* Enter with the address and number of bytes to write out
* Returns nothing of value
*/
@ -313,7 +313,7 @@ lwrite(buf,len)
lflush();
write(lfd,buf,len);
#endif VT100
}
}
else while (len)
{
if (lpnt >= lpend) lflush(); /* if buffer is full flush it */
@ -451,7 +451,7 @@ lcreat(str)
{
lpnt = lpbuf; lpend = lpbuf+BUFBIG;
if (str==NULL) return(lfd=1);
if ((lfd=creat(str,0644)) < 0)
if ((lfd=creat(str,0644)) < 0)
{
lfd=1; lprintf("error creating file <%s>\n",str); lflush(); return(-1);
}
@ -525,7 +525,7 @@ lprcat(str)
register char *str;
{
register char *str2;
if (lpnt >= lpend) lflush();
if (lpnt >= lpend) lflush();
str2 = lpnt;
while (*str2++ = *str++);
lpnt = str2 - 1;
@ -536,7 +536,7 @@ lprcat(str)
* cursor(x,y) Subroutine to set the cursor position
*
* x and y are the cursor coordinates, and lpbuff is the output buffer where
* escape sequence will be placed.
* escape sequence will be placed.
*/
static char *y_num[]= { "\33[","\33[","\33[2","\33[3","\33[4","\33[5","\33[6",
"\33[7","\33[8","\33[9","\33[10","\33[11","\33[12","\33[13","\33[14",
@ -611,9 +611,9 @@ init_term()
switch (tgetent(termbuf, term = getenv("TERM")))
{
case -1:
case -1:
write(2, "Cannot open termcap file.\n", 26); exit();
case 0:
case 0:
write(2, "Cannot find entry of ", 21);
write(2, term, strlen (term));
write(2, " in termcap\n", 12);
@ -870,9 +870,9 @@ flush_buf()
/*
* char *tmcapcnv(sd,ss) Routine to convert VT100 escapes to termcap format
*
* Processes only the \33[#m sequence (converts . files for termcap use
* Processes only the \33[#m sequence (converts . files for termcap use
*/
char *tmcapcnv(sd,ss)
char *tmcapcnv(sd,ss)
register char *sd,*ss;
{
register int tmstate=0; /* 0=normal, 1=\33 2=[ 3=# */

View File

@ -71,7 +71,7 @@ main(argc,argv)
sprintf(optsfile, "%s/.larnopts",ptr); /* the .larnopts filename */
/*
* now malloc the memory for the dungeon
* now malloc the memory for the dungeon
*/
cell = (struct cel *)malloc(sizeof(struct cel)*(MAXLEVEL+MAXVLEVEL)*MAXX*MAXY);
if (cell == 0) died(-285); /* malloc failure */
@ -96,13 +96,13 @@ main(argc,argv)
#endif VT100
/*
* now make scoreboard if it is not there (don't clear)
* now make scoreboard if it is not there (don't clear)
*/
if (access(scorefile,0) == -1) /* not there */
makeboard();
/*
* now process the command line arguments
* now process the command line arguments
*/
for (i=1; i<argc; i++)
{
@ -128,7 +128,7 @@ main(argc,argv)
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': /* for hardness */
sscanf(&argv[i][1],"%d",&hard);
sscanf(&argv[i][1],"%d",&hard);
break;
case 'h': /* print out command line arguments */
@ -174,7 +174,7 @@ main(argc,argv)
argv[0] = psname; execv(psname,argv);
}
}
else
else
unlink(psname);
}
@ -317,7 +317,7 @@ showwear()
}
/*
function to show the things player can wield only
function to show the things player can wield only
*/
showwield()
{
@ -442,7 +442,7 @@ show1(idx,str2)
show3(index)
register int index;
{
switch(iven[index])
switch(iven[index])
{
case OPOTION: show1(index,potionname); break;
case OSCROLL: show1(index,scrollname); break;
@ -530,7 +530,7 @@ parse()
case '?': yrepcount=0; help(); nomove=1; return; /* give the help screen*/
case 'S': clear(); lprcat("Saving . . ."); lflush();
case 'S': clear(); lprcat("Saving . . ."); lflush();
savegame(savefilename); wizard=1; died(-257); /* save the game - doesn't return */
case 'Z': yrepcount=0; if (c[LEVEL]>9) { oteleport(1); return; }
@ -622,7 +622,7 @@ parse()
return;
#endif
#endif
case 'P': cursors();
case 'P': cursors();
if (outstanding_taxes>0)
lprintf("\nYou presently owe %d gp in taxes.",(long)outstanding_taxes);
else
@ -654,7 +654,7 @@ run(dir)
/*
function to wield a weapon
*/
wield()
wield()
{
register int i;
while (1)
@ -722,7 +722,7 @@ dropobj()
while (1)
{
if ((i = whatitem("drop"))=='\33') return;
if (i=='*') showstr(); else
if (i=='*') showstr(); else
{
if (i=='.') /* drop some gold */
{
@ -743,7 +743,7 @@ dropobj()
{ *p=OKGOLD; i=amt/1000; amt = 1000*i; }
else
{ *p=OKGOLD; i=32767; amt = 32767000L; }
c[GOLD] -= amt;
c[GOLD] -= amt;
lprintf("You drop %d gold pieces",(long)amt);
iarg[playerx][playery]=i; bottomgold();
know[playerx][playery]=0; dropflag=1; return;

View File

@ -1,5 +1,5 @@
/*
* monster.c Larn is copyrighted 1986 by Noah Morgan.
* monster.c Larn is copyrighted 1986 by Noah Morgan.
*
* This file contains the following functions:
* ----------------------------------------------------------------------------
@ -324,7 +324,7 @@ speldamage(x)
*p=OBOOK; iarg[i][j]=level; *kn=0;
}
break;
case OTHRONE: *pm=GNOMEKING; *kn=0; *p= OTHRONE2;
hitp[i][j]=monster[GNOMEKING].hitpoints; break;
@ -409,12 +409,12 @@ speldamage(x)
for (i=0; i<MAXX; i++) /* save all items and monsters */
{
xl = item[i][j];
if (xl && xl!=OWALL && xl!=OANNIHILATION)
if (xl && xl!=OWALL && xl!=OANNIHILATION)
{
save[sc].type=0; save[sc].id=item[i][j];
save[sc++].arg=iarg[i][j];
}
if (mitem[i][j])
if (mitem[i][j])
{
save[sc].type=1; save[sc].id=mitem[i][j];
save[sc++].arg=hitp[i][j];
@ -505,7 +505,7 @@ fullhit(xx)
register int i;
if (xx<0 || xx>20) return(0); /* fullhits are out of range */
if (c[LANCEDEATH]) return(10000); /* lance of death */
i = xx * ((c[WCLASS]>>1)+c[STRENGTH]+c[STREXTRA]-c[HARDGAME]-12+c[MOREDAM]);
i = xx * ((c[WCLASS]>>1)+c[STRENGTH]+c[STREXTRA]-c[HARDGAME]-12+c[MOREDAM]);
return( (i>=1) ? i : xx );
}
@ -546,7 +546,7 @@ direct(spnum,dam,str,arg)
}
else
{
lastnum=278;
lastnum=278;
lprintf(str,"spell caster (thats you)",(long)arg);
beep(); losehp(dam); return;
}
@ -566,7 +566,7 @@ direct(spnum,dam,str,arg)
* Function to hit in a direction from a missile weapon and have it keep
* on going in that direction until its power is exhausted
* Enter with the spell number in spnum, the power of the weapon in hp,
* lprintf format string in str, the # of milliseconds to delay between
* lprintf format string in str, the # of milliseconds to delay between
* locations in delay, and the character to represent the weapon in cshow.
* Returns no value.
*/
@ -741,12 +741,12 @@ dirsub(x,y)
switch(getchar())
{
case 'b': i++;
case 'n': i++;
case 'y': i++;
case 'n': i++;
case 'y': i++;
case 'u': i++;
case 'h': i++;
case 'h': i++;
case 'k': i++;
case 'l': i++;
case 'l': i++;
case 'j': i++; goto out;
};
out:
@ -820,7 +820,7 @@ hitmonster(x,y)
if ((rnd(20) < tmp-c[HARDGAME]) || (rnd(71) < 5)) /* need at least random chance to hit */
{
lprcat("\nYou hit"); flag=1;
damag = fullhit(1);
damag = fullhit(1);
if (damag<9999) damag=rnd(damag)+1;
}
else
@ -910,7 +910,7 @@ hitplayer(x,y)
hitflag = hit2flag = hit3flag = 1;
yrepcount=0;
cursors(); ifblind(x,y);
if (c[INVISIBILITY]) if (rnd(33)<20)
if (c[INVISIBILITY]) if (rnd(33)<20)
{
lprintf("\nThe %s misses wildly",lastmonst); return;
}
@ -1002,7 +1002,7 @@ something(level)
* Enter with the cave level and a pointer to the items arg
*/
static char nobjtab[] = { 0, OSCROLL, OSCROLL, OSCROLL, OSCROLL, OPOTION,
OPOTION, OPOTION, OPOTION, OGOLDPILE, OGOLDPILE, OGOLDPILE, OGOLDPILE,
OPOTION, OPOTION, OPOTION, OGOLDPILE, OGOLDPILE, OGOLDPILE, OGOLDPILE,
OBOOK, OBOOK, OBOOK, OBOOK, ODAGGER, ODAGGER, ODAGGER, OLEATHER, OLEATHER,
OLEATHER, OREGENRING, OPROTRING, OENERGYRING, ODEXRING, OSTRRING, OSPEAR,
OBELT, ORING, OSTUDLEATHER, OSHIELD, OFLAIL, OCHAIN, O2SWORD, OPLATE,
@ -1013,7 +1013,7 @@ newobject(lev,i)
{
register int tmp=32,j;
if (level<0 || level>MAXLEVEL+MAXVLEVEL) return(0); /* correct level? */
if (lev>6) tmp=37; else if (lev>4) tmp=35;
if (lev>6) tmp=37; else if (lev>4) tmp=35;
j = nobjtab[tmp=rnd(tmp)]; /* the object type */
switch(tmp)
{
@ -1032,7 +1032,7 @@ newobject(lev,i)
case 29: case 31: *i=rund(lev/2+1); if (*i==0) return(0); break;
case 34: *i=newchain(); break;
case 36: *i=newplate(); break;
case 37: *i=newsword(); break;
case 37: *i=newsword(); break;
}
return(j);
}
@ -1067,7 +1067,7 @@ newobject(lev,i)
*
* char rustarm[ARMORTYPES][2];
* special array for maximum rust damage to armor from rustmonster
* format is: { armor type , minimum attribute
* format is: { armor type , minimum attribute
*/
#define ARMORTYPES 6
static char rustarm[ARMORTYPES][2] = { OSTUDLEATHER,-2, ORING,-4, OCHAIN,-5,
@ -1093,7 +1093,7 @@ spattack(x,xx,yy)
if (m == rustarm[i][0]) /* find his armor in table */
{
if (--ivenarg[k]< rustarm[i][1])
ivenarg[k]= rustarm[i][1]; else j=1;
ivenarg[k]= rustarm[i][1]; else j=1;
break;
}
}
@ -1162,7 +1162,7 @@ spattack(x,xx,yy)
p="\nThe %s nearly misses"; break;
}
break;
}
}
break;
case 10: p="\nThe %s hit you with his barbed tail";
@ -1326,7 +1326,7 @@ rmsphere(x,y)
{
item[x][y]=mitem[x][y]=0; know[x][y]=1;
show1cell(x,y); /* show the now missing sphere */
--c[SPHCAST];
--c[SPHCAST];
if (sp==spheres) { sp2=sp; spheres=sp->p; free((char*)sp2); }
else
{ sp2->p = sp->p; free((char*)sp); }

View File

@ -30,7 +30,7 @@ oaltar()
case 'p': lprcat(" pray\nDo you (m) give money or (j) just pray? ");
while (1) switch(getchar())
{
case 'j': if (rnd(100)<75)
case 'j': if (rnd(100)<75)
lprcat("\nnothing happens");
else if (rnd(13)<4) ohear();
else if (rnd(43) == 10)
@ -212,7 +212,7 @@ ochest()
lprcat("\nYou begin to lose hand to eye coordination!");
beep();
break;
case 3: c[HALFDAM]+= rnd(1600)+200;
beep();
lprcat("\nA sickness engulfs you!"); break;

View File

@ -245,7 +245,7 @@ mmove(aa,bb,cc,dd)
if (i==OTELEPORTER) /* monster hits teleport trap */
{ flag=3; fillmonst(mitem[cc][dd]); mitem[cc][dd]=0; }
if (c[BLINDCOUNT]) return; /* if blind don't show where monsters are */
if (know[cc][dd] & 1)
if (know[cc][dd] & 1)
{
p=0;
if (flag) cursors();

View File

@ -67,7 +67,7 @@ switch(i)
case OTELEPORTER: lprcat("\nZaaaappp! You've been teleported!\n");
beep(); nap(3000); oteleport(0);
break;
break;
case OSCHOOL: if (nearbymonst()) return;
lprcat("\n\nYou have found the College of Larn.");
@ -133,7 +133,7 @@ switch(i)
{
case 6: c[AGGRAVATE] += rnd(400); break;
case 7: lprcat("\nYou are jolted by an electric shock ");
case 7: lprcat("\nYou are jolted by an electric shock ");
lastnum=274; losehp(rnd(20)); bottomline(); break;
case 8: loselevel(); break;
@ -172,7 +172,7 @@ switch(i)
if (level!=0) { lprcat("\nThe shaft only extends 5 feet downward!"); return; }
if (packweight() > 45+3*(c[STRENGTH]+c[STREXTRA])) { lprcat("\nYou slip and fall down the shaft"); beep();
lastnum=275; losehp(30+rnd(20)); bottomhp(); }
else lprcat("climb down"); nap(3000); newcavelevel(MAXLEVEL);
for (i=0; i<MAXY; i++) for (j=0; j<MAXX; j++) /* put player near volcano shaft */
if (item[j][i]==OVOLUP) { playerx=j; playery=i; j=MAXX; i=MAXY; positionplayer(); }
@ -382,7 +382,7 @@ opotion(pot)
return;
};
}
/*
function to drink a potion
*/
@ -423,7 +423,7 @@ quaffpotion(pot)
case 2: lprcat("\nSuddenly, you feel much more skillful!");
raiselevel(); raisemhp(1); return;
case 3: lprcat("\nYou feel strange for a moment");
case 3: lprcat("\nYou feel strange for a moment");
c[rund(6)]++; break;
case 4: lprcat("\nYou feel more self confident!");
@ -571,7 +571,7 @@ read_scroll(typ)
case 6: c[AGGRAVATE]+=800; return; /* aggravate monsters */
case 7: gtime += (i = rnd(1000) - 850); /* time warp */
case 7: gtime += (i = rnd(1000) - 850); /* time warp */
if (i>=0) lprintf("\nYou went forward in time by %d mobuls",(long)((i+99)/100));
else lprintf("\nYou went backward in time by %d mobuls",(long)(-(i+99)/100));
adjtime((long)i); /* adjust time for time warping */

View File

@ -51,9 +51,9 @@ regen()
if (d[CANCELLATION]) if ((--d[CANCELLATION]) <= 0) flag=1;
if (d[WTW]) if ((--d[WTW]) <= 0) flag=1;
if (d[HASTESELF]) if ((--d[HASTESELF]) <= 0) flag=1;
if (d[AGGRAVATE]) --d[AGGRAVATE];
if (d[SCAREMONST]) if ((--d[SCAREMONST]) <= 0) flag=1;
if (d[STEALTH]) if ((--d[STEALTH]) <= 0) flag=1;
if (d[AGGRAVATE]) --d[AGGRAVATE];
if (d[SCAREMONST]) if ((--d[SCAREMONST]) <= 0) flag=1;
if (d[STEALTH]) if ((--d[STEALTH]) <= 0) flag=1;
if (d[AWARENESS]) --d[AWARENESS];
if (d[HOLDMONST]) if ((--d[HOLDMONST]) <= 0) flag=1;
if (d[HASTEMONST]) --d[HASTEMONST];
@ -73,7 +73,7 @@ regen()
if (rnd(100)<50)
{
d[WEAR]=d[SHIELD]= -1; cursors();
lprcat("\nThe hysteria of itching forces you to remove your armor!");
lprcat("\nThe hysteria of itching forces you to remove your armor!");
beep(); recalc(); bottomline();
}
if (--d[ITCHING]<=0) { cursors(); lprcat("\nYou now feel the irritation subside!"); beep(); }

View File

@ -13,8 +13,8 @@
* showallscores() Function to show scores and the iven lists that go with them
* sortboard() Function to sort the scoreboard
* newscore(score, whoo, whyded, winner) Function to add entry to scoreboard
* new1sub(score,i,whoo,taxes) Subroutine to put player into a
* new2sub(score,i,whoo,whyded) Subroutine to put player into a
* new1sub(score,i,whoo,taxes) Subroutine to put player into a
* new2sub(score,i,whoo,whyded) Subroutine to put player into a
* died(x) Subroutine to record who played larn, and what the score was
* diedsub(x) Subroutine to print out a line showing player when he is killed
* diedlog() Subroutine to read a log file and print it out in ascii format
@ -187,7 +187,7 @@ long paytaxes(x)
/*
* winshou() Subroutine to print out the winning scoreboard
*
* Returns the number of players on scoreboard that were shown
* Returns the number of players on scoreboard that were shown
*/
winshou()
{
@ -224,7 +224,7 @@ winshou()
* int x;
*
* Enter with 0 to list the scores, enter with 1 to list inventories too
* Returns the number of players on scoreboard that were shown
* Returns the number of players on scoreboard that were shown
*/
shou(x)
int x;
@ -275,7 +275,7 @@ showscores()
{
register int i,j;
lflush(); lcreat((char*)0); if (readboard()<0) return;
i=winshou(); j=shou(0);
i=winshou(); j=shou(0);
if (i+j == 0) lprcat(esb); else lprc('\n');
lflush();
}
@ -369,7 +369,7 @@ newscore(score, whoo, whyded, winner)
}
/*
* new1sub(score,i,whoo,taxes) Subroutine to put player into a
* new1sub(score,i,whoo,taxes) Subroutine to put player into a
* int score,i,whyded,taxes; winning scoreboard entry if his score
* char *whoo; is high enough
*
@ -395,7 +395,7 @@ new1sub(score,i,whoo,taxes)
}
/*
* new2sub(score,i,whoo,whyded) Subroutine to put player into a
* new2sub(score,i,whoo,whyded) Subroutine to put player into a
* int score,i,whyded,taxes; non-winning scoreboard entry if his
* char *whoo; score is high enough
*
@ -611,7 +611,7 @@ diedlog()
* it will try to make a new entry in the file. Only returns -1 if can't
* find him in the file, and can't make a new entry in the file.
* Format of playerids file:
* Id # in ascii \n character name \n
* Id # in ascii \n character name \n
*/
static int havepid= -1; /* playerid # if previously done */
getplid(nam)

View File

@ -5,7 +5,7 @@ extern char savefilename[],wizard,predostuff,nosignal;
static s2choose() /* text to be displayed if ^C during intro screen */
{
cursor(1,24); lprcat("Press "); setbold(); lprcat("return"); resetbold();
lprcat(" to continue: "); lflush();
lprcat(" to continue: "); lflush();
}
static void
@ -61,7 +61,7 @@ static void sigpipe() { sigpanic(SIGPIPE); }
static void sigterm() { sigpanic(SIGTERM); }
sigsetup()
{
signal(SIGQUIT, cntlc); signal(SIGINT, cntlc);
signal(SIGQUIT, cntlc); signal(SIGINT, cntlc);
signal(SIGKILL, SIG_IGN); signal(SIGHUP, sgam);
signal(SIGILL, sigill); signal(SIGTRAP, sigtrap);
signal(SIGIOT, sigiot); signal(SIGEMT, sigemt);
@ -143,6 +143,6 @@ sigpanic(sig)
sprintf(buf,"\nLarn - Panic! Signal %d received [%s]",sig,signame[sig]);
write(2,buf,strlen(buf)); sleep(2);
sncbr();
savegame(savefilename);
savegame(savefilename);
kill(getpid(),sig); /* this will terminate us */
}

View File

@ -211,7 +211,7 @@ dndstore()
lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep();
lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes);
lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n");
cursors();
cursors();
lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
i=0;
while (i!='\33') i=getchar();
@ -353,7 +353,7 @@ oschool()
cl_line(16,8);
c[STRENGTH] += 2; c[CONSTITUTION] += 2; break;
case 'c': c[INTELLIGENCE] += 2;
case 'c': c[INTELLIGENCE] += 2;
lprcat("\nThe task before you now seems more attainable!");
cl_line(16,9); break;
@ -366,15 +366,15 @@ oschool()
cl_line(16,10);
c[INTELLIGENCE] += 2; break;
case 'e': c[CHARISMA] += 3;
case 'e': c[CHARISMA] += 3;
lprcat("\nYou now feel like a born leader!");
cl_line(16,11); break;
case 'f': c[WISDOM] += 2;
case 'f': c[WISDOM] += 2;
lprcat("\nYou now feel more confident that you can find the potion in time!");
cl_line(16,12); break;
case 'g': c[DEXTERITY] += 3;
case 'g': c[DEXTERITY] += 3;
lprcat("\nYou feel like dancing!");
cl_line(16,13); break;
@ -388,7 +388,7 @@ oschool()
{
gtime += time_used;
course[i-'a']++; /* remember that he has taken that course */
c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */
c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */
if (c[BLINDCOUNT]) c[BLINDCOUNT]=1; /* cure blindness too! */
if (c[CONFUSE]) c[CONFUSE]=1; /* end confusion */
@ -426,7 +426,7 @@ banktitle(str)
lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes);
lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n");
lprcat("We suggest you go to the LRS office and pay your taxes.\n");
cursors();
cursors();
lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
i=0;
while (i!='\33') i=getchar();
@ -465,7 +465,7 @@ obanksub()
for (k=i=0; i<26; i++)
switch(iven[i])
{
case OLARNEYE: case ODIAMOND: case OEMERALD:
case OLARNEYE: case ODIAMOND: case OEMERALD:
case ORUBY: case OSAPPHIRE:
if (iven[i]==OLARNEYE)
@ -505,7 +505,7 @@ obanksub()
if (amt<0) { lprcat("\nSorry, but we don't have any negative gold!"); nap(2000); amt=0; }
else if (amt > c[BANKACCOUNT])
{ lprcat("\nYou don't have that much in the bank!"); nap(2000); }
else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; }
else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; }
break;
case 's': lprcat("\nWhich stone would you like to sell? ");
@ -513,7 +513,7 @@ obanksub()
if (i=='*')
for (i=0; i<26; i++)
{
if (gemvalue[i])
if (gemvalue[i])
{
c[GOLD]+=gemvalue[i]; iven[i]=0;
gemvalue[i]=0; k = gemorder[i];
@ -523,7 +523,7 @@ obanksub()
}
else
{
if (gemvalue[i=i-'a']==0)
if (gemvalue[i=i-'a']==0)
{
lprintf("\nItem %c is not a gemstone!",i+'a');
nap(2000); break;
@ -567,7 +567,7 @@ appraise(gemstone)
lprcat("\nWould you like to sell it to us? "); yrepcount=0;
if (getyn()=='y') { lprcat("yes\n"); c[GOLD]+=amt; iven[j]=0; }
else lprcat("no thank you.\n");
if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n");
if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n");
}
else lprcat("no\nO. K.\n");
}

View File

@ -29,7 +29,7 @@ yylex()
if (hit2flag) { hit2flag=0; yrepcount=0; return(' '); }
if (yrepcount>0) { --yrepcount; return(lastok); } else yrepcount=0;
if (yrepcount==0) { bottomdo(); showplayer(); } /* show where the player is */
lflush();
lflush();
while (1)
{
c[BYTESIN]++;
@ -82,7 +82,7 @@ yylex()
setscroll();
return(lastok = 'L'-64); /* redisplay screen */
}
if ((cc <= '9') && (cc >= '0'))
{ yrepcount = yrepcount*10 + cc - '0'; }
else { if (yrepcount>0) --yrepcount; return(lastok = cc); }
@ -105,14 +105,14 @@ flushall()
}
/*
function to set the desired hardness
function to set the desired hardness
enter with hard= -1 for default hardness, else any desired hardness
*/
sethard(hard)
int hard;
{
register int j,k,i;
j=c[HARDGAME]; hashewon();
j=c[HARDGAME]; hashewon();
if (restorflag==0) /* don't set c[HARDGAME] if restoring game */
{
if (hard >= 0) c[HARDGAME]= hard;
@ -132,7 +132,7 @@ sethard(hard)
monster[j].armorclass = (i< -127) ? -127 : i;
i = (7*monster[j].experience)/(7+k) + 1;
monster[j].experience = (i<=0) ? 1 : i;
}
}
}
/*
@ -171,7 +171,7 @@ readopts()
{
if ((i=lgetw())==0) break;
if (strlen(i)>=MAXMNAME) i[MAXMNAME-1]=0;
strcpy(usermonster[usermpoint],i);
strcpy(usermonster[usermpoint],i);
if (usermpoint >= MAXUM) break; /* defined all of em */
if (isalpha(j=usermonster[usermpoint][0]))
{
@ -196,7 +196,7 @@ readopts()
else if (strcmp(i,"no-beep") == 0) nobeep=1;
break;
case 'p': if (strcmp(i,"process-name:")== 0)
case 'p': if (strcmp(i,"process-name:")== 0)
{
if ((i=lgetw())==0) break;
if (strlen(i)>=PSNAMESIZE) i[PSNAMESIZE-1]=0;

View File

@ -62,7 +62,7 @@ char *C_fmt = "%-18.18s", /* format for printing cards */
"Flat Tire",
"Accident",
"Stop",
"Speed Limit",
"Speed Limit",
"Gasoline",
"Spare Tire",
"Repairs",

View File

@ -119,7 +119,7 @@
# define C_100 3
# define C_200 4
# define C_EMPTY 5
# define C_FLAT 6
# define C_FLAT 6
# define C_CRASH 7
# define C_STOP 8
# define C_LIMIT 9

View File

@ -158,7 +158,7 @@ reg bool forcomp; {
goto extend;
for (miles = 0, i = 0; i < HAND_SZ; i++)
if ((safe = pp->hand[i]) <= C_200)
miles += Value[safe];
miles += Value[safe];
if (miles + (Topcard - Deck) * 3 > 1000)
goto extend;
goto done;

View File

@ -68,7 +68,7 @@ static char *name1[] = {
"trillion", "quadrillion", "quintillion", "sextillion",
"septillion", "octillion", "nonillion", "decillion",
"undecillion", "duodecillion", "tredecillion", "quattuordecillion",
"quindecillion", "sexdecillion",
"quindecillion", "sexdecillion",
"septendecillion", "octodecillion",
"novemdecillion", "vigintillion",
};

View File

@ -11,10 +11,10 @@ CLEANFILES+= characs gold lastdead mess monsters motd scoreboard void
all: setup phantasia ${MAN6}
setup: phantglobs.o setup.o monsters.asc ${LIBM}
setup: phantglobs.o setup.o monsters.asc ${LIBM}
${CC} phantglobs.o setup.o -o ${.TARGET} -lm
beforeinstall:
beforeinstall:
./setup -m ${.CURDIR}/monsters.asc
install -c -m 660 -o games -g bin gold ${DESTDIR}/var/games/phantasia
install -c -m 660 -o games -g bin lastdead ${DESTDIR}/var/games/phantasia

View File

@ -24,7 +24,7 @@ char Newpfile[] = DEST/newcharacs"; /* new format file */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: time(), exit(), fread(), fopen(), srandom(), floor(),
/ MODULES CALLED: time(), exit(), fread(), fopen(), srandom(), floor(),
/ random(), strcmp(), fwrite(), strcpy(), fclose(), fprintf()
/
/ GLOBAL INPUTS: _iob[], Oldplayer, Newplayer

View File

@ -17,12 +17,12 @@
/
/ RETURN VALUE: none
/
/ MODULES CALLED: monsthits(), playerhits(), readmessage(), callmonster(),
/ writerecord(), pickmonster(), displaystats(), pow(), cancelmonster(),
/ awardtreasure(), more(), death(), wmove(), setjmp(), drandom(), printw(),
/ MODULES CALLED: monsthits(), playerhits(), readmessage(), callmonster(),
/ writerecord(), pickmonster(), displaystats(), pow(), cancelmonster(),
/ awardtreasure(), more(), death(), wmove(), setjmp(), drandom(), printw(),
/ longjmp(), wrefresh(), mvprintw(), wclrtobot()
/
/ GLOBAL INPUTS: Curmonster, Whichmonster, LINES, Lines, Circle, Shield,
/ GLOBAL INPUTS: Curmonster, Whichmonster, LINES, Lines, Circle, Shield,
/ Player, *stdscr, Fileloc, Fightenv[], *Enemyname
/
/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player, Luckout
@ -237,7 +237,7 @@ pickmonster()
/* even chance of some tamer non-water monsters */
return((int) ROLL(14.0, 50.0));
else
else
/* even chance of some of the tamest non-water monsters */
return((int) ROLL(14.0, 25.0));
}
@ -254,8 +254,8 @@ pickmonster()
/
/ RETURN VALUE: none
/
/ MODULES CALLED: hitmonster(), throwspell(), inputoption(), cancelmonster(),
/ floor(), wmove(), drandom(), altercoordinates(), waddstr(), mvprintw(),
/ MODULES CALLED: hitmonster(), throwspell(), inputoption(), cancelmonster(),
/ floor(), wmove(), drandom(), altercoordinates(), waddstr(), mvprintw(),
/ wclrtoeol(), wclrtobot()
/
/ GLOBAL INPUTS: Curmonster, Lines, Player, *stdscr, Luckout, *Enemyname
@ -429,14 +429,14 @@ int ch; /* input */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: cancelmonster(), scramblestats(), more(), floor(), wmove(),
/ drandom(), altercoordinates(), longjmp(), waddstr(), mvprintw(),
/ MODULES CALLED: cancelmonster(), scramblestats(), more(), floor(), wmove(),
/ drandom(), altercoordinates(), longjmp(), waddstr(), mvprintw(),
/ getanswer()
/
/ GLOBAL INPUTS: Curmonster, Lines, Circle, Shield, Player, *stdscr,
/ GLOBAL INPUTS: Curmonster, Lines, Circle, Shield, Player, *stdscr,
/ Fightenv[], *Enemyname
/
/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player,
/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player,
/ *Enemyname
/
/ DESCRIPTION:
@ -471,7 +471,7 @@ int ch; /* input */
/* take experience away */
inflict = ROLL(10.0, Curmonster.m_strength);
inflict = MIN(Player.p_experience, inflict);
mvprintw(Lines++, 0,
mvprintw(Lines++, 0,
"%s took away %.0f experience points.", Enemyname, inflict);
Player.p_experience -= inflict;
return;
@ -796,11 +796,11 @@ double inflict;
/
/ RETURN VALUE: none
/
/ MODULES CALLED: hitmonster(), cancelmonster(), sqrt(), floor(), wmove(),
/ drandom(), altercoordinates(), longjmp(), infloat(), waddstr(), mvprintw(),
/ MODULES CALLED: hitmonster(), cancelmonster(), sqrt(), floor(), wmove(),
/ drandom(), altercoordinates(), longjmp(), infloat(), waddstr(), mvprintw(),
/ getanswer()
/
/ GLOBAL INPUTS: Curmonster, Whichmonster, Nomana[], Player, *stdscr,
/ GLOBAL INPUTS: Curmonster, Whichmonster, Nomana[], Player, *stdscr,
/ Fightenv[], Illspell[], *Enemyname
/
/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Shield, Player
@ -1035,7 +1035,7 @@ int ch; /* input */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: truncstring(), fread(), fseek(), floor(), drandom(),
/ MODULES CALLED: truncstring(), fread(), fseek(), floor(), drandom(),
/ strcpy()
/
/ GLOBAL INPUTS: Curmonster, Circle, Player, *Monstfp
@ -1144,11 +1144,11 @@ struct monster Othermonster; /* to find a name for mimics */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: pickmonster(), collecttaxes(), more(), cursedtreasure(),
/ floor(), wmove(), drandom(), sscanf(), printw(), altercoordinates(),
/ MODULES CALLED: pickmonster(), collecttaxes(), more(), cursedtreasure(),
/ floor(), wmove(), drandom(), sscanf(), printw(), altercoordinates(),
/ longjmp(), infloat(), waddstr(), getanswer(), getstring(), wclrtobot()
/
/ GLOBAL INPUTS: Somebetter[], Curmonster, Whichmonster, Circle, Player,
/ GLOBAL INPUTS: Somebetter[], Curmonster, Whichmonster, Circle, Player,
/ *stdscr, Databuf[], *Statptr, Fightenv[]
/
/ GLOBAL OUTPUTS: Whichmonster, Shield, Player
@ -1211,7 +1211,7 @@ double dtemp; /* for temporary calculations */
return;
}
else
else
/* other treasures */
{
addstr("You have found some treasure. Do you want to inspect it ? ");

View File

@ -17,12 +17,12 @@
/
/ RETURN VALUE: none
/
/ MODULES CALLED: freerecord(), writerecord(), descrstatus(), truncstring(),
/ time(), more(), wmove(), wclear(), strcmp(), printw(), strcpy(),
/ infloat(), waddstr(), cleanup(), findname(), userlist(), mvprintw(),
/ MODULES CALLED: freerecord(), writerecord(), descrstatus(), truncstring(),
/ time(), more(), wmove(), wclear(), strcmp(), printw(), strcpy(),
/ infloat(), waddstr(), cleanup(), findname(), userlist(), mvprintw(),
/ localtime(), getanswer(), descrtype(), getstring()
/
/ GLOBAL INPUTS: LINES, *Login, Other, Wizard, Player, *stdscr, Databuf[],
/ GLOBAL INPUTS: LINES, *Login, Other, Wizard, Player, *stdscr, Databuf[],
/ Fileloc
/
/ GLOBAL OUTPUTS: Echo
@ -226,7 +226,7 @@ short *sptr; /* pointer to short item to change */
if (strcmp(Databuf, playerp->p_password) != 0)
continue;
}
if (c == 'A')
/* get new name */
{
@ -537,7 +537,7 @@ register int count = 0; /* count in file */
/
/ MODULES CALLED: fread(), fopen(), printf(), fclose()
/
/ GLOBAL INPUTS:
/ GLOBAL INPUTS:
/
/ GLOBAL OUTPUTS: none
/
@ -660,7 +660,7 @@ long loc = 0L; /* location in file */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: fread(), fseek(), fopen(), error(), strcmp(), fclose(),
/ MODULES CALLED: fread(), fseek(), fopen(), error(), strcmp(), fclose(),
/ strcpy(), fwrite(), descrtype()
/
/ GLOBAL INPUTS: Player

View File

@ -79,12 +79,12 @@ long foeloc = 0L; /* location in file of person to fight */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: readrecord(), readmessage(), writerecord(), collecttaxes(),
/ displaystats(), fabs(), more(), death(), sleep(), wmove(), waddch(), printw(),
/ myturn(), altercoordinates(), waddstr(), wrefresh(), mvprintw(),
/ MODULES CALLED: readrecord(), readmessage(), writerecord(), collecttaxes(),
/ displaystats(), fabs(), more(), death(), sleep(), wmove(), waddch(), printw(),
/ myturn(), altercoordinates(), waddstr(), wrefresh(), mvprintw(),
/ getanswer(), wclrtoeol(), wclrtobot()
/
/ GLOBAL INPUTS: Foestrikes, LINES, Lines, Other, Shield, Player, *stdscr,
/ GLOBAL INPUTS: Foestrikes, LINES, Lines, Other, Shield, Player, *stdscr,
/ Fileloc, *Enemyname
/
/ GLOBAL OUTPUTS: Foestrikes, Lines, Shield, Player, Luckout, *Enemyname
@ -347,10 +347,10 @@ short oldtampered; /* old value of foe's p_tampered */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), inputoption(), floor(), wmove(), drandom(),
/ MODULES CALLED: writerecord(), inputoption(), floor(), wmove(), drandom(),
/ waddstr(), wrefresh(), mvprintw(), wclrtoeol(), wclrtobot()
/
/ GLOBAL INPUTS: Lines, Other, Player, *stdscr, Fileloc, Luckout,
/ GLOBAL INPUTS: Lines, Other, Player, *stdscr, Fileloc, Luckout,
/ *Enemyname
/
/ GLOBAL OUTPUTS: Foestrikes, Lines, Player, Luckout
@ -380,7 +380,7 @@ int ch; /* input */
{
default: /* fight */
dtemp = ROLL(2.0, Player.p_might);
HIT:
HIT:
mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, dtemp);
Player.p_sin += 0.5;
Player.p_1scratch += dtemp;
@ -516,8 +516,8 @@ long loc = 0L; /* location in energy void file */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), more(), fread(), death(), fseek(), sleep(),
/ floor(), wmove(), waddch(), drandom(), printw(), altercoordinates(),
/ MODULES CALLED: writerecord(), more(), fread(), death(), fseek(), sleep(),
/ floor(), wmove(), waddch(), drandom(), printw(), altercoordinates(),
/ waddstr(), wrefresh(), encounter(), writevoid()
/
/ GLOBAL INPUTS: Other, Player, *stdscr, Enrgyvoid, *Playersfp
@ -654,7 +654,7 @@ long loc; /* location in file of other players */
Player.p_mana =
Player.p_energy =
Player.p_maxenergy =
Player.p_magiclvl =
Player.p_magiclvl =
Player.p_brains =
Player.p_experience =
Player.p_quickness = 1.0;
@ -708,8 +708,8 @@ long loc; /* location in file of other players */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: descrstatus(), descrlocation(), more(), fread(), fseek(),
/ floor(), wmove(), printw(), waddstr(), distance(), wrefresh(),
/ MODULES CALLED: descrstatus(), descrlocation(), more(), fread(), fseek(),
/ floor(), wmove(), printw(), waddstr(), distance(), wrefresh(),
/ descrtype(), wclrtobot()
/
/ GLOBAL INPUTS: LINES, Other, Circle, Wizard, Player, *stdscr, *Playersfp
@ -766,7 +766,7 @@ register int numusers = 0; /* number of users on file */
/* those nearer the origin can be seen */
|| Player.p_palantir)
/* palantir enables one to see others */
&& (Other.p_status != S_CLOAKED
&& (Other.p_status != S_CLOAKED
|| (Player.p_specialtype == SC_VALAR && Player.p_palantir))
/* not cloaked; valar can see through cloak with a palantir */
&& Other.p_specialtype != SC_VALAR)
@ -778,7 +778,7 @@ register int numusers = 0; /* number of users on file */
/* cannot see player's coordinates */
printw("%-20s %19.19s ",
Other.p_name, descrlocation(&Other, TRUE));
printw("%6.0f %s %-9.9s%s\n", Other.p_level, descrtype(&Other, TRUE),
Other.p_login, descrstatus(&Other));
@ -806,7 +806,7 @@ register int numusers = 0; /* number of users on file */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), fread(), fseek(), fopen(), wmove(), fclose(),
/ MODULES CALLED: writerecord(), fread(), fseek(), fopen(), wmove(), fclose(),
/ fwrite(), altercoordinates(), waddstr(), fprintf()
/
/ GLOBAL INPUTS: *Energyvoidfp, Other, Player, *stdscr,
@ -889,12 +889,12 @@ long loc = 0L; /* location of old king in player file */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), truncstring(), fread(), fseek(), fopen(),
/ floor(), wmove(), drandom(), fclose(), fwrite(), sscanf(), strcmp(),
/ infloat(), waddstr(), findname(), distance(), userlist(), mvprintw(),
/ MODULES CALLED: writerecord(), truncstring(), fread(), fseek(), fopen(),
/ floor(), wmove(), drandom(), fclose(), fwrite(), sscanf(), strcmp(),
/ infloat(), waddstr(), findname(), distance(), userlist(), mvprintw(),
/ allocvoid(), getanswer(), getstring(), wclrtoeol(), writevoid()
/
/ GLOBAL INPUTS: *Energyvoidfp, Other, Illcmd[], Wizard, Player, *stdscr,
/ GLOBAL INPUTS: *Energyvoidfp, Other, Illcmd[], Wizard, Player, *stdscr,
/ Databuf[], Enrgyvoid
/
/ GLOBAL OUTPUTS: Other, Player, Enrgyvoid

View File

@ -18,7 +18,7 @@
/
/ RETURN VALUE: none
/
/ MODULES CALLED: wmove(), _filbuf(), clearok(), waddstr(), wrefresh(),
/ MODULES CALLED: wmove(), _filbuf(), clearok(), waddstr(), wrefresh(),
/ wclrtoeol()
/
/ GLOBAL INPUTS: Echo, _iob[], Wizard, *stdscr
@ -212,9 +212,9 @@ inputoption()
/
/ RETURN VALUE: none
/
/ MODULES CALLED: fork(), exit(), wait(), death(), alarm(), execl(), wmove(),
/ getgid(), signal(), getenv(), wclear(), setuid(), getuid(), setgid(),
/ crmode(), clearok(), waddstr(), cleanup(), wrefresh(), leavegame(),
/ MODULES CALLED: fork(), exit(), wait(), death(), alarm(), execl(), wmove(),
/ getgid(), signal(), getenv(), wclear(), setuid(), getuid(), setgid(),
/ crmode(), clearok(), waddstr(), cleanup(), wrefresh(), leavegame(),
/ getanswer()
/
/ GLOBAL INPUTS: Player, *stdscr
@ -300,10 +300,10 @@ unsigned savealarm; /* to save alarm value */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: alarm(), wmove(), waddch(), signal(), setjmp(), strchr(),
/ MODULES CALLED: alarm(), wmove(), waddch(), signal(), setjmp(), strchr(),
/ _filbuf(), clearok(), toupper(), wrefresh(), mvprintw(), wclrtoeol()
/
/ GLOBAL INPUTS: catchalarm(), Echo, _iob[], _ctype[], *stdscr, Timeout,
/ GLOBAL INPUTS: catchalarm(), Echo, _iob[], _ctype[], *stdscr, Timeout,
/ Timeoenv[]
/
/ GLOBAL OUTPUTS: _iob[]

View File

@ -49,7 +49,7 @@
*/
/*
* All source files are set up for 'vi' with shiftwidth=4, tabstop=8.
* All source files are set up for 'vi' with shiftwidth=4, tabstop=8.
*/
/* */
@ -73,16 +73,16 @@
/
/ RETURN VALUE: none
/
/ MODULES CALLED: monstlist(), checkenemy(), activelist(),
/ throneroom(), checkbattle(), readmessage(), changestats(), writerecord(),
/ tradingpost(), adjuststats(), recallplayer(), displaystats(), checktampered(),
/ fabs(), rollnewplayer(), time(), exit(), sqrt(), floor(), wmove(),
/ signal(), strcat(), purgeoldplayers(), getuid(), isatty(), wclear(),
/ strcpy(), system(), altercoordinates(), cleanup(), waddstr(), procmain(),
/ playinit(), leavegame(), localtime(), getanswer(), neatstuff(), initialstate(),
/ MODULES CALLED: monstlist(), checkenemy(), activelist(),
/ throneroom(), checkbattle(), readmessage(), changestats(), writerecord(),
/ tradingpost(), adjuststats(), recallplayer(), displaystats(), checktampered(),
/ fabs(), rollnewplayer(), time(), exit(), sqrt(), floor(), wmove(),
/ signal(), strcat(), purgeoldplayers(), getuid(), isatty(), wclear(),
/ strcpy(), system(), altercoordinates(), cleanup(), waddstr(), procmain(),
/ playinit(), leavegame(), localtime(), getanswer(), neatstuff(), initialstate(),
/ scorelist(), titlelist()
/
/ GLOBAL INPUTS: *Login, Throne, Wizard, Player, *stdscr, Changed, Databuf[],
/ GLOBAL INPUTS: *Login, Throne, Wizard, Player, *stdscr, Changed, Databuf[],
/ Fileloc, Stattable[]
/
/ GLOBAL OUTPUTS: Wizard, Player, Changed, Fileloc, Timeout, *Statptr
@ -320,13 +320,13 @@ double dtemp; /* for temporary calculations */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: time(), fopen(), srandom(), error(), getuid(), getlogin(),
/ MODULES CALLED: time(), fopen(), srandom(), error(), getuid(), getlogin(),
/ getpwuid()
/
/ GLOBAL INPUTS:
/ GLOBAL INPUTS:
/
/ GLOBAL OUTPUTS: *Energyvoidfp, Echo, Marsh, *Login, Users, Beyond,
/ Throne, Wizard, Changed, Okcount, Timeout, Windows, *Monstfp, *Messagefp,
/ GLOBAL OUTPUTS: *Energyvoidfp, Echo, Marsh, *Login, Users, Beyond,
/ Throne, Wizard, Changed, Okcount, Timeout, Windows, *Monstfp, *Messagefp,
/ *Playersfp
/
/ DESCRIPTION:
@ -349,7 +349,7 @@ initialstate()
/* setup login name */
if ((Login = getlogin()) == NULL)
Login = getpwuid(getuid())->pw_name;
/* open some files */
if ((Playersfp = fopen(_PATH_PEOPLE, "r+")) == NULL)
error(_PATH_PEOPLE);
@ -382,8 +382,8 @@ initialstate()
/
/ RETURN VALUE: none
/
/ MODULES CALLED: initplayer(), allocrecord(), truncstring(), fabs(), wmove(),
/ wclear(), sscanf(), strcmp(), genchar(), waddstr(), findname(), mvprintw(),
/ MODULES CALLED: initplayer(), allocrecord(), truncstring(), fabs(), wmove(),
/ wclear(), sscanf(), strcmp(), genchar(), waddstr(), findname(), mvprintw(),
/ getanswer(), getstring()
/
/ GLOBAL INPUTS: Other, Wizard, Player, *stdscr, Databuf[]
@ -499,12 +499,12 @@ int ch; /* input */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: dotampered(), changestats(), inputoption(), allstatslist(),
/ fopen(), wmove(), drandom(), sscanf(), fclose(), altercoordinates(),
/ waddstr(), fprintf(), distance(), userlist(), leavegame(), encounter(),
/ MODULES CALLED: dotampered(), changestats(), inputoption(), allstatslist(),
/ fopen(), wmove(), drandom(), sscanf(), fclose(), altercoordinates(),
/ waddstr(), fprintf(), distance(), userlist(), leavegame(), encounter(),
/ getstring(), wclrtobot()
/
/ GLOBAL INPUTS: Circle, Illcmd[], Throne, Wizard, Player, *stdscr,
/ GLOBAL INPUTS: Circle, Illcmd[], Throne, Wizard, Player, *stdscr,
/ Databuf[], Illmove[]
/
/ GLOBAL OUTPUTS: Player, Changed
@ -650,7 +650,7 @@ bool hasmoved = FALSE; /* set if player has moved */
*/
if (Player.p_level < MEL_TELEPORT || Player.p_magiclvl < ML_TELEPORT)
ILLCMD();
else
else
for (loop = 3; loop; --loop)
{
mvaddstr(4, 0, "X Y Coordinates ? ");
@ -735,7 +735,7 @@ bool hasmoved = FALSE; /* set if player has moved */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: fread(), fseek(), fopen(), fgets(), wmove(), strcpy(),
/ MODULES CALLED: fread(), fseek(), fopen(), fgets(), wmove(), strcpy(),
/ fclose(), strlen(), waddstr(), sprintf(), wrefresh()
/
/ GLOBAL INPUTS: Lines, Other, *stdscr, Databuf[], *Playersfp
@ -867,8 +867,8 @@ char hiname[21], nxtname[21];/* used for finding the two highest players */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), truncstring(), more(), death(), wmove(),
/ wclear(), strcmp(), printw(), cleanup(), waddstr(), findname(), mvprintw(),
/ MODULES CALLED: writerecord(), truncstring(), more(), death(), wmove(),
/ wclear(), strcmp(), printw(), cleanup(), waddstr(), findname(), mvprintw(),
/ getanswer(), getstring()
/
/ GLOBAL INPUTS: Player, *stdscr, Databuf[]
@ -954,7 +954,7 @@ int ch; /* input */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: collecttaxes(), floor(), wmove(), drandom(), infloat(),
/ MODULES CALLED: collecttaxes(), floor(), wmove(), drandom(), infloat(),
/ waddstr(), mvprintw(), getanswer()
/
/ GLOBAL INPUTS: Player, *stdscr, *Statptr
@ -1112,7 +1112,7 @@ register struct charstats *statptr;/* for pointing into Stattable */
if (subscript != C_SUPER || !Wizard)
/* fighter is default */
subscript = C_FIGHTER;
statptr = &Stattable[subscript];
Player.p_quickness =
@ -1148,7 +1148,7 @@ register struct charstats *statptr;/* for pointing into Stattable */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: signal(), wclear(), noecho(), crmode(), initscr(),
/ MODULES CALLED: signal(), wclear(), noecho(), crmode(), initscr(),
/ wrefresh()
/
/ GLOBAL INPUTS: *stdscr, ill_sig()
@ -1255,7 +1255,7 @@ playinit()
/
/ MODULES CALLED: exit(), wmove(), fclose(), endwin(), nocrmode(), wrefresh()
/
/ GLOBAL INPUTS: *Energyvoidfp, LINES, *stdscr, Windows, *Monstfp,
/ GLOBAL INPUTS: *Energyvoidfp, LINES, *stdscr, Windows, *Monstfp,
/ *Messagefp, *Playersfp
/
/ GLOBAL OUTPUTS: none

View File

@ -180,9 +180,9 @@ static char *nametable[4][4] = /* names of places */
/
/ RETURN VALUE: none
/
/ MODULES CALLED: writerecord(), adjuststats(), fabs(), more(), sqrt(),
/ sleep(), floor(), wmove(), drandom(), wclear(), printw(),
/ altercoordinates(), infloat(), waddstr(), wrefresh(), mvprintw(), getanswer(),
/ MODULES CALLED: writerecord(), adjuststats(), fabs(), more(), sqrt(),
/ sleep(), floor(), wmove(), drandom(), wclear(), printw(),
/ altercoordinates(), infloat(), waddstr(), wrefresh(), mvprintw(), getanswer(),
/ wclrtoeol(), wclrtobot()
/
/ GLOBAL INPUTS: Menu[], Circle, Player, *stdscr, Fileloc, Nobetter[]
@ -539,7 +539,7 @@ allstatslist()
{
static char *flags[] = /* to print value of some bools */
{
"False",
"False",
" True"
};
@ -560,8 +560,8 @@ static char *flags[] = /* to print value of some bools */
mvprintw(15, 40, "Sword : %9.0f", Player.p_sword);
mvprintw(16, 40, "Quickslver: %9.0f", Player.p_quksilver);
mvprintw(18, 0, "Blessing: %s Ring: %s Virgin: %s Palantir: %s",
flags[Player.p_blessing], flags[Player.p_ring.ring_type != R_NONE],
mvprintw(18, 0, "Blessing: %s Ring: %s Virgin: %s Palantir: %s",
flags[Player.p_blessing], flags[Player.p_ring.ring_type != R_NONE],
flags[Player.p_virgin], flags[Player.p_palantir]);
}
/* */
@ -843,9 +843,9 @@ leavegame()
/
/ RETURN VALUE: none
/
/ MODULES CALLED: freerecord(), enterscore(), more(), exit(), fread(),
/ fseek(), execl(), fopen(), floor(), wmove(), drandom(), wclear(), strcmp(),
/ fwrite(), fflush(), printw(), strcpy(), fclose(), waddstr(), cleanup(),
/ MODULES CALLED: freerecord(), enterscore(), more(), exit(), fread(),
/ fseek(), execl(), fopen(), floor(), wmove(), drandom(), wclear(), strcmp(),
/ fwrite(), fflush(), printw(), strcpy(), fclose(), waddstr(), cleanup(),
/ fprintf(), wrefresh(), getanswer(), descrtype()
/
/ GLOBAL INPUTS: Curmonster, Wizard, Player, *stdscr, Fileloc, *Monstfp
@ -1019,7 +1019,7 @@ long place;
/
/ GLOBAL OUTPUTS: none
/
/ DESCRIPTION:
/ DESCRIPTION:
/ Experience level is a geometric progression. This has been finely
/ tuned over the years, and probably should not be changed.
/
@ -1043,7 +1043,7 @@ double experience;
/
/ AUTHOR: E. A. Estes, 12/4/85
/
/ ARGUMENTS:
/ ARGUMENTS:
/ char *string - pointer to null terminated string
/
/ RETURN VALUE: none
@ -1054,7 +1054,7 @@ double experience;
/
/ GLOBAL OUTPUTS: none
/
/ DESCRIPTION:
/ DESCRIPTION:
/ Put nul characters in place of spaces at the end of the string.
/
*************************************************************************/
@ -1077,7 +1077,7 @@ register int length; /* length of string */
/
/ AUTHOR: E. A. Estes, 12/16/85
/
/ ARGUMENTS:
/ ARGUMENTS:
/ double xnew, ynew - new x, y coordinates
/ int operation - operation to perform with coordinates
/
@ -1089,7 +1089,7 @@ register int length; /* length of string */
/
/ GLOBAL OUTPUTS: Marsh, Circle, Beyond, Throne, Player, Changed
/
/ DESCRIPTION:
/ DESCRIPTION:
/ This module is called whenever the player's coordinates are altered.
/ If the player is beyond the point of no return, he/she is forced
/ to stay there.
@ -1130,7 +1130,7 @@ int operation;
ynew = Player.p_y + SGN(Player.p_y) * ROLL(50 * Circle, 250 * Circle);
break;
}
/* now set location flags and adjust coordinates */
Circle = CIRCLE(Player.p_x = floor(xnew), Player.p_y = floor(ynew));
@ -1361,7 +1361,7 @@ register struct player *playerp;
playerp->p_type = C_FIGHTER; /* default */
playerp->p_specialtype = SC_NONE;
playerp->p_lives =
playerp->p_crowns =
playerp->p_crowns =
playerp->p_charms =
playerp->p_amulets =
playerp->p_holywater =
@ -1463,7 +1463,7 @@ error(whichfile)
/
/ AUTHOR: E. A. Estes, 12/4/85
/
/ ARGUMENTS:
/ ARGUMENTS:
/ double x1, y1 - x, y coordinates of first point
/ double x2, y2 - x, y coordinates of second point
/

View File

@ -18,15 +18,15 @@
/
/ RETURN VALUE: none
/
/ MODULES CALLED: time(), exit(), stat(), Error(), creat(), close(), fopen(),
/ fgets(), floor(), srandom(), umask(), drandom(), strcpy(), getuid(),
/ MODULES CALLED: time(), exit(), stat(), Error(), creat(), close(), fopen(),
/ fgets(), floor(), srandom(), umask(), drandom(), strcpy(), getuid(),
/ unlink(), fwrite(), fclose(), sscanf(), printf(), strlen(), fprintf()
/
/ GLOBAL INPUTS: Curmonster, _iob[], Databuf[], *Monstfp, Enrgyvoid
/
/ GLOBAL OUTPUTS: Curmonster, Databuf[], *Monstfp, Enrgyvoid
/
/ DESCRIPTION:
/ DESCRIPTION:
/
/ This program tries to verify the parameters specified in
/ the Makefile.
@ -247,7 +247,7 @@ char *str, *file;
/
/ GLOBAL OUTPUTS: none
/
/ DESCRIPTION:
/ DESCRIPTION:
/
*************************************************************************/

View File

@ -1,7 +1,7 @@
/*
* piano.c - a piano emulator
*/
static char rcsid[] = "$Id$";
static char rcsid[] = "$Id: piano.c,v 1.1.1.1 1995/04/28 17:38:07 jkh Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -90,7 +90,7 @@ fdputs(const char *s, int fd, int echo)
return err;
}/* fdputs */
static int
static int
outspkr(const char *s)
{
int err = -1, fd = open("/dev/speaker", O_WRONLY);

View File

@ -45,8 +45,8 @@ static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93";
*
* chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
*
* To avoid excessive sieves for small factors, we use the table below to
* setup our sieve blocks. Each element represents a odd number starting
* To avoid excessive sieves for small factors, we use the table below to
* setup our sieve blocks. Each element represents a odd number starting
* with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
*/

View File

@ -45,7 +45,7 @@ static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93";
*
* chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
*
* We are able to sieve 2^32-1 because this table has primes up to 65537
* We are able to sieve 2^32-1 because this table has primes up to 65537
* and 65537^2 > 2^32-1.
*/

View File

@ -86,15 +86,15 @@ char table[TABSIZE]; /* Eratosthenes sieve of odd numbers */
/*
* prime[i] is the (i-1)th prime.
*
* We are able to sieve 2^32-1 because this byte table yields all primes
* We are able to sieve 2^32-1 because this byte table yields all primes
* up to 65537 and 65537^2 > 2^32-1.
*/
extern ubig prime[];
extern ubig *pr_limit; /* largest prime in the prime array */
/*
* To avoid excessive sieves for small factors, we use the table below to
* setup our sieve blocks. Each element represents a odd number starting
* To avoid excessive sieves for small factors, we use the table below to
* setup our sieve blocks. Each element represents a odd number starting
* with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
*/
extern char pattern[];

View File

@ -98,7 +98,7 @@ main(argc, argv)
errx(1, "denominator is not valid.");
break;
default:
usage();
usage();
/* NOTREACHED */
}
@ -115,7 +115,7 @@ main(argc, argv)
*/
if (unbuffer_output)
setbuf(stdout, NULL);
/*
* Select whether to print the first line. (Prime the pump.)
* We find a random number between 0 and denom - 1 and, if it's

View File

@ -60,7 +60,7 @@ static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93";
*
* All UNIX code should be included between the single "#ifdef UNIX" at the
* top of this file, and the "#endif" at the bottom.
*
*
* To change a routine to include a new UNIX system, simply #ifdef the
* existing routine, as in the following example:
*
@ -291,7 +291,7 @@ char *fname;
* system doesn't provide all of the time units requested here, then you
* can provide only those that it does, and return zeros for the others.
* If you cannot provide good time values, then users may be able to copy
* saved-game files and play them.
* saved-game files and play them.
*/
md_gct(rt_buf)
@ -322,7 +322,7 @@ struct rogue_time *rt_buf;
* exactly the same here.
* Or if md_gct() is implemented correctly, but your system does not provide
* file modification dates, you may return some date far in the past so
* that the program will never know that a saved-game file being modified.
* that the program will never know that a saved-game file being modified.
* You may also do this if you wish to be able to restore games from
* saved-games that have been modified.
*/
@ -481,7 +481,7 @@ int n;
* You need to find some single random integer, such as:
* process id.
* current time (minutes + seconds) returned from md_gct(), if implemented.
*
*
* It will not help to return "get_rand()" or "rand()" or the return value of
* any pseudo-RNG. If you don't have a random number, you can just return 1,
* but this means your games will ALWAYS start the same way, and will play
@ -591,7 +591,7 @@ char *shell;
* program is compiled with CURSES defined to use the enclosed curses
* emulation package. If you are not using this, then this routine is
* totally unnecessary.
*
*
* Notice that information is saved between calls. This is used to
* restore the terminal to an initial saved state.
*

View File

@ -77,7 +77,7 @@ char *argv[];
put_mons();
put_player(party_room);
print_stats(STAT_ALL);
PL:
PL:
play_level();
free_stuff(&level_objects);
free_stuff(&level_monsters);

View File

@ -297,7 +297,7 @@ register drow, dcol;
return(0);
}
can_move(row1, col1, row2, col2)
can_move(row1, col1, row2, col2)
{
if (!is_passable(row2, col2)) {
return(0);

View File

@ -221,7 +221,7 @@ object *obj, *pack;
op = pack->next_object;
while (op) {
if ((op->what_is == obj->what_is) &&
if ((op->what_is == obj->what_is) &&
(op->which_kind == obj->which_kind)) {
if ((obj->what_is != WEAPON) ||

View File

@ -51,11 +51,11 @@ static char sccsid[] = "@(#)random.c 8.1 (Berkeley) 5/31/93";
*/
static long rntb[32] = {
3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, 0x7449e56b,
0xbeb1dbb0, 0xab5c5918, 0x946554fd, 0x8c2e680f, 0xeb3d799f,
0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, 0xe369735d,
0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e,
0x8999220b, 0x27fb47b9
};
@ -91,7 +91,7 @@ long
rrandom()
{
long i;
if (rand_type == 0) {
i = state[0] = (state[0]*1103515245 + 12345) & 0x7fffffff;
} else {

View File

@ -587,7 +587,7 @@ get_ench_color()
return(id_potions[get_rand(0, POTIONS-1)].title);
} else if (con_mon) {
return("red ");
}
}
return("blue ");
}

View File

@ -213,7 +213,7 @@ int rig, shot, hittable, roll;
makesignal(on, "crew mutinying!", (struct ship *)0);
on->specs->qual = 5;
Write(W_CAPTURED, on, 0, on->file->index, 0, 0, 0);
} else
} else
makesignal(on, "crew demoralized", (struct ship *)0);
Write(W_QUAL, on, 0, on->specs->qual, 0, 0, 0);
}

View File

@ -320,7 +320,7 @@ reload()
checksails()
{
register struct ship *sp;
register int rig, full;
register int rig, full;
struct ship *close;
foreachship(sp) {
@ -336,7 +336,7 @@ checksails()
full = 1;
else
full = 0;
} else
} else
full = 0;
} else
full = 0;

View File

@ -79,7 +79,7 @@ int dir, fs;
Move = (flank ? 2 : 1) - WET[windspeed][ship->specs->class-1].D;
else if (dir == winddir + 4 || dir == winddir - 4)
Move = 0;
else
else
Move -= WET[windspeed][ship->specs->class-1].A;
Move -= riggone;
Move = Move < 0 ? 0 : Move;

View File

@ -415,7 +415,7 @@ char AMMO[9][4] = {
{ -3, 2, 0, 3 },
{ -3, 2, 0, 3 }
};
char HDT[9][10] = {
{ 1, 0,-1,-2,-3,-3,-4,-4,-4,-4 },
{ 1, 1, 0,-1,-2,-2,-3,-3,-3,-3 },

View File

@ -201,14 +201,14 @@ int crew[3];
char isdefense;
char buf;
{
register int k, j, men;
register int k, j, men;
struct BP *ptr;
int temp[3];
for (k = 0; k < 3; k++)
temp[k] = crew[k];
if (isdigit(buf)) {
ptr = isdefense ? to->file->DBP : to->file->OBP;
ptr = isdefense ? to->file->DBP : to->file->OBP;
for (j = 0; j < NBP && ptr[j].turnsent; j++)
;
if (!ptr[j].turnsent && buf > '0') {

View File

@ -200,7 +200,7 @@ struct point *sp;
if (sp->col > cursor.col)right(sp);
else{
distance = (cursor.col -sp->col)*BSlength;
if (((TA) &&
if (((TA) &&
(distance > tfield+((sp->col)&7)*NDlength)
) ||
(((cursor.col)*NDlength) < distance)
@ -232,7 +232,7 @@ struct point *sp;
}
if (((sp->line << 1) > cursor.line + LINES+1 + f) && (LL != 0)){
/* home,rlf quicker than lf
* (LINES+1 - sp->line + f < sp->line - cursor.line)
* (LINES+1 - sp->line + f < sp->line - cursor.line)
*/
if (cursor.line > f + 1){
/* is home faster than wraparound lf?
@ -271,7 +271,7 @@ struct point *sp;
if (BW && (CM == 0) &&
((sp->col << 1) - field > (COLUMNS - 8) << 1 )
){
if (cursor.line == 0){
if (cursor.line == 0){
outch('\n');
}
outch('\r');
@ -493,7 +493,7 @@ char ch;{
}
}
outch(c)
{
putchar(c);

View File

@ -195,7 +195,7 @@ mainloop()
if (c == '.') {
c = lastc;
}
if ((Klength > 0) &&
if ((Klength > 0) &&
(c == *KL || c == *KR || c == *KU || c == *KD)) {
savec = c;
match = 0;
@ -225,7 +225,7 @@ mainloop()
if (match == 0) {
ungetc(c,stdin);
ch = savec;
/* Oops!
/* Oops!
* This works if we figure it out on second character.
*/
break;
@ -355,7 +355,7 @@ mainloop()
if (same(&you,&money))
{
char xp[20];
char xp[20];
struct point z;
loot += 25;
if(k < repeat)
@ -524,11 +524,11 @@ flushi()
{
stty(0, &new);
}
int mx [8] = {
int mx [8] = {
0, 1, 1, 1, 0,-1,-1,-1};
int my [8] = {
-1,-1, 0, 1, 1, 1, 0,-1};
float absv[8]= {
float absv[8]= {
1, 1.4, 1, 1.4, 1, 1.4, 1, 1.4
};
int oldw=0;
@ -542,7 +542,7 @@ struct point *sp, *np;
double v1, v2, vp, max;
point(&d,you.col-sp->col,you.line-sp->line);
v1 = sqrt( (double) (d.col*d.col + d.line*d.line) );
w=0;
w=0;
max=0;
for(i=0; i<8; i++)
{
@ -584,7 +584,7 @@ struct point *sp, *np;
else
vp -= wt[i];
if (i==8) {
pr("failure\n");
pr("failure\n");
i=0;
while (wt[i]==0) i++;
}
@ -803,7 +803,7 @@ pushsnake()
}
return(0);
}
chk(sp)
struct point *sp;
{

View File

@ -157,7 +157,7 @@ torped()
{
case EMPTY:
continue;
case HOLE:
printf("Torpedo disappears into a black hole\n");
break;
@ -178,15 +178,15 @@ torped()
break;
}
break;
case STAR:
nova(ix, iy);
break;
case INHABIT:
kills(ix, iy, -1);
break;
case BASE:
killb(Ship.quadx, Ship.quady);
Game.killb += 1;

View File

@ -625,7 +625,7 @@ getans(prompt)
}
bats_nearby()
{
{
register int i;
/* check for bats in the immediate vicinity */
@ -636,7 +636,7 @@ bats_nearby()
}
pit_nearby()
{
{
register int i;
/* check for pits in the immediate vicinity */

View File

@ -1,5 +1,5 @@
# @(#)Makefile 8.2 (Berkeley) 3/31/94
SUBDIR= xneko xroach
SUBDIR= xneko xroach
.include <bsd.subdir.mk>

View File

@ -146,7 +146,7 @@ static char sccsid[] = "@(#)xneko.c 8.1 (Berkeley) 5/31/93";
#ifndef lint
static char
rcsid[] = "$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/src/xneko/RCS/xneko.c,v 1.2 90/09/01 23:40:01 jik Exp $";
rcsid[] = "$Header: /home/ncvs/src/games/x11/xneko/xneko.c,v 1.1.1.1 1994/09/04 04:02:16 jkh Exp $";
static char WriterMessage[] = "xneko: Programmed by Masayuki Koba, 1990";
#endif
@ -975,7 +975,7 @@ IsNekoMoveStart()
#ifndef DEBUG
if ( ( PrevMouseX >= MouseX - IDLE_SPACE
&& PrevMouseX <= MouseX + IDLE_SPACE ) &&
( PrevMouseY >= MouseY - IDLE_SPACE
( PrevMouseY >= MouseY - IDLE_SPACE
&& PrevMouseY <= MouseY + IDLE_SPACE ) ) {
return( False );
} else {

Some files were not shown because too many files have changed in this diff Show More