-/* $NetBSD: nova.c,v 1.6 2003/08/07 09:37:53 agc Exp $ */
+/* $NetBSD: nova.c,v 1.8 2009/05/24 21:44:56 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)nova.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: nova.c,v 1.6 2003/08/07 09:37:53 agc Exp $");
+__RCSID("$NetBSD: nova.c,v 1.8 2009/05/24 21:44:56 dholland Exp $");
#endif
#endif /* not lint */
*/
void
-nova(x, y)
-int x, y;
+nova(int x, int y)
{
int i, j;
int se;
if (Sect[x][y] != STAR || Quad[Ship.quadx][Ship.quady].stars < 0)
return;
- if (ranf(100) < 15)
- {
+ if (ranf(100) < 15) {
printf("Spock: Star at %d,%d failed to nova.\n", x, y);
return;
}
}
printf("Spock: Star at %d,%d gone nova\n", x, y);
- if (ranf(4) != 0)
+ if (ranf(4) != 0) {
Sect[x][y] = EMPTY;
- else
- {
+ } else {
Sect[x][y] = HOLE;
Quad[Ship.quadx][Ship.quady].holes += 1;
}
Quad[Ship.quadx][Ship.quady].stars -= 1;
Game.kills += 1;
- for (i = x - 1; i <= x + 1; i++)
- {
+ for (i = x - 1; i <= x + 1; i++) {
if (i < 0 || i >= NSECTS)
continue;
- for (j = y - 1; j <= y + 1; j++)
- {
+ for (j = y - 1; j <= y + 1; j++) {
if (j < 0 || j >= NSECTS)
continue;
se = Sect[i][j];
- switch (se)
- {
+ switch (se) {
case EMPTY:
case HOLE: