Add braces to make the new egcs happy.
This commit is contained in:
parent
a93789ab6a
commit
04afeca685
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: com5.c,v 1.8 1998/08/29 19:58:12 hubertf Exp $ */
|
||||
/* $NetBSD: com5.c,v 1.9 1998/08/30 09:19:36 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: com5.c,v 1.8 1998/08/29 19:58:12 hubertf Exp $");
|
||||
__RCSID("$NetBSD: com5.c,v 1.9 1998/08/30 09:19:36 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -92,7 +92,7 @@ love()
|
||||
|
||||
while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount);
|
||||
if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects, wordvalue[wordnumber])) {
|
||||
if (wordvalue[wordnumber] == NORMGOD && !loved)
|
||||
if (wordvalue[wordnumber] == NORMGOD && !loved) {
|
||||
if (godready >= 2) {
|
||||
puts("She cuddles up to you, and her mouth starts to work:\n'That was my sister's amulet. The lovely goddess, Purl, was she. The Empire\ncaptured her just after the Darkness came. My other sister, Vert, was killed\nby the Dark Lord himself. He took her amulet and warped its power.\nYour quest was foretold by my father before he died, but to get the Dark Lord's\namulet you must use cunning and skill. I will leave you my amulet.");
|
||||
puts("which you may use as you wish. As for me, I am the last goddess of the\nwaters. My father was the Island King, and the rule is rightfully mine.'\n\nShe pulls the throne out into a large bed.");
|
||||
@ -116,6 +116,7 @@ love()
|
||||
puts("You wish!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (wordvalue[wordnumber] == NATIVE) {
|
||||
puts("The girl is easy prey. She peals off her sarong and indulges you.");
|
||||
power++;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bog.c,v 1.8 1997/10/11 02:12:11 lukem Exp $ */
|
||||
/* $NetBSD: bog.c,v 1.9 1998/08/30 09:19:36 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: bog.c,v 1.8 1997/10/11 02:12:11 lukem Exp $");
|
||||
__RCSID("$NetBSD: bog.c,v 1.9 1998/08/30 09:19:36 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -166,18 +166,19 @@ main(argc, argv)
|
||||
argv += optind;
|
||||
|
||||
/* process final arguments */
|
||||
if (argc > 0)
|
||||
if (argc > 0) {
|
||||
if (strcmp(argv[0], "+") == 0)
|
||||
reuse = 1;
|
||||
else if (strcmp(argv[0], "++") == 0)
|
||||
selfuse = 1;
|
||||
}
|
||||
|
||||
if (reuse || selfuse) {
|
||||
argc -= 1;
|
||||
argv += 1;
|
||||
}
|
||||
|
||||
if (argc > 0)
|
||||
if (argc > 0) {
|
||||
if (islower(argv[0][0])) {
|
||||
if (strlen(argv[0]) != 16) {
|
||||
usage();
|
||||
@ -188,6 +189,7 @@ main(argc, argv)
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (batch && bspec == NULL)
|
||||
errx(1, "must give both -b and a board setup");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: crib.c,v 1.9 1997/10/11 02:44:30 lukem Exp $ */
|
||||
/* $NetBSD: crib.c,v 1.10 1998/08/30 09:19:37 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: crib.c,v 1.9 1997/10/11 02:44:30 lukem Exp $");
|
||||
__RCSID("$NetBSD: crib.c,v 1.10 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -582,7 +582,7 @@ peg(mycrib)
|
||||
prhand(ph, pnum, Playwin, FALSE);
|
||||
prhand(ch, cnum, Compwin, TRUE);
|
||||
prtable(sum);
|
||||
if (last)
|
||||
if (last) {
|
||||
if (played) {
|
||||
msg(quiet ? "I get one for last" :
|
||||
"I get one point for last");
|
||||
@ -596,6 +596,7 @@ peg(mycrib)
|
||||
if (chkscr(&pscore, 1))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: score.c,v 1.5 1997/10/10 12:32:34 lukem Exp $ */
|
||||
/* $NetBSD: score.c,v 1.6 1998/08/30 09:19:37 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: score.c,v 1.5 1997/10/10 12:32:34 lukem Exp $");
|
||||
__RCSID("$NetBSD: score.c,v 1.6 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -159,21 +159,23 @@ scorehand(hand, starter, n, crb, do_explain)
|
||||
sorthand(h, n + 1); /* sort by rank */
|
||||
i = 2 * fifteens(h, n + 1);
|
||||
score += i;
|
||||
if (do_explain)
|
||||
if (do_explain) {
|
||||
if (i > 0) {
|
||||
(void) sprintf(buf, "%d points in fifteens", i);
|
||||
strcat(expl, buf);
|
||||
} else
|
||||
strcat(expl, "No fifteens");
|
||||
}
|
||||
i = pairuns(h, n + 1);
|
||||
score += i;
|
||||
if (do_explain)
|
||||
if (do_explain) {
|
||||
if (i > 0) {
|
||||
(void) sprintf(buf, ", %d points in pairs, %d in runs",
|
||||
pairpoints, runpoints);
|
||||
strcat(expl, buf);
|
||||
} else
|
||||
strcat(expl, ", No pairs/runs");
|
||||
}
|
||||
return (score);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fortune.c,v 1.12 1998/02/04 10:16:20 christos Exp $ */
|
||||
/* $NetBSD: fortune.c,v 1.13 1998/08/30 09:19:37 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1986, 1993
|
||||
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: fortune.c,v 1.12 1998/02/04 10:16:20 christos Exp $");
|
||||
__RCSID("$NetBSD: fortune.c,v 1.13 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -263,12 +263,13 @@ display(fp)
|
||||
(void) fseek(fp->inf, (long)Seekpts[0], 0);
|
||||
for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL &&
|
||||
!STR_ENDSTRING(line, fp->tbl); Fort_len++) {
|
||||
if (fp->tbl.str_flags & STR_ROTATED)
|
||||
if (fp->tbl.str_flags & STR_ROTATED) {
|
||||
for (p = line; (ch = *p) != 0; ++p)
|
||||
if (isupper(ch))
|
||||
*p = 'A' + (ch - 'A' + 13) % 26;
|
||||
else if (islower(ch))
|
||||
*p = 'a' + (ch - 'a' + 13) % 26;
|
||||
}
|
||||
fputs(line, stdout);
|
||||
}
|
||||
(void) fflush(stdout);
|
||||
@ -410,13 +411,14 @@ form_file_list(files, file_cnt)
|
||||
int i, percent;
|
||||
char *sp;
|
||||
|
||||
if (file_cnt == 0)
|
||||
if (file_cnt == 0) {
|
||||
if (Find_files)
|
||||
return add_file(NO_PROB, FORTDIR, NULL, &File_list,
|
||||
&File_tail, NULL);
|
||||
else
|
||||
return add_file(NO_PROB, "fortunes", FORTDIR,
|
||||
&File_list, &File_tail, NULL);
|
||||
}
|
||||
for (i = 0; i < file_cnt; i++) {
|
||||
percent = NO_PROB;
|
||||
if (!isdigit(files[i][0]))
|
||||
@ -884,8 +886,7 @@ init_prob()
|
||||
num_noprob++;
|
||||
if (Equal_probs)
|
||||
last = fp;
|
||||
}
|
||||
else
|
||||
} else
|
||||
percent += fp->percent;
|
||||
DPRINTF(1, (stderr, "summing probabilities:%d%% with %d NO_PROB's",
|
||||
percent, num_noprob));
|
||||
@ -897,7 +898,7 @@ init_prob()
|
||||
else if (percent == 100 && num_noprob != 0)
|
||||
errx(1, "No probability left to put in residual files");
|
||||
percent = 100 - percent;
|
||||
if (Equal_probs)
|
||||
if (Equal_probs) {
|
||||
if (num_noprob != 0) {
|
||||
if (num_noprob > 1) {
|
||||
frac = percent / num_noprob;
|
||||
@ -911,7 +912,7 @@ init_prob()
|
||||
last->percent = percent;
|
||||
DPRINTF(1, (stderr, ", residual = %d%%", percent));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
DPRINTF(1, (stderr,
|
||||
", %d%% distributed over remaining fortunes\n",
|
||||
percent));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hack.read.c,v 1.4 1997/10/19 16:58:52 christos Exp $ */
|
||||
/* $NetBSD: hack.read.c,v 1.5 1998/08/30 09:19:37 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.read.c,v 1.4 1997/10/19 16:58:52 christos Exp $");
|
||||
__RCSID("$NetBSD: hack.read.c,v 1.5 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -557,11 +557,12 @@ do_it:
|
||||
for (zy = seely; zy <= seehy; zy++)
|
||||
for (zx = seelx; zx <= seehx; zx++) {
|
||||
levl[zx][zy].lit = on;
|
||||
if (!Blind && dist(zx, zy) > 2)
|
||||
if (!Blind && dist(zx, zy) > 2) {
|
||||
if (on)
|
||||
prl(zx, zy);
|
||||
else
|
||||
nosee(zx, zy);
|
||||
}
|
||||
}
|
||||
if (!on)
|
||||
seehx = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hack.trap.c,v 1.4 1997/10/19 16:59:16 christos Exp $ */
|
||||
/* $NetBSD: hack.trap.c,v 1.5 1998/08/30 09:19:37 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.trap.c,v 1.4 1997/10/19 16:59:16 christos Exp $");
|
||||
__RCSID("$NetBSD: hack.trap.c,v 1.5 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -433,11 +433,12 @@ level_tele()
|
||||
newlevel = atoi(buf);
|
||||
} else {
|
||||
newlevel = 5 + rn2(20); /* 5 - 24 */
|
||||
if (dlevel == newlevel)
|
||||
if (dlevel == newlevel) {
|
||||
if (!xdnstair)
|
||||
newlevel--;
|
||||
else
|
||||
newlevel++;
|
||||
}
|
||||
}
|
||||
if (newlevel >= 30) {
|
||||
if (newlevel > MAXLEVEL)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hunt.c,v 1.6 1998/07/06 07:00:15 mrg Exp $ */
|
||||
/* $NetBSD: hunt.c,v 1.7 1998/08/30 09:19:37 veego Exp $ */
|
||||
/*
|
||||
* Hunt
|
||||
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hunt.c,v 1.6 1998/07/06 07:00:15 mrg Exp $");
|
||||
__RCSID("$NetBSD: hunt.c,v 1.7 1998/08/30 09:19:37 veego Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <sys/stat.h>
|
||||
@ -1039,11 +1039,12 @@ env_init(enter_status)
|
||||
envp = s + 1;
|
||||
}
|
||||
}
|
||||
if (*envp != '\0')
|
||||
if (*envp != '\0') {
|
||||
if (envname == NULL)
|
||||
strncpy(name, envp, NAMELEN);
|
||||
else
|
||||
printf("unknown option %s\n", envp);
|
||||
}
|
||||
}
|
||||
return enter_status;
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: main.c,v 1.13 1998/07/27 01:12:35 mycroft Exp $ */
|
||||
/* $NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $ */
|
||||
|
||||
/* main.c */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: main.c,v 1.13 1998/07/27 01:12:35 mycroft Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -72,15 +72,17 @@ main(argc, argv)
|
||||
init_term(); /* setup the terminal (find out what type)
|
||||
* for termcap */
|
||||
#endif /* VT100 */
|
||||
if (((ptr = getlogin()) == 0) || (*ptr == 0)) /* try to get login name */
|
||||
if ((pwe = getpwuid(getuid())) != NULL)/* can we get it from
|
||||
* /etc/passwd? */
|
||||
/* try to get login name */
|
||||
if (((ptr = getlogin()) == 0) || (*ptr == 0)) {
|
||||
/* can we get it from /etc/passwd? */
|
||||
if ((pwe = getpwuid(getuid())) != NULL)
|
||||
ptr = pwe->pw_name;
|
||||
else if ((ptr = getenv("USER")) == 0)
|
||||
if ((ptr = getenv("LOGNAME")) == 0) {
|
||||
noone: write(2, "Can't find your logname. Who Are You?\n", 39);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (ptr == 0)
|
||||
goto noone;
|
||||
if (strlen(ptr) == 0)
|
||||
@ -1201,7 +1203,7 @@ eatcookie()
|
||||
while (1) {
|
||||
if ((i = whatitem("eat")) == '\33')
|
||||
return;
|
||||
if (i != '.')
|
||||
if (i != '.') {
|
||||
if (i == '*')
|
||||
showeat();
|
||||
else {
|
||||
@ -1223,6 +1225,7 @@ eatcookie()
|
||||
lprcat("\nYou can't eat that!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: monster.c,v 1.5 1997/10/18 20:03:29 christos Exp $ */
|
||||
/* $NetBSD: monster.c,v 1.6 1998/08/30 09:19:38 veego Exp $ */
|
||||
|
||||
/*
|
||||
* monster.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -100,7 +100,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: monster.c,v 1.5 1997/10/18 20:03:29 christos Exp $");
|
||||
__RCSID("$NetBSD: monster.c,v 1.6 1998/08/30 09:19:38 veego Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <string.h>
|
||||
@ -965,7 +965,7 @@ omnidirect(spnum, dam, str)
|
||||
return; /* bad args */
|
||||
for (x = playerx - 1; x < playerx + 2; x++)
|
||||
for (y = playery - 1; y < playery + 2; y++) {
|
||||
if ((m = mitem[x][y]) != 0)
|
||||
if ((m = mitem[x][y]) != 0) {
|
||||
if (nospell(spnum, m) == 0) {
|
||||
ifblind(x, y);
|
||||
cursors();
|
||||
@ -977,6 +977,7 @@ omnidirect(spnum, dam, str)
|
||||
lasthx = x;
|
||||
lasthy = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1512,11 +1513,12 @@ spattack(x, xx, yy)
|
||||
switch (x) {
|
||||
case 1: /* rust your armor, j=1 when rusting has occurred */
|
||||
m = k = c[WEAR];
|
||||
if ((i = c[SHIELD]) != -1)
|
||||
if ((i = c[SHIELD]) != -1) {
|
||||
if (--ivenarg[i] < -1)
|
||||
ivenarg[i] = -1;
|
||||
else
|
||||
j = 1;
|
||||
}
|
||||
if ((j == 0) && (k != -1)) {
|
||||
m = iven[k];
|
||||
for (i = 0; i < ARMORTYPES; i++)
|
||||
@ -1710,8 +1712,8 @@ annihilate()
|
||||
u_char *p;
|
||||
for (k = 0, i = playerx - 1; i <= playerx + 1; i++)
|
||||
for (j = playery - 1; j <= playery + 1; j++)
|
||||
if (!vxy(&i, &j)) /* if not out of bounds */
|
||||
if (*(p = &mitem[i][j])) /* if a monster there */
|
||||
if (!vxy(&i, &j)) { /* if not out of bounds */
|
||||
if (*(p = &mitem[i][j])) { /* if a monster there */
|
||||
if (*p < DEMONLORD + 2) {
|
||||
k += monster[*p].experience;
|
||||
*p = know[i][j] = 0;
|
||||
@ -1719,6 +1721,8 @@ annihilate()
|
||||
lprintf("\nThe %s barely escapes being annihilated!", monster[*p].name);
|
||||
hitp[i][j] = (hitp[i][j] >> 1) + 1; /* lose half hit points */
|
||||
}
|
||||
}
|
||||
}
|
||||
if (k > 0) {
|
||||
lprcat("\nYou hear loud screams of agony!");
|
||||
raiseexperience((long) k);
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $NetBSD: object.c,v 1.8 1997/10/18 20:03:38 christos Exp $ */
|
||||
/* $NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $ */
|
||||
|
||||
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: object.c,v 1.8 1997/10/18 20:03:38 christos Exp $");
|
||||
__RCSID("$NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $");
|
||||
#endif /* not lint */
|
||||
#include "header.h"
|
||||
#include "extern.h"
|
||||
@ -1110,8 +1110,8 @@ void
|
||||
opit()
|
||||
{
|
||||
int i;
|
||||
if (rnd(101) < 81)
|
||||
if (rnd(70) > 9 * c[DEXTERITY] - packweight() || rnd(101) < 5)
|
||||
if (rnd(101) < 81) {
|
||||
if (rnd(70) > 9 * c[DEXTERITY] - packweight() || rnd(101) < 5) {
|
||||
if (level == MAXLEVEL - 1)
|
||||
obottomless();
|
||||
else if (level == MAXLEVEL + MAXVLEVEL - 1)
|
||||
@ -1131,6 +1131,8 @@ opit()
|
||||
newcavelevel(level + 1);
|
||||
draws(0, MAXX, 0, MAXY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: store.c,v 1.6 1997/10/18 20:03:52 christos Exp $ */
|
||||
/* $NetBSD: store.c,v 1.7 1998/08/30 09:19:38 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988 The Regents of the University of California.
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
|
||||
#else
|
||||
__RCSID("$NetBSD: store.c,v 1.6 1997/10/18 20:03:52 christos Exp $");
|
||||
__RCSID("$NetBSD: store.c,v 1.7 1998/08/30 09:19:38 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -790,7 +790,7 @@ otradepost()
|
||||
j = 1;
|
||||
cnsitm();
|
||||
} /* can't sell unidentified item */
|
||||
if (!j)
|
||||
if (!j) {
|
||||
if (i == '*') {
|
||||
clear();
|
||||
qshowstr();
|
||||
@ -837,6 +837,7 @@ otradepost()
|
||||
if (j <= maxitm + 2)
|
||||
lprcat("\nSo sorry, but we are not authorized to accept that item.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cards.c,v 1.4 1997/10/12 17:45:07 christos Exp $ */
|
||||
/* $NetBSD: cards.c,v 1.5 1998/08/30 09:19:39 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: cards.c,v 1.4 1997/10/12 17:45:07 christos Exp $");
|
||||
__RCSID("$NetBSD: cards.c,v 1.5 1998/08/30 09:19:39 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -188,11 +188,12 @@ DECK *dp;
|
||||
}
|
||||
num_h = num_H = 0;
|
||||
for (op = cur_p->own_list; op; op = op->next)
|
||||
if (op->sqr->type == PRPTY)
|
||||
if (op->sqr->type == PRPTY) {
|
||||
if (op->sqr->desc->houses == 5)
|
||||
++num_H;
|
||||
else
|
||||
num_h += op->sqr->desc->houses;
|
||||
}
|
||||
num = per_h * num_h + per_H * num_H;
|
||||
printf("You had %d Houses and %d Hotels, so that cost you $%d\n", num_h, num_H, num);
|
||||
if (num == 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: morg.c,v 1.5 1997/10/12 17:45:21 christos Exp $ */
|
||||
/* $NetBSD: morg.c,v 1.6 1998/08/30 09:19:39 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: morg.c,v 1.5 1997/10/12 17:45:21 christos Exp $");
|
||||
__RCSID("$NetBSD: morg.c,v 1.6 1998/08/30 09:19:39 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -122,13 +122,14 @@ set_mlist()
|
||||
|
||||
num_good = 0;
|
||||
for (op = cur_p->own_list; op; op = op->next)
|
||||
if (!op->sqr->desc->morg)
|
||||
if (!op->sqr->desc->morg) {
|
||||
if (op->sqr->type == PRPTY && op->sqr->desc->houses)
|
||||
got_houses++;
|
||||
else {
|
||||
names[num_good] = op->sqr->name;
|
||||
square[num_good++] = sqnum(op->sqr);
|
||||
}
|
||||
}
|
||||
names[num_good++] = "done";
|
||||
names[num_good--] = 0;
|
||||
return num_good;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fight.c,v 1.3 1997/10/13 02:18:12 lukem Exp $ */
|
||||
/* $NetBSD: fight.c,v 1.4 1998/08/30 09:19:39 veego Exp $ */
|
||||
|
||||
/*
|
||||
* fight.c Phantasia monster fighting routines
|
||||
@ -203,13 +203,14 @@ playerhits()
|
||||
|
||||
mvaddstr(7, 0, "1:Melee 2:Skirmish 3:Evade 4:Spell 5:Nick ");
|
||||
|
||||
if (!Luckout)
|
||||
if (!Luckout) {
|
||||
/* haven't tried to luckout yet */
|
||||
if (Curmonster.m_type == SM_MORGOTH)
|
||||
/* cannot luckout against Morgoth */
|
||||
addstr("6:Ally ");
|
||||
else
|
||||
addstr("6:Luckout ");
|
||||
}
|
||||
|
||||
if (Player.p_ring.ring_type != R_NONE)
|
||||
/* player has a ring */
|
||||
@ -951,7 +952,7 @@ awardtreasure()
|
||||
ch = getanswer("NY", FALSE);
|
||||
addstr("\n\n");
|
||||
|
||||
if (ch == 'Y')
|
||||
if (ch == 'Y') {
|
||||
if (drandom() < treasuretype / 35.0 + 0.04)
|
||||
/* cursed */
|
||||
{
|
||||
@ -959,6 +960,7 @@ awardtreasure()
|
||||
cursedtreasure();
|
||||
} else
|
||||
collecttaxes(gold, gems);
|
||||
}
|
||||
|
||||
return;
|
||||
} else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.4 1997/10/13 02:18:27 lukem Exp $ */
|
||||
/* $NetBSD: main.c,v 1.5 1998/08/30 09:19:39 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Phantasia 3.3.2 -- Interterminal fantasy game
|
||||
@ -218,7 +218,7 @@ main(argc, argv)
|
||||
checkbattle(); /* check for player to player battle */
|
||||
neatstuff(); /* gurus, medics, etc. */
|
||||
|
||||
if (Player.p_status == S_CLOAKED)
|
||||
if (Player.p_status == S_CLOAKED) {
|
||||
/* costs 3 mana per turn to be cloaked */
|
||||
if (Player.p_mana > 3.0)
|
||||
Player.p_mana -= 3.0;
|
||||
@ -228,6 +228,7 @@ main(argc, argv)
|
||||
Player.p_status = S_PLAYING;
|
||||
Changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.p_status != S_PLAYING && Player.p_status != S_CLOAKED)
|
||||
/* change status back to S_PLAYING */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: misc.c,v 1.3 1997/10/13 02:18:30 lukem Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.4 1998/08/30 09:19:39 veego Exp $ */
|
||||
|
||||
/*
|
||||
* misc.c Phantasia miscellaneous support routines
|
||||
@ -343,7 +343,7 @@ tradingpost()
|
||||
printw("A blessing requires a %.0f gp donation. Still want one ? ", blessingcost);
|
||||
ch = getanswer("NY", FALSE);
|
||||
|
||||
if (ch == 'Y')
|
||||
if (ch == 'Y') {
|
||||
if (Player.p_gold < blessingcost)
|
||||
++cheat;
|
||||
else {
|
||||
@ -354,6 +354,7 @@ tradingpost()
|
||||
else
|
||||
Player.p_blessing = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dr_1.c,v 1.6 1997/10/13 21:03:09 christos Exp $ */
|
||||
/* $NetBSD: dr_1.c,v 1.7 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dr_1.c,v 1.6 1997/10/13 21:03:09 christos Exp $");
|
||||
__RCSID("$NetBSD: dr_1.c,v 1.7 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -359,11 +359,12 @@ compcombat()
|
||||
hit++;
|
||||
hit += QUAL[index][capship(sp)->specs->qual - 1];
|
||||
for (n = 0; n < 3 && sp->file->captured == 0; n++)
|
||||
if (!crew[n])
|
||||
if (!crew[n]) {
|
||||
if (index <= 5)
|
||||
hit--;
|
||||
else
|
||||
hit -= 2;
|
||||
}
|
||||
if (ready & R_INITIAL) {
|
||||
if (!r)
|
||||
sp->file->readyL &= ~R_INITIAL;
|
||||
@ -374,11 +375,12 @@ compcombat()
|
||||
else
|
||||
hit += 2;
|
||||
}
|
||||
if (sp->file->captured != 0)
|
||||
if (sp->file->captured != 0) {
|
||||
if (index <= 1)
|
||||
hit--;
|
||||
else
|
||||
hit -= 2;
|
||||
}
|
||||
hit += AMMO[index][load - 1];
|
||||
temp = sp->specs->class;
|
||||
if ((temp >= 5 || temp == 1) && windspeed == 5)
|
||||
@ -399,11 +401,12 @@ compcombat()
|
||||
int
|
||||
next()
|
||||
{
|
||||
if (++turn % 55 == 0)
|
||||
if (++turn % 55 == 0) {
|
||||
if (alive)
|
||||
alive = 0;
|
||||
else
|
||||
people = 0;
|
||||
}
|
||||
if (people <= 0 || windspeed == 7) {
|
||||
struct ship *s;
|
||||
struct ship *bestship = NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pl_3.c,v 1.5 1997/10/13 21:04:09 christos Exp $ */
|
||||
/* $NetBSD: pl_3.c,v 1.6 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pl_3.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pl_3.c,v 1.5 1997/10/13 21:04:09 christos Exp $");
|
||||
__RCSID("$NetBSD: pl_3.c,v 1.6 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -131,12 +131,13 @@ acceptcombat()
|
||||
else if (temp > 8)
|
||||
temp -= 8;
|
||||
sternrake = temp > 4 && temp < 6;
|
||||
if (rakehim)
|
||||
if (rakehim) {
|
||||
if (!sternrake)
|
||||
Msg("Raking the %s!", closest->shipname);
|
||||
else
|
||||
Msg("Stern Rake! %s splintering!",
|
||||
closest->shipname);
|
||||
}
|
||||
index = guns;
|
||||
if (target < 3)
|
||||
index += car;
|
||||
@ -150,21 +151,24 @@ acceptcombat()
|
||||
hit++;
|
||||
hit += QUAL[index][mc->qual-1];
|
||||
for (n = 0; n < 3 && mf->captured == 0; n++)
|
||||
if (!crew[n])
|
||||
if (!crew[n]) {
|
||||
if (index <= 5)
|
||||
hit--;
|
||||
else
|
||||
hit -= 2;
|
||||
if (ready & R_INITIAL)
|
||||
}
|
||||
if (ready & R_INITIAL) {
|
||||
if (index <= 3)
|
||||
hit++;
|
||||
else
|
||||
hit += 2;
|
||||
if (mf->captured != 0)
|
||||
}
|
||||
if (mf->captured != 0) {
|
||||
if (index <= 1)
|
||||
hit--;
|
||||
else
|
||||
hit -= 2;
|
||||
}
|
||||
hit += AMMO[index][load - 1];
|
||||
if (((temp = mc->class) >= 5 || temp == 1) && windspeed == 5)
|
||||
hit--;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pl_7.c,v 1.8 1997/10/13 21:04:32 christos Exp $ */
|
||||
/* $NetBSD: pl_7.c,v 1.9 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pl_7.c,v 1.8 1997/10/13 21:04:32 christos Exp $");
|
||||
__RCSID("$NetBSD: pl_7.c,v 1.9 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -100,16 +100,18 @@ newturn(n)
|
||||
movebuf[0] = '\0';
|
||||
|
||||
(void) alarm(0);
|
||||
if (mf->readyL & R_LOADING)
|
||||
if (mf->readyL & R_LOADING) {
|
||||
if (mf->readyL & R_DOUBLE)
|
||||
mf->readyL = R_LOADING;
|
||||
else
|
||||
mf->readyL = R_LOADED;
|
||||
if (mf->readyR & R_LOADING)
|
||||
}
|
||||
if (mf->readyR & R_LOADING) {
|
||||
if (mf->readyR & R_DOUBLE)
|
||||
mf->readyR = R_LOADING;
|
||||
else
|
||||
mf->readyR = R_LOADED;
|
||||
}
|
||||
if (!hasdriver)
|
||||
Write(W_DDEAD, SHIP(0), 0, 0, 0, 0, 0);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sync.c,v 1.8 1998/03/29 04:56:46 mrg Exp $ */
|
||||
/* $NetBSD: sync.c,v 1.9 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: sync.c,v 1.8 1998/03/29 04:56:46 mrg Exp $");
|
||||
__RCSID("$NetBSD: sync.c,v 1.9 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -349,7 +349,7 @@ sync_update(type, ship, a, b, c, d)
|
||||
}
|
||||
case W_UNFOUL: {
|
||||
struct snag *p = &ship->file->foul[a];
|
||||
if (p->sn_count > 0)
|
||||
if (p->sn_count > 0) {
|
||||
if (b) {
|
||||
ship->file->nfoul -= p->sn_count;
|
||||
p->sn_count = 0;
|
||||
@ -357,11 +357,12 @@ sync_update(type, ship, a, b, c, d)
|
||||
ship->file->nfoul--;
|
||||
p->sn_count--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case W_UNGRAP: {
|
||||
struct snag *p = &ship->file->grap[a];
|
||||
if (p->sn_count > 0)
|
||||
if (p->sn_count > 0) {
|
||||
if (b) {
|
||||
ship->file->ngrap -= p->sn_count;
|
||||
p->sn_count = 0;
|
||||
@ -369,14 +370,16 @@ sync_update(type, ship, a, b, c, d)
|
||||
ship->file->ngrap--;
|
||||
p->sn_count--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case W_SIGNAL:
|
||||
if (mode == MODE_PLAYER)
|
||||
if (mode == MODE_PLAYER) {
|
||||
if (nobells)
|
||||
Signal("$$: %s", ship, (char *) a);
|
||||
else
|
||||
Signal("\7$$: %s", ship, (char *) a);
|
||||
}
|
||||
break;
|
||||
case W_CREW: {
|
||||
struct shipspecs *s = ship->specs;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kill.c,v 1.4 1997/10/12 21:24:56 christos Exp $ */
|
||||
/* $NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kill.c,v 1.4 1997/10/12 21:24:56 christos Exp $");
|
||||
__RCSID("$NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -113,13 +113,14 @@ int qx, qy;
|
||||
|
||||
if (q->bases <= 0)
|
||||
return;
|
||||
if (!damaged(SSRADIO))
|
||||
if (!damaged(SSRADIO)) {
|
||||
/* then update starchart */
|
||||
if (q->scanned < 1000)
|
||||
q->scanned -= 10;
|
||||
else
|
||||
if (q->scanned > 1000)
|
||||
q->scanned = -1;
|
||||
}
|
||||
q->bases = 0;
|
||||
Now.bases -= 1;
|
||||
for (b = Now.base; ; b++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: move.c,v 1.4 1997/10/12 21:25:02 christos Exp $ */
|
||||
/* $NetBSD: move.c,v 1.5 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: move.c,v 1.4 1997/10/12 21:25:02 christos Exp $");
|
||||
__RCSID("$NetBSD: move.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -186,13 +186,13 @@ double speed;
|
||||
Ship.quady = iy / NSECTS;
|
||||
Ship.sectx = ix % NSECTS;
|
||||
Ship.secty = iy % NSECTS;
|
||||
if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 || Ship.quady >= NQUADS)
|
||||
if (!damaged(COMPUTER))
|
||||
{
|
||||
if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 ||
|
||||
Ship.quady >= NQUADS) {
|
||||
if (!damaged(COMPUTER)) {
|
||||
dumpme(0);
|
||||
}
|
||||
else
|
||||
} else
|
||||
lose(L_NEGENB);
|
||||
}
|
||||
initquad(0);
|
||||
n = 0;
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nova.c,v 1.4 1997/10/12 21:25:03 christos Exp $ */
|
||||
/* $NetBSD: nova.c,v 1.5 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)nova.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: nova.c,v 1.4 1997/10/12 21:25:03 christos Exp $");
|
||||
__RCSID("$NetBSD: nova.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -124,17 +124,15 @@ int x, y;
|
||||
case ENTERPRISE:
|
||||
case QUEENE:
|
||||
se = 2000;
|
||||
if (Ship.shldup)
|
||||
if (Ship.shield >= se)
|
||||
{
|
||||
if (Ship.shldup) {
|
||||
if (Ship.shield >= se) {
|
||||
Ship.shield -= se;
|
||||
se = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
se -= Ship.shield;
|
||||
Ship.shield = 0;
|
||||
}
|
||||
}
|
||||
Ship.energy -= se;
|
||||
if (Ship.energy <= 0)
|
||||
lose(L_SUICID);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: shield.c,v 1.5 1997/10/12 21:25:17 christos Exp $ */
|
||||
/* $NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)shield.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: shield.c,v 1.5 1997/10/12 21:25:17 christos Exp $");
|
||||
__RCSID("$NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -140,11 +140,12 @@ int f;
|
||||
printf("down\n");
|
||||
return;
|
||||
}
|
||||
if (i)
|
||||
if (i) {
|
||||
if (f >= 0)
|
||||
Ship.energy -= Param.shupengy;
|
||||
else
|
||||
Ship.cloakgood = 0;
|
||||
}
|
||||
Move.free = 0;
|
||||
if (f >= 0)
|
||||
Move.shldchg = 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wump.c,v 1.5 1997/10/12 03:36:42 lukem Exp $ */
|
||||
/* $NetBSD: wump.c,v 1.6 1998/08/30 09:19:41 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: wump.c,v 1.5 1997/10/12 03:36:42 lukem Exp $");
|
||||
__RCSID("$NetBSD: wump.c,v 1.6 1998/08/30 09:19:41 veego Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -377,7 +377,7 @@ move_to(room_number)
|
||||
wump_kill();
|
||||
return(1);
|
||||
}
|
||||
if (cave[next_room].has_a_pit)
|
||||
if (cave[next_room].has_a_pit) {
|
||||
if (random() % 12 < 2) {
|
||||
pit_survive();
|
||||
return(0);
|
||||
@ -385,6 +385,7 @@ move_to(room_number)
|
||||
pit_kill();
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (cave[next_room].has_a_bat) {
|
||||
(void)printf(
|
||||
@ -420,13 +421,14 @@ shoot(room_list)
|
||||
*/
|
||||
arrow_location = player_loc;
|
||||
for (roomcnt = 1;; ++roomcnt, room_list = NULL) {
|
||||
if (!(p = strtok(room_list, " \t\n")))
|
||||
if (!(p = strtok(room_list, " \t\n"))) {
|
||||
if (roomcnt == 1) {
|
||||
(void)printf(
|
||||
"The arrow falls to the ground at your feet!\n");
|
||||
return(0);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (roomcnt > 5) {
|
||||
(void)printf(
|
||||
"The arrow wavers in its flight and and can go no further!\n");
|
||||
|
Loading…
Reference in New Issue
Block a user